*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --deep: #062636;
  --tank: #0a4a68;
  --water-top: #1f8aad;
  --water-bot: #0d3d56;
  --sand: #d4b896;
  --foam: #e8f6fa;
  --glass: rgba(255, 255, 255, 0.08);
  --panel: rgba(6, 32, 46, 0.88);
  --panel-border: rgba(140, 210, 230, 0.22);
  --accent: #3ecfba;
  --accent-hot: #ff9f1c;
  --coral: #e76f51;
  --text: #eef8fb;
  --muted: #8fb8c8;
  --coin: #ffd166;
  --danger: #ef476f;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --radius: 18px;
  --inv-h: 92px;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #1a6f8c 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, #0a3a4a 0%, transparent 50%),
    linear-gradient(165deg, #041820 0%, #062636 40%, #0a3040 100%);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr var(--inv-h);
  height: 100vh;
  height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 14px 10px;
  gap: 10px;
}

/* —— Top bar —— */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  font-size: 1.75rem;
  filter: drop-shadow(0 4px 8px rgba(62, 207, 186, 0.4));
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tagline {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.stat.coins { color: var(--coin); }
.stat.income { color: var(--accent); }
.stat.level { position: relative; padding-right: 14px; }

.xp-track {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  border-radius: 2px;
  transition: width 0.35s ease;
}

/* —— Stage —— */
.stage {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  min-height: 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.65rem;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-btn span { font-size: 1.35rem; line-height: 1; }
.nav-btn:hover {
  color: var(--text);
  border-color: rgba(62, 207, 186, 0.45);
  transform: translateY(-1px);
}
.nav-btn.active {
  background: linear-gradient(160deg, rgba(62, 207, 186, 0.28), rgba(31, 138, 173, 0.35));
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(62, 207, 186, 0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}

.viewport {
  position: relative;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.panel {
  display: none;
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 14px;
  animation: fadeIn 0.25s ease;
}
.panel.active { display: flex; flex-direction: column; gap: 12px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.panel-head p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* —— Tank —— */
.panel-tank {
  padding: 10px !important;
}

.tank-frame {
  position: relative;
  flex: 1;
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(180, 220, 235, 0.35);
  box-shadow:
    inset 0 0 60px rgba(0, 40, 60, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, var(--water-top), var(--water-bot));
  cursor: crosshair;
}

.tank-frame.targeting {
  outline: 3px solid var(--accent-hot);
  outline-offset: 2px;
  animation: pulseTarget 1.2s ease-in-out infinite;
}

@keyframes pulseTarget {
  0%, 100% { outline-color: var(--accent-hot); }
  50% { outline-color: var(--accent); }
}

#tank-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tank-glass {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.18) 0%, transparent 28%, transparent 72%, rgba(255,255,255,0.06) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 18%);
}

.use-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 28, 40, 0.85);
  border: 1px solid var(--accent-hot);
  color: var(--foam);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 3;
  box-shadow: var(--shadow);
}
.use-hint.hidden { display: none; }

.toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 28, 40, 0.92);
  border: 1px solid var(--panel-border);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 4;
  animation: toastIn 0.25s ease;
  max-width: 90%;
  text-align: center;
}
.toast.hidden { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.tank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}
.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.action-btn.ocean {
  background: linear-gradient(160deg, #1b6ca8, #0a3d62);
  border-color: rgba(120, 200, 255, 0.35);
  color: #e8f7ff;
  box-shadow: 0 4px 16px rgba(10, 80, 140, 0.35);
}
.action-btn.ocean:hover:not(:disabled) {
  background: linear-gradient(160deg, #2480c4, #0d4a74);
}

/* —— Ocean fishing screen —— */
.fishing-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #041828;
}
.fishing-screen.hidden { display: none !important; }

.fishing-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  /* Clear fixed "All games" exit control (top-left) */
  padding: 14px 16px 14px max(140px, env(safe-area-inset-left) + 130px);
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(4, 24, 40, 0.85) 0%, transparent 100%);
  pointer-events: none;
}
.fishing-hud > * { pointer-events: auto; }

.fishing-hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fishing-hint {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(230, 248, 255, 0.9);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  flex: 1;
  min-width: 0;
}

.fishing-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(4, 24, 40, 0.65);
  border: 1px solid rgba(140, 210, 230, 0.28);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

#ocean-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.fish-toast {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3;
  padding: 10px 18px;
  background: rgba(4, 24, 40, 0.88);
  border: 1px solid rgba(140, 210, 230, 0.35);
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  pointer-events: none;
  max-width: min(90vw, 360px);
  text-align: center;
}
.fish-toast.hidden { display: none; }

@media (max-width: 640px) {
  .fishing-hint { font-size: 0.72rem; }
}
.action-btn.danger {
  background: rgba(239, 71, 111, 0.25);
  border-color: rgba(239, 71, 111, 0.5);
  color: #ffc2d0;
}
.action-btn.small {
  padding: 7px 10px;
  font-size: 0.75rem;
}

.buff-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-hot);
  animation: bob 1.5s ease-in-out infinite;
}
.buff-label.hidden { display: none; }

/* —— Shop —— */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition: border-color 0.15s, transform 0.15s;
}
.shop-card:hover:not(.locked) {
  border-color: rgba(62, 207, 186, 0.45);
  transform: translateY(-2px);
}
.shop-card.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.shop-ico {
  font-size: 2rem;
  line-height: 1;
}
.shop-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.shop-card .desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  flex: 1;
}
.shop-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.shop-card .price {
  color: var(--coin);
  font-weight: 800;
  font-size: 0.9rem;
}
.shop-card .lock-note {
  font-size: 0.7rem;
  color: var(--accent-hot);
  font-weight: 700;
}

/* —— Fishdex —— */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.dex-card {
  position: relative;
  padding: 12px 10px 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.dex-card.unknown {
  background: #0a1820;
  border-color: rgba(255, 255, 255, 0.06);
}
.dex-art {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(40, 120, 150, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(8, 40, 58, 0.9), rgba(4, 22, 34, 0.95));
  border: 1px solid rgba(140, 210, 230, 0.15);
  overflow: hidden;
}
.dex-card .dex-sprite {
  width: 104px;
  height: 104px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.dex-card .dex-sprite.silhouetted {
  filter: brightness(0) opacity(0.35);
  object-fit: cover;
}
.dex-mystery {
  width: 64px;
  height: 36px;
  border-radius: 50% 50% 45% 45%;
  background: #1a2e38;
  box-shadow:
    18px 0 0 -8px #1a2e38,
    -14px 4px 0 -10px #152830;
  opacity: 0.85;
  position: relative;
}
.dex-mystery::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0a1820;
}
.dex-card .dex-emoji {
  font-size: 2.1rem;
  line-height: 1.2;
  margin-bottom: 6px;
  display: block;
}
.dex-card .dex-q {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: #8aa0ac;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.dex-card .dex-name {
  font-weight: 800;
  font-size: 0.8rem;
}
.dex-card.unknown .dex-name {
  color: var(--muted);
  letter-spacing: 0.08em;
}
.dex-card .dex-rarity {
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* —— Fish list —— */
.fish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fish-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.fish-row:hover {
  border-color: rgba(62, 207, 186, 0.4);
  background: rgba(62, 207, 186, 0.08);
}
.fish-row .fr-emoji { font-size: 1.6rem; }
.fish-row .fr-sprite {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.fish-row .fr-name { font-weight: 800; font-size: 0.9rem; }
.fish-row .fr-meta { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.fish-row .fr-sell {
  color: var(--coin);
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}
.fish-row.hungry {
  border-color: rgba(255, 159, 28, 0.45);
}
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-weight: 600;
}

/* —— Inventory —— */
.inventory-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  min-height: var(--inv-h);
}

.inv-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.inventory {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.inv-slot {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.inv-slot:hover {
  border-color: rgba(62, 207, 186, 0.5);
  transform: translateY(-2px);
}
.inv-slot.selected {
  border-color: var(--accent-hot);
  background: rgba(255, 159, 28, 0.18);
  box-shadow: 0 0 0 2px rgba(255, 159, 28, 0.25);
}
.inv-slot .ico { font-size: 1.5rem; line-height: 1; }
.inv-slot.permanent {
  border-color: rgba(62, 207, 186, 0.35);
  background: rgba(62, 207, 186, 0.1);
}
.inv-slot .pin-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(232, 246, 250, 0.92);
  color: #0a4a68;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1px solid rgba(62, 207, 186, 0.45);
}
.inv-slot .qty {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #042028;
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.inv-empty {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 8px;
  align-self: center;
}

.cancel-use {
  flex-shrink: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 71, 111, 0.45);
  background: rgba(239, 71, 111, 0.2);
  color: #ffc2d0;
  cursor: pointer;
}
.cancel-use.hidden { display: none; }

/* —— Modal —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(2, 12, 18, 0.72);
  backdrop-filter: blur(6px);
  padding: 16px;
}
.modal.hidden { display: none; }

.modal-card {
  position: relative;
  width: min(380px, 100%);
  background: linear-gradient(165deg, #0c3a4e, #062636);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.22s ease;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.modal-body-inner .big-emoji { font-size: 3rem; }
.modal-body-inner .big-sprite {
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
.modal-body-inner h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.modal-body-inner .rarity-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.modal-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  text-align: left;
  font-size: 0.8rem;
}
.modal-stats div {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: 10px;
}
.modal-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.modal-actions .action-btn { flex: 1; }

/* —— Hatch —— */
.hatch-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(2, 12, 18, 0.8);
  backdrop-filter: blur(8px);
}
.hatch-overlay.hidden { display: none; }

.hatch-card {
  text-align: center;
  padding: 28px 32px;
  background: linear-gradient(165deg, #0e4560, #073040);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(255, 209, 102, 0.12);
  animation: hatchPop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes hatchPop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
.hatch-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-hot);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.hatch-emoji {
  font-size: 4rem;
  line-height: 1;
  margin: 8px 0 12px;
  animation: bob 2s ease-in-out infinite;
  min-height: 120px;
  display: grid;
  place-items: center;
}
.hatch-emoji img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}
.hatch-card h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.hatch-rarity {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  #app { padding: 8px; gap: 8px; }
  .stage { grid-template-columns: 56px 1fr; }
  .nav-btn em { display: none; }
  .brand h1 { font-size: 1.1rem; }
  .stat { padding: 5px 9px; font-size: 0.75rem; }
  .inv-label { display: none; }
  :root { --inv-h: 80px; }
  .shop-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
