/* ===== Schriften (lokal, damit das Spiel offline läuft) ===== */
@font-face { font-family: 'Cinzel'; font-weight: 400 900; font-display: swap; src: url(/fonts/Cinzel.woff2) format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 400; font-display: swap; src: url(/fonts/AlegreyaSans-400.woff2) format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/AlegreyaSans-400i.woff2) format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 500; font-display: swap; src: url(/fonts/AlegreyaSans-500.woff2) format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 800; font-display: swap; src: url(/fonts/AlegreyaSans-800.woff2) format('woff2'); }

/* ===== Gestaltungsgrundlagen ===== */
:root {
  --uiscale: 1;
  --ink: #0d0906;
  --panel: #1a130d;
  --panel-2: #231912;
  --raised: #2c2016;
  --line: rgba(200, 155, 90, 0.18);
  --line-strong: rgba(200, 155, 90, 0.45);
  --brass: #c89b5a;
  --brass-dark: #8a6a3a;
  --gold: #ecc77a;
  --text: #f0e6d6;
  --muted: #b3a18a;
  --faint: #7d6c57;
  --aether: #5fdbe3;
  --aether-dim: rgba(95, 219, 227, 0.14);
  --ember: #ff9a3c;
  --danger: #e2654d;
  --ok: #84cf70;
  --display: 'Cinzel', Georgia, serif;
  --body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(16px * var(--uiscale)); }
html, body { height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--body); line-height: 1.4; }
body { -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--aether); outline-offset: 2px; }
.padfocus { outline: 2px solid var(--aether) !important; outline-offset: 3px; box-shadow: 0 0 0 6px var(--aether-dim) !important; }

canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: 0.06em; }
h2 { font-size: 1.75rem; color: var(--gold); text-align: center; margin-bottom: 0.35rem; }
h3 { font-size: 0.78rem; color: var(--brass); text-transform: uppercase; letter-spacing: 0.16em; margin: 1.1rem 0 0.55rem; }
h4 { font-size: 0.8rem; color: var(--gold); margin-bottom: 0.5rem; }
.eyebrow { text-align: center; font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.2rem; min-height: 1em; }
.lead { text-align: center; color: var(--muted); margin-bottom: 1.1rem; }
.hint { text-align: center; color: var(--faint); font-size: 0.85rem; }
kbd { display: inline-block; min-width: 1.6em; padding: 0.05em 0.4em; margin-right: 0.2em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--ink); color: var(--gold); font: 500 0.78rem var(--body); text-align: center; }
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.cog-amount { display: inline-flex; align-items: center; gap: 0.25em; color: var(--gold); font-weight: 800; white-space: nowrap; }
.cog-amount .ic { stroke-width: 1.6; }

/* ===== Bildschirme und Panels ===== */
.screen {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; justify-content: center; align-items: flex-start;
  padding: calc(1.25rem + var(--safe-top)) 1rem calc(1.25rem + var(--safe-bottom));
  background: radial-gradient(120% 90% at 50% 40%, rgba(13, 9, 6, 0.55), rgba(8, 5, 3, 0.9));
  animation: fadeIn 0.18s ease;
}
.screen.stacked { z-index: 12; }
.screen.behind { visibility: hidden; }
#menu { background: radial-gradient(90% 70% at 50% 35%, rgba(13, 9, 6, 0.15), rgba(8, 5, 3, 0.75)); }
#pause, #over { background: rgba(8, 5, 3, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

.panel {
  position: relative; width: 100%; max-width: 34rem; margin: auto 0;
  padding: 1.9rem 1.8rem 1.6rem;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 5px var(--panel), inset 0 0 0 6px var(--line), inset 0 1px 0 6px rgba(255, 220, 160, 0.03);
  animation: rise 0.22s ease;
}
.panel.wide { max-width: 52rem; }
/* Nieten in den Ecken */
.panel::before {
  content: ''; position: absolute; inset: 11px; pointer-events: none;
  background:
    radial-gradient(circle, var(--brass-dark) 2px, transparent 2.5px) left top / 8px 8px no-repeat,
    radial-gradient(circle, var(--brass-dark) 2px, transparent 2.5px) right top / 8px 8px no-repeat,
    radial-gradient(circle, var(--brass-dark) 2px, transparent 2.5px) left bottom / 8px 8px no-repeat,
    radial-gradient(circle, var(--brass-dark) 2px, transparent 2.5px) right bottom / 8px 8px no-repeat;
}

@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ===== Knöpfe ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 2.75rem; padding: 0.6rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 800; letter-spacing: 0.03em; text-align: left;
  transition: transform 0.08s ease, filter 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; }
.btn svg { width: 1.2rem; height: 1.2rem; }
.btn-text { display: flex; flex-direction: column; line-height: 1.15; }
.btn-text small { font-weight: 500; font-size: 0.78rem; opacity: 0.75; letter-spacing: 0; }
.btn-text small:empty { display: none; }
.btn.big { min-height: 3.4rem; font-size: 1.1rem; padding: 0.75rem 1.4rem; }

.btn.primary {
  color: #1d1309;
  background: linear-gradient(180deg, #f3d48e, var(--brass) 70%, #b0844a);
  border: 1px solid #f6dc9d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 -2px 0 rgba(0, 0, 0, 0.18) inset, 0 6px 18px rgba(200, 155, 90, 0.18), 0 3px 0 #5e4523;
}
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.secondary { background: var(--raised); border: 1px solid var(--line-strong); color: var(--gold); }
.btn.secondary:hover:not(:disabled) { border-color: var(--brass); background: #33251a; }
.btn.ghost { color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { color: var(--gold); border-color: var(--line-strong); }
.btn.danger { color: var(--danger); border-color: rgba(226, 101, 77, 0.35); }
.btn.danger:hover:not(:disabled), .btn.armed { color: #fff; background: rgba(226, 101, 77, 0.85); border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1.1rem; }
.btn-row + .btn-row { margin-top: 0.6rem; }
.back-btn { display: flex; margin: 1.2rem auto 0; }
.btn-row .back-btn { margin: 0; }
.link { color: var(--faint); text-decoration: underline; text-underline-offset: 3px; font-size: 0.85rem; }
.link:hover { color: var(--gold); }

.icon-btn { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 8px; color: var(--muted); border: 1px solid var(--line); pointer-events: auto; }
.icon-btn:hover { color: var(--gold); border-color: var(--line-strong); }

/* ===== Hauptmenü ===== */
.menu { width: 100%; max-width: 25rem; margin: auto 0; display: flex; flex-direction: column; gap: 1.4rem; animation: rise 0.3s ease; }
.brand { text-align: center; }
.brand-gear { width: 3.4rem; height: 3.4rem; color: var(--brass); stroke-width: 1.2; filter: drop-shadow(0 0 18px rgba(255, 154, 60, 0.35)); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
h1 {
  font-size: clamp(2.3rem, 11vw, 3.4rem); font-weight: 800; letter-spacing: 0.12em; line-height: 1.05; margin: 0.3rem 0 0.45rem;
  background: linear-gradient(180deg, #fbe3a8 10%, var(--brass) 60%, #8a6334);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(255, 154, 60, 0.18));
}
.tagline { color: var(--muted); font-style: italic; }
.menu-main { display: flex; flex-direction: column; gap: 0.7rem; }
.menu-main > .btn { justify-content: flex-start; width: 100%; }
.mode-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem; }
.mode-row .btn { justify-content: flex-start; }
.press { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(13, 9, 6, 0.55); }
.press-label { font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.12em; color: var(--brass); text-transform: uppercase; }
.press-info { color: var(--muted); font-size: 0.82rem; margin-left: auto; text-align: right; }
.stepper { display: flex; align-items: center; gap: 0.5rem; }
.stepper b { min-width: 1.2rem; text-align: center; font: 800 1.2rem var(--display); color: var(--gold); }
.step { width: 1.9rem; height: 1.9rem; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--gold); font-size: 1.1rem; line-height: 1; }
.step:hover:not(:disabled) { background: var(--raised); }
.step:disabled { opacity: 0.3; }
.menu-main .hint { font-size: 0.82rem; }

.menu-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr)); gap: 0.5rem; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.8rem 0.4rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(26, 19, 13, 0.75); color: var(--muted); font-size: 0.85rem; font-weight: 500; transition: color 0.12s, border-color 0.12s, transform 0.12s; }
.nav-btn svg { width: 1.5rem; height: 1.5rem; color: var(--brass); }
.nav-btn small { font-size: 0.75rem; line-height: 1; }
.nav-btn small:empty { display: none; }
.nav-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); }
.menu-foot { display: flex; justify-content: center; gap: 0.8rem; color: var(--faint); font-size: 0.85rem; min-height: 1.2rem; }

/* ===== Karten (Auswahl & Händler) ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.9rem; margin: 1.3rem 0 1.1rem; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
  padding: 1.3rem 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #2f2217, #1f1610);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  animation: rise 0.26s ease backwards;
}
.card:hover:not(:disabled) { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 26px rgba(236, 199, 122, 0.12); }
.card:disabled { opacity: 0.5; }
.card.sold { opacity: 0.35; }
.card-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.card-icon { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; margin-bottom: 0.25rem; font-size: 1.75rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3d2c1d, #150f0a); border: 1px solid var(--line-strong); box-shadow: inset 0 0 0 4px rgba(13, 9, 6, 0.6); }
.card-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--gold); letter-spacing: 0.03em; }
.card-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.35; }
.card-tag { position: absolute; top: 0.6rem; right: 0.7rem; font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--aether); }
.card-price { margin-top: auto; padding-top: 0.6rem; }
.card-price.short .cog-amount { color: var(--danger); }
.card.relic { border-color: rgba(95, 219, 227, 0.4); background: linear-gradient(180deg, #1a2a2c, #12191b); }
.card.relic .card-title { color: var(--aether); }
.card.relic .card-icon { border-color: rgba(95, 219, 227, 0.45); background: radial-gradient(circle at 35% 30%, #22393c, #0b1314); }
.card.relic:hover:not(:disabled) { border-color: var(--aether); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 26px rgba(95, 219, 227, 0.18); }
.syn-hint { font-size: 0.8rem; color: rgba(95, 219, 227, 0.75); font-style: italic; }
.syn-hint.active { color: var(--aether); font-style: normal; }
.syn-hint.active b { font-weight: 800; }
#rerollBtn { display: flex; margin: 0 auto; }

/* ===== Listen, Reiter, Kacheln ===== */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; padding: 0.25rem; margin: 0.8rem auto 1rem; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 9, 6, 0.5); }
.tab { padding: 0.4rem 0.95rem; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.tab:hover { color: var(--text); }
.tab.active { color: #1d1309; background: var(--brass); font-weight: 800; }

.list { display: grid; gap: 0.5rem; max-height: min(56vh, 34rem); overflow-y: auto; padding: 0.15rem 0.3rem 0.15rem 0.1rem; }
.list.two { grid-template-columns: 1fr 1fr; }
.list .full, .list h3 { grid-column: 1 / -1; margin-top: 0.4rem; }

.row { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(35, 25, 18, 0.7); }
.row.owned { background: rgba(35, 25, 18, 0.35); }
.row-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; font-size: 1.2rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--ink); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 800; color: var(--gold); }
.row-desc { color: var(--muted); font-size: 0.86rem; }
.pips { display: flex; gap: 3px; margin-top: 0.35rem; }
.pips i { width: 1.1rem; height: 0.3rem; border-radius: 2px; background: rgba(200, 155, 90, 0.18); }
.pips i.on { background: var(--gold); box-shadow: 0 0 6px rgba(236, 199, 122, 0.4); }
.buy { flex: none; min-width: 5.8rem; padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--ink); color: var(--gold); font-weight: 800; font-size: 0.88rem; display: inline-flex; justify-content: center; }
.buy:hover:not(:disabled) { background: var(--brass); color: #1d1309; }
.buy:hover:not(:disabled) .cog-amount { color: inherit; }
.buy:disabled { opacity: 0.45; }
.row.owned .buy:disabled { opacity: 0.6; color: var(--ok); border-color: rgba(132, 207, 112, 0.3); }
.swatch { display: inline-block; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, white), var(--c) 55%, color-mix(in srgb, var(--c) 50%, black)); border: 2px solid rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px var(--line-strong); }
.entry .swatch { width: 1.6rem; height: 1.6rem; }

.entry { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(35, 25, 18, 0.6); }
.entry-icon { display: grid; place-items: center; width: 1.8rem; flex: none; font-size: 1.25rem; color: var(--gold); }
.entry-title { font-weight: 800; color: var(--gold); }
.entry-desc { color: var(--muted); font-size: 0.86rem; }
.entry.locked { opacity: 0.45; }
.entry.locked .entry-icon { color: var(--faint); }
.entry.done .entry-icon { color: var(--gold); }
.pairs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.35rem; }
.pair { padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.8rem; color: var(--aether); background: var(--aether-dim); border: 1px solid rgba(95, 219, 227, 0.25); }
.plus { color: var(--faint); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.6rem; margin: 1rem 0; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.85rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(13, 9, 6, 0.45); }
.tile .ic { width: 1.3rem; height: 1.3rem; color: var(--brass); margin-bottom: 0.15rem; }
.tile b { font: 800 1.45rem var(--display); color: var(--gold); line-height: 1.1; }
.tile span { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.note { margin: 0.2rem auto 0.4rem; max-width: 34rem; padding: 0.7rem 1rem; border-radius: var(--radius-sm); text-align: center; color: var(--aether); background: var(--aether-dim); border: 1px solid rgba(95, 219, 227, 0.25); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.6rem; margin-top: 1rem; }
.stat-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.38rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.stat-row b { color: var(--gold); }
.relic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; }
.relic-line { display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; color: var(--muted); }
.relic-line b { color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
#pauseRelics .hint { margin-top: 1rem; }

.board { display: flex; flex-direction: column; gap: 0.2rem; margin: 0.5rem 0; }
.board-row { display: grid; grid-template-columns: 2rem 1fr auto auto; gap: 0.8rem; align-items: center; padding: 0.45rem 0.6rem; border-radius: 7px; background: rgba(35, 25, 18, 0.5); font-size: 0.92rem; }
.board-row .rank { color: var(--brass); font-family: var(--display); font-weight: 700; }
.board-row.me { outline: 1px solid var(--gold); color: var(--gold); }
.board-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Einstellungen ===== */
.settings { display: grid; gap: 0.5rem; margin-top: 1rem; }
.setting { display: flex; align-items: center; gap: 1rem; padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(35, 25, 18, 0.6); }
.setting > span { flex: 0 0 11rem; color: var(--text); }
.setting input[type='range'] { flex: 1; accent-color: var(--gold); }
.setting b { min-width: 3.2rem; text-align: right; color: var(--gold); }
.toggle { margin-left: auto; position: relative; width: 4.2rem; height: 1.9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink); color: var(--faint); font-size: 0.78rem; font-weight: 800; text-align: right; padding: 0 0.6rem; transition: background-color 0.15s; }
.toggle::before { content: ''; position: absolute; left: 3px; top: 3px; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--faint); transition: transform 0.15s, background-color 0.15s; }
.toggle.on { background: rgba(200, 155, 90, 0.25); color: var(--gold); text-align: left; }
.toggle.on::before { transform: translateX(2.3rem); background: var(--gold); }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.7rem; }
.control-col { padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(13, 9, 6, 0.4); }
.control-col dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.7rem; font-size: 0.86rem; align-items: baseline; }
.control-col dt { color: var(--gold); white-space: nowrap; }
.control-col dd { color: var(--muted); }

.steps { margin: 1.1rem 0 1.4rem 1.2rem; display: grid; gap: 0.7rem; color: var(--muted); }
.steps b { color: var(--gold); }
.steps li::marker { color: var(--brass); font-family: var(--display); font-weight: 700; }
#tutorial .btn { display: flex; width: 100%; }
[data-input-text] { display: none; }
body[data-input='kbm'] [data-input-text='kbm'], body[data-input='touch'] [data-input-text='touch'], body[data-input='pad'] [data-input-text='pad'] { display: inline; }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; padding: calc(0.75rem + var(--safe-top)) 1.1rem 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 1rem; }
.hud-plate { display: flex; align-items: center; gap: 0.9rem; padding: 0.55rem 0.8rem; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(18, 12, 8, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.hud-vitals { grid-column: 1; flex-direction: column; align-items: stretch; gap: 0.4rem; justify-self: start; width: min(100%, 27rem); }
.meters { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0.75rem; }
.meter { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.meter .ic { width: 1rem; height: 1rem; color: var(--brass); }
.track { position: relative; flex: 1; height: 0.6rem; min-width: 2rem; border-radius: 999px; background: rgba(0, 0, 0, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(200, 155, 90, 0.25); overflow: hidden; }
.fill { position: absolute; inset: 0; transform-origin: left center; border-radius: inherit; transition: transform 0.12s linear; }
.fill.hp { background: linear-gradient(180deg, #a6e6ff, #3aa6e0); }
.fill.heat { background: linear-gradient(90deg, #ffcf86, #ff7a2e); }
.fill.bomb { background: linear-gradient(180deg, #d9bbff, #8a5ad6); }
.meter-val { font-size: 0.78rem; font-weight: 800; color: var(--text); min-width: 1.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.meter-warn, .meter-ready { display: none; }
#heatMeter.alert .meter-warn { display: inline; color: var(--danger); }
#heatMeter.alert .fill.heat { background: linear-gradient(90deg, #ff6a4a, #c01f0d); animation: pulse 0.35s infinite alternate; }
#heatMeter.alert .ic { color: var(--danger); }
#bombMeter.ready .meter-ready { display: inline; color: var(--gold); }
#bombMeter.ready .fill.bomb { background: linear-gradient(90deg, #ffe089, #ff9a3c); animation: pulse 0.6s infinite alternate; }
#bombMeter.ready .ic { color: var(--gold); }
@keyframes pulse { to { filter: brightness(1.5); } }
.tray { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 0; }
.tray:empty { display: none; }
.chip { display: inline-flex; align-items: center; justify-content: center; pointer-events: auto; }
.chip.relic { width: 1.8rem; height: 1.8rem; font-size: 0.95rem; border-radius: 7px; border: 1px solid var(--line-strong); background: rgba(13, 9, 6, 0.75); }
.chip.syn { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 800; color: #062326; background: var(--aether); box-shadow: 0 0 12px rgba(95, 219, 227, 0.35); }
.hud-run { grid-column: 3; justify-self: end; gap: 1rem; }
.stat { display: flex; align-items: center; gap: 0.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .ic { color: var(--brass); width: 1.05rem; height: 1.05rem; }
.stat b { min-width: 1.3rem; }
.stat.cogs b { color: var(--gold); }

.boss-bar { grid-column: 2; grid-row: 1; width: min(30rem, 42vw); text-align: center; padding-top: 0.2rem; animation: rise 0.4s ease; }
.boss-name { font-family: var(--display); font-weight: 700; color: var(--gold); letter-spacing: 0.12em; font-size: 0.95rem; text-shadow: 0 2px 6px #000; margin-bottom: 0.3rem; }
.boss-track { position: relative; height: 0.75rem; border-radius: 999px; overflow: hidden; background: rgba(0, 0, 0, 0.7); box-shadow: 0 0 0 1px var(--brass-dark), 0 4px 14px rgba(0, 0, 0, 0.5); }
.boss-fill { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(180deg, #ff7a5a, #b8321f); transition: transform 0.15s linear; }
.boss-bar.endboss .boss-fill { background: linear-gradient(180deg, #ff4a3a, #8e0f05); }
.boss-bar.endboss .boss-name { color: #ff9a7a; }

.announce { position: fixed; left: 0; right: 0; top: 30%; z-index: 6; text-align: center; pointer-events: none; opacity: 0; }
.announce.show { animation: announce 2.8s ease forwards; }
.announce-title { font: 800 clamp(1.8rem, 6vw, 3rem) var(--display); letter-spacing: 0.14em; color: var(--gold); text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 154, 60, 0.3); }
.announce-sub { margin-top: 0.3rem; color: var(--text); font-style: italic; text-shadow: 0 2px 6px #000; }
@keyframes announce { 0% { opacity: 0; transform: translateY(8px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }

.toasts { position: fixed; left: 50%; top: calc(6.5rem + var(--safe-top)); transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; pointer-events: none; }
.toast { padding: 0.45rem 1rem; border-radius: 999px; font-weight: 800; font-size: 0.9rem; color: var(--text); background: rgba(26, 19, 13, 0.92); border: 1px solid var(--line-strong); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); animation: toastIn 0.25s ease, toastOut 0.4s ease 2.2s forwards; white-space: nowrap; }
.toast.aether { color: #062326; background: var(--aether); border-color: var(--aether); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ===== Touch ===== */
#touch { position: fixed; inset: 0; z-index: 6; touch-action: none; }
.tstick { position: absolute; width: 6.5rem; height: 6.5rem; margin: -3.25rem 0 0 -3.25rem; border-radius: 50%; border: 2px solid rgba(200, 155, 90, 0.45); background: rgba(18, 12, 8, 0.3); pointer-events: none; }
.tstick i { position: absolute; left: 50%; top: 50%; width: 2.9rem; height: 2.9rem; margin: -1.45rem 0 0 -1.45rem; border-radius: 50%; background: rgba(236, 199, 122, 0.5); border: 2px solid var(--brass-dark); }
.tbtn { position: absolute; display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(26, 19, 13, 0.75); color: var(--gold); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.tbtn svg { width: 1.6rem; height: 1.6rem; }
.tbtn:active { background: var(--brass); color: #1d1309; }
#tdash { right: 1.1rem; bottom: calc(1.6rem + var(--safe-bottom)); }
#tbomb { right: 6rem; bottom: calc(3.6rem + var(--safe-bottom)); }
#tpause { display: none; }
body[data-input='touch'] #pauseBtn { width: 2.6rem; height: 2.6rem; }

/* ===== Schmale Bildschirme ===== */
@media (max-width: 640px) {
  .panel { padding: 1.5rem 1.1rem 1.2rem; }
  h2 { font-size: 1.45rem; }
  .list.two, .relic-list, .stat-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; gap: 0.6rem; }
  .card { flex-direction: row; text-align: left; align-items: center; gap: 0.9rem; padding: 0.9rem; }
  .card-icon { width: 3rem; height: 3rem; font-size: 1.4rem; margin: 0; flex: none; }
  .card-body { align-items: flex-start; gap: 0.15rem; }
  .card-price { padding-top: 0.2rem; }
  .setting > span { flex-basis: 7.5rem; }
  .menu-nav { display: flex; flex-wrap: wrap; }
  .nav-btn { flex: 1 1 40%; flex-direction: row; justify-content: center; gap: 0.5rem; padding: 0.75rem 0.5rem; }
  #hud { grid-template-columns: 1fr auto; gap: 0.5rem; padding: calc(0.5rem + var(--safe-top)) 0.6rem 0; }
  .hud-plate { padding: 0.45rem 0.6rem; }
  .meters { grid-template-columns: 1fr; gap: 0.3rem; }
  .hud-run { grid-column: 2; display: grid; grid-template-columns: auto auto; gap: 0.35rem 0.8rem; }
  .boss-bar { position: fixed; left: 0.6rem; right: 0.6rem; top: calc(6.6rem + var(--safe-top)); width: auto; }
  .toasts { top: calc(9rem + var(--safe-top)); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-gear, .card, .panel, .screen { animation: none; }
}
