/* WILDCAP landing: pannable island map (map mode) + the field guide fallback (static mode). */

/* ── map mode: one fixed canvas, overlay UI, no page scroll ───────────── */
#world { display: none; }
.ui { display: none; }
html.map, html.map body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.map body { background: #cdeeff; }
html.map #world { display: block; position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 1; touch-action: none; cursor: grab; outline: none; }
html.map #world.dragging { cursor: grabbing; }
html.map #world.hovering { cursor: pointer; }
html.map .ui { display: block; position: fixed; inset: 0; z-index: 2; pointer-events: none; }
html.map .ui [hidden] { display: none !important; }
html.map .isles, html.map #foot { visibility: hidden; }
.ui a, .ui button, .ui .ca, .ui .countdown, .ui .dexcard, .ui .stepper { pointer-events: auto; }

/* loader */
.loader {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 40%, #f2fbff 0%, #cdeeff 70%); font: 800 16px/1 var(--f-body); color: var(--ink-2);
  transition: opacity 0.5s;
}
.loader.out { opacity: 0; pointer-events: none; }
.loader-egg {
  width: 46px; height: 58px; border: 3px solid var(--ink); border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 30% 30%, #ff9a8a 0 4px, transparent 5px), radial-gradient(circle at 70% 55%, #5cc98a 0 5px, transparent 6px),
    radial-gradient(circle at 40% 75%, #7cc6f5 0 4px, transparent 5px), #fff6e4;
  box-shadow: 0 4px 0 var(--ink); animation: eggwob 1.1s ease-in-out infinite; transform-origin: 50% 100%;
}
@keyframes eggwob { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-12deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-5deg); } }

/* ── gate ─────────────────────────────────────────────────────────────── */
.gate { position: absolute; inset: 0; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.gate-chip {
  position: absolute; top: max(22px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); margin: 0;
  padding: 10px 18px; background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
  font: 800 16px/1 var(--f-display); white-space: nowrap; animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both 0.2s;
}
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ring circle { fill: none; transition: stroke 0.15s; }
.ring-zone { fill: rgba(182, 240, 211, 0.28) !important; stroke: #fff; stroke-width: 3; stroke-dasharray: 6 7; }
.ring-edge { stroke: var(--ink); stroke-width: 9; }
.ring-line { stroke: var(--sun); stroke-width: 5; }
.ring.good .ring-line { stroke: var(--grass); }
.ring.hit .ring-line { stroke: #fff; }
.ring.off { opacity: 0; transition: opacity 0.2s; }
.gate-say {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); margin: 0; pointer-events: none;
  font: 800 clamp(30px, 6vw, 54px)/1 var(--f-display); color: #fff; letter-spacing: -0.01em; text-align: center;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); opacity: 0;
}
.gate-say.show { animation: say 1.3s cubic-bezier(.2, 1.5, .4, 1) both; }
.gate-say.stay { animation: sayin 0.6s cubic-bezier(.2, 1.5, .4, 1) both; }
.gate-say small { display: block; margin-top: 10px; font: 800 16px/1.3 var(--f-body); -webkit-text-stroke: 0; text-shadow: none; color: var(--ink);
  background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 14px; box-shadow: 0 3px 0 var(--ink); }
@keyframes say { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 28% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
@keyframes sayin { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.gate-bottom {
  position: absolute; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 12px; pointer-events: none;
}
.gate-hint { margin: 0; text-align: center; padding: 12px 22px; background: var(--panel); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both 0.5s; }
.gate-hint b { display: block; font: 800 20px/1.1 var(--f-display); }
.gate-hint small { display: block; margin-top: 4px; font: 700 13px/1 var(--f-body); color: var(--muted); }
.gate-ball { width: 44px; height: 52px; animation: ballbob 1.4s ease-in-out infinite; filter: drop-shadow(0 3px 0 rgba(28,39,66,.25)); }
.gate.thrown .gate-ball { visibility: hidden; }
@keyframes ballbob { 50% { transform: translateY(-5px) rotate(-8deg); } }
.gate-top { position: absolute; top: max(16px, env(safe-area-inset-top)); right: var(--gutter); display: flex; gap: 8px; align-items: center; }
.gate-skip {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.85);
  font: 800 14px/1 var(--f-body); cursor: pointer; box-shadow: 0 3px 0 var(--ink);
}
.gate-skip:hover { background: #fff; }
.gate.done .gate-hint, .gate.done .gate-ball { opacity: 0; transition: opacity 0.3s; }
@keyframes pop { 0% { opacity: 0; transform: translateX(var(--tx, -50%)) scale(0.6); } 100% { opacity: 1; transform: translateX(var(--tx, -50%)) scale(1); } }
.gate-hint { --tx: 0; }
@media (max-width: 560px) { .gate-chip { top: calc(max(16px, env(safe-area-inset-top)) + 58px); } }

/* ── HUD ──────────────────────────────────────────────────────────────── */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { position: absolute; }
.hud.in > * { animation: hudin 0.6s cubic-bezier(.2, 1.4, .4, 1) both; }
.hud.in > :nth-child(2) { animation-delay: 0.08s; } .hud.in > :nth-child(3) { animation-delay: 0.16s; }
.hud.in > :nth-child(4) { animation-delay: 0.24s; } .hud.in > :nth-child(5) { animation-delay: 0.3s; } .hud.in > :nth-child(6) { animation-delay: 0.36s; }
@keyframes hudin { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.hud-logo {
  top: max(16px, env(safe-area-inset-top)); left: var(--gutter); display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 6px 14px 6px 6px; background: rgba(255, 255, 255, 0.82); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink); backdrop-filter: blur(6px);
}
.hud-logo img { display: block; width: 40px; height: 40px; }
.hud-logo .hud-word { width: auto; height: 22px; }
.hud-tr { top: max(16px, env(safe-area-inset-top)); right: var(--gutter); display: flex; gap: 8px; align-items: center; }
.hud-tr > * { pointer-events: auto; }
.hud-tr .icon-btn, .gate-top .icon-btn { width: 44px; height: 44px; }
.hud-buy { min-height: 44px; }
.hud-banner {
  top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 640px)); min-width: 300px;
  display: grid; justify-items: center; gap: 8px; text-align: center; transition: opacity 0.5s, transform 0.5s;
}
.hud-banner p {
  margin: 0; padding: 10px 18px; background: rgba(255, 250, 240, 0.92); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink);
  font: 700 15px/1.3 var(--f-body); backdrop-filter: blur(6px); transition: opacity 0.4s, max-height 0.4s, padding 0.4s; max-height: 120px; overflow: hidden;
}
.hud-banner p b { font-family: var(--f-display); color: var(--coral-deep); }
.hud-banner.tucked p { opacity: 0; max-height: 0; padding-block: 0; border-width: 0; box-shadow: none; }
.hud-stats { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.hud-stats li {
  padding: 5px 11px; background: rgba(255, 255, 255, 0.9); border: 2px solid var(--ink); border-radius: 999px; font: 700 12px/1 var(--f-body); color: var(--ink-2);
  box-shadow: 0 2px 0 var(--ink);
}
.hud-stats b { font: 800 13px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-bl { left: var(--gutter); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; gap: 10px; justify-items: start; max-width: min(430px, 36vw); }
.hud-bl > * { min-width: 0; max-width: 100%; }
.hud .ca { padding: 5px 6px 5px 6px; gap: 8px; flex-wrap: nowrap; box-shadow: 0 3px 0 var(--ink); max-width: 100%; }
.hud .ca-label { font-size: 11px; padding: 5px 7px; }
.hud .ca-addr { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.hud .ca .btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.hud .countdown { gap: 6px; }
.hud .countdown .cell { min-width: 48px; padding: 6px 4px 5px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.hud .countdown b { font-size: 20px; }
.hud .countdown small { font-size: 9px; margin-top: 3px; }
.hud-play {
  right: var(--gutter); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 66px; padding: 16px 30px; font: 800 22px/1 var(--f-display);
  box-shadow: 0 6px 0 var(--ink); letter-spacing: -0.01em;
}
.hud-play:hover { box-shadow: 0 7px 0 var(--ink); }
.hud-play::before { content: ''; position: absolute; inset: -8px; border-radius: inherit; border: 3px solid var(--coral); opacity: 0; animation: halo 2.4s ease-out infinite 1.5s; pointer-events: none; }
@keyframes halo { 0% { opacity: 0.8; transform: scale(0.96); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
.hud-help {
  left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px); transform: translateX(-50%); margin: 0; white-space: nowrap;
  font: 800 12px/1 var(--f-body); color: var(--ink-2); background: rgba(255, 255, 255, 0.7); padding: 6px 12px; border-radius: 999px; transition: opacity 0.6s;
}
.hud-help.gone { opacity: 0; }

/* stepper + minimap */
.stepper {
  left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 6px; background: rgba(255, 255, 255, 0.9); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink); backdrop-filter: blur(6px);
}
.step-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--ink);
  display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--ink); transition: transform 0.12s, box-shadow 0.12s;
}
.step-btn svg { width: 22px; height: 22px; }
.step-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.step-btn:disabled { opacity: 0.4; cursor: default; }
.step-mid { display: grid; justify-items: center; gap: 2px; width: 196px; }
.minimap { width: 196px; height: 40px; display: block; overflow: visible; }
.minimap .mm-link { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; fill: none; opacity: 0.35; }
.minimap .mm-isle { cursor: pointer; pointer-events: auto; }
.minimap .mm-isle path { stroke: var(--ink); stroke-width: 2; transition: transform 0.25s; transform-box: fill-box; transform-origin: center; }
.minimap .mm-isle.on path { stroke-width: 3; transform: scale(1.18); }
.minimap .mm-you { fill: var(--coral); stroke: var(--ink); stroke-width: 2; transition: transform 0.12s linear; }
.step-name { font: 800 14px/1 var(--f-display); white-space: nowrap; }

/* pins over islands */
.pins, .tags, .cardlayer { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: auto; will-change: transform; transition: opacity 0.3s; -webkit-tap-highlight-color: transparent;
}
.pin-icon {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2.5px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink); animation: pinbob 2.6s ease-in-out infinite; transition: transform 0.15s, background 0.15s;
}
.pin-icon svg { width: 28px; height: 28px; }
.pin-label {
  font: 800 13px/1 var(--f-display); padding: 5px 10px; background: var(--ink); color: #fff; border-radius: 999px; white-space: nowrap;
}
.pin::after { content: ''; width: 3px; height: 16px; background: var(--ink); border-radius: 3px; order: 3; opacity: 0.6; }
.pin:hover .pin-icon, .pin:focus-visible .pin-icon, .pin.hot .pin-icon { transform: scale(1.12) translateY(-3px); background: var(--sun); }
.pin.on .pin-icon { background: var(--sun); }
.pin.far { opacity: 0.55; }
.pin.away { opacity: 0; pointer-events: none; }
.pin[data-isle='fair'] .pin-icon { width: 42px; height: 42px; }
.pin-hint {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 800 13px/1 var(--f-body);
  padding: 8px 12px; background: var(--coral); color: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); animation: hintbob 1.2s ease-in-out infinite;
}
.pin-hint::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
@keyframes pinbob { 50% { transform: translateY(-5px); } }
@keyframes hintbob { 50% { transform: translateX(-50%) translateY(-4px); } }

/* name tags over real creatures */
.tag {
  position: absolute; left: 0; top: 0; padding: 4px 9px; border: 2px solid var(--ink); border-radius: 999px; background: var(--panel); pointer-events: auto; cursor: pointer;
  font: 800 12px/1 var(--f-display); white-space: nowrap; box-shadow: 0 2px 0 var(--ink); will-change: transform; transition: opacity 0.25s;
}
.tag[data-r='legendary'] { background: #ffe3a8; } .tag[data-r='epic'] { background: #ead9ff; } .tag[data-r='rare'] { background: #cfe6ff; } .tag[data-r='uncommon'] { background: #c9f2dc; }
.tag.raging { background: #ffb59e; }
.tag.new::before { content: 'NEW'; margin-right: 5px; font-size: 9px; letter-spacing: 0.08em; padding: 2px 4px; border-radius: 4px; background: var(--coral); color: #fff; vertical-align: 1px; }
.tag.away { opacity: 0; pointer-events: none; }

/* ── Dex cards ────────────────────────────────────────────────────────── */
.dex {
  --tint: #b6f0d3; --tint-2: #e6fff1;
  position: relative; background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink);
  padding: 0 20px 20px; overflow: hidden;
}
.dex[data-isle='marsh'] { --tint: #a7e6e0; --tint-2: #e8fbf8; }
.dex[data-isle='cliffs'] { --tint: #ffd9a8; --tint-2: #fff4e3; }
.dex[data-isle='peaks'] { --tint: #c9d3f7; --tint-2: #f0f3ff; }
.dex[data-isle='fair'] { --tint: #ffe68f; --tint-2: #fff9de; }
.dex[data-isle='den'] { --tint: #ffc4b8; --tint-2: #fff0eb; }
.dex-top {
  margin: 0 -20px 14px; padding: 12px 20px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: repeating-linear-gradient(-45deg, var(--tint) 0 12px, var(--tint-2) 12px 14px); border-bottom: 2px solid var(--ink);
  font: 800 11px/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase;
}
.dex-no { padding: 4px 8px; background: var(--ink); color: #fff; border-radius: 6px; }
.dex-type { color: var(--ink); }
.dex-title { font: 800 clamp(28px, 3vw, 34px)/1 var(--f-display); letter-spacing: -0.02em; margin: 0 0 6px; }
.dex-hook { font: 800 17px/1.3 var(--f-display); color: var(--coral-deep); margin: 0 0 10px; }
.dex-lines { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }
.dex-lines li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.dex-lines li::before { content: ''; position: absolute; left: 2px; top: 0.5em; width: 9px; height: 9px; border-radius: 50%; background: var(--tint); border: 2px solid var(--ink); }
.dex-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 14px; }
.dex-stats div { padding: 8px 8px 7px; background: var(--panel-2); border: 2px solid var(--line-2); border-radius: 12px; min-width: 0; }
.dex-stats dt { font: 800 10px/1.1 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dex-stats dd { margin: 4px 0 0; font: 800 17px/1.1 var(--f-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dex-cta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dex-cta .btn { min-height: 42px; }
.dex-honest { margin: 0 0 4px; padding: 8px 12px; border-radius: 12px; background: #fff6e4; border: 2px dashed var(--line-2); font: 700 13px/1.35 var(--f-body); color: var(--ink-2); }
.dex-live:empty, .seed:empty, .stages:empty, .ladder:empty, .tickers:empty { display: none; }

/* live feed */
.feed { margin: 0 0 4px; padding: 10px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line-2); }
.feed h4 { margin: 0 0 8px; font: 800 11px/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.feed h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(34, 181, 115, 0.2); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.feed ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.feed li img, .feed .ph { width: 40px; height: 40px; border-radius: 12px; background: var(--sky-2); border: 2px solid var(--ink); object-fit: cover; }
.feed .who { min-width: 0; }
.feed .who b { display: block; font: 800 14px/1.1 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .who small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .when { font: 700 12px/1 var(--f-body); color: var(--muted); text-align: right; display: grid; gap: 4px; justify-items: end; }
.feed .chip { font-size: 10px; padding: 2px 7px; }
.feed .empty { font-size: 14px; color: var(--muted); margin: 0; }

/* moods, rarity ladder, stages, tickers, seed */
.moods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.mood { display: grid; justify-items: center; text-align: center; gap: 3px; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; }
.mood svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mood[data-mood='hyped'] { background: #fff1b8; } .mood[data-mood='hyped'] svg { fill: var(--sun); }
.mood[data-mood='calm'] { background: #dcf7e8; } .mood[data-mood='sleepy'] { background: #e6e9ff; }
.mood b { font: 800 15px/1 var(--f-display); }
.mood small { font: 700 11px/1.25 var(--f-body); color: var(--ink-2); }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.ladder .chip { font-size: 11px; }
.ladder .chip small { font-weight: 700; text-transform: none; letter-spacing: 0; opacity: 0.75; }
.stages { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: end; gap: 4px; margin: 4px 0 6px; padding: 10px 8px; border-radius: 14px; background: var(--tint-2); border: 2px solid var(--line-2); }
.stage { display: grid; justify-items: center; gap: 4px; text-align: center; }
.stage img, .stage canvas { display: block; }
.stage b { font: 800 13px/1 var(--f-display); }
.stage small { font: 700 11px/1.2 var(--f-body); color: var(--ink-2); }
.stages .arr { font: 800 20px/1 var(--f-display); color: var(--coral-deep); padding-bottom: 26px; }
.nyse { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 14px; border: 2px solid var(--ink); font: 800 14px/1.2 var(--f-body); background: #eef1ff; }
.nyse i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.nyse.open { background: #ffe0d6; } .nyse.open i { background: var(--down); animation: blink 0.9s infinite; }
.nyse small { font-weight: 700; color: var(--ink-2); margin-left: auto; text-align: right; }
.tickers { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.tickers span { padding: 4px 9px; border-radius: 8px; border: 2px solid var(--ink); background: #ffe3a8; font: 800 12px/1 var(--f-display); }
.seed { margin: 0 0 4px; padding: 10px 12px; border-radius: 14px; background: var(--tint-2); border: 2px solid var(--line-2); font: 700 13px/1.4 var(--f-body); color: var(--ink-2); }
.seed b { color: var(--ink); font-family: var(--f-display); overflow-wrap: anywhere; }

/* floating card (map mode) */
.dexcard { position: absolute; left: 0; top: 0; width: min(390px, calc(100vw - 32px)); max-height: calc(100dvh - 200px); overflow: auto; pointer-events: auto; overscroll-behavior: contain; scrollbar-width: thin; will-change: transform; }
.dexcard .dex { animation: cardin 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
.dexcard.out .dex { animation: cardout 0.2s ease-in both; }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) rotate(-3deg) scale(0.9); } }
@keyframes cardout { to { opacity: 0; transform: translateY(12px) scale(0.95); } }
.dex-x {
  position: absolute; top: 7px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center;
  cursor: pointer; font: 800 18px/1 var(--f-body); z-index: 2; box-shadow: 0 2px 0 var(--ink); padding: 0;
}
.dexcard .dex-top { padding-right: 52px; }
.dex-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line-2); font: 800 12px/1 var(--f-body); color: var(--muted); }
.dex-nav button { border: 2px solid var(--ink); background: var(--panel); border-radius: 999px; padding: 7px 12px; font: 800 13px/1 var(--f-body); cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.dex-nav button:disabled { opacity: 0.35; cursor: default; }
.sheet-grip { display: none; }

/* creature card */
.dex.mon .mon-head { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; margin-bottom: 10px; }
.dex.mon .mon-pic { width: 96px; height: 96px; border-radius: 18px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 60%, #fff 0 40%, var(--tint) 100%); display: grid; place-items: center; overflow: hidden; }
.dex.mon .mon-pic img { width: 92px; height: 92px; }
.dex.mon .dex-title { font-size: 28px; }
.dex.mon .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* ── static mode: the field guide ─────────────────────────────────────── */
.isles { padding: 28px var(--gutter) 64px; background: linear-gradient(#bfe6ff, #e3f4ff 420px, #e3f4ff); }
.isles-head {
  max-width: 760px; margin: 0 auto 48px; display: grid; justify-items: center; gap: 16px; text-align: center; padding: 32px 22px;
  background: var(--cream); position: relative;
}
.isles-mark { width: 88px; height: 88px; margin-top: -4px; }
.isles-title { margin: 0; } .isles-title img { width: min(340px, 78vw); height: auto; }
.isles-head .lead { margin: 0; font-weight: 700; }
.isles-head .lead b { color: var(--coral-deep); font-family: var(--f-display); }
.isles-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.isles-head .ca { max-width: 100%; }
.dex-stack { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 26px 22px; align-items: start; }
.dex-stack-title { grid-column: 1 / -1; text-align: center; margin: 0 0 4px; }
.isles .dex:nth-of-type(odd) { transform: rotate(-0.6deg); } .isles .dex:nth-of-type(even) { transform: rotate(0.5deg); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .hud-banner { top: calc(max(16px, env(safe-area-inset-top)) + 64px); width: min(560px, calc(100% - 32px)); }
  .hud-bl { max-width: min(360px, 34vw); }
}
@media (max-width: 900px) {
  .hud-bl { max-width: none; }
  .hud .ca-addr { display: none; }
  .hud-help { display: none; }
}
@media (max-width: 760px) {
  .hud-logo { padding: 4px; }
  .hud-logo .hud-word { display: none; }
  .hud-tr { gap: 6px; }
  .hud-tr .icon-btn { width: 40px; height: 40px; }
  .hud-buy { min-height: 40px; padding: 6px 12px; }
  .hud-banner { top: calc(max(16px, env(safe-area-inset-top)) + 58px); min-width: 0; }
  .hud-banner p { font-size: 14px; padding: 8px 12px; }
  .hud-stats li { font-size: 11px; padding: 4px 8px; }
  /* bottom stack: stepper / countdown + play / CA */
  .stepper { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 120px); }
  .step-mid { width: 150px; } .minimap { width: 150px; height: 32px; }
  .step-btn { width: 42px; height: 42px; }
  .hud-bl { left: var(--gutter); right: var(--gutter); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hud-bl [data-countdown] { order: 1; }
  .hud-bl [data-ca] { order: 2; }
  .hud .ca { width: 100%; }
  .hud .ca-addr { display: block; font-size: 12px; flex: 1 1 0; min-width: 0; }
  .hud .countdown .cell { min-width: 40px; padding: 5px 3px 4px; }
  .hud .countdown b { font-size: 16px; }
  .hud-play { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px); min-height: 52px; padding: 12px 18px; font-size: 18px; }
  .pin-icon { width: 42px; height: 42px; } .pin-icon svg { width: 24px; height: 24px; }
  .pin-label { font-size: 11px; padding: 4px 8px; }
  /* bottom sheet */
  .dexcard { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 72dvh; transform: none !important; }
  .dexcard .dex { border-radius: 24px 24px 0 0; border-bottom: 0; box-shadow: 0 -4px 0 rgba(28, 39, 66, 0.12); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .dexcard .dex { animation-name: sheetin; }
  .dexcard.out .dex { animation-name: sheetout; }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--ink); opacity: 0.25; margin: 8px auto 0; position: absolute; left: 50%; transform: translateX(-50%); top: 0; z-index: 3; }
  .isles .dex { transform: none !important; }
}
@keyframes sheetin { from { transform: translateY(100%); } }
@keyframes sheetout { to { transform: translateY(100%); } }
@media (max-width: 400px) {
  .hud-tr .icon-btn { width: 38px; height: 38px; }
  .hud-buy span { display: none; }
  .dex-stats dd { font-size: 15px; }
  .moods small { font-size: 10px; }
}

/* static-mode backdrop: key art behind the field-guide header (only fetched when this rule applies) */
html:not(.map) .isles { background: url(/assets/img/keyart-2-1280.webp) center top / 100% auto no-repeat, linear-gradient(#bfe6ff, #e3f4ff 420px, #e3f4ff); padding-top: min(30vw, 300px); }
@media (max-width: 760px) { html:not(.map) .isles { background-size: 180% auto, auto; padding-top: 44vw; } }

/* toasts sit under the top HUD in map mode so they never cover the stepper */
html.map .toast { bottom: auto; top: calc(max(16px, env(safe-area-inset-top)) + 64px); transform: translate(-50%, -12px); z-index: 60; }
html.map .toast.show { transform: translate(-50%, 0); }
