/* HYCEAN 18 — Arcade. Look nach Figma-Seite "📟 Arcade" (schwarz, #C3FF00, Pill-Buttons mit Kontur, Climate Crisis + Katakana) */
@font-face { font-family: "Climate Crisis"; src: url("../fonts/climate-crisis-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/OpenSans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --acc: #C3FF00;
  --fg: #ffffff;
  --muted: #8c8c8c;
  --line: #5e5e5e;
  --bg: #000000;
  --pf-w: 100vw;            /* Spielfeldbreite in px (setzt game.js) */
  --pf-core: 100vw;
  --kana: "Hiragino Kaku Gothic StdN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  --display: "Climate Crisis", "Open Sans", sans-serif;
  --ui: "Open Sans", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --head-h: 82px;           /* Figma: Head 82 px */
  --head-pad: 100px;               /* Head: links und rechts je 100 px Abstand (schmale Bildschirme siehe unten) */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; font-family: var(--ui);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
/* Videos müssen gerendert werden (nicht display:none), sonst decodiert iOS Safari sie nicht */
video.pv { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: .01; pointer-events: none; }

/* Spielfeld-Rahmen auf breiten Bildschirmen: dezente Kanten links/rechts */
#pf-frame { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--pf-core); transform: translateX(-50%); pointer-events: none;
  border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); }

/* ---------- Buttons (Figma "elemente") ---------- */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.pill { min-width: 132px; height: 46px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--line); background: #000;
  color: var(--muted); font: 700 13px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; transition: color .2s, border-color .2s, background .2s; }
.pill:hover, .pill:focus-visible { color: var(--fg); border-color: var(--fg); outline: none; }
.pill-primary { color: var(--fg); border-color: var(--fg); }
.pill-primary:hover, .pill-primary:focus-visible { background: var(--acc); border-color: var(--acc); color: #000; }
.ibtn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); background: rgba(0,0,0,.5); }
.ibtn svg { width: 22px; height: 22px; fill: currentColor; }
.ibtn:hover { color: var(--fg); border-color: var(--fg); }
.ibtn-lg { width: 46px; height: 46px; }
.btn-sound .s-off { display: none; }
.btn-sound.is-muted .s-on { display: none; }
.btn-sound.is-muted .s-off { display: block; }
.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btns-col { flex-direction: column; align-items: center; }

/* ---------- Screens ---------- */
.scr { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
  background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,.72), rgba(0,0,0,.35) 70%); }
.scr.on { opacity: 1; visibility: visible; }
.scr-bottom { justify-content: flex-end; padding-bottom: calc(9vh + var(--safe-b)); background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.85) 75%); }
#scr-loading { background: #000; }
.panel { width: min(520px, 100%); max-height: 100%; overflow: auto; padding: 28px 24px; border-radius: 24px; text-align: left;
  background: linear-gradient(180deg, #1d1d1d, #000); border: 1px solid #2a2a2a; }
.panel .btns { justify-content: flex-start; }

.logo { color: var(--acc); }
.logo svg { display: block; width: 100%; height: 100%; }
.logo-title { width: 30px; height: 54px; margin-bottom: 14px; }
.logo-pulse { width: 36px; height: 64px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: translateY(4px); } }

.kana-title { font: 900 clamp(34px, 8vw, 56px)/1 var(--kana); color: var(--acc); letter-spacing: .02em; }
.h-display { font: 400 clamp(18px, 4.2vw, 28px)/1.1 var(--display); letter-spacing: .04em; margin: 10px 0 0; text-transform: uppercase; }
.h-sm { font-size: clamp(16px, 3.6vw, 22px); }
.tagline { margin: 14px 0 0; font-size: 15px; color: var(--fg); }
.lead { margin: 8px 0 0; max-width: 34ch; font-size: 14px; line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 8px 0 0; max-width: 40ch; }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.accent { color: var(--acc); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.eyebrow { font: 700 12px/1.4 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 14px 0 0; }
.tier-big { font: 400 clamp(54px, 14vw, 96px)/1 var(--display); color: var(--acc); margin: 10px 0 4px; }
.tier-line { font-weight: 700; color: var(--fg); margin: 14px 0 0; max-width: 36ch; line-height: 1.45; }
#over[data-tier="1"] .tier-line { color: var(--acc); }
#over { display: flex; flex-direction: column; align-items: center; }
#over[data-tier="0"] #btn-claim1 { display: none; }
#scr-pause, #scr-sector, #scr-over, #scr-victory, #scr-claim, #scr-brief { background: rgba(0,0,0,.78); }
.rules { margin: 16px 0 0; padding-left: 18px; color: #d6d6d6; font-size: 14px; line-height: 1.55; }
.rules li { margin-bottom: 6px; }
.rules b { color: var(--acc); }
.controls { margin-top: 16px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; font: 700 11px/1.5 var(--ui); color: var(--fg); text-align: center; }

/* ---------- HUD (Figma „Screens Optimzations“: Head 82 px, Linie 2 px) ---------- */
#hud { position: fixed; z-index: 3; top: 0; left: 0; right: 0; padding-top: var(--safe-t); pointer-events: none; opacity: 0; transition: opacity .3s; }
#hud.on { opacity: 1; }
.hud-bar-row { position: relative; height: var(--head-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--head-pad); }
.hud-lives { display: flex; gap: 8px; align-items: center; min-width: 88px; }
.hud-lives i { display: block; width: 24px; height: 24px; border-radius: 50%; border: 6px solid var(--acc); }
.hud-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 24px; white-space: nowrap; }
.hud-score, .hud-pct { font: 700 17px/1.2 var(--ui); font-variant-numeric: tabular-nums; color: var(--muted); }
.hud-time { font: 400 40px/1 var(--display); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.hud-time.warn { color: var(--acc); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.hud-right { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.hud-name { font: 400 16px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.hud-stage { font: 400 17px/1.2 var(--ui); }
.hud-btns { display: none; }   /* Pause und Ton: kommen woanders hin (Pause weiter mit P / Esc) */
.hud-btns .ibtn { width: 34px; height: 34px; }
.hud-btns .ibtn svg { width: 16px; height: 16px; }
.hud-barwrap { height: 2px; background: rgba(255,255,255,.2); overflow: hidden; }
.hud-bar { height: 100%; background: var(--acc); transform-origin: left; transform: scaleX(0); transition: transform .15s linear; }
@media (max-width: 1100px) { .hud-stage { display: none; } .hud-center { gap: 16px; } .hud-time { font-size: 30px; } .hud-score, .hud-pct { font-size: 14px; } }
@media (max-width: 640px) { .hud-name { display: none; } .hud-center { gap: 10px; } .hud-time { font-size: 22px; } .hud-score, .hud-pct { font-size: 12px; } .hud-lives { gap: 5px; min-width: 0; } .hud-lives i { width: 16px; height: 16px; border-width: 4px; } }

/* ---------- Spezies-Info (links, ohne Box) ---------- */
.info { position: fixed; z-index: 4; left: 10.3vw; top: 50%; width: 312px; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; pointer-events: none; }
.info.on { opacity: 1; visibility: visible; }
.info-kana { font: 900 60px/1.2 var(--kana); letter-spacing: -.08em; color: var(--acc); white-space: nowrap; }
.info-name { padding-left: 20px; font: 400 16px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.info-typ { margin-top: 24px; padding-left: 20px; font: 800 14px/1.2 var(--ui); }
.info-origin { margin-top: 10px; padding-left: 20px; font: 400 12px/1.4 var(--ui); }
.info-origin b { font-weight: 700; }
@media (max-width: 900px) { .info { left: 50%; top: calc(var(--head-h) + 28px); transform: translateX(-50%); text-align: center; width: min(312px, calc(100vw - 32px)); } .info-name, .info-typ, .info-origin { padding-left: 0; } .info-kana { font-size: 40px; } }
/* ---------- Karte (Start Schwarm / Einzelkampf / Flug) ---------- */
.card { position: fixed; z-index: 4; left: 50%; top: 50%; width: max-content; min-width: 320px; max-width: min(620px, calc(100vw - 32px)); padding: 40px; border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, rgba(41,41,41,.8), rgba(0,0,0,.8));
  transform: translate(-50%, -50%) scale(.96); opacity: 0; visibility: hidden; transition: opacity .35s, transform .35s, visibility .35s; pointer-events: none; }
.card.low { top: calc(55.7% + 135px); }
.card.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.card.wait { pointer-events: auto; }
.card-round { font: 400 14px/1.2 var(--ui); }
.card-title { margin-top: 8px; font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 640px) { .card-title { white-space: normal; line-height: 1.15; } }
.card-text { margin: 24px auto 0; max-width: 391px; font: 400 14px/1.4 var(--ui); color: var(--acc); }
.card-text:empty { display: none; }
.card-btns { display: none; justify-content: center; margin-top: 40px; }
.card.wait .card-btns { display: flex; }
/* Buttons wie in Figma: 42 px hoch, weiße Kontur, Open Sans Bold 13 */
.fbtn { height: 42px; padding: 0 22px; border-radius: 999px; border: 2px solid #fff; background: #000; color: #fff; font: 700 13px/1 var(--ui); letter-spacing: .1em; cursor: pointer; pointer-events: auto; transition: background .15s, color .15s, border-color .15s; }
.fbtn:hover, .fbtn:focus-visible { background: var(--acc); border-color: var(--acc); color: #000; outline: none; }
.fbtn-dim { opacity: .5; }
.fbtn-dim:hover, .fbtn-dim:focus-visible { opacity: 1; }
.fbtns { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 40px; }
/* ---------- Prozentkarte (Ende Flug) ---------- */
.end-round { font: 400 14px/1.2 var(--ui); margin: 0 0 8px; }
.sector-head b { display: block; font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.sector-head span { display: block; font: 400 20px/1.4 var(--ui); color: rgba(255,255,255,.5); }
.sector-tier { font: 400 100px/1 var(--display); letter-spacing: .1em; color: var(--acc); margin: 8px 0 24px; }
.end-sub { font: 400 20px/1.4 var(--ui); color: var(--acc); margin: 0; }
.sector-extra { font: 400 14px/1.4 var(--ui); color: rgba(255,255,255,.5); margin: 6px 0 0; }
.sector-extra:empty { display: none; }

/* ---------- Toast / Abschluss-Titel (Ende Schwarm / Ende Eliminierung) ---------- */
.toast { position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100vw - 32px); text-align: center; pointer-events: none; opacity: 0; }
.toast i { display: block; font: 400 14px/1.2 var(--ui); font-style: normal; margin-bottom: 8px; }
.toast i:empty { display: none; }
.toast b { display: block; font: 400 clamp(22px, 5.4vw, 40px)/1.1 var(--display); text-transform: uppercase; letter-spacing: .1em; }   /* alle Einblendungen wie die Abschluss-Zeilen (Figma: 40 / 20) */
.toast span { display: block; margin-top: 24px; font: 400 20px/1.4 var(--ui); color: var(--acc); }
.toast.on { animation: toast 1.5s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -40%); } 11% { opacity: 1; transform: translate(-50%, -50%); } 82% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -54%); } }

.nojs { position: fixed; inset: 0; display: grid; place-items: center; }
body[data-screen="title"] #pf-frame, body[data-screen="loading"] #pf-frame { opacity: 0; }

/* ---------- BOMB ---------- */
.hud-bomb { position: fixed; z-index: 3; left: calc(50% - min(var(--pf-w), 100vw) / 2 + 16px); bottom: calc(16px + var(--safe-b)); display: none; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: rgba(0,0,0,.5); color: var(--muted); font: 700 14px/1 var(--ui); }
#hud.on ~ .hud-bomb { display: flex; }
.hud-bomb .pips { display: flex; gap: 4px; }
.hud-bomb .pips i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--line); }
.hud-bomb .pips i.on { background: var(--acc); border-color: var(--acc); }
.hud-bomb .bombs b { color: var(--acc); margin-left: 2px; }
.hud-bomb.ready { border-color: var(--acc); color: var(--fg); animation: bombpulse 1s ease-in-out infinite; }
@keyframes bombpulse { 50% { box-shadow: 0 0 18px rgba(195,255,0,.45); } }
.flash { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle at 50% 30%, rgba(195,255,0,.55), rgba(195,255,0,0) 60%); opacity: 0; }
.flash.on { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Test-Leiste (?debug) */
.dbg { position: fixed; z-index: 6; right: 8px; bottom: 8px; display: none; flex-wrap: wrap; gap: 4px; max-width: 360px; justify-content: flex-end; }
.dbg.on { display: flex; }
.dbg button { font: 700 10px/1 var(--ui); letter-spacing: .06em; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.7); color: var(--muted); }
.dbg button:hover { color: var(--fg); border-color: var(--fg); }
.dbg button.dbg-x { color: var(--acc); border-color: rgba(195,255,0,.4); }
.dbg button.on { background: var(--acc); color: #000; }

.hud-power { position: fixed; z-index: 3; left: 50%; top: calc(var(--head-h) + 18px + var(--safe-t)); transform: translateX(-50%); font: 700 12px/1 var(--ui); letter-spacing: .16em; color: var(--acc);
  text-transform: uppercase; opacity: 0; transition: opacity .3s; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud-power.on { opacity: 1; }

/* Sieg: riesige Prozentzahl auf geblurrtem, gedimmtem Hintergrund (dahinter explodieren die Partikel) */
#scr-victory.celebrate { background: rgba(0,0,0,.55); }
.tier-huge { font-size: clamp(110px, min(30vw, 30vh), 260px); line-height: .9; margin: 6px 0 2px; white-space: nowrap; text-shadow: 0 0 40px rgba(195,255,0,.55), 0 0 120px rgba(195,255,0,.35); }
#scr-victory.celebrate .tier-huge { animation: tierPop 1.1s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes tierPop { 0% { transform: scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.tier-huge .pct { font-size: .45em; margin-left: .06em; }
#scr-victory.celebrate .kana-title { display: none; }
.vic-secured { font: 400 20px/1.4 var(--ui); color: var(--acc); margin: 0 0 18px; }
@media (max-width: 900px) { .card.low { top: 64%; } .card { padding: 28px 24px; } }

/* ---------- Startscreen (Figma „Start Screen“): Partikel dahinter unscharf und abgedunkelt wie bei Pause, Karte ohne Hintergrund ---------- */
#scr-title.scr-start { background: rgba(0,0,0,.78); }
.start-card { width: 400px; max-width: calc(100vw - 32px); padding: 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.logo-start { width: 120px; height: 212px; margin-bottom: 40px; color: var(--acc); }
.logo-start svg { width: 100%; height: 100%; }
.start-kana { font: 900 clamp(40px, 12vw, 60px)/1.2 var(--kana); letter-spacing: -.03em; color: var(--acc); white-space: nowrap; }
.start-name { font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.start-tag { margin: 38px 0 0; font: 400 14px/1.4 var(--ui); color: #fff; }
.start-lead { margin: 10px 0 0; max-width: 300px; font: 400 14px/1.4 var(--ui); color: rgba(255,255,255,.6); }
.start-btns { display: flex; gap: 10px; margin-top: 40px; }
.start-best { margin: 24px 0 0; font: 400 14px/1.4 var(--ui); letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.5); }   /* wie „Punkte …“ im End-Screen */
.start-best:empty { display: none; }
@media (max-height: 760px) { .logo-start { width: 80px; height: 141px; margin-bottom: 24px; } .start-kana { font-size: 44px; } .start-tag { margin-top: 24px; } .start-btns { margin-top: 28px; } }

/* ---------- Einblenden: Karte steigt aus leichter Unschärfe weich nach oben, Inhalt folgt gestaffelt ---------- */
:root { --in-ms: 1s; --in-y: 36px; --in-ease: cubic-bezier(.16, 1, .3, 1); }
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, calc(-50% + var(--in-y))) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes scrIn  { from { opacity: 0; transform: translateY(var(--in-y)) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes infoIn { from { opacity: 0; transform: translateY(calc(-50% + var(--in-y))); } to { opacity: 1; transform: translateY(-50%); } }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card.on { animation: cardIn var(--in-ms) var(--in-ease) both; }
.info.on { animation: infoIn var(--in-ms) var(--in-ease) both; }
.scr.on { transition: opacity .6s ease-out, visibility 0s; }
.scr.on > * { animation: scrIn var(--in-ms) var(--in-ease) .08s both; }
/* Inhalt der Karten erscheint nacheinander */
.card.on > *, .info.on > * { animation: itemIn .8s var(--in-ease) both; }
.scr.on .start-card > * { animation: itemIn .8s var(--in-ease) both; }
.card.on > :nth-child(1), .scr.on .start-card > :nth-child(1), .info.on > :nth-child(1) { animation-delay: .12s; }
.card.on > :nth-child(2), .scr.on .start-card > :nth-child(2), .info.on > :nth-child(2) { animation-delay: .2s; }
.card.on > :nth-child(3), .scr.on .start-card > :nth-child(3), .info.on > :nth-child(3) { animation-delay: .28s; }
.card.on > :nth-child(4), .scr.on .start-card > :nth-child(4), .info.on > :nth-child(4) { animation-delay: .36s; }
.scr.on .start-card > :nth-child(5) { animation-delay: .44s; }
.scr.on .start-card > :nth-child(6) { animation-delay: .52s; }
.scr.on .start-card > :nth-child(7) { animation-delay: .6s; }
.scr:not(.on) .start-card > * { animation: none; }
/* Overlays ohne eigene Karte (Rabatt, Pause, Game Over …): Zeilen erscheinen ebenfalls nacheinander */
.scr.on > :nth-child(2) { animation-delay: 0.16s; }
.scr.on > :nth-child(3) { animation-delay: 0.24s; }
.scr.on > :nth-child(4) { animation-delay: 0.32s; }
.scr.on > :nth-child(5) { animation-delay: 0.40s; }
.scr.on > :nth-child(6) { animation-delay: 0.48s; }
.scr.on > :nth-child(7) { animation-delay: 0.56s; }
.scr.on > :nth-child(8) { animation-delay: 0.64s; }
@media (prefers-reduced-motion: reduce) { .card.on, .info.on, .scr.on > *, .card.on > *, .scr.on .start-card > *, .info.on > * { animation: none; } }

/* ---------- Ausblenden (Klasse .out, per JS): Spiegelbild des Einblendens – Inhalt verschwindet gestaffelt (unten zuerst),
   dann sinkt die Karte weich nach unten, wird unscharf und blendet aus. Erst danach fällt .on weg → kein Springen ---------- */
:root { --out-ms: .95s; --out-y: 56px; --out-ease: cubic-bezier(.5, 0, .3, 1); }
@keyframes cardOut { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, calc(-50% + var(--out-y))) scale(.97); } }
@keyframes scrOut  { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(var(--out-y)) scale(.97); } }
@keyframes infoOut { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(calc(-50% + var(--out-y))); } }
@keyframes itemOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px); } }
@keyframes bgOut   { from { opacity: 1; } to { opacity: 0; } }
.card.on.out { animation: cardOut var(--out-ms) var(--out-ease) .12s both; pointer-events: none; }
.info.on.out { animation: infoOut var(--out-ms) var(--out-ease) .12s both; }
.scr.on.out { animation: bgOut var(--out-ms) var(--out-ease) .2s both; pointer-events: none; }
.scr.on.out > * { animation: scrOut var(--out-ms) var(--out-ease) .12s both; }
.card.on.out > *, .info.on.out > *, .scr.on.out .start-card > * { animation: itemOut .55s var(--out-ease) both; }
.card.on.out > :nth-last-child(1), .info.on.out > :nth-last-child(1), .scr.on.out .start-card > :nth-last-child(1) { animation-delay: 0s; }
.card.on.out > :nth-last-child(2), .info.on.out > :nth-last-child(2), .scr.on.out .start-card > :nth-last-child(2) { animation-delay: .05s; }
.card.on.out > :nth-last-child(3), .info.on.out > :nth-last-child(3), .scr.on.out .start-card > :nth-last-child(3) { animation-delay: .1s; }
.card.on.out > :nth-last-child(4), .info.on.out > :nth-last-child(4), .scr.on.out .start-card > :nth-last-child(4) { animation-delay: .15s; }
.scr.on.out .start-card > :nth-last-child(5) { animation-delay: .2s; }
.scr.on.out .start-card > :nth-last-child(6) { animation-delay: .25s; }
.scr.on.out .start-card > :nth-last-child(7) { animation-delay: .3s; }
#hud { transition: opacity .9s var(--in-ease); }
@media (prefers-reduced-motion: reduce) { .card.on.out, .info.on.out, .scr.on.out, .scr.on.out > *, .card.on.out > *, .info.on.out > *, .scr.on.out .start-card > * { animation: bgOut .3s both; } }

/* ---------- Mobil Hochformat (Figma HYCEAN18 › 📟 Arcade › „Start Schwarm Mobile“): Name-Block und Karte unter der Form, nacheinander ----------
   --form-bottom = Unterkante der Form in px (js/game.js layout(), CFG.FORM_BOTTOM). Querformat ≤ 900 px behält die Regeln oben. */
@media (max-width: 900px) and (orientation: portrait) {
  .info { left: 50%; top: calc(var(--form-bottom, 50vh) + 16px); transform: translateX(-50%); text-align: left; width: 312px; max-width: calc(100vw - 32px); }
  .info-name, .info-typ, .info-origin { padding-left: 20px; }
  .info-kana { font-size: min(52px, calc((100vw - 40px) / 6)); }   /* längster Kana-Name hat 6 Zeichen (グラヴィクラ) → passt immer in die Spalte */
  /* Karte unten, 16 px Abstand, volle Breite und deckend → BOMB-, Ton- und Pause-Knöpfe darunter sind komplett verdeckt */
  .card.low { top: auto; bottom: calc(16px + var(--safe-b)); width: calc(100vw - 32px); min-width: 0; max-width: none; padding: 40px; transform: translate(-50%, 0) scale(.96);
    background: linear-gradient(180deg, #292929, #000); }
  .card.low.on { transform: translate(-50%, 0) scale(1); animation-name: cardInLow; }
  .info.on { animation-name: infoInM; }
  .card.low.on.out { animation-name: cardOutLow; }
  .info.on.out { animation-name: infoOutM; }
}
@media (max-width: 900px) and (orientation: portrait) and (max-width: 400px) { .card.low { padding: 32px 24px; } }
@keyframes cardInLow { from { opacity: 0; transform: translate(-50%, var(--in-y)) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes infoInM { from { opacity: 0; transform: translate(-50%, var(--in-y)); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes cardOutLow { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, var(--out-y)) scale(.97); } }
@keyframes infoOutM { from { opacity: 1; transform: translateX(-50%); } to { opacity: 0; transform: translate(-50%, var(--out-y)); } }

/* ---------- Head: Zähler, Timer und Fortschritt an fester Position (Timer-Ziffern in gleich breiten Zellen) ---------- */
.hud-center { display: grid; grid-template-columns: 130px auto 130px; gap: 24px; align-items: center; }
.hud-score { justify-self: end; text-align: right; }
.hud-pct { justify-self: start; text-align: left; }
.hud-time { letter-spacing: 0; display: flex; justify-content: center; }
.hud-time i { display: inline-block; width: 1.14em; text-align: center; font-style: normal; }
.hud-time i.c { width: .5em; }

/* Spielcard: Button bleibt nach dem Klick sichtbar, bis die Karte ausgeblendet ist (sonst schrumpft die Karte und der Inhalt springt) */
.card.keepbtn .card-btns { display: flex; }
.card.keepbtn .card-btns .fbtn { pointer-events: none; }

/* ---------- Loader: das Shuttle (Partikelring) in Grün, exakt mittig; Text darunter beeinflusst die Position nicht ---------- */
.loader { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.loader-ship { position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; fill: var(--acc); animation: loaderSpin 6s linear infinite, loaderBreath 1.6s ease-in-out infinite; }
.loader #loading-text { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); white-space: nowrap; margin: 0; }
@keyframes loaderSpin { to { rotate: 360deg; } }
@keyframes loaderBreath { 50% { opacity: .45; scale: .92; } }
#scr-loading.on > * { animation: none; }

/* Head rechts: Stufen-Text in fester Breite (linksbündig), Name rechtsbündig davor → nichts springt beim Wechsel Schwarm / Einzelkampf / Durchflug */
.hud-stage { text-align: left; font-variant-numeric: tabular-nums; }
.hud-name { text-align: right; }
@media (max-width: 760px) { .hud-stage { width: auto; } }

/* Head-Abstand auf schmalen Bildschirmen */
@media (max-width: 1400px) { :root { --head-pad: 40px; } }
@media (max-width: 1023px) { :root { --head-pad: clamp(16px, 4vw, 40px); } }

/* ---------- Abschluss-Screens (Figma „Loose Screen“ / „End Screen“) ---------- */
#scr-over.scr-end { background: rgba(0,0,0,.8); backdrop-filter: none; -webkit-backdrop-filter: none; }   /* Partikel schimmern gedimmt durch */
#scr-victory.scr-end, #scr-victory.scr-end.celebrate { background: rgba(0,0,0,.92); }
.end-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px; max-width: calc(100vw - 32px); }
.end-card .end-round { font: 400 14px/1.2 var(--ui); margin: 0; }
.end-title { font: 400 clamp(28px, 7vw, 40px)/1 var(--display); letter-spacing: .1em; text-transform: uppercase; margin: 8px 0 0; }
.end-yes { font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.end-line { font: 400 20px/1.4 var(--ui); margin: 0; }
.end-line:empty { display: none; }
.end-grey { color: #8a8f80; margin-top: 24px; }
.end-acc { color: var(--acc); }
.end-dim { color: rgba(255,255,255,.5); }
.end-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 40px; }
.end-lines-tight { margin-top: 24px; }
.end-huge { margin-top: 8px; font: 400 clamp(110px, min(26vw, 26vh), 220px)/1 var(--display); letter-spacing: .1em; color: var(--acc); white-space: nowrap;
  text-shadow: 0 0 40px rgba(195,255,0,.7); }
.end-huge .pct { font-size: .545em; letter-spacing: .1em; }
#scr-victory.celebrate .end-huge { animation: tierPop 1.1s cubic-bezier(.2,1.4,.4,1) both; }
.fbtns.fbtns-row { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 40px; }
#over[data-tier="0"] #btn-claim1 { display: none; }
/* Abschluss-Screens: Zeilen erscheinen / verschwinden gestaffelt wie bei den Karten */
.scr.on .end-card > * { animation: itemIn .8s var(--in-ease) both; }
.scr.on .end-card > :nth-child(1) { animation-delay: .12s; } .scr.on .end-card > :nth-child(2) { animation-delay: .2s; }
.scr.on .end-card > :nth-child(3) { animation-delay: .28s; } .scr.on .end-card > :nth-child(4) { animation-delay: .36s; }
.scr.on .end-card > :nth-child(5) { animation-delay: .44s; } .scr.on .end-card > :nth-child(6) { animation-delay: .52s; }
.scr.on.out .end-card > * { animation: itemOut .55s var(--out-ease) both; }

.end-title { white-space: nowrap; }
@media (max-width: 640px) { .end-title { white-space: normal; line-height: 1.15; } }

/* Spielkarte: mehrere Fähigkeiten untereinander */
.card-text { white-space: pre-line; }

/* ---------- Responsive 1400 → 1024 px: Typo skaliert linear (bei 1400 max, bei 1024 min). Startscreen bleibt unverändert ---------- */
.card-title { font-size: clamp(16px, calc(1.064vw + 5.1px), 20px); }                 /* Runden-Start-Karten: 20 → 16 */
#scr-over .end-title { font-size: clamp(30px, calc(2.66vw + 2.77px), 40px); }       /* Verloren / Zeit abgelaufen: 40 → 30 */
#scr-over .end-line { font-size: clamp(12px, calc(2.128vw - 9.79px), 20px); }      /* Copys 20 → 12 */
#scr-over .end-round { font-size: clamp(12px, calc(0.532vw + 6.55px), 14px); }     /* Runde x / 5: 14 → 12 */

/* ---------- BOMB (Figma „Bomb“): Ringe 42 px, 4 px Abstand; voller Ring = bereit, Klick/Tippen zündet ---------- */
.hud-bomb { height: auto; padding: 0; border: 0; border-radius: 0; background: none; gap: 8px; cursor: pointer; }
.hud-bomb .bomb-ring { display: block; width: 42px; height: 42px; }
.hud-bomb .bomb-ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hud-bomb.ready { animation: none; }
.hud-bomb .bomb-ring.full { border-radius: 50%; animation: bombpulse 1.2s ease-in-out infinite; }
/* BOMB: gleicher Abstand links wie der Inhalt im Head, unten genauso viel */
.hud-bomb { left: calc(var(--head-pad) + var(--safe-l, 0px)); bottom: calc(var(--head-pad) + var(--safe-b)); }
.hud-bomb .br-base { fill: #000; stroke: rgba(255,255,255,.4); stroke-width: 1; }
.hud-bomb .br-arc { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: butt; stroke-dasharray: 0 200; opacity: 1; transition: stroke-dasharray .7s cubic-bezier(.4, 0, .2, 1), opacity 0s; }
.hud-bomb .bomb-ring:not(.lit) .br-arc { opacity: 0; transition: stroke-dasharray .7s cubic-bezier(.4, 0, .2, 1), opacity 0s linear .7s; }   /* bei 0: kein Pixel Grün */
.hud-bomb .br-icon { fill: #fff; opacity: .4; transition: fill .4s, opacity .7s; }
.hud-bomb .lit .br-icon { fill: var(--acc); }
.hud-bomb .bomb-ring.enter { animation: bombIn .45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes bombIn { from { opacity: 0; transform: scale(.6); } }

/* ---------- Unten links: Pause + Ton, dann die BOMB-Ringe (8 px zueinander, 24 px zu den Bombs) ---------- */
.hud-dock { position: fixed; z-index: 3; left: calc(var(--head-pad) + var(--safe-l, 0px)); bottom: calc(var(--head-pad) + var(--safe-b)); display: none; align-items: center; gap: 8px; }
#hud.on ~ .hud-dock { display: flex; }
.hud-dock .hud-bomb { position: static; display: flex; margin-left: 0; }
/* Mobil Hochformat: solange Name und Karte stehen (Intro), sinken die Knöpfe unten links weg und kommen mit dem Spielstart wieder hoch */
@media (max-width: 900px) and (orientation: portrait) {
  .hud-dock { transition: opacity .5s var(--in-ease), transform .5s var(--in-ease); }
  body.h18-intro .hud-dock { opacity: 0; transform: translateY(32px); pointer-events: none; transition-timing-function: var(--out-ease); }
}
.dock-btn { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); background: #000; color: rgba(255,255,255,.6); cursor: pointer; pointer-events: auto; }
.dock-btn svg { width: 18px; height: 18px; }
.dock-btn:hover, .dock-btn:focus-visible { color: #fff; border-color: #fff; outline: none; }

/* ---------------------------------------------------------------- Rabatt-Code (scr-claim) */
#scr-claim.scr-end { background: rgba(0,0,0,.92); }
.claim-card { max-width: min(640px, calc(100vw - 32px)); }
.claim-code { margin-top: 16px; font: 400 clamp(20px, 4.2vw, 36px)/1.1 var(--display); letter-spacing: .08em; color: #fff; white-space: nowrap;
  user-select: none; -webkit-user-select: none; cursor: pointer; min-height: 1.1em; }
.claim-code.is-wait { color: rgba(255,255,255,.5); text-shadow: none; font-size: clamp(14px, 2vw, 18px); letter-spacing: .1em; }
.claim-code.is-err { color: #ff6b6b; text-shadow: none; font: 400 16px/1.4 var(--ui); letter-spacing: 0; white-space: normal; }
.claim-copy { margin-top: 24px; }
.claim-copy.is-done { background: var(--acc); border-color: var(--acc); color: #000; }
.claim-hint { font: 400 14px/1.5 var(--ui); color: #8a8f80; max-width: 44ch; margin: 24px 0 0; }
#btn-motifs { display: inline-flex; align-items: center; text-decoration: none; }
#scr-claim[data-ok="0"] #btn-copy, #scr-claim[data-ok="0"] .end-lines, #scr-claim[data-ok="0"] #claim-hint, #scr-claim[data-ok="0"] #btn-motifs { display: none; }   /* kein Code: nur Meldung + ZURÜCK */
#scr-claim[data-ok="0"] .fbtns-row { margin-top: 32px; }
.scr.on .end-card > :nth-child(7) { animation-delay: .6s; }
@media (max-width: 640px) { .claim-code { white-space: normal; word-break: break-all; } }
.claim-card .end-lines { margin-top: 48px; }                       /* Abstand KOPIEREN → „40 % auf …“ verdoppelt */
.claim-card #claim-terms { font: 400 14px/1.5 var(--ui); }          /* „Gültig bis …“ wie der Hinweistext */
.claim-code::selection { background: transparent; }
.claim-copy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.claim-copy .copy-check { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* Briefing (WTF?) – Figma HYCEAN18 › 📟 Arcade › „WTF? screen“: ohne Karte direkt auf dem abgedunkelten Hintergrund.
   ≥ 901 px zwei Spalten (Regeln | Steuerung + Symbole), darunter eine Spalte; Inhalt scrollt, wenn er nicht passt */
#scr-brief { background: rgba(0,0,0,.8); backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; text-align: left;
  padding: calc(clamp(56px, 7vh, 104px) + var(--safe-t)) clamp(32px, 4vw, 64px) calc(56px + var(--safe-b)); }
.brief { width: min(1115px, 100%); margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 58px; }
.brief-title { margin: 0; font: 400 40px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); text-align: center; }
.brief-cols { display: flex; gap: 108px; width: 100%; align-items: flex-start; }
.brief-rules { flex: 522 1 0; min-width: 0; font: 500 16px/1.2 var(--ui); color: rgba(255,255,255,.8); }
.brief-rules p { margin: 0 0 12px; }
.brief-rules p:last-child { margin-bottom: 0; }
.brief-rules b { font-weight: 700; color: var(--acc); }
.brief-rules .brief-meta { margin: 0 0 40px; font: 700 12px/1.6 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.brief-rules h3 { margin: 40px 0 16px; font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.brief-rules .brief-meta + h3 { margin-top: 0; }
.brief-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.brief-rules li { margin: 0; }
.brief-side { flex: 485 1 0; min-width: 0; display: flex; flex-direction: column; gap: 64px; }
.brief-block h3 { margin: 0 0 32px; font: 400 20px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.brief-list { display: flex; flex-direction: column; gap: 12px; }
.brief-row { display: flex; align-items: center; gap: 16px; font: 500 16px/1.2 var(--ui); color: #fff; }
.brief-row kbd { flex: none; display: inline-flex; align-items: center; height: 32px; min-width: 0; padding: 0 10px; border: 1px solid #fff; border-radius: 8px; font: 700 14px/1.4 var(--ui); color: #fff; }
.brief-row .kbd-arrows { letter-spacing: .05em; }
.brief-row svg { flex: none; width: 32px; height: 32px; }
@media (max-width: 900px) {
  .brief-cols { flex-direction: column; gap: 108px; }
  .brief-rules { flex: none; width: 100%; }
  .brief-side { flex: none; width: min(485px, 100%); }
}

/* ---------------------------------------------------------------- Teilen (scr-share, Desktop): Karte nach Figma „Share-Card“ */
#scr-share.scr-end { background: rgba(0,0,0,.92); }
.share-card { padding: 24px; }
.share-img { display: block; height: min(62vh, 640px); width: auto; max-width: calc(100vw - 64px); aspect-ratio: 1080 / 1350; object-fit: contain; }
.share-card .fbtns-row { margin-top: 32px; }
#scr-share[data-img="0"] #btn-share-dl { display: none; }
/* Startscreen: Herausforderung aus einem geteilten Link (?vs=…) */
.start-vs { margin: 12px 0 0; font: 400 14px/1.4 var(--ui); color: var(--acc); }
.start-vs:empty { display: none; }
.scr.on .start-card > :nth-child(8) { animation-delay: .68s; }
.share-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fbtn.share-link.is-done { opacity: 1; background: var(--acc); border-color: var(--acc); color: #000; }
.share-link .copy-check { width: 16px; height: 16px; fill: currentColor; flex: none; }
.share-card .share-back { margin-top: 16px; }   /* ZURÜCK mittig unter BILD SPEICHERN / LINK KOPIEREN */
/* Share-Screen: leere Karte (Rahmen, Logo, URL) steht sofort, das fertige Bild blendet darüber ein */
.share-frame { position: relative; width: min(calc(62vh * 0.8), 512px, calc(100vw - 64px)); aspect-ratio: 1080 / 1350; background: #000; }
.share-frame img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
.share-frame .share-img { opacity: 0; transition: opacity .7s var(--in-ease, ease-out); }
.share-frame .share-img.is-on { opacity: 1; }
/* Share-Screen ohne Weichzeichner (wie Game Over) – sonst ruckelt das Einblenden über dem laufenden Spiel */
#scr-share.scr-end { background: rgba(0,0,0,.94); backdrop-filter: none; -webkit-backdrop-filter: none; }
.share-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.share-frame .share-img { opacity: 0; transition: opacity 1.8s cubic-bezier(.4, 0, .2, 1); will-change: opacity; }
.share-frame .share-img.is-on { opacity: 1; }

/* ---------------------------------------------------------------- Mobil-Hinweis (#mobile-hint, Figma HYCEAN18 › 📟 Arcade › „Start HYCEAN Schwarm Mobile – modal“, Frame „modal“ 270:449)
   Liegt über dem Startscreen (z-index 6 > .scr 5), nicht in screens[] → show() blendet ihn nicht aus. Ein-/Ausblenden über fadeIn/fadeOut (js/game.js).
   Figma: Abdunklung Schwarz 70 %, Karte #C3FF00 r24, Padding 32/20, Gap 24 · Avatar 88 rund · Text Open Sans 20/20 Schwarz · Button „primary S“ (Schwarz, 48 hoch, Padding 32, 14 Bold), 12 px zusätzlicher Abstand oben. */
#mobile-hint { z-index: 6; background: rgba(0,0,0,.7); backdrop-filter: none; -webkit-backdrop-filter: none; }
.mhint-card { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 367px; max-width: calc(100vw - 32px); padding: 32px 20px; border-radius: 24px;
  background: var(--acc); border: 2px solid var(--acc); text-align: center; color: #000; }
.mhint-avatar { display: block; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.mhint-text { margin: 0; font: 400 20px/20px var(--ui); color: #000; }
.mhint-btns { display: flex; justify-content: center; padding-top: 12px; }
.mhint-btn { height: 48px; padding: 0 32px; border-radius: 999px; border: 3px solid #000; background: #000; color: #fff; font: 700 14px/1 var(--ui); cursor: pointer; pointer-events: auto;
  transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.mhint-btn:hover, .mhint-btn:focus-visible { background: #fff; color: #000; outline: none; }   /* kein Hover-Zustand in Figma → invertiert */
#mobile-hint.on .mhint-card { animation: mhintIn var(--in-ms) var(--in-ease) backwards; }   /* backwards statt both: sonst überschreibt die Animation das Wegwischen (inline transform) */
#mobile-hint { touch-action: none; }
/* Close oben rechts: wie .info-modal__close (css/generai-style.css der Website), Grün statt Gelb */
.mhint-close { position: absolute; top: calc(clamp(10px, 3vw, 30px) + var(--safe-t)); right: 24px; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; pointer-events: auto; display: flex; align-items: center; justify-content: center; transition: background-color .3s ease; -webkit-tap-highlight-color: transparent; }
.mhint-close svg { display: block; width: 100%; height: 100%; transition: transform .3s ease; pointer-events: none; }
@media (hover: hover) { .mhint-close:hover { background-color: rgba(195,255,0,.2); } .mhint-close:hover svg { transform: scale(1.085); } }
.mhint-close:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (max-width: 600px) { .mhint-close { width: 52px; height: 52px; top: calc(8px + var(--safe-t)); right: 12px; } }
@keyframes mhintIn { from { opacity: 0; transform: translateY(var(--in-y)) scale(.97); } to { opacity: 1; transform: none; } }



/* ---------------------------------------------------------------- Dock rechts + Begegnungen (2026-11-02, Figma HYCEAN18 › 📟 Arcade › „screen cards“)
   Links nur BOMB (#hud-dock). Rechts (#hud-dock-r): Pause · Sound · WTF? · Begegnungen. Mobil nur das Zahnrad (= Pause-Menü).
   Media-Query mobil = ENC_CAROUSEL / mobile in js/game.js. */
.hud-dock-r { left: auto; right: calc(var(--head-pad) + var(--safe-r, 0px)); }
.dock-btn { position: relative; }
.dock-wide span { font: 400 15px/1 var(--display); }
.enc-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acc); color: #000;
  font: 700 11px/20px var(--ui); text-align: center; display: none; pointer-events: none; }
.enc-btn svg { width: 22px; height: 22px; }
.enc-btn:not([data-n="0"]) { color: var(--acc); border-color: var(--acc); }
.enc-btn:not([data-n="0"]) .enc-badge { display: block; }
.enc-btn[data-n="5"] { background: var(--acc); color: #000; }
.enc-btn[data-n="5"] .enc-badge { box-shadow: 0 0 0 2px #000; }
.menu-btn { display: none; color: var(--acc); border-color: var(--acc); }
.menu-btn.has-new .enc-badge { display: block; }
.is-ping { animation: encPing .8s cubic-bezier(.2, .7, .2, 1) 2; }
@keyframes encPing { 35% { transform: scale(1.22); box-shadow: 0 0 0 10px rgba(195,255,0,.22); } }
@media (max-width: 810px), (hover: none) and (pointer: coarse) {
  .hud-dock-r > :not(.menu-btn) { display: none; }
  .hud-dock-r .menu-btn { display: grid; }
}

/* Pause-Menü (Desktop + mobil = Zahnrad-Menü) */
.pause-menu { gap: 16px; margin-top: 40px; }
.pause-menu .pill { width: 240px; }
.pill-fill { background: var(--acc); border-color: var(--acc); color: #000; }
.pill-fill:hover, .pill-fill:focus-visible { background: #fff; border-color: #fff; color: #000; }
.pill-acc { color: var(--acc); border-color: var(--acc); }
.pill-acc:hover, .pill-acc:focus-visible { background: var(--acc); color: #000; border-color: var(--acc); }
.btn-sound .snd-off, .btn-sound.is-muted .snd-on { display: none; }
.btn-sound.is-muted .snd-off { display: inline; }

/* Begegnungen-Overlay (#scr-enc) */
#scr-enc { background: rgba(0,0,0,.9); backdrop-filter: none; -webkit-backdrop-filter: none; }   /* ohne Weichzeichner: über dem laufenden Spiel ruckelt sonst das Einblenden */
/* Cards einzeln mit Versatz (--i aus renderEnc), nur opacity + transform – kein filter:blur auf der großen Fläche */
#scr-enc.on > .enc-wrap, #scr-enc.on.out > .enc-wrap { animation: none; }
.enc-card { will-change: transform, opacity; }
#scr-enc.on .enc-card { animation: encIn .7s var(--in-ease, cubic-bezier(.2,.7,.2,1)) both; animation-delay: calc(.12s + var(--i, 0) * .09s); }
#scr-enc.on.out .enc-card { animation: encOut .4s var(--out-ease, ease-in) both; animation-delay: calc(var(--i, 0) * .04s); }
@keyframes encIn { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes encOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { #scr-enc.on .enc-card, #scr-enc.on.out .enc-card { animation: none; } }
.enc-title { font: 400 clamp(24px, 2.2vw, 32px)/1.1 var(--display); margin: 0 0 clamp(24px, 5vh, 56px); }
.enc-wrap { width: 100%; display: flex; justify-content: center; }
.enc-track { display: flex; gap: 14px; transform-origin: top center; flex: none; }
.enc-card { flex: none; width: 260px; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 20px 20px 24px; border-radius: 24px;
  background: var(--acc); border: 2px solid var(--acc); }
.enc-card.is-lost { background: #FF1500; border-color: #FF1500; }
.enc-img { position: relative; width: 220px; height: 378px; border-radius: 17px; overflow: hidden; background: #000; }
.enc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.enc-img.is-q::before { content: ""; position: absolute; inset: 11px; border: 1.4px solid var(--acc); border-radius: 6px; }
.enc-q { position: absolute; inset: 0; display: grid; place-items: center; font: 400 180px/1 var(--display); color: #fff; padding-bottom: 20px; }
.enc-status { position: absolute; left: 26px; bottom: 22px; display: flex; align-items: center; gap: 4px; font: 400 12px/16px var(--ui); color: #fff; }
.enc-ico { width: 16px; height: 16px; border-radius: 50%; background: var(--acc); display: grid; place-items: center; flex: none; }
.is-lost .enc-ico, .over-card .enc-ico { background: #FF1500; }
.enc-ico svg { width: 12px; height: 12px; fill: #000; }
.enc-cta { height: 42px; padding: 0 22px; border-radius: 999px; background: #000; border: 2px solid #000; color: #fff; font: 700 13px/1 var(--ui); letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; pointer-events: auto; transition: background .15s, color .15s; }
.enc-cta:not(.is-off):hover, .enc-cta:not(.is-off):focus-visible { background: #fff; border-color: #fff; color: #000; outline: none; }
.enc-cta.is-off { background: none; border-color: transparent; color: #000; cursor: default; }   /* „Offen“ ist ein Status, kein Button */
.enc-close { pointer-events: auto; }
@media (max-width: 810px) {
  #scr-enc { justify-content: flex-start; padding: calc(64px + var(--safe-t)) 0 calc(24px + var(--safe-b)); }
  .enc-wrap { display: block; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; }
  .enc-wrap::-webkit-scrollbar { display: none; }
  .enc-track { transform: none !important; padding: 0 calc(50vw - 130px); width: max-content; }
  .enc-card { scroll-snap-align: center; }
}
@media (max-width: 810px) and (max-height: 700px) { .enc-card { zoom: .86; } }

/* Game Over / Zeit abgelaufen, Schritt 2: quadratische Card des HYCEAN, der Dich erwischt hat (Figma „card / end of round destroyed“) */
.over-cardwrap { display: grid; grid-template-rows: 0fr; margin: 0; transition: grid-template-rows 1.3s cubic-bezier(.16, 1, .3, 1), margin 1.3s cubic-bezier(.16, 1, .3, 1); }
.over-cardwrap > * { min-height: 0; }
.over-cardwrap { overflow: visible; }
#over.is-step2 .over-cardwrap { grid-template-rows: 1fr; margin: 48px 0 8px; }
.over-card { position: relative; display: block; width: min(329px, calc(100vw - 68px)); aspect-ratio: 1; background: #000; border-radius: 10px;
  opacity: 0; transform: scale(.96); transition: opacity 1.2s cubic-bezier(.16, 1, .3, 1) .3s, transform 1.4s cubic-bezier(.16, 1, .3, 1) .3s; pointer-events: none; }   /* langes Ease-out */
#over.is-step2 .over-card { opacity: 1; transform: none; }
.over-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
/* Nur EINE Linie (Figma Game Over): roter Rahmen an der Kante, Kana sitzt oben links auf der Linie und unterbricht sie */
.over-card::after { content: ""; position: absolute; inset: 0; border: 2px solid #FF1500; border-radius: 10px; pointer-events: none; }
.oc-kana { position: absolute; z-index: 1; left: -2px; top: -17px; padding: 0 8px 6px 0; background: #000; font: 900 30px/1 var(--kana); color: #FF1500; }
.oc-name { position: absolute; z-index: 1; left: 18px; top: 26px; font: 400 8px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.oc-status { left: 18px; bottom: 18px; z-index: 1; }
@media (max-height: 760px) { .over-card { width: min(260px, calc(100vw - 68px)); } #over.is-step2 .over-cardwrap { margin: 32px 0 4px; } }

/* Claim: Link in die Begegnungen */
.enc-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; color: var(--acc); font: 700 13px/1 var(--ui); letter-spacing: .1em; cursor: pointer; pointer-events: auto; }
.enc-link-ico { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--acc); background: #000; display: grid; place-items: center; transition: background .15s; }
.enc-link-ico svg { width: 22px; height: 22px; fill: var(--acc); transition: fill .15s; }
.enc-link:hover .enc-link-ico, .enc-link:focus-visible .enc-link-ico { background: var(--acc); }
.enc-link:hover svg, .enc-link:focus-visible svg { fill: #000; }
#scr-claim[data-n="0"] .enc-link, #scr-claim:not([data-n]) .enc-link, #scr-claim[data-ok="0"] .enc-link { display: none; }

/* Teilen: Einblenden ohne filter:blur (ruckelte über dem laufenden Spiel); ab dem zweiten Öffnen steht das Bild sofort (.is-instant, js/game.js openSharePanel) */
#scr-share.on > * { animation-name: itemIn; }
#scr-share.on.out > * { animation: bgOut .4s var(--out-ease, ease-in) both; }
.share-frame .share-img.is-instant { transition: none; }

/* End-Screens (Game Over, Sieg, Claim, Teilen, Begegnungen): Ein-/Ausblenden ohne filter:blur – Weichzeichnen großer Flächen ruckelt über dem laufenden Spiel */
.scr-end.on > * { animation-name: itemIn; }
.scr-end.on.out > *, .scr-end.on.out .end-card > * { animation: bgOut .35s var(--out-ease, ease-in) both; }
/* Zurück auf einen Screen, der schon stand (showBack in js/game.js): Inhalte sofort da, nur die Fläche blendet */
.scr.no-anim.on > *, .scr.no-anim.on .end-card > *, .scr.no-anim.on .enc-card { animation: none; }

/* Pause-Menü: Collector Token erst ab 10 % (data-tier setzt syncPauseToken in js/game.js) */
#scr-pause:not([data-tier]) .pause-token, #scr-pause[data-tier="0"] .pause-token { display: none; }

/* Pause (auch Zahnrad-Menü): stärker abgedunkelt als die übrigen Screens (Dirk 2026-11-03) */
#scr-pause { background: rgba(0,0,0,.92); }
