/* ═══════════════════════════════ PIXELZEIT ═══════════════════════════════ */
@font-face { font-family: 'PZ Press'; src: url('../assets/fonts/pressstart2p.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'PZ Pixelify'; src: url('../assets/fonts/pixelifysans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'PZ VT'; src: url('../assets/fonts/vt323.woff2') format('woff2'); font-display: swap; }

:root {
  color-scheme: dark;
  --acc: #39ff88;
  --acc2: #b6ffcf;
  --acc-ink: #04120a;
  --era-bg: #030a06;
  --bg: #07060d;
  --panel: rgba(12, 10, 21, 0.84);
  --panel-solid: #0e0c18;
  --card: rgba(255, 255, 255, 0.045);
  --card-hi: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.09);
  --line-hi: rgba(255, 255, 255, 0.18);
  --ink: #f2effa;
  --muted: #a39dbd;
  --dim: #6d6788;
  --gold: #ffd23f;
  --gold-d: #e39a19;
  --np: #c68bff;
  --good: #5cff9d;
  --bad: #ff5470;
  --bronze: #d58a4a;
  --silver: #c9d2de;
  --goldt: #ffd23f;
  --plat: #9fe8ff;
  --r-c: #b8c0cc;
  --r-r: #3fa7ff;
  --r-e: #b45cff;
  --r-l: #ffb31a;
  --f-display: 'Press Start 2P', 'PZ Press', ui-monospace, monospace;
  --f-body: 'Pixelify Sans', 'PZ Pixelify', ui-rounded, system-ui, sans-serif;
  --f-mono: 'VT323', 'PZ VT', ui-monospace, 'Courier New', monospace;
  --topbar-h: 50px;
  --ticker-h: 30px;
  --nav-h: 64px;
  --radius: 10px;
  --crt: 0.55;
  --shadow-px: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--bg); }
html.local { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.spr, .pix { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ───────── Hintergrund & CRT ───────── */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
/* Scanlines & Vignette nur über dem animierten Hintergrund – nie über Texten */
#crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, calc(var(--crt) * 0.28)) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, calc(var(--crt) * 0.7)) 100%);
}
body.no-crt #crt { display: none; }
body.crt-flicker #crt { animation: flicker 0.12s steps(2) infinite; }
@keyframes flicker { 50% { opacity: 0.92; } }

/* ───────── App-Raster ───────── */
#app {
  position: relative; z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: var(--topbar-h) var(--ticker-h) minmax(0, 1fr);
}
#app.layout-3 { grid-template-columns: minmax(400px, 1fr) minmax(360px, 420px) minmax(360px, 440px); grid-template-areas: 'top top top' 'tick tick tick' 'stage shop panel'; }
#app.layout-2 { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); grid-template-areas: 'top top' 'tick tick' 'stage panel'; }
#app.layout-1 { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar-h) var(--ticker-h) minmax(0, 1fr) var(--nav-h); grid-template-areas: 'top' 'tick' 'stage' 'nav'; }
#topbar { grid-area: top; }
#ticker { grid-area: tick; }
#stage { grid-area: stage; }
#shopCol { grid-area: shop; }
#panel { grid-area: panel; }
#bottomNav { grid-area: nav; }

/* ───────── Kopfzeile ───────── */
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(to bottom, rgba(5, 4, 10, 0.92), rgba(5, 4, 10, 0.72));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.logo { font-family: var(--f-display); font-size: 15px; letter-spacing: 1px; color: var(--ink); text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); white-space: nowrap; }
.logo b { color: var(--acc); font-weight: 400; text-shadow: 0 0 12px color-mix(in srgb, var(--acc) 60%, transparent), 2px 2px 0 rgba(0, 0, 0, 0.6); }
.year-box { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.year { font-family: var(--f-display); font-size: 18px; color: var(--acc); background: rgba(0, 0, 0, 0.55); padding: 6px 8px 5px; border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent); border-radius: 4px; text-shadow: 0 0 10px color-mix(in srgb, var(--acc) 70%, transparent); font-variant-numeric: tabular-nums; }
.year.tick { animation: yeartick 0.5s ease-out; }
@keyframes yeartick { 0% { transform: scale(1.25); color: #fff; } 100% { transform: scale(1); } }
.era-name { font-family: var(--f-body); font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  min-width: 38px; height: 34px; padding: 0 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--f-display); font-size: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.icon-btn:hover { background: var(--card-hi); border-color: var(--line-hi); }
.icon-btn:active { transform: translateY(1px); }
.np-chip { color: var(--np); font-size: 11px; }
.np-chip img { width: 18px; height: 18px; }
.ico-sound::before { content: '♪'; font-family: var(--f-body); font-size: 18px; }


/* ───────── Newsticker ───────── */
#ticker {
  display: flex; align-items: center; gap: 0; overflow: hidden; cursor: pointer;
  background: rgba(0, 0, 0, 0.62); border-bottom: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 21px; color: var(--acc2); white-space: nowrap;
}
.ticker-tag { flex: none; font-family: var(--f-display); font-size: 9px; color: var(--acc-ink); background: var(--acc); padding: 0 10px; height: 100%; display: flex; align-items: center; letter-spacing: 1px; }
.ticker-track { flex: 1; overflow: hidden; position: relative; height: 100%; mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); }
#tickerText { position: absolute; left: 0; top: 50%; transform: translate(100%, -50%); will-change: transform; }

/* ───────── Bühne ───────── */
#stage {
  position: relative; overflow: hidden; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 16px 14px;
  gap: 8px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.score { text-align: center; z-index: 3; }
.coins { font-family: var(--f-display); font-size: clamp(22px, 3.4vw, 38px); color: var(--gold); text-shadow: 0 0 18px rgba(255, 210, 63, 0.35), 3px 3px 0 rgba(0, 0, 0, 0.7); display: inline-flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.coin-ico img { width: clamp(24px, 3.2vw, 38px); height: auto; display: block; }
.cps { font-family: var(--f-mono); font-size: 23px; color: var(--ink); opacity: 0.85; margin-top: 2px; }
.cps.boosted { color: var(--acc); }

#buffs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 26px; z-index: 3; }
.buff { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line-hi); font-family: var(--f-mono); font-size: 18px; position: relative; overflow: hidden; }
.buff img { width: 20px; height: 20px; }
.buff .bt { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--acc); }
.buff.b-prod { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.buff.b-click { border-color: color-mix(in srgb, #ff5cf0 60%, transparent); }
.buff.b-fever { border-color: #ff8a1f; }

#clickZone { position: relative; flex: 1 1 auto; width: 100%; min-height: 150px; display: grid; place-items: center; z-index: 2; }
#clickZone .halo {
  position: absolute; width: min(70%, 480px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 38%, transparent) 0%, transparent 65%);
  filter: blur(8px); opacity: 0.55; transition: opacity 0.3s, transform 0.3s; pointer-events: none;
  animation: halo 4s ease-in-out infinite;
}
@keyframes halo { 50% { transform: scale(1.08); opacity: 0.7; } }
#comboRing {
  position: absolute; width: min(64%, 43vh, 440px); aspect-ratio: 1; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--acc) 45%, transparent);
  animation: spin 18s linear infinite; pointer-events: none; opacity: 0.5;
}
@keyframes spin { to { transform: rotate(360deg); } }
#controller {
  position: relative; background: none; border: 0; padding: 0; border-radius: 30px;
  width: min(62%, 40vh, 400px); max-width: 100%;
  touch-action: manipulation;
  animation: float 4.5s ease-in-out infinite;
  outline-offset: 6px;
}
#controller img { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.3)); transition: transform 0.07s ease-out, filter 0.2s; pointer-events: none; }
#controller.press img { transform: scale(0.93) rotate(-1.5deg); }
#controller.press.alt img { transform: scale(0.93) rotate(1.5deg); }
@keyframes float { 50% { transform: translateY(-8px); } }
#clickHint { position: absolute; bottom: 4%; font-family: var(--f-display); font-size: 11px; color: var(--acc); letter-spacing: 1px; animation: blink 1.1s steps(2) infinite; pointer-events: none; text-shadow: 2px 2px 0 #000; }
@keyframes blink { 50% { opacity: 0; } }

body.fever #controller img { filter: drop-shadow(0 0 22px #ff8a1f) drop-shadow(0 0 40px #ff3fa4); }
body.fever #clickZone .halo { background: conic-gradient(from 0deg, #ff3b3b, #ffe23b, #4bff6b, #3bb4ff, #b45cff, #ff3b3b); opacity: 0.45; animation: spin 2.5s linear infinite; filter: blur(30px); }
body.fever #comboRing { border-color: #ffe23b; animation-duration: 2s; opacity: 0.9; }

/* Combo */
.combo { width: min(100%, 440px); z-index: 3; }
.combo-bar { height: 12px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line-hi); overflow: hidden; }
.combo-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--acc), var(--gold)); transition: width 0.12s linear; box-shadow: 0 0 12px var(--acc); }
body.fever .combo-fill { background: linear-gradient(90deg, #ff3b3b, #ffe23b, #4bff6b, #3bb4ff, #b45cff, #ff3b3b); background-size: 200% 100%; animation: rainbow 0.8s linear infinite; }
@keyframes rainbow { to { background-position: 200% 0; } }
.combo-label { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--f-display); font-size: 10px; color: var(--muted); }
.combo-label #comboText.hot { color: var(--gold); }
body.fever .combo-label #comboText { color: #ff8a1f; animation: blink 0.4s steps(2) infinite; }

/* Regal: gekaufte Geräte der aktuellen Epoche */
#shelf { width: min(100%, 560px); z-index: 3; position: relative; flex: none; }
.shelf-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 2.4vw, 22px); height: var(--shelf-h, 76px); padding: 0 14px; }
.shelf-board { height: 7px; border-radius: 2px; background: linear-gradient(to bottom, color-mix(in srgb, var(--acc) 45%, #2a2438), #0d0a14); box-shadow: 0 0 18px color-mix(in srgb, var(--acc) 22%, transparent), 0 7px 12px rgba(0, 0, 0, 0.65); }
.sh-item { position: relative; flex: 0 1 96px; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.sh-item img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.65)); transform-origin: 50% 100%; }
.sh-item.photo img { height: 78%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; border: 2px solid rgba(255, 255, 255, 0.16); }
.sh-item.empty img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, 0.4)); opacity: 0.55; }
.sh-item.empty.photo img { border-color: transparent; }
.sh-item .n { position: absolute; right: -6px; top: 0; font-family: var(--f-mono); font-size: 18px; line-height: 1; color: var(--ink); background: rgba(0, 0, 0, 0.72); border: 1px solid var(--line-hi); border-radius: 4px; padding: 1px 4px 0; font-variant-numeric: tabular-nums; }
.sh-item.empty .n { display: none; }
.sh-item::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -5px; height: 6px; border-radius: 50%; background: var(--tier, transparent); filter: blur(5px); opacity: 0.9; pointer-events: none; }
.sh-item.t1 { --tier: var(--bronze); } .sh-item.t1 .n { border-color: var(--bronze); color: var(--bronze); }
.sh-item.t2 { --tier: var(--silver); } .sh-item.t2 .n { border-color: var(--silver); color: var(--silver); }
.sh-item.t3 { --tier: var(--goldt); } .sh-item.t3 .n { border-color: var(--goldt); color: var(--goldt); box-shadow: 0 0 8px color-mix(in srgb, var(--goldt) 50%, transparent); }
.sh-item.bump img { animation: sh-bump 0.32s ease-out; }
.sh-item.pop img { animation: sh-pop 0.55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes sh-bump { 40% { transform: scale(1.08, 0.94); } }
@keyframes sh-pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.15, 0.9); } 100% { transform: scale(1); } }
.sh-fly { position: fixed; z-index: 90; pointer-events: none; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); }
.sh-coin { position: absolute; width: 16px; height: 16px; margin-left: -8px; image-rendering: pixelated; animation: sh-coin 1s ease-out both; z-index: 4; pointer-events: none; }
@keyframes sh-coin { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-10px) scale(1); } 100% { transform: translateY(-46px) scale(0.9); opacity: 0; } }
body.reduce-motion .sh-item img { animation: none !important; }
@media (max-height: 700px) { #shelf { --shelf-h: 58px; } }

/* Unterer Bühnenbereich */
.stage-bottom { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; width: min(100%, 600px); z-index: 3; }
.boss-btn, .era-btn {
  position: relative; text-align: left; border-radius: var(--radius); padding: 9px 12px 12px;
  background: rgba(8, 6, 14, 0.78); border: 1px solid var(--line-hi); color: var(--ink);
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.08s, border-color 0.2s, background 0.2s;
}
.boss-btn { flex-direction: row; align-items: center; gap: 8px; }
.boss-btn img { width: 28px; height: 28px; flex: none; }
.boss-btn-label { font-family: var(--f-display); font-size: 9px; line-height: 1.5; }
.boss-charge, .era-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.06); }
.boss-charge span, .era-progress span { display: block; height: 100%; width: 0; background: var(--bad); transition: width 0.3s; }
.era-progress span { background: var(--acc); }
.boss-btn:disabled { opacity: 0.75; cursor: default; }
.boss-btn.ready { border-color: var(--bad); animation: pulse-red 1s ease-in-out infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 3px rgba(255, 84, 112, 0.35), 0 0 22px rgba(255, 84, 112, 0.5); } }
.era-btn-top { font-family: var(--f-display); font-size: 8px; color: var(--muted); letter-spacing: 0.5px; }
.era-btn-main { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.era-btn.ready { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, rgba(8, 6, 14, 0.85)); animation: pulse-acc 1.2s ease-in-out infinite; }
.era-btn.ready .era-btn-top { color: var(--acc); }
@keyframes pulse-acc { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 30%, transparent), 0 0 24px color-mix(in srgb, var(--acc) 45%, transparent); } }
.boss-btn:active:not(:disabled), .era-btn:active { transform: translateY(2px); }
.era-btn.max { opacity: 0.8; }

/* Effekte */
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
#floaters { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.floater { position: absolute; font-family: var(--f-display); font-size: 13px; color: var(--gold); text-shadow: 2px 2px 0 #000; white-space: nowrap; animation: floatup 0.95s ease-out forwards; will-change: transform, opacity; }
.floater.crit { font-size: 18px; color: #ff5a3c; }
.floater.crit::before { content: 'KRIT! '; color: #ffe23b; font-size: 11px; }
.floater.dmg { color: #ff4d6d; font-size: 15px; }
.floater.big { font-size: 16px; color: #fff; }
.floater.auto { font-size: 10px; opacity: 0.8; }
@keyframes floatup { 0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; } 12% { transform: translate(-50%, -12px) scale(1.12); opacity: 1; } 100% { transform: translate(-50%, -90px) scale(1); opacity: 0; } }

#powerups { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.powerup {
  position: absolute; pointer-events: auto; width: 64px; height: 64px; border: 0; padding: 0; background: none;
  animation: pu-in 0.4s cubic-bezier(.2, 1.6, .5, 1) both, pu-bob 1.6s ease-in-out 0.4s infinite;
  filter: drop-shadow(0 0 10px rgba(255, 230, 120, 0.8)) drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.5));
  touch-action: manipulation;
}
.powerup::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.6); animation: pu-ring 1.4s ease-out infinite; }
.powerup img { width: 100%; height: 100%; }
.powerup.leaving { animation: pu-out 0.5s ease-in forwards; }
.powerup.glitch { animation: pu-in 0.4s both, glitchy 0.25s steps(2) infinite; }
@keyframes pu-in { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
@keyframes pu-bob { 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes pu-ring { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.4); opacity: 0; } }
@keyframes pu-out { to { transform: scale(0); opacity: 0; } }
@keyframes glitchy { 0% { transform: translate(2px, -1px); filter: hue-rotate(90deg); } 100% { transform: translate(-2px, 1px); filter: hue-rotate(-90deg) invert(0.2); } }

/* Boss */
#bossLayer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; z-index: 4; cursor: crosshair; }
#bossLayer::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 30, 60, 0.28), transparent 70%); pointer-events: none; }
.boss-head { display: flex; justify-content: space-between; width: min(92%, 420px); font-family: var(--f-display); font-size: 11px; z-index: 1; }
.boss-name { color: #ff8a9a; text-shadow: 2px 2px 0 #000; }
.boss-timer { color: #fff; }
.boss-timer.low { color: var(--bad); animation: blink 0.5s steps(2) infinite; }
.boss-hp { position: relative; width: min(92%, 420px); height: 18px; background: rgba(0, 0, 0, 0.75); border: 2px solid #fff; border-radius: 3px; overflow: hidden; z-index: 1; }
.boss-hp-fill { position: absolute; inset: 0; right: auto; width: 100%; background: linear-gradient(90deg, #ff2b4a, #ff8a1f); transition: width 0.1s linear; }
.boss-hp span { position: relative; display: block; text-align: center; font-family: var(--f-mono); font-size: 18px; line-height: 14px; color: #fff; text-shadow: 1px 1px 0 #000; }
#bossImg { width: min(52%, 34vh, 300px); height: auto; image-rendering: pixelated; animation: boss-bob 1.4s ease-in-out infinite; filter: drop-shadow(6px 8px 0 rgba(0, 0, 0, 0.45)); z-index: 1; pointer-events: none; }
#bossImg.hit { animation: boss-hit 0.12s linear; filter: brightness(2.4) drop-shadow(6px 8px 0 rgba(0, 0, 0, 0.45)); }
@keyframes boss-bob { 50% { transform: translateY(-10px) scale(1.03); } }
@keyframes boss-hit { 25% { transform: translate(-5px, 2px); } 75% { transform: translate(5px, -2px); } }
.boss-quote { font-family: var(--f-mono); font-size: 21px; color: #ffd0d8; text-align: center; max-width: 90%; z-index: 1; }
body.boss #controller, body.boss #clickHint, body.boss #comboRing { visibility: hidden; }

/* Schütteln */
.shake { animation: shake 0.28s linear; }
.shake-big { animation: shake-big 0.5s linear; }
@keyframes shake { 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 2px); } 80% { transform: translate(2px, -1px); } }
@keyframes shake-big { 10%, 50%, 90% { transform: translate(-8px, 3px) rotate(-0.5deg); } 30%, 70% { transform: translate(8px, -3px) rotate(0.5deg); } }

/* ───────── Spalten / Panel ───────── */
.col {
  min-height: 0; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#shopCol { overflow: hidden; }
#shopCol .col-head, .page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.col-title { font-family: var(--f-display); font-size: 11px; color: var(--acc); letter-spacing: 1px; }
#tabs { display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px 9px;
  background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  font-family: var(--f-body); font-weight: 600; font-size: 15px; white-space: nowrap; position: relative;
}
.tab img { width: 18px; height: 18px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--acc); }
/* Desktop: alle Tabs ohne Scrollen, in zwei Reihen */
#app:not(.layout-1) #tabs { flex-wrap: wrap; overflow: visible; padding-top: 4px; }
#app:not(.layout-1) .tab { flex: 1 1 22%; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 2px 4px; font-size: 13px; line-height: 1.15; }
#app:not(.layout-1) .tab img { width: 16px; height: 16px; }
#app.layout-2 .tab { flex-basis: 18%; }
#app:not(.layout-1) .tab .dot { top: 3px; right: calc(50% - 16px); }
.tab .dot, .nav-btn .dot { position: absolute; top: 4px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 6px var(--bad); }
#panelBody { flex: 1; min-height: 0; position: relative; }
.tab-page { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 0 12px 24px; display: none; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.tab-page.active { display: block; }
#shopCol .tab-page { position: static; display: block; flex: 1; min-height: 0; }
.tab-page::-webkit-scrollbar { width: 8px; }
.tab-page::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
.section-title { font-family: var(--f-display); font-size: 10px; color: var(--muted); letter-spacing: 1px; margin: 18px 2px 10px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 2px 10px; }

/* Kauf-Modus */
.seg { display: inline-flex; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { background: none; border: 0; padding: 5px 9px; border-radius: 6px; font-family: var(--f-display); font-size: 9px; color: var(--muted); }
.seg button.on { background: var(--acc); color: var(--acc-ink); }

/* Geräte-Zeilen */
.gen-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.gen {
  position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px 8px 8px; border-radius: var(--radius); text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, transform 0.06s, opacity 0.2s;
}
.gen:hover { background: var(--card-hi); border-color: var(--line-hi); }
.gen:active { transform: scale(0.985); }
.gen.cannot { opacity: 0.62; }
.gen.cannot .gen-cost { color: var(--bad); }
.gen.can { border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); }
.gen.can::after { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.gen-thumb { width: 62px; height: 52px; border-radius: 8px; background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)); display: grid; place-items: center; overflow: hidden; }
.gen-thumb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.gen-thumb.photo img { object-fit: cover; border-radius: 8px; filter: saturate(0.95); }
.gen-name { font-weight: 700; font-size: 16px; line-height: 1.15; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.gen-year { font-family: var(--f-mono); font-size: 17px; color: var(--acc); font-weight: 400; }
.gen-tag { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.gen-meta { display: flex; gap: 10px; align-items: baseline; margin-top: 3px; flex-wrap: wrap; }
.gen-cost { font-family: var(--f-mono); font-size: 20px; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.gen-cost img { width: 14px; height: 14px; }
.gen-prod { font-family: var(--f-mono); font-size: 16px; color: var(--muted); line-height: 1; }
.gen-count { font-family: var(--f-display); font-size: 18px; color: var(--ink); opacity: 0.9; min-width: 34px; text-align: right; }
.gen-buyn { font-family: var(--f-display); font-size: 8px; color: var(--acc); display: block; margin-top: 6px; text-align: right; }
.gen.locked { opacity: 0.5; cursor: default; }
.gen.locked .gen-thumb img { filter: brightness(0) opacity(0.6); }
.gen.fresh .gen-name::after { content: 'NEU'; font-family: var(--f-display); font-size: 7px; background: var(--bad); color: #fff; padding: 3px 4px; border-radius: 3px; }
.gen.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 40% { transform: scale(1.02); background: color-mix(in srgb, var(--acc) 18%, transparent); } }

/* Upgrades */
.upg-detail { position: sticky; top: 0; z-index: 3; margin: 0 -12px 10px; padding: 12px; background: linear-gradient(to bottom, var(--panel-solid) 85%, transparent); }
.upg-card { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: stretch; padding: 10px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line-hi); min-height: var(--upg-h, 74px); }
.upg-card > div { display: flex; flex-direction: column; }
.upg-card .upg-t { width: 52px; height: 52px; }
.upg-card h4 { margin: 0; font-size: 16px; line-height: 1.2; }
.upg-card p { margin: 3px 0 6px; font-size: 14px; color: var(--muted); }
.upg-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.upg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.upg-t {
  position: relative; aspect-ratio: 1; border-radius: 8px; padding: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); display: grid; place-items: center;
  transition: transform 0.08s, border-color 0.15s, opacity 0.2s;
}
.upg-t img.spr { width: 62%; height: 62%; }
.upg-t img.gimg { width: 88%; height: 88%; object-fit: contain; }
.upg-t .badge { position: absolute; right: 2px; bottom: 2px; font-family: var(--f-display); font-size: 7px; background: rgba(0, 0, 0, 0.75); padding: 2px 3px; border-radius: 3px; color: var(--gold); }
.upg-t .kind { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.upg-t.can { border-color: var(--gold); box-shadow: inset 0 0 12px rgba(255, 210, 63, 0.25); }
.upg-t.cannot { opacity: 0.45; }
.upg-t.sel { outline: 2px solid var(--acc); outline-offset: 1px; }
.upg-t:hover { transform: translateY(-2px); }
.upg-owned { opacity: 0.8; }
.upg-owned .upg-t { opacity: 0.55; cursor: default; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 8px; border: 0;
  background: var(--acc); color: var(--acc-ink);
  font-family: var(--f-display); font-size: 10px; letter-spacing: 0.5px; line-height: 1.4;
  box-shadow: var(--shadow-px); transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55); }
.btn:disabled { background: #3a3650; color: #8f89a8; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--card-hi); color: var(--ink); border: 1px solid var(--line-hi); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.gold { background: var(--gold); color: #2a1a00; }
.btn.np { background: var(--np); color: #1a0830; }
.btn.small { padding: 7px 10px; font-size: 8px; }
.btn.wide { width: 100%; }
.btn img { width: 16px; height: 16px; }
.price { font-family: var(--f-mono); font-size: 20px; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }
.price img { width: 14px; height: 14px; }
.price.bad { color: var(--bad); }

/* Epoche */
.era-hero { position: relative; margin-top: 12px; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 22%, transparent), rgba(0, 0, 0, 0.3)); border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); overflow: hidden; }
.era-hero .years { font-family: var(--f-display); font-size: 10px; color: var(--acc); }
.era-hero h3 { margin: 6px 0 6px; font-size: 22px; line-height: 1.15; text-wrap: balance; }
.era-hero p { margin: 0; color: var(--ink); opacity: 0.85; font-size: 15px; }
.req { display: grid; gap: 6px; margin: 12px 0; }
.req-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; font-size: 15px; }
.req-row .ok { color: var(--good); font-family: var(--f-display); font-size: 10px; }
.req-row .no { color: var(--dim); font-family: var(--f-display); font-size: 10px; }
.req-row .v { font-family: var(--f-mono); font-size: 19px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; grid-column: 2 / 4; }
.bar > span { display: block; height: 100%; background: var(--acc); }
.timeline { display: grid; gap: 4px; }
.tl { display: grid; grid-template-columns: 58px 16px 1fr; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; }
.tl .y { font-family: var(--f-mono); font-size: 18px; color: var(--muted); text-align: right; }
.tl .dotc { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--dim); justify-self: center; }
.tl.done .dotc { background: var(--eracol, var(--acc)); border-color: var(--eracol, var(--acc)); }
.tl.cur { background: var(--card); }
.tl.cur .dotc { background: var(--acc); border-color: #fff; box-shadow: 0 0 10px var(--acc); }
.tl .n { font-weight: 600; }
.tl.lock .n { color: var(--dim); }
.tl small { color: var(--muted); font-size: 13px; margin-left: 6px; }
.war-box { padding: 14px; border-radius: 12px; border: 1px dashed var(--line-hi); background: rgba(0, 0, 0, 0.3); }
.war-box h4 { margin: 0 0 4px; font-size: 17px; }
.war-choice { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.war-pill { padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #fff; }
.crash-box { padding: 14px; border-radius: 12px; background: linear-gradient(160deg, rgba(255, 84, 112, 0.14), rgba(0, 0, 0, 0.35)); border: 1px solid rgba(255, 84, 112, 0.35); }
.crash-box h4 { margin: 0 0 6px; font-family: var(--f-display); font-size: 12px; color: #ff8a9a; }
.crash-box p { margin: 6px 0; font-size: 14px; color: var(--muted); }
.crash-gain { font-family: var(--f-display); font-size: 18px; color: var(--np); margin: 8px 0; display: flex; align-items: center; gap: 8px; }
.crash-gain img { width: 24px; height: 24px; }

/* Sammlung */
.loot-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 12px; }
.loot-count { font-family: var(--f-display); font-size: 16px; }
.loot-count small { font-family: var(--f-body); font-size: 14px; color: var(--muted); display: block; margin-top: 4px; }
.bin { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-hi); }
.bin > img { width: 44px; height: 44px; }
.bin b { display: block; font-size: 16px; }
.bin span { font-size: 13px; color: var(--muted); }
.fx-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fx-chip { font-size: 13px; padding: 3px 8px; border-radius: 999px; background: var(--card-hi); border: 1px solid var(--line); }
.loot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px 8px; }
.li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; text-align: center; }
.li .t { font-size: 12px; line-height: 1.15; color: var(--ink); max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li.none .t { color: var(--dim); }
.li .lv { position: absolute; top: 0; right: 4px; font-family: var(--f-display); font-size: 7px; background: rgba(0, 0, 0, 0.8); color: var(--gold); padding: 2px 3px; border-radius: 3px; z-index: 2; }
.li:hover .cart, .li:hover .med { transform: translateY(-3px) rotate(-2deg); }

/* Datenträger */
.med { position: relative; width: 58px; height: 64px; transition: transform 0.15s; --lbl: #e8243c; --rar: var(--r-c); filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5)); }
.med .lbl { position: absolute; display: grid; place-items: center; overflow: hidden; font-family: var(--f-display); font-size: 5.5px; line-height: 1.3; color: #fff; text-align: center; padding: 2px; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6); }
.med.r-r { --rar: var(--r-r); } .med.r-e { --rar: var(--r-e); } .med.r-l { --rar: var(--r-l); }
.med.r-e, .med.r-l { filter: drop-shadow(0 0 8px var(--rar)) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5)); }
.med.r-l::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, transparent 60%); background-size: 250% 100%; animation: shine 2.6s linear infinite; mix-blend-mode: overlay; border-radius: inherit; pointer-events: none; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.med.cart { background: linear-gradient(#5b5866, #3d3a47); border-radius: 4px 4px 2px 2px; clip-path: polygon(0 12%, 8% 0, 92% 0, 100% 12%, 100% 100%, 0 100%); border-bottom: 5px solid var(--rar); }
.med.cart .lbl { left: 8%; right: 8%; top: 22%; bottom: 14%; background: var(--lbl); border-radius: 2px; }
.med.cart::before { content: ''; position: absolute; left: 20%; right: 20%; top: 7%; height: 6%; background: repeating-linear-gradient(90deg, #2a2833 0 3px, transparent 3px 6px); }
.med.cart16 { background: linear-gradient(#a8a6b2, #8c8a96); border-radius: 10px 10px 3px 3px; border-bottom: 5px solid var(--rar); }
.med.cart16 .lbl { left: 12%; right: 12%; top: 14%; bottom: 20%; background: var(--lbl); border-radius: 3px; }
.med.cart64 { background: linear-gradient(#4a4856, #2e2c38); border-radius: 12px 12px 3px 3px; clip-path: polygon(0 0, 100% 0, 100% 100%, 86% 100%, 86% 88%, 14% 88%, 14% 100%, 0 100%); border-top: 5px solid var(--rar); }
.med.cart64 .lbl { left: 10%; right: 10%; top: 10%; bottom: 26%; background: var(--lbl); border-radius: 3px; }
.med.disk { width: 60px; height: 60px; background: linear-gradient(#2f3542, #1c212b); border-radius: 3px; border-right: 4px solid var(--rar); }
.med.disk::before { content: ''; position: absolute; left: 28%; right: 20%; top: 0; height: 30%; background: linear-gradient(#d9dde6, #9aa2b1); border-radius: 0 0 2px 2px; }
.med.disk .lbl { left: 10%; right: 10%; top: 42%; bottom: 6%; background: #f4f1e8; color: #1a1a1a; text-shadow: none; border-top: 3px solid var(--lbl); }
.med.cd, .med.dvd, .med.bd { width: 54px; height: 70px; border-radius: 3px; background: linear-gradient(90deg, #111 0 8%, var(--lbl) 8%); border: 2px solid var(--rar); }
.med.cd { width: 64px; height: 60px; background: linear-gradient(135deg, #cfd6e3, #8994a8); border-radius: 3px; }
.med.cd::before { content: ''; position: absolute; left: 10%; top: 8%; width: 80%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #eee 0 8%, #888 9% 14%, transparent 15%), conic-gradient(from 20deg, #f5f0ff, #b9f3ff, #ffe7b9, #ffc4f0, #c9ffd0, #f5f0ff); }
.med.cd .lbl { left: 10%; right: 10%; bottom: 4%; height: 26%; background: var(--lbl); border-radius: 2px; }
.med.dvd .lbl, .med.bd .lbl { left: 12%; right: 4%; top: 6%; bottom: 6%; }
.med.bd { border-top: 8px solid #1f5fe0; }
.med.card { width: 50px; height: 58px; border-radius: 4px 12px 4px 4px; background: #d8d8e0; border-bottom: 5px solid var(--rar); }
.med.card .lbl { left: 12%; right: 12%; top: 12%; bottom: 14%; background: var(--lbl); border-radius: 3px; }
.med.digital { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(145deg, var(--lbl), #1b1430); border: 2px solid var(--rar); }
.med.digital .lbl { inset: 0; font-size: 6px; }
.med.crystal { width: 56px; height: 64px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, #5cffe8, var(--lbl), #ff5cf0); }
.med.crystal .lbl { inset: 18% 8%; font-size: 5px; }
.med.unknown { background: rgba(255, 255, 255, 0.05) !important; border-color: rgba(255, 255, 255, 0.1) !important; filter: none; }
.med.unknown::before, .med.unknown::after { display: none; }
.med.unknown .lbl { background: none !important; color: var(--dim); font-size: 14px; border: 0; }
/* Echte Cover als Etikett */
.med .lbl img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.med.has-cover .lbl { padding: 0; }
.med.disk.has-cover .lbl { top: 34%; border-top-width: 2px; }
.med.cd.has-cover { background: linear-gradient(90deg, #1c212b 0 10%, #9aa2b1 10% 12%, #111 12%); }
.med.cd.has-cover::before { display: none; }
.med.cd.has-cover .lbl { left: 12%; right: 0; top: 0; bottom: 0; height: auto; border-radius: 0 2px 2px 0; }
.med.digital .lbl { border-radius: 14px; }

/* Trophäen */
.ach-sum { display: flex; gap: 16px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ach-big { font-family: var(--f-display); font-size: 18px; }
.ach-big small { display: block; font-family: var(--f-body); font-size: 14px; color: var(--muted); margin-top: 4px; }
.filters { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chip.on { background: var(--card-hi); color: var(--ink); border-color: var(--acc); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ach { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; padding: 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); min-height: 58px; }
.ach .tico { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.ach .tico img { width: 22px; height: 22px; }
.ach b { display: block; font-size: 14px; line-height: 1.15; }
.ach span { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.ach.locked { opacity: 0.45; }
.ach.locked .tico { filter: grayscale(1); }
.t-b .tico { background: color-mix(in srgb, var(--bronze) 30%, transparent); } .t-s .tico { background: color-mix(in srgb, var(--silver) 30%, transparent); }
.t-g .tico { background: color-mix(in srgb, var(--goldt) 30%, transparent); } .t-p .tico { background: color-mix(in srgb, var(--plat) 30%, transparent); }
.t-b:not(.locked) { border-color: color-mix(in srgb, var(--bronze) 40%, transparent); } .t-s:not(.locked) { border-color: color-mix(in srgb, var(--silver) 40%, transparent); }
.t-g:not(.locked) { border-color: color-mix(in srgb, var(--goldt) 45%, transparent); } .t-p:not(.locked) { border-color: color-mix(in srgb, var(--plat) 50%, transparent); box-shadow: 0 0 12px rgba(159, 232, 255, 0.2); }

/* Perks */
.np-hero { margin-top: 12px; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, rgba(198, 139, 255, 0.22), rgba(0, 0, 0, 0.3)); border: 1px solid rgba(198, 139, 255, 0.4); display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.np-hero img { width: 48px; height: 48px; }
.np-hero b { font-family: var(--f-display); font-size: 18px; color: var(--np); display: block; }
.np-hero span { font-size: 14px; color: var(--muted); }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.perk { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.perk .ph { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; }
.perk .ph img { width: 28px; height: 28px; }
.perk b { font-size: 15px; line-height: 1.15; }
.perk p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.perk .pc { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.perk .cost { font-family: var(--f-mono); font-size: 20px; color: var(--np); }
.perk.owned { border-color: rgba(92, 255, 157, 0.35); background: rgba(92, 255, 157, 0.06); }
.perk.owned .cost { color: var(--good); font-family: var(--f-display); font-size: 9px; }
.perk.locked { opacity: 0.5; }
.perk.secret { border-color: var(--gold); }

/* Museum */
.museum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.mu { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: transform 0.1s, border-color 0.15s; }
.mu:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.mu .im { aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 6px; background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.1), transparent 70%); overflow: hidden; }
.mu .im img { width: 100%; height: 100%; object-fit: contain; }
.mu .im.photo img { object-fit: cover; }
.mu b { font-size: 14px; line-height: 1.15; }
.mu span { font-family: var(--f-mono); font-size: 17px; color: var(--acc); }
.mu.locked .im img { filter: brightness(0) opacity(0.45); }
.mu.locked b { color: var(--dim); }
.mu.seen { border-color: color-mix(in srgb, var(--acc) 25%, var(--line)); }

/* Statistik & Optionen */
.stats { display: grid; grid-template-columns: 1fr auto; gap: 0; margin-top: 8px; }
.stats div { padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.stats div:nth-child(odd) { color: var(--muted); }
.stats div:nth-child(even) { font-family: var(--f-mono); font-size: 19px; text-align: right; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.opt label { font-size: 15px; }
.opt small { display: block; color: var(--muted); font-size: 13px; }
.opt input[type=range] { width: 140px; accent-color: var(--acc); }
.opt select { background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line-hi); border-radius: 6px; padding: 6px; font: inherit; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #2b2840; border: 1px solid var(--line-hi); padding: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #9a94b3; transition: transform 0.15s, background 0.15s; }
.switch.on { background: color-mix(in srgb, var(--acc) 55%, #1a1a1a); }
.switch.on::after { transform: translateX(20px); background: #fff; }
.opt-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
textarea.save { width: 100%; min-height: 90px; background: #06050b; color: var(--acc2); border: 1px solid var(--line-hi); border-radius: 8px; font-family: var(--f-mono); font-size: 14px; padding: 8px; resize: vertical; word-break: break-all; }
input.txt { background: #06050b; color: var(--ink); border: 1px solid var(--line-hi); border-radius: 8px; padding: 9px 10px; font-family: var(--f-mono); font-size: 18px; width: 100%; text-transform: uppercase; }
.credits { font-size: 13px; color: var(--muted); }
.credits li { margin: 3px 0; }
.credits a { color: var(--acc2); }
.cloud-state { font-size: 13px; color: var(--muted); }
.cloud-state b { color: var(--good); font-weight: 600; }

/* ───────── Mobile Navigation ───────── */
#bottomNav { display: none; }
#app.layout-1 #bottomNav {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(6, 5, 11, 0.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 30;
}
.nav-btn { position: relative; background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 0; }
.nav-btn img { width: 24px; height: 24px; }
.nav-btn.active { color: var(--ink); }
.nav-btn.active::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.nav-btn .dot { right: 26%; top: 6px; }

#app.layout-1 #panel {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  height: var(--sheet-h); z-index: 25;
  border-left: 0; border-top: 1px solid var(--line-hi); border-radius: 16px 16px 0 0;
  background: rgba(10, 8, 18, 0.95);
  transform: translateY(110%); transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.55);
}
#app.layout-1.sheet-open #panel { transform: translateY(0); }
#app.switching #panel { transition: none !important; }
#app.layout-1 #panel::before { content: ''; position: absolute; top: 6px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
#app.layout-1 #tabs { padding-top: 14px; }
#app.layout-1 { --sheet-h: min(60vh, 620px); --sheet-h: min(60dvh, 620px); }
#app.layout-1.sheet-open #stage { padding-bottom: calc(var(--sheet-h) + 6px); gap: 2px; }
#app.layout-1.sheet-open #clickZone { min-height: 0; }
#app.layout-1.sheet-open #controller { width: min(44%, 17vh, 200px); animation: none; }
#app.layout-1.sheet-open #comboRing, #app.layout-1.sheet-open #clickHint, #app.layout-1.sheet-open .stage-bottom, #app.layout-1.sheet-open #buffs { display: none; }
#app.layout-1.sheet-open .coins { font-size: 18px; }
#app.layout-1.sheet-open .cps { font-size: 17px; }
#app.layout-1.sheet-open #bossImg { width: min(30%, 16vh); }
#app.layout-1.sheet-open .boss-quote { display: none; }
#app.layout-1 #shelf { --shelf-h: 54px; }
#app.layout-1.sheet-open #shelf { display: none; }

/* ───────── Toasts, Tooltip, Modals ───────── */
#toasts { position: fixed; top: calc(var(--topbar-h) + var(--ticker-h) + 10px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100% - 28px); }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  min-width: 250px; max-width: 360px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(12, 10, 22, 0.95); border: 1px solid var(--line-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.toast.out { animation: toast-out 0.3s ease-in forwards; }
.toast .ti { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); }
.toast .ti img { width: 26px; height: 26px; }
.toast small { display: block; font-family: var(--f-display); font-size: 7px; letter-spacing: 1px; color: var(--muted); margin-bottom: 3px; }
.toast b { display: block; font-size: 15px; line-height: 1.15; }
.toast span { font-size: 13px; color: var(--muted); }
.toast.t-p { border-color: var(--plat); } .toast.t-g { border-color: var(--goldt); } .toast.t-s { border-color: var(--silver); } .toast.t-b { border-color: var(--bronze); }
.toast.loot-l { border-color: var(--r-l); box-shadow: 0 0 24px rgba(255, 179, 26, 0.35); }
@keyframes toast-in { from { transform: translateX(40px) scale(0.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(40px); opacity: 0; } }

#tooltip { position: fixed; z-index: 90; max-width: 300px; padding: 10px 12px; border-radius: 8px; background: rgba(8, 6, 16, 0.97); border: 1px solid var(--line-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); pointer-events: none; font-size: 14px; }
#tooltip h5 { margin: 0 0 4px; font-size: 15px; }
#tooltip p { margin: 0 0 6px; color: var(--muted); }
#tooltip .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
#tooltip .k { font-family: var(--f-display); font-size: 8px; color: var(--acc); }

.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(3, 2, 8, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in 0.2s; }
@keyframes fade-in { from { opacity: 0; } }
.modal {
  position: relative; width: min(100%, 520px); max-height: calc(100% - 20px); overflow-y: auto;
  padding: 22px 20px 20px; border-radius: 14px; background: var(--panel-solid);
  border: 2px solid color-mix(in srgb, var(--acc) 55%, transparent);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55), 0 0 40px color-mix(in srgb, var(--acc) 18%, transparent);
  animation: pop 0.28s cubic-bezier(.2, 1.4, .4, 1);
}
.modal.wide { width: min(100%, 720px); }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font-family: var(--f-display); font-size: 15px; line-height: 1.5; color: var(--acc); text-wrap: balance; }
.modal p { color: var(--ink); opacity: 0.9; margin: 8px 0; }
.modal .x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-family: var(--f-display); font-size: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.big-num { font-family: var(--f-display); font-size: 22px; color: var(--gold); margin: 10px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-num img { width: 28px; height: 28px; }

/* Museumsdetail */
.mu-detail .mimg { display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 70%); border-radius: 12px; padding: 10px; margin: 6px 0 10px; cursor: pointer; }
.mu-detail .mimg img { max-height: 240px; width: auto; max-width: 100%; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)); }
.mu-detail .mimg.photo img { border-radius: 10px; }
.mu-detail .tag { font-family: var(--f-mono); font-size: 21px; color: var(--acc2); }
.mu-detail ul { padding-left: 18px; margin: 10px 0; }
.mu-detail li { margin: 6px 0; }
.mu-detail .cred { font-size: 12px; color: var(--dim); margin-top: 10px; }
.mu-detail .cred a { color: var(--muted); }

/* Konsolenkrieg-Karten */
.war-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.war-card { text-align: left; padding: 14px; border-radius: 12px; border: 2px solid var(--wc); background: color-mix(in srgb, var(--wc) 16%, #0b0914); display: flex; flex-direction: column; gap: 6px; transition: transform 0.12s, box-shadow 0.12s; }
.war-card:hover { transform: translateY(-3px); box-shadow: 0 0 24px color-mix(in srgb, var(--wc) 45%, transparent); }
.war-card.sel { box-shadow: 0 0 0 3px #fff; }
.war-card b { font-family: var(--f-display); font-size: 11px; line-height: 1.5; color: #fff; }
.war-card i { font-style: normal; color: var(--wc); font-weight: 700; filter: brightness(1.4); }
.war-card span { font-size: 14px; color: var(--ink); opacity: 0.85; }

/* Beute-Enthüllung */
.loot-reveal { text-align: center; }
.loot-reveal .med { margin: 16px auto; transform: scale(1.8); transform-origin: center; animation: reveal 0.7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes reveal { 0% { transform: scale(0.2) rotate(-200deg); opacity: 0; } 100% { transform: scale(1.8) rotate(0); opacity: 1; } }
.loot-reveal .rar { font-family: var(--f-display); font-size: 10px; letter-spacing: 1px; margin-top: 40px; }
.cover-art { position: relative; display: inline-block; margin: 14px 0 0; --rar: var(--r-c); animation: cover-in 0.7s cubic-bezier(.2, 1.4, .4, 1); }
.cover-art.r-r { --rar: var(--r-r); } .cover-art.r-e { --rar: var(--r-e); } .cover-art.r-l { --rar: var(--r-l); }
.cover-art > img { display: block; width: auto; height: auto; max-width: 200px; max-height: 190px; border-radius: 3px; box-shadow: 0 0 0 2px var(--rar), 0 10px 22px rgba(0, 0, 0, 0.6); }
.cover-art.r-e > img, .cover-art.r-l > img { box-shadow: 0 0 0 2px var(--rar), 0 0 18px var(--rar), 0 10px 22px rgba(0, 0, 0, 0.6); }
.loot-reveal .cover-art .med { position: absolute; right: -32px; bottom: -14px; margin: 0; transform: rotate(10deg); animation: none; }
.loot-reveal .cover-art + .rar { margin-top: 24px; }
.loot-reveal .cred { font-size: 12px; color: var(--dim); margin-top: 8px; }
.loot-reveal .cred a { color: var(--muted); }
@keyframes cover-in { 0% { transform: scale(0.3) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.loot-reveal h3 { margin: 6px 0; font-size: 22px; }
.loot-reveal .fx { color: var(--good); font-weight: 600; }

/* Epochen-Titelkarte */
.era-card { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 16px; text-align: center; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--acc) 22%, #000), #000 72%); animation: fade-in 0.4s; overflow-y: auto; }
.era-card .ey { font-family: var(--f-display); font-size: clamp(44px, 12vw, 110px); color: var(--acc); text-shadow: 0 0 30px var(--acc), 6px 6px 0 rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }
.era-card .en { font-family: var(--f-display); font-size: clamp(13px, 2.6vw, 22px); line-height: 1.5; color: #fff; text-wrap: balance; }
.era-card p { max-width: 58ch; color: var(--ink); opacity: 0.88; font-size: 17px; margin: 0; }
.era-card .gens { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.era-card .gens figure { margin: 0; width: 110px; animation: pop 0.5s both; }
.era-card .gens img { width: 110px; height: 80px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.7)); }
.era-card .gens figcaption { font-size: 13px; color: var(--muted); }
.era-card .slide { opacity: 0; animation: slide-up 0.6s forwards; }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Crash-Sequenz */
.crash-screen { position: fixed; inset: 0; z-index: 86; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; text-align: center; background: #000; overflow: hidden; }
.crash-screen .photo { position: absolute; inset: 0; background-size: cover; background-position: center; filter: grayscale(0.6) sepia(0.5) brightness(0.35) contrast(1.1); opacity: 0; animation: fade-to 2s 0.6s forwards; }
@keyframes fade-to { to { opacity: 1; } }
.crash-screen > *:not(.photo) { position: relative; }
.crash-screen .go { font-family: var(--f-display); font-size: clamp(26px, 8vw, 64px); color: #ff3b5c; text-shadow: 4px 4px 0 #000, 0 0 30px #ff3b5c; animation: glitch-text 0.3s steps(2) 6; }
@keyframes glitch-text { 0% { transform: translate(3px, 0); clip-path: inset(0 0 40% 0); } 50% { transform: translate(-3px, 2px); clip-path: inset(40% 0 0 0); } 100% { transform: none; clip-path: none; } }
.crash-screen p { max-width: 52ch; color: #ddd; }
.crash-screen .cont { font-family: var(--f-display); font-size: 14px; color: #fff; animation: blink 1s steps(2) infinite; }
body.glitching #app { animation: glitch-app 0.12s steps(3) infinite; }
@keyframes glitch-app { 0% { transform: translate(0); filter: none; } 33% { transform: translate(-6px, 2px) skewX(3deg); filter: hue-rotate(90deg) saturate(3); } 66% { transform: translate(5px, -3px); filter: invert(0.15); } }

/* Pause */
.pause-screen { position: fixed; inset: 0; z-index: 74; display: grid; place-items: center; background: rgba(0, 0, 0, 0.8); text-align: center; }
.pause-screen .pt { font-family: var(--f-display); font-size: clamp(28px, 7vw, 56px); color: #fff; animation: blink 1.2s steps(2) infinite; }

/* ───────── Breakpoints ───────── */
@media (max-width: 899px) {
  :root { --topbar-h: 46px; --ticker-h: 28px; }
  #topbar { padding: 0 10px; gap: 8px; }
  .logo { font-size: 11px; }
  .era-name { display: none; }
  .year { font-size: 14px; padding: 5px 6px 4px; }
  #ticker { font-size: 19px; }
  #stage { padding: 10px 12px 10px; gap: 6px; }
  .cps { font-size: 20px; }
  .stage-bottom { grid-template-columns: 1fr 1.25fr; gap: 8px; }
  .boss-btn, .era-btn { padding: 7px 9px 10px; }
  .era-btn-main { font-size: 14px; }
  #toasts { left: 10px; right: 10px; align-items: center; }
  .toast { min-width: 0; width: 100%; }
  .modal { padding: 20px 16px 16px; }
  #controller { width: min(70%, 38vh, 380px); }
}
@media (max-width: 380px) {
  .np-chip span:last-child { display: none; }
  .gen { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .gen-thumb { width: 52px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-iteration-count: 1 !important; }
body.reduce-motion #controller, body.reduce-motion .halo, body.reduce-motion #comboRing { animation: none !important; }

/* Shop-Spalte (≥ 1320 px) */
#shopCol .shop-upg { flex: 0 1 auto; max-height: 40%; overflow-y: auto; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
#shopCol .shop-gens { flex: 1 1 0; overflow-y: auto; }
#shopCol .upg-detail { margin: 0 -12px 8px; }
body.muted .ico-sound { position: relative; }
body.muted .ico-sound::after { content: ''; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; background: var(--bad); transform: rotate(-35deg); }
body.muted .ico-sound::before { content: '♪'; opacity: 0.6; }

/* Titelbildschirm */
.splash { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px 16px; text-align: center; cursor: pointer;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--acc) 20%, #07060d) 0%, #040308 70%); transition: opacity 0.4s, transform 0.4s; }
.splash.out { opacity: 0; transform: scale(1.06); }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(100%, 1000px); }
.splash-logo { font-family: var(--f-display); font-size: clamp(34px, 9vw, 84px); color: #fff; letter-spacing: 2px; text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.7); animation: pop 0.6s cubic-bezier(.2, 1.4, .4, 1); }
.splash-logo b { font-weight: 400; color: var(--acc); text-shadow: 0 0 24px var(--acc), 5px 5px 0 rgba(0, 0, 0, 0.7); }
.splash-sub { font-family: var(--f-mono); font-size: clamp(20px, 3.4vw, 28px); color: var(--acc2); }
.splash-strip { display: flex; gap: clamp(2px, 1.2vw, 14px); justify-content: center; flex-wrap: nowrap; margin: 6px 0; max-width: 100%; }
.splash-strip img { width: clamp(30px, 9vw, 96px); height: clamp(28px, 7vw, 72px); min-width: 0; flex: 0 1 auto; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.7)); animation: slide-up 0.5s both; }
.splash-save { font-size: 15px; color: var(--muted); }
.splash-start { background: none; border: 0; font-family: var(--f-display); font-size: clamp(14px, 3vw, 20px); color: var(--gold); letter-spacing: 2px; animation: blink 1s steps(2) infinite; padding: 12px 18px; text-shadow: 3px 3px 0 #000; }
.splash-hint { font-size: 14px; color: var(--dim); }

/* Zukunft: Hologramm-Controller */
body[data-era="9"] #controller img { filter: drop-shadow(0 0 14px #5cffe8) drop-shadow(0 0 34px rgba(255, 92, 240, 0.7)) saturate(1.4) hue-rotate(-10deg); animation: holo 3.2s linear infinite; }
body[data-era="9"] #controller::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(92, 255, 232, 0.16) 0 2px, transparent 2px 5px); mix-blend-mode: screen; pointer-events: none; -webkit-mask: radial-gradient(circle, #000 45%, transparent 70%); mask: radial-gradient(circle, #000 45%, transparent 70%); }
@keyframes holo { 0%, 100% { opacity: 0.95; } 47% { opacity: 0.95; } 48% { opacity: 0.6; transform: translateX(2px); } 49% { opacity: 1; transform: none; } }
body[data-era="0"] #controller img { filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(57, 255, 136, 0.25)); }
