/* ==========================================================================
   AquaHaven: Virtual Aquarium Simulator Styles
   Theme: Modern Deep Ocean Glassmorphism
   ========================================================================== */

:root {
  --primary: #00b4d8;
  --primary-glow: rgba(0, 180, 216, 0.4);
  --accent: #ffd166;
  --success: #06d6a0;
  --danger: #ef476f;
  --bg-deep: #03071e;
  --glass-bg: rgba(13, 27, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8f9fa;
  --text-muted: #adb5bd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
}

.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, #0d2b45 0%, #03071e 100%);
}

/* ==========================================================================
   TOP HUD
   ========================================================================== */

.hud-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.logo-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #90e0ef, #00b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats-panel {
  justify-self: end;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  pointer-events: auto;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.stat-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.stat-badge .icon {
  font-size: 16px;
}

/* ==========================================================================
   HACK / CHEAT BUTTONS
   ========================================================================== */

.btn-hack-pill {
  background: linear-gradient(135deg, #ffd166, #f39c12);
  color: #03071e;
  border: 1px solid #ffe494;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(243, 156, 18, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

.btn-hack-pill:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.7);
}

.btn-hack-pill:active {
  transform: translateY(0) scale(0.96);
}

.btn-hack-pill.max {
  background: linear-gradient(135deg, #f72585, #7209b7);
  color: #ffffff;
  border-color: #ff70a6;
  box-shadow: 0 4px 14px rgba(247, 37, 133, 0.45);
}

.btn-hack-pill.max:hover {
  box-shadow: 0 6px 20px rgba(247, 37, 133, 0.7);
}

.btn-hack-pill.view-toggle {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #ffffff;
  border-color: #90e0ef;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.45);
}

.btn-hack-pill.view-toggle:hover {
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.7);
}

.btn-hack-pill.cam-preset {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #6ee7b7;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.btn-hack-pill.cam-preset:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.7);
}

.aquarium-loading-badge {
  grid-column: 1 / -1;
  justify-self: center;
  background: rgba(3, 37, 65, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 100;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.aquarium-loading-badge.hidden {
  opacity: 0;
  transform: translateY(-10px);
}

/* ==========================================================================
   REAL FISH IMAGE STYLES IN UI
   ========================================================================== */

.card-img-wrapper {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-img-real {
  max-width: 90%;
  max-height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}

.card-item:hover .card-img-real {
  transform: scale(1.1);
}

.fish-row-avatar {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: 14px;
  flex-shrink: 0;
}

.fish-avatar-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   AQUARIUM MAIN VIEW
   ========================================================================== */

.aquarium-view {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}

#aquarium-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   BOTTOM DOCK
   ========================================================================== */

.hud-bottom-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 12px;
  border-radius: 40px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 68px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 180, 216, 0.3);
}

.action-btn:active {
  transform: translateY(0) scale(0.96);
}

.action-btn.highlight {
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
  border-color: #90e0ef;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.5);
}

.action-btn.highlight:hover {
  box-shadow: 0 8px 22px rgba(0, 180, 216, 0.7);
}

.action-btn.zen-btn {
  background: linear-gradient(135deg, rgba(82, 183, 136, 0.3), rgba(45, 106, 79, 0.4));
  border-color: rgba(82, 183, 136, 0.5);
}

.btn-icon {
  font-size: 20px;
}

.btn-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   ZEN MODE
   ========================================================================== */

.zen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 30px;
}

.zen-clock-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 16px 32px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.zen-time {
  font-size: 46px;
  font-weight: 200;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 180, 216, 0.6);
}

.zen-date {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.btn-exit-zen {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  opacity: 0.6;
}

.btn-exit-zen:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Zen Mode Active State */
.zen-mode-active .hud-top {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.zen-mode-active .hud-bottom-dock {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

.zen-mode-active .zen-overlay {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MODAL DIALOG
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  max-height: 85dvh;
  background: #0d1b2a;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.btn-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Shop Tabs */
.shop-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.capacity-banner {
  background: rgba(0, 180, 216, 0.12);
  border: 1px solid rgba(0, 180, 216, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.capacity-banner .warn {
  color: var(--danger);
  font-weight: 600;
}

/* Grid Catalog */
.grid-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.card-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.card-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-icon.decor-icon {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
}

.card-item h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-item .desc, .card-item .buff-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.buff-text {
  color: var(--success) !important;
  font-weight: 600;
}

.btn-buy {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-buy.primary {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #ffffff;
}

.btn-buy.primary:hover {
  background: #48cae4;
  transform: scale(1.02);
}

.btn-buy.disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.btn-buy.owned {
  background: rgba(82, 183, 136, 0.2);
  color: var(--success);
  cursor: default;
}

/* Badges */
.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.common { background: rgba(173, 181, 189, 0.2); color: #adb5bd; }
.badge.rare { background: rgba(0, 180, 216, 0.2); color: #00b4d8; }
.badge.epic { background: rgba(155, 93, 229, 0.2); color: #9b5de5; }
.badge.legendary { background: rgba(255, 209, 102, 0.2); color: #ffd166; }
.badge.mutation { background: rgba(239, 71, 111, 0.25); color: #ff758f; }

.rate {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* Upgrade Card */
.upgrade-section h3 {
  font-size: 15px;
  margin: 16px 0 10px 0;
  color: #90e0ef;
}

.upgrade-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.upgrade-card h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.upgrade-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.max-badge {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(82, 183, 136, 0.15);
  border-radius: 10px;
}

/* Fish Roster */
.fish-row-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.fish-roster-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fish-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
}

.fish-row-info .name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fish-row-info .stats-line {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.fish-row-info .stats-line strong {
  color: #ffffff;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: auto;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: min(420px, calc(100vw - 28px));
  gap: 4px;
  pointer-events: none;
}

.toast-item {
  max-width: 100%;
  padding: 2px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dceeed;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px #000, 0 0 5px #000b;
  animation: toastIn 0.28s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast-item.toast-success { color: #b9e5c5; }
.toast-item.toast-error { color: #ffb3b3; }
.toast-item.fade-out { opacity: 0; transform: translateY(-12px); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media(prefers-reduced-motion:reduce){.toast-item{animation:none;transition:none}}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .hud-top {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }
  .hud-bottom-dock {
    width: 95%;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 24px;
    padding: 6px 8px;
  }
  .action-btn {
    min-width: 60px;
    padding: 6px 10px;
  }
  .btn-label {
    font-size: 10px;
  }
  .zen-time {
    font-size: 36px;
  }
}

/* The engine owns only this mount point; HUD/Zen overlays survive mode changes. */
.engine-root { position:absolute; inset:0; overflow:hidden; }
.engine-root > canvas { display:block; width:100%; height:100%; touch-action:none; }
[hidden] { display:none !important; }
.action-btn:disabled { opacity:.45; cursor:default; }
@media(max-width:700px) {
  .hud-bottom-dock { overflow-x:auto; justify-content:flex-start; max-width:calc(100vw - 12px); }
  .action-btn { flex-shrink:0; } }

.aquarium-loading-badge { max-width:100%; flex-wrap:wrap; font-size:12px; }


/* Keep the entire toolbar reachable on narrow viewports. */
@media (max-width: 768px) {
  .hud-top { left:10px; right:10px; top:10px; }
  .stats-panel { width:100%; min-width:0; flex-wrap:wrap; gap:6px; }
  .stat-badge { padding:6px 9px; font-size:12px; min-width:0; }
  .btn-hack-pill { padding:6px 10px; font-size:11px; }
  .logo-brand { padding:6px 12px; }
  .fish-row { flex-wrap:wrap; gap:10px; padding:10px; }
  .fish-row-info { min-width:0; flex:1 1 180px; }
  .fish-row-info .stats-line, .fish-row-info .name-line { flex-wrap:wrap; gap:6px; }
  .upgrade-card { flex-wrap:wrap; gap:10px; }
}

/* Per-species motion and live actions. */
.fish-motion-panel[hidden]{display:none!important}
.fish-motion-panel{position:fixed;z-index:1400;top:72px;right:18px;bottom:100px;width:min(360px,calc(100vw - 24px));overflow:auto;padding:20px;border:1px solid #45646e;border-radius:16px;background:#102630f5;color:#edf6f6;box-shadow:0 12px 50px #0007;box-sizing:border-box;font-size:14px}
.fish-motion-panel header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.fish-motion-panel h2{font-size:21px;margin:3px 0}.fish-motion-panel h3{font-size:17px;margin:0 0 10px}
.fish-motion-panel small{font-size:10px;letter-spacing:.14em;color:#83b5bf}
.fish-motion-panel label{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 8px}
.fish-motion-panel select,.fish-motion-panel input[type=range]{width:100%}
.fish-motion-panel select,.fish-motion-panel button{font:inherit;padding:9px 11px;border:1px solid #45646e;border-radius:8px;background:#183c48;color:#eef7f7;max-width:100%}
.fish-motion-panel button{cursor:pointer}.fish-motion-panel button:hover{background:#265461}
.fish-motion-panel :focus-visible{outline:2px solid #ffd166;outline-offset:2px}
.fish-motion-panel output{color:#9fdee6}.fish-motion-panel .motion-help{color:#b7cdd2;font-size:12px;line-height:1.6;margin:8px 0 12px}
.fish-motion-panel .motion-check{align-items:center}.fish-motion-panel .motion-count{margin-top:8px;color:#a9cdd5}
.fish-motion-panel .motion-actions button{display:block;width:100%;margin:8px 0}
.fish-motion-panel [data-preview-status]{padding:9px;border-left:3px solid #80d8df;background:#183c48;border-radius:4px}
.fish-motion-panel .motion-actions{border-top:1px solid #345460;margin:18px 0;padding:18px 0 0}
.fish-motion-panel .motion-status{display:block;margin-top:12px;font-size:12px;line-height:1.5}
@media(max-width:600px){.fish-motion-panel{top:12px;right:12px;bottom:86px;padding:16px}}

/* Mobile-first floating menu: no horizontal dock or overlapping account pill. */
.app-container {height:100dvh;}
#game-menu-toggle{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:1451;width:62px;height:62px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px solid #84d5dc88;border-radius:50%;background:linear-gradient(145deg,#167d91,#103b52);color:#fff;box-shadow:0 6px 24px #0006;cursor:pointer;font:600 11px/1.2 sans-serif;touch-action:manipulation}
#game-menu-toggle>span:first-child{font-size:25px;line-height:1.1}
#game-menu-toggle:focus-visible,.game-menu button:focus-visible{outline:2px solid #9ceaf4;outline-offset:3px}
#game-menu-backdrop{position:fixed;inset:0;z-index:1449;background:#0005;border:0;cursor:default}
#game-menu.game-menu{position:fixed;left:auto;right:max(14px,env(safe-area-inset-right));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 74px);transform:none;z-index:1450;display:flex;flex-direction:column;gap:6px;width:min(280px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 116px - env(safe-area-inset-top));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;justify-content:flex-start;padding:0 12px 12px;border-radius:20px;background:#102832f5;backdrop-filter:blur(14px);box-shadow:0 12px 40px #0008;scrollbar-width:thin}
#game-menu[hidden],#game-menu-backdrop[hidden]{display:none!important}
.game-menu-heading{display:flex;align-items:center;justify-content:space-between;padding:7px 6px;color:#a6d9de;font-size:12px;flex-shrink:0}
#game-menu>.game-menu-heading:first-child{position:sticky;top:0;z-index:5;isolation:isolate;background:#102832;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#d5eeee;margin:0 -12px;padding:10px 12px;min-height:64px;border-bottom:1px solid #ffffff12;font-size:14px;flex-shrink:0}
#game-menu-close{width:44px;height:44px;background:#ffffff0c;color:#fff;border:0;border-radius:50%;cursor:pointer;font-size:18px}
#game-menu .action-btn,#game-menu .btn-hack-pill,#game-menu #account-open{position:static;display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px;width:100%;min-width:0;min-height:46px;flex-shrink:0;margin:0;padding:10px 14px;transform:none;border:1px solid #a9c6cf21;border-radius:12px;background:#ffffff08;color:#f4fbfc;text-align:left;white-space:normal;font:600 13px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:none;touch-action:manipulation}
#game-menu .action-btn:hover,#game-menu .btn-hack-pill:hover,#game-menu #account-open:hover{background:#ffffff15;transform:none}
#game-menu .btn-icon{font-size:21px;width:26px;text-align:center}
#game-menu .btn-label{font-size:13px}
.zen-mode-active #game-menu,.zen-mode-active #game-menu-backdrop{display:none!important}
.zen-mode-active #game-menu-toggle{display:flex!important;opacity:1;visibility:visible;pointer-events:auto}
.zen-overlay{z-index:25}
.zen-mode-active .btn-exit-zen{position:fixed;bottom:calc(18px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);min-height:44px;opacity:1;z-index:1452;background:#123c49}
@media(max-width:768px){
 .hud-top{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));gap:7px}
 .logo-brand{padding:5px 10px}.logo-icon{font-size:20px}.logo-text .subtitle,.logo-text a{display:none}.logo-text .title{font-size:13px}
 .stats-panel{justify-self:start;width:auto;max-width:100%;gap:5px}.stat-badge{padding:5px 8px;font-size:11px}.stat-badge .icon{font-size:13px}
 .modal-overlay{padding:10px;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom))}
 .modal-box{width:100%;max-width:100%;max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-radius:18px}
 .modal-body{padding:14px}.modal-header{padding:14px}.modal-header h2{font-size:17px}
 .shop-tabs{overflow-x:auto;flex-wrap:nowrap}.tab-btn{flex-shrink:0;min-height:44px}
 #account-dialog{max-height:calc(100dvh - 32px);width:calc(100vw - 28px);box-sizing:border-box}
}
@media(orientation:landscape) and (max-height:600px){
 .hud-top{grid-template-columns:minmax(0,1fr);align-items:start}.logo-brand{display:none}.stats-panel{justify-self:start;width:auto}
 #game-menu.game-menu{max-height:calc(100dvh - 100px - env(safe-area-inset-top));bottom:86px}
 .fish-motion-panel{top:12px;bottom:12px;right:88px;max-height:calc(100dvh - 24px)}
}
@media(prefers-reduced-motion:reduce){#game-menu,#game-menu-toggle{transition:none}}
@media(max-width:768px){
 .modal-overlay{height:100dvh}
 .grid-catalog{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .card-item{min-width:0;padding:10px}.card-item h4{font-size:13px}.card-item .desc{font-size:11px}
}
@media(max-width:340px){.grid-catalog{grid-template-columns:1fr}}

/* Separate purchase catalogue and compact placement controls; aquarium stays touchable. */
.scape-inspector[hidden]{display:none!important}
.scape-inspector{position:fixed;z-index:1390;left:16px;bottom:16px;width:340px;max-height:50dvh;overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:12px 14px;border:1px solid #719277;border-radius:16px;background:#10291ff5;color:#e9f3e4;box-shadow:0 8px 36px #0007;font:12px/1.4 system-ui,sans-serif;touch-action:pan-y}
.scape-inspector header{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:-12px;background:#10291f;padding:6px 0 8px;z-index:1}
.scape-inspector header>div{display:flex;gap:6px}.scape-inspector header strong{font-size:15px}
.scape-inspector button{min-height:44px;padding:7px 10px;border:1px solid #64816a;border-radius:9px;background:#264b37;color:#edf7e7;font:600 12px/1.3 system-ui;cursor:pointer;touch-action:manipulation}
.scape-inspector button[aria-pressed=true]{background:#78934f;color:#fff}.scape-inspector button:disabled{opacity:.4;cursor:default}
.scape-inspector select{width:100%;min-height:44px;margin:5px 0 8px;padding:8px;background:#203e2e;border:1px solid #718972;border-radius:8px;color:#f2faeb;font:inherit}
.scape-inspector label{display:block}.scape-inspector input{display:block;width:100%;min-height:30px;accent-color:#b4d18d;touch-action:pan-x}
.scape-inspector .scape-help{margin:3px 0 8px;font-size:11px;color:#bbd3b3}
.scape-inspector .scape-transforms{display:grid;grid-template-columns:1fr 1fr;gap:3px 14px;margin-top:8px}
.scape-nudges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px}
.scape-inspector .scape-actions{margin:6px 0 0;padding:6px 0 0}.scape-inspector .scape-status{display:block;font-size:10px;margin-top:6px;color:#b8dca6}
@media(max-width:768px){
 .scape-inspector{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));width:auto;max-height:42dvh;padding:10px 12px;border-radius:16px}
 .scape-inspector header{top:-10px}.scape-inspector .scape-help{font-size:10px}
 .scape-inspecting #game-menu-toggle{display:none!important}
}
@media(orientation:landscape) and (max-height:600px){
 .scape-inspector{left:10px;right:auto;bottom:10px;width:min(330px,43vw);max-height:calc(100dvh - 20px)}
 .scape-inspector .scape-help{display:none}
}

/* Per-tank LED lighting controls, with touch-friendly color squares. */
.tank-lamp-panel{display:flex;flex-direction:column;gap:16px}.tank-lamp-panel>p{color:#b8d0cc;font-size:13px;line-height:1.6;margin:0}.tank-lamp-panel button{min-height:44px;cursor:pointer}.lamp-power{padding:12px;border-radius:10px;border:1px solid #538483;background:#183c42;color:#e8ffff}.lamp-power[aria-pressed=true]{background:#96d9c6;color:#102c32}
.lamp-swatches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.lamp-swatches button{display:flex;flex-direction:column;align-items:center;gap:5px;background:transparent;border:0;color:inherit;padding:4px}.lamp-swatches span{display:grid;place-items:center;width:40px;height:40px;border-radius:7px;color:transparent;font-size:23px}.lamp-swatches [aria-pressed=true] span{color:white;text-shadow:0 1px 4px #000}.lamp-swatches small{font-size:11px}.lamp-swatches button:focus-visible{outline:2px solid #a5e5d2;outline-offset:2px}
.tank-lamp-panel label{display:block;color:#d5e6df;font-size:13px}.tank-lamp-panel input[type=range]{display:block;width:100%;min-height:36px;accent-color:#a5e5d2}.lamp-custom{display:flex!important;align-items:center;justify-content:space-between}.lamp-custom input{width:76px;height:44px;padding:2px;background:transparent;border:1px solid #4d6c68;border-radius:7px}.lamp-modes{display:flex;gap:8px}.lamp-modes button{flex:1;padding:8px;border:1px solid #4d6c68;border-radius:9px;color:#dcefe8;background:#19373d}.lamp-modes [aria-pressed=true]{background:#b6caa2;color:#102725}.lamp-save-status{display:block;min-height:1.5em;font-size:12px;color:#b9d9c6}

.modal-overlay.lamp-editing{z-index:1600;background:transparent;backdrop-filter:none;height:100dvh;align-items:flex-end;justify-content:flex-end;padding:16px}
.lamp-editing .modal-box{width:min(360px,calc(100vw - 24px));max-height:80dvh}.lamp-editing .modal-body{padding:14px}.lamp-editing .modal-header{padding:10px 14px}.lamp-editing .modal-header h2{font-size:16px}
@media(max-width:640px){.modal-overlay.lamp-editing{padding:8px 8px max(8px,env(safe-area-inset-bottom))}.lamp-editing .modal-box{width:100%;max-height:48dvh}.tank-lamp-panel{gap:10px}.lamp-swatches{gap:6px}.lamp-swatches span{width:34px;height:34px}.tank-lamp-panel>p{font-size:12px}}

/* Async local ornaments retain the card envelope while the full asset decodes. */
.scape-card-preview{position:relative}
.shop-asset-status{position:absolute;inset:auto 5px 5px;padding:5px 7px;border-radius:6px;background:#143038ed;color:#e9f5eb;font:11px/1.4 system-ui;text-align:center;z-index:1}
.shop-asset-status button{min-height:32px;padding:3px 8px;color:inherit;background:#2b5b62;border:1px solid #94bdb8;border-radius:5px;cursor:pointer}

/* Static aquascape catalogue: no canvas or WebGL context per card. */
.scape-card-preview img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;border-radius:8px;background:#e2e1da}
.scape-decor-card [data-resource-status]{min-height:2.4em;font-size:.73rem;line-height:1.35;overflow-wrap:anywhere}
.scape-decor-card [data-download]{margin-bottom:5px;background:#254c56;border-color:#588c98}
.scape-decor-card[aria-busy="true"] [data-download]{opacity:.75}
.scape-download-status:empty{display:none}
.scape-download-status{font-size:.8rem;color:#f5d780}

#premium-open{color:inherit;font-family:inherit;cursor:pointer}

.connection-issue{box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:24px;border:1px solid #56828b;border-radius:18px;background:#12303a;color:#ecf7f8}
.connection-issue::backdrop{background:#001018c9}
.connection-issue h2{margin-top:0}
.connection-issue button{min-height:44px;margin:6px 6px 0 0;padding:8px 12px;border:1px solid #72a8ad;border-radius:8px;background:#1b5965;color:white;font:inherit}
.player-guide{max-height:85dvh;overflow:auto}
.player-guide header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.player-guide h2{margin:0}
#account-connection-warning{position:fixed;z-index:80;left:50%;bottom:max(108px,env(safe-area-inset-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);padding:8px 12px;border:1px solid #d9b476;border-radius:12px;background:#253b43;color:#ffe8b9}
#account-connection-warning[hidden]{display:none}
#account-connection-warning button{min-height:44px;padding:6px 10px;margin-left:4px;background:#1b5965;color:white;border:1px solid #72a8ad;border-radius:8px;font:inherit}

/* Native dialogs need their auto margin restored after the page-wide reset. */
dialog{margin:auto}
dialog input,dialog textarea,dialog code{user-select:text;-webkit-user-select:text}
#account-dialog>header{position:sticky;top:-24px;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;background:#12303a}
#account-dialog>header h2{font-size:clamp(17px,5vw,22px)}
#account-dialog>header button{min-width:44px;min-height:44px;margin:0;padding:0}
.commerce-dialog>header{position:sticky;top:-20px;z-index:1;padding:8px 0;background:#12303a}
.scape-editor header{position:sticky;top:-20px;z-index:1;background:#101f1b;padding:4px 0}
.scape-editor header button{min-width:44px;min-height:44px}
.scape-editor a{color:#b6ded3}
@media(max-width:640px){
 .scape-editor header{top:-13px}
 .scape-editor select,.scape-editor .scape-decor-card button{min-height:44px}
}

/* Keep reward actions visible and tuck reference details behind disclosure rows. */
#rewards-dialog{width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #56828b;border-radius:18px;background:#102b34;color:#ecf7f8;overflow:auto;overscroll-behavior:contain;font:14px/1.45 system-ui,sans-serif}
#rewards-dialog::backdrop{background:#001018b8}
#rewards-dialog>header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:#102b34;border-bottom:1px solid #365662}
#rewards-dialog h2{font-size:18px}
#rewards-dialog h3{font-size:14px}
#rewards-dialog button{min-height:44px;padding:8px 10px;border:1px solid #4d7a83;border-radius:9px;background:#1b4955;color:#f0faff;font:inherit;cursor:pointer}
#rewards-dialog button:disabled{opacity:.7;cursor:default}
#rewards-dialog button:focus-visible,#rewards-dialog summary:focus-visible{outline:2px solid #ffe4a1;outline-offset:2px}
#rewards-close{min-width:44px}
#rewards-content{display:grid;gap:8px;padding:12px}
#rewards-error{display:block;padding:8px 12px 0;color:#ffcc9c;overflow-wrap:anywhere}
#rewards-error:empty{display:none}
.reward-card{min-width:0;padding:11px;border:1px solid #365662;border-radius:12px;background:#193944}
.reward-daily,.reward-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.reward-daily{flex-wrap:wrap}
.reward-amount{display:inline-block;margin-top:3px;color:#ffe4a1;font-size:15px}
#rewards-action:not(:disabled){background:#b8dfba;color:#173627;border-color:#b8dfba;font-weight:700}
.reward-progress{flex:none;color:#b7e1cd;font-weight:700}
.reward-tasks,.reward-milestones{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.reward-tasks{margin-top:8px}
#rewards-dialog .reward-task{display:grid;place-content:center;min-width:0;min-height:54px;padding:4px 3px;text-align:center;font-size:12px;line-height:1.2}
.reward-task.done,.reward-task.muted{border-radius:9px;background:#142e37}
.reward-task.done{color:#bbe6cd}
.reward-task.muted{color:#b4cbd1}
.reward-task>span:first-child{font-size:16px;margin-bottom:3px}
.reward-sources{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#rewards-dialog [data-rewards-fish]{display:grid;align-content:center;text-align:left;gap:3px}
.reward-sources p,.reward-sources button span{margin-top:2px;color:#c0d9de;font-size:12px}
.reward-detail{padding:0 11px;border:1px solid #365662;border-radius:10px}
.reward-detail summary{min-height:44px;padding:11px 0;cursor:pointer}
.reward-detail h4{margin:6px 0}
.reward-detail p{margin:6px 0 10px;color:#c6d9dd}
.reward-detail button{margin-bottom:10px}
.reward-milestones{list-style:none;margin:0 0 10px}
.reward-milestones li{display:grid;gap:2px;padding:6px 3px;border-radius:8px;background:#193944;text-align:center;font-size:12px}
.reward-milestones strong{color:#ffe4a1}
.reward-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

#account-dialog .account-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}
#account-dialog .account-actions button{min-height:44px;margin:0}
.player-guide{padding:14px}
.player-guide header{position:sticky;top:-14px;z-index:1;background:#12303a;padding:6px 0}
.player-guide header button{min-width:44px;margin:0}
.guide-heading,.guide-goals li{display:flex;align-items:center;justify-content:space-between;gap:8px}
.guide-heading{margin:10px 0 6px}
.guide-heading h3{font-size:15px}
.guide-tasks,.guide-goals{list-style:none}
.guide-tasks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.guide-tasks button{width:100%;height:100%;margin:0;padding:6px;text-align:left}
.guide-goals li{min-height:38px;padding:6px 0;font-size:13px;border-top:1px solid #365662}
.guide-goals strong{flex:none;color:#b7e1cd}

.reward-sync{display:block;color:#ffcc9c}
.insight-gain{color:#ffe4a1}
.insight-totals{list-style:none}
.insight-totals li{display:flex;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid #365662;font-size:13px}
.insight-totals li:last-child{border-bottom:0}
.insight-totals li strong{text-align:right}

/* Aquarium readings stay behind one small button next to Menu. */
#tank-info-toggle{position:fixed;right:calc(max(16px,env(safe-area-inset-right)) + 74px);bottom:calc(max(16px,env(safe-area-inset-bottom)) + 7px);z-index:1451;width:48px;height:48px;display:grid;place-items:center;padding:0;border:1px solid #79b4bf88;border-radius:50%;background:#153945;color:#d7eff1;font:28px/1 system-ui;box-shadow:0 4px 18px #0004;cursor:pointer;touch-action:manipulation}
#tank-info-toggle.has-warning::after{content:"";position:absolute;top:2px;right:2px;width:10px;height:10px;border:2px solid #153945;border-radius:50%;background:#ffcf70}
#tank-info-toggle:focus-visible,.tank-info button:focus-visible{outline:2px solid #9ceaf4;outline-offset:3px}
.zen-mode-active #tank-info-toggle,.scape-inspecting #tank-info-toggle{display:none}
.tank-info{box-sizing:border-box;position:fixed;inset:auto max(16px,env(safe-area-inset-right)) calc(max(16px,env(safe-area-inset-bottom)) + 76px) auto;margin:0;width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;padding:16px 18px;border:1px solid #49727b;border-radius:20px;background:#102b34;color:#e3f0ee;box-shadow:0 12px 40px #0007;font:14px/1.4 system-ui}
.tank-info::backdrop{background:#00151c40}
.tank-info header{position:sticky;top:-16px;z-index:1;padding:4px 0;background:#102b34;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.tank-info h2{margin:0;font-size:18px}.tank-info h3{font-size:13px;color:#a8d0ce;margin:20px 0 6px}
.tank-info button{display:grid;place-items:center;flex-shrink:0;min-width:44px;min-height:44px;border:1px solid #42656f;border-radius:50%;background:#1a3c47;color:#e3f0ee;cursor:pointer;font-size:18px}
.tank-info dl{margin:0}.tank-info dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:12px;padding:9px 0;border-bottom:1px solid #ffffff10}
.tank-info dt{color:#afc7cb}.tank-info dd{margin:0;text-align:right;font-weight:600;overflow-wrap:anywhere}
.tank-info-alert{padding:9px 12px;border-radius:10px;background:#4f3a19;color:#ffdb8c;font-weight:600}
@media(max-height:500px){.tank-info{bottom:12px;max-height:calc(100dvh - 24px)}}

.tank-info dt small,.tank-info dd small{display:block;margin-top:3px;font-size:10px;font-weight:400;line-height:1.4;color:#9cb8bd}
.tank-info [data-tone="safe"] dd small{color:#9bd8bc}.tank-info [data-tone="watch"] dd,.equipment-undersized{color:#f4ce86}.tank-info [data-tone="danger"] dd{color:#ffaaaa}
.tank-info [data-tone="danger"] dd small{color:#ffaaaa}.tank-info [data-tone="watch"] dd small{color:#f4ce86}
.tank-info .tank-info-actions{display:flex;gap:8px;margin-top:12px}.tank-info-actions button{flex:1;border-radius:10px;font:600 12px/1.4 system-ui;padding:8px}
.tank-water-advice{margin-top:12px;color:#efd8ac;font-size:12px;line-height:1.6}
.equipment-shop{display:grid;gap:12px}.equipment-summary{margin:0;font-size:13px;color:#bad8d6}.equipment-card{margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center}.equipment-card>div{min-width:0}.equipment-card h4{margin:0 0 8px}.equipment-card p{font-size:12px;line-height:1.5;margin:6px 0}.equipment-card .btn-buy{width:auto;max-width:220px;min-height:44px;white-space:normal;flex-shrink:0}.equipment-card .btn-buy:disabled{opacity:.45;cursor:default}.equipment-next{color:#a6d8ba}.equipment-alerts{padding:4px 12px;background:#513d241f;border:1px solid #d5aa5b66;border-radius:12px}.equipment-alerts p,.equipment-cycle p{font-size:12px;line-height:1.6}.equipment-cycle summary{cursor:pointer;padding:10px 0;font-size:13px;color:#bad8d6}
@media(max-width:600px){.equipment-card{grid-template-columns:minmax(0,1fr);align-items:stretch}.equipment-card .btn-buy{width:100%;max-width:none}}

.equipment-preview{min-height:36px;padding:6px 10px;margin:3px 0;border:1px solid #79b4bf66;border-radius:8px;color:#b4e9ed;background:#17343e;font:600 12px/1.4 system-ui;cursor:pointer}.equipment-preview:focus-visible{outline:2px solid #9ceaf4;outline-offset:2px}

/* Brand button opens the live wallet and tank counters on demand. */
button.logo-brand{font:inherit;color:inherit;text-align:left;cursor:pointer;height:44px;min-height:44px;padding:7px 10px;gap:8px;border:1px solid #93c8cd22;border-radius:12px;background:#102d35b3;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:0 3px 12px #0002}button.logo-brand .logo-icon{font-size:24px;line-height:1}button.logo-brand .title{font-size:14px;letter-spacing:.2px}button.logo-brand:hover{background:#173d46}
.hud-chevron{color:#83c2cc;font-size:15px;transition:transform .15s}#hud-stats-toggle[aria-expanded=true] .hud-chevron{transform:rotate(180deg)}
#hud-stats-toggle:focus-visible,.hud-stats button:focus-visible,.hud-credits:focus-visible{outline:2px solid #9ceaf4;outline-offset:3px}
.hud-stats{position:fixed;inset:70px auto auto max(16px,env(safe-area-inset-left));margin:0;box-sizing:border-box;width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 90px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;padding:12px 16px;border:1px solid #48717a;border-radius:18px;background:#102b34;color:#e2f1ed;box-shadow:0 12px 32px #0007;pointer-events:auto;font:14px/1.4 system-ui}
.hud-stats-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}.hud-stats-heading h2{font-size:16px;margin:0}.hud-stats-heading button{width:36px;height:36px;border:0;border-radius:50%;color:#d7eeeb;background:#ffffff0a;font-size:18px;cursor:pointer}
.hud-stats .stats-panel{display:grid;grid-template-columns:minmax(0,1fr);width:100%;max-width:100%;justify-self:stretch;gap:0}
.hud-stats .stat-badge{box-sizing:border-box;display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;min-width:0;min-height:44px;padding:10px 0;margin:0;border:0;border-bottom:1px solid #ffffff12;border-radius:0;background:transparent;backdrop-filter:none;box-shadow:none;color:inherit;font:600 14px/1.4 system-ui;transform:none;text-align:left}
.hud-stats button.stat-badge{cursor:pointer}.hud-stats button.stat-badge:hover{background:#ffffff08}.hud-stats .stat-label{font-weight:400;color:#b2cdd0}.hud-stats .stat-badge .value{font-variant-numeric:tabular-nums;white-space:nowrap}.hud-stats .stat-badge .icon{font-size:17px}
.hud-credits{display:inline-block;margin-top:12px;color:#9ebcc3;font-size:10px;text-decoration:none}.hud-credits:hover{text-decoration:underline}
@media(max-width:768px){.hud-stats{top:calc(max(10px,env(safe-area-inset-top)) + 54px);left:max(10px,env(safe-area-inset-left))}}
@media(orientation:landscape) and (max-height:600px){.hud-top #hud-stats-toggle{display:flex}.hud-stats{top:60px;max-height:calc(100dvh - 72px)}}
