/* =========================================================================
   WOLFGANG v2 — „Der Hof". Design-System: Kerzenlicht zu Glut.
   Warm-schwarzer Grund, eine Akzentfarbe zur Zeit (Heat-Stufe steuert Temperatur),
   Display-Serife auf der Bühne, ruhige Grotesk im Nebentext, Gold als Hof-Signatur.
   ========================================================================= */

/* Self-hosted Cormorant (optional) — siehe FONTS.md. Zum Aktivieren die 4 Zeilen
   entkommentieren und in --font-display "Cormorant" voranstellen. Ohne Datei bleibt
   ui-serif (New York) aktiv, die App sieht auf iPhone weiterhin hochwertig aus. */
/*
@font-face { font-family: "Cormorant"; src: url("assets/fonts/cormorant-subset.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
*/

:root {
  /* Grundton: fast-schwarz, warm */
  --bg: #160b0a;
  --bg-2: #1d0f0e;
  --panel: #241413;
  --panel-2: #2c1917;
  --line: #3a2320;
  --line-soft: #2a1917;

  /* Warme Parchment-Tinten */
  --ink: #f2e6d2;
  --ink-2: #d8c4a6;
  --ink-dim: #a98f74;
  --ink-faint: #7c6650;

  /* Gold — Hof-/Werben-Signatur, unabhängig von der Heat-Stufe */
  --gold: #c9973f;
  --gold-bright: #edc879;
  --gold-deep: #8a6222;
  --wax: #7a2130;
  --wax-2: #5a1622;

  /* Akzent (wird je Heat-Stufe überschrieben) */
  --accent: #c9973f;
  --accent-bright: #edc879;
  --accent-deep: #7a5620;

  /* Display-Serife: hochwertig & offline auf iOS (New York via ui-serif).
     Self-hosted Cormorant/Playfair kann hier per @font-face + Variable eingesetzt
     werden — nur diese Variable tauschen (siehe DECISIONS.md). */
  --font-display: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ui: ui-sans-serif, -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;

  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* Heat-Stufe steuert die Akzent-Farbtemperatur (weich überblendet). */
body[data-heat="1"] { --accent: #c9973f; --accent-bright: #edc879; --accent-deep: #6f4f1e; } /* Kerzenschein Gold */
body[data-heat="2"] { --accent: #d59a3a; --accent-bright: #f2cf7c; --accent-deep: #7a5418; } /* wärmeres Messing */
body[data-heat="3"] { --accent: #c9702f; --accent-bright: #efa864; --accent-deep: #6e3616; } /* Bernstein/Kupfer */
body[data-heat="4"] { --accent: #b02330; --accent-bright: #e2606a; --accent-deep: #5f1119; } /* tiefes Rot */
body[data-heat="5"] { --accent: #9a2f75; --accent-bright: #d668b0; --accent-deep: #4d143a; } /* königliches Purpur */

* { box-sizing: border-box; }
html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(201, 151, 63, .10), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .8s var(--ease);
}

/* Atmosphäre: dezenter, warmer Glow oben — folgt der Akzentfarbe. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(90% 55% at 50% -8%,
    color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
  transition: background .8s var(--ease);
}

/* Spiel-Screens: keine Textauswahl / Long-Press-Callouts. */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Layout ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding:
    calc(var(--safe-t) + 20px)
    calc(var(--safe-r) + 20px)
    calc(var(--safe-b) + 28px)
    calc(var(--safe-l) + 20px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.screen.center { justify-content: center; align-items: center; text-align: center; }
.screen.center .stack { align-items: center; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }

/* Screen-Einblendung */
.screen-enter { animation: screen-in .5s var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Typografie ---------- */
.eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-bright);
  opacity: .9;
}
.title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: .01em;
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  color: var(--ink);
}
.title.grand { font-size: clamp(42px, 13vw, 76px); font-weight: 700; }
.subtitle {
  font-family: var(--font-display);
  font-size: clamp(19px, 4.5vw, 24px);
  color: var(--ink-2);
  margin: 0;
  font-style: italic;
}
.lede { color: var(--ink-dim); font-size: 15px; margin: 0; }
.muted { color: var(--ink-dim); font-size: 14px; }
.faint { color: var(--ink-faint); font-size: 13px; }
.serif { font-family: var(--font-display); }
.name { font-family: var(--font-display); color: var(--accent-bright); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Ornamente ---------- */
.ornament { color: var(--accent); display: block; }
.ornament.crown { color: var(--gold); }
.fleuron { margin: 2px auto; opacity: .8; }

.framed { position: relative; }
.framed .corner { position: absolute; color: var(--gold); opacity: .55; width: 34px; height: 34px; }
.corner-tl { top: 8px; left: 8px; }
.corner-tr { top: 8px; right: 8px; transform: rotate(90deg); }
.corner-br { bottom: 8px; right: 8px; transform: rotate(180deg); }
.corner-bl { bottom: 8px; left: 8px; transform: rotate(270deg); }

.gold-sig { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 20px;
  cursor: pointer;
  transition: transform .08s var(--ease), border-color .2s, background .2s, box-shadow .2s;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  color: #241110;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent-bright) 60%, #fff 0%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  font-weight: 700;
}
.btn-gold {
  color: #1c1206;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid #e7cd8e;
  box-shadow: 0 10px 26px rgba(201,151,63,.3), inset 0 1px 0 rgba(255,255,255,.4);
  font-weight: 700;
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent-deep); color: var(--ink); }
.btn-quiet { background: transparent; border: none; color: var(--ink-dim); padding: 12px 14px; font-weight: 500; }
.btn-quiet:hover { color: var(--ink); }
.btn.block { width: 100%; }
.btn.lg { padding: 18px 24px; font-size: 18px; }
.btn:disabled { opacity: .4; cursor: default; }

.btn-bad { color: var(--ink-2); }
.btn-bad:hover { border-color: #6b2a2a; }

/* Kleiner runder Icon-Button (Anleitung/Menü) */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); color: var(--gold);
  cursor: pointer;
}

/* App-Kopfzeile (funktional, dezent) */
.topbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px;
}
.topbar .brand {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Segmentierte Auswahl / Toggles ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 4px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
}
.segmented button {
  appearance: none; border: none; background: transparent;
  color: var(--ink-dim); font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  padding: 10px 8px; border-radius: 9px; cursor: pointer; transition: .18s var(--ease);
}
.segmented button.on { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; }
.segmented button:disabled { opacity: .35; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--ink-dim); letter-spacing: .04em; }
.input, select.input {
  font-family: var(--font-ui); font-size: 16px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; width: 100%;
}
.input::placeholder { color: var(--ink-faint); }

/* Umschalter (an/aus) */
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.toggle .t-label { display: flex; flex-direction: column; gap: 2px; }
.toggle .t-label b { font-weight: 600; }
.switch {
  --w: 52px; width: var(--w); height: 30px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--bg-2); position: relative; cursor: pointer; transition: .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ink-dim); transition: .2s var(--ease);
}
.switch.on { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; }
.switch.on::after { left: calc(var(--w) - 25px); background: #fff; }

/* ---------- Porträts ---------- */
.portrait { position: relative; display: inline-block; }
.portrait-ring {
  border-radius: 50%; padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,235,190,.4), 0 4px 14px rgba(0,0,0,.4);
}
.portrait-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #3a2320, #180c0b);
  display: flex; align-items: center; justify-content: center;
}
.portrait-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-monogram {
  font-family: var(--font-display); font-weight: 600;
  color: var(--gold-bright); font-size: 44%; /* relativ zur Ringgröße via inline */
  line-height: 1;
}
.portrait-ring { position: relative; }
.portrait.is-active .portrait-ring {
  box-shadow: inset 0 0 0 1px rgba(255,235,190,.5), 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent), 0 6px 22px color-mix(in srgb, var(--accent) 40%, transparent);
}
.portrait-fig { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; }
.portrait-name { font-family: var(--font-display); font-size: 16px; color: var(--ink-2); }

.portrait-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.portrait-opt {
  appearance: none; border: 1px solid transparent; background: transparent; padding: 4px;
  border-radius: 50%; cursor: pointer; transition: .15s; display: flex; justify-content: center;
}
.portrait-opt.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }

/* ---------- Spielkarte ---------- */
.card-stage {
  position: relative; display: flex; justify-content: center; align-items: center;
  perspective: 1400px; padding: 8px 0;
}
/* Glow hinter der aktiven Karte in der Akzentfarbe */
.card-stage::before {
  content: ""; position: absolute; width: 78%; height: 70%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%);
  filter: blur(28px); z-index: 0; transition: background .8s var(--ease);
}

.game-card {
  position: relative; z-index: 1;
  width: min(100%, 300px); aspect-ratio: 3 / 4.2;
  border-radius: var(--radius-lg);
  transform-style: preserve-3d;
  transition: transform .5s var(--ease);
}

/* Rückseite (verdeckt) */
button.game-card {
  appearance: none; border: none; background: transparent; cursor: pointer; padding: 0;
}
.card-back {
  position: absolute; inset: 0; border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg, rgba(201,151,63,.05) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, var(--panel-2), #1a0e0d);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(201,151,63,.10);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  overflow: hidden;
}
.card-back-frame {
  position: absolute; inset: 12px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--gold-deep));
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 20%, transparent);
  pointer-events: none;
}
.card-back-label {
  font-family: var(--font-display); font-style: italic; color: var(--ink-dim); font-size: 15px;
}

/* Wachssiegel */
.wax-seal { filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.wax-body { fill: url(#wax); }
.wax-seal .wax-body { fill: var(--wax); }
.wax-seal { position: relative; }
.wax-seal .wax-crown-path { fill: color-mix(in srgb, var(--wax-2) 80%, #000); opacity: .85; }
.game-card .wax-seal { --wax: #7a2130; }
/* subtiler Glanz + Akzent-Rand am Siegel */
.card-back .wax-seal::after { content: ""; }

/* Siegelbruch + Flip beim Wählen */
.game-card.sealed:active { transform: scale(.98); }
.game-card.breaking { animation: card-flip .72s var(--ease) forwards; }
.game-card.breaking .wax-seal { animation: seal-break .5s var(--ease) forwards; transform-origin: 50% 50%; }
.game-card.breaking .card-back-label { opacity: 0; transition: opacity .2s; }
@keyframes seal-break {
  0% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.12) rotate(-4deg); }
  100% { transform: scale(1.5) rotate(8deg); opacity: 0; filter: blur(3px); }
}
@keyframes card-flip {
  0% { transform: rotateY(0) scale(1); }
  55% { transform: rotateY(-82deg) scale(1.02); }
  56% { opacity: .0; }
  100% { transform: rotateY(-90deg) scale(1.02); opacity: 0; }
}

/* Vorderseite (aufgedeckt) */
.game-card.revealed { aspect-ratio: auto; min-height: 46vh; }
.card-face {
  position: relative; height: 100%; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    linear-gradient(165deg, #2a1917, #180c0b);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow), inset 0 0 40px color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-stufe {
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .22em; font-size: 11px;
  font-weight: 700; color: var(--accent-bright);
}
.card-type { font-size: 12px; color: var(--ink-dim); letter-spacing: .08em; text-transform: uppercase; }
.card-target { font-family: var(--font-display); font-style: italic; color: var(--ink-2); font-size: 16px; }
.card-text {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(24px, 6.4vw, 34px); line-height: 1.18; color: var(--ink);
  margin: auto 0; text-wrap: balance;
}
.game-card.reveal-in { animation: reveal-in .6s var(--ease) both; }
@keyframes reveal-in {
  0% { transform: rotateY(90deg) scale(.98); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

/* Zwei-Karten-Wahl */
.choice-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch;
}
.choice-pair .card-stage { padding: 0; }
.choice-pair .game-card { width: 100%; }

/* ---------- Bote-Screen ---------- */
.bote {
  min-height: 72vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 20px;
}
.bote .caller { font-family: var(--font-display); font-style: italic; color: var(--ink-dim); font-size: 18px; }
.bote .who { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 12vw, 68px); color: var(--accent-bright); line-height: 1.02; }

/* ---------- Spielstand / Listen ---------- */
.board { display: flex; flex-direction: column; gap: 2px; }
.board-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.board-row:last-child { border-bottom: none; }
.board-row .rank { width: 22px; font-family: var(--font-display); color: var(--ink-faint); text-align: center; }
.board-row.lead .rank { color: var(--gold); }
.board-row .who { flex: 1; font-family: var(--font-display); font-size: 19px; }
.board-row .pts { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-bright); font-size: 19px; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 6px 0; }

/* Regel-Zeilen */
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-list li { list-style: none; color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.verbot {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: clamp(22px, 5.5vw, 28px); text-align: center; color: var(--accent-bright);
  padding: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 6px;
}

/* ---------- Overlay (Spielstand/Anleitung) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(12, 6, 6, .72); backdrop-filter: blur(10px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .25s var(--ease);
  padding: 0;
}
.overlay.open { opacity: 1; }
.overlay[hidden] { display: none; }
.overlay-sheet {
  width: 100%; max-width: 640px; max-height: 88dvh; overflow: auto;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 22px calc(var(--safe-r) + 20px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 20px);
  transform: translateY(20px); transition: transform .3s var(--ease);
}
.overlay.open .overlay-sheet { transform: none; }
.sheet-grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }

/* Badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--bg-2);
}
.pill.accent { color: var(--accent-bright); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

/* =========================================================================
   Phase 2 — Timer, Flammen, Glut/Joker, Kelch, Zeremonien
   ========================================================================= */

/* ---- Kerzen-Timer ---- */
.candle { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.candle-stick {
  position: relative; width: 46px; height: 150px;
  border-radius: 8px 8px 4px 4px; overflow: hidden;
  background: #241412; border: 1px solid var(--line);
  display: flex; align-items: flex-end;
}
.candle-wax {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #f3e2c0, #d8bf95 60%, #b89b6a);
  box-shadow: inset 0 6px 10px rgba(255,255,255,.35);
  transition: height .25s linear;
  position: relative;
}
.candle-wax::after { /* Docht */
  content: ""; position: absolute; top: -5px; left: 50%; width: 2px; height: 8px;
  background: #3a2a18; transform: translateX(-50%);
}
.candle-flame {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -80%);
  width: 16px; height: 26px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6cf, var(--accent-bright) 45%, var(--accent) 75%, transparent 80%);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent));
  animation: flicker 1.4s ease-in-out infinite; transition: opacity .4s;
}
@keyframes flicker {
  0%,100% { transform: translate(-50%, -80%) scale(1); opacity: 1; }
  50% { transform: translate(-52%, -84%) scale(1.06, 1.1); opacity: .9; }
}
.candle-label { font-family: var(--font-display); font-size: 30px; color: var(--ink); }
.candle.pulsing .candle-label { color: var(--accent-bright); animation: pulse-num .5s ease-in-out infinite; }
.candle.pulsing .candle-flame { animation: flicker .3s ease-in-out infinite; }
@keyframes pulse-num { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.candle.spent .candle-label { color: var(--ink-faint); }

/* ---- Flammen-Bewertung ---- */
.flammen { display: flex; justify-content: center; gap: 14px; }
.flame-btn {
  appearance: none; background: transparent; border: none; cursor: pointer;
  width: 64px; height: 76px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; transition: transform .1s var(--ease), background .2s;
}
.flame-btn svg { width: 40px; height: 48px; color: #6b5236; transition: color .2s, filter .2s, transform .2s; }
.flame-btn { border: 1px solid transparent; }
.flame-btn:active { transform: scale(.94); }
.flame-btn.lit svg { color: var(--accent); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent)); }
.flame-btn.lit.hot svg { color: var(--accent-bright); }
.flammen-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); padding: 0 8px; }

/* ---- Glut / Joker Statusreihe ---- */
.status-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.glut-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.glut-toggle.on {
  border-color: transparent; color: #2a1004;
  background: linear-gradient(180deg, #f2a24a, #c9702f);
  box-shadow: 0 0 20px color-mix(in srgb, #c9702f 55%, transparent);
}
.ember { width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd28a, #d8641f 60%, #7a2a0c);
  box-shadow: 0 0 8px #d8641f; }

/* Marker am Porträt (Glut/Joker/Anspruch) */
.portrait .badge-glut, .portrait .badge-joker {
  position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  border: 1px solid #1a0d0b;
}
.portrait .badge-glut { background: radial-gradient(circle at 40% 35%, #ffd28a, #d8641f 65%); }
.portrait .badge-joker { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #24160a; }

/* ---- Glanz-Wette ---- */
.wette-box { text-align: center; }
.wette-choices { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.wette-choices .btn { min-width: 120px; }

/* ---- Kelch ---- */
.kelch { min-height: 74vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.chalice svg { width: 120px; height: 120px; color: var(--accent); filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent)); }

/* ---- Zeremonien (Halbzeit / Krönung / Schluss) ---- */
.ceremony { min-height: 76vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.curtain-in { animation: curtain .8s var(--ease) both; }
@keyframes curtain { 0% { opacity: 0; transform: scale(1.04); } 100% { opacity: 1; transform: none; } }

.crown-burst { position: relative; }
.crown-burst::before {
  content: ""; position: absolute; inset: -40px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  animation: burst 1.2s var(--ease) both; z-index: -1;
}
@keyframes burst { 0% { transform: scale(.3); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1.3); opacity: .5; } }
.winner-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(46px, 15vw, 92px); color: var(--accent-bright); line-height: 1; }

.stat-grid { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; max-width: 380px; }
.stat-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.stat-item .k { color: var(--ink-dim); font-size: 14px; }
.stat-item .v { font-family: var(--font-display); color: var(--accent-bright); }

.schluss-verbot {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: clamp(34px, 9vw, 60px); color: var(--accent-bright); line-height: 1.05;
  text-wrap: balance;
}

/* ---- Offene Wahl (zwei lesbare Karten) ---- */
.choice-open { display: flex; flex-direction: column; gap: 14px; margin: 6px 0; }
button.game-card.open-card {
  appearance: none; width: 100%; aspect-ratio: auto; min-height: 0;
  border: none; padding: 0; cursor: pointer; text-align: left;
  transition: transform .12s var(--ease);
}
.open-card .card-face { padding: 18px 18px; min-height: 0; }
.open-card .card-text.open { font-size: clamp(19px, 4.8vw, 24px); margin: 8px 0 0; }
.open-card { opacity: .82; transition: opacity .2s, transform .12s var(--ease); }
.open-card.selected { opacity: 1; }
.open-card.selected .card-face {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow), inset 0 0 40px color-mix(in srgb, var(--accent) 16%, transparent);
}
.open-card:active { transform: scale(.99); }

/* ---- Fortschrittsleiste ---- */
.progress { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.progress-track { height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright)); transition: width .4s var(--ease); }
.progress-label { font-size: 11px; letter-spacing: .04em; color: var(--ink-faint); text-align: center; }

/* ---- Punkte-Tafel ---- */
.tafel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tafel-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.tafel-row:last-child { border-bottom: none; }
.tafel-row .t-k { color: var(--ink-2); }
.tafel-row .t-v { font-family: var(--font-display); color: var(--accent-bright); white-space: nowrap; }
.tafel-row.minus .t-v { color: #e2606a; }

/* ---- Zwischenstand-Zeilen ---- */
.stand-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.stand-row:last-child { border-bottom: none; }
.stand-row .s-rank { width: 20px; text-align: center; font-family: var(--font-display); color: var(--ink-faint); }
.stand-row.lead .s-rank { color: var(--gold); }
.stand-row .s-name { flex: 1; font-family: var(--font-display); font-size: 17px; }
.stand-row .s-meta { font-size: 12px; color: var(--ink-dim); }
.stand-row .s-pts { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-bright); min-width: 34px; text-align: right; }

/* ---- Siegerwunsch-Eingabe ---- */
.wish-area {
  width: 100%; max-width: 440px; min-height: 96px; resize: none;
  font-family: var(--font-display); font-size: 22px; line-height: 1.3; text-align: center;
  color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.wish-area::placeholder { color: var(--ink-faint); font-style: italic; }
.wish-big { font-family: var(--font-display); font-style: italic; font-size: clamp(26px, 6.5vw, 40px); color: var(--accent-bright); text-wrap: balance; }

/* ---- Der Hof (Phase 3) ---- */
.hof-auftritt, .tribut-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--font-ui); font-size: 15px; transition: .15s var(--ease);
}
.hof-auftritt:not(:disabled):active, .tribut-row:not(:disabled):active { transform: scale(.99); }
.hof-auftritt.awarded { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); opacity: .8; }
.hof-auftritt:disabled, .tribut-row:disabled { opacity: .4; cursor: default; }
.tribut-row.selected { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }

/* Partner-Auswahl (Casting/Choice) */
.partner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0; }
.partner-opt {
  appearance: none; background: transparent; border: 1px solid transparent; border-radius: 16px;
  padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.partner-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Anspruch-Siegel am Porträt */
.portrait .badge-anspruch {
  position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, #a83a48, var(--wax) 65%, #4a1119);
  border: 1px solid #1a0d0b; box-shadow: 0 0 8px color-mix(in srgb, var(--wax) 70%, transparent);
  color: #f0d9b0; font-size: 11px;
}

.switch.disabled { opacity: .4; pointer-events: none; }

/* ---- Werkstatt / Editor (Phase 4) ---- */
.werk-tile {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  transition: border-color .2s, transform .08s var(--ease);
}
.werk-tile:active { transform: translateY(1px); }
.werk-tile:hover { border-color: var(--accent-deep); }
.chip {
  appearance: none; text-align: left; cursor: pointer; font-family: var(--font-ui); font-size: 14px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink-2); transition: .15s;
}
.chip.on { border-color: transparent; background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; }
textarea.input { width: 100%; font-family: var(--font-ui); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .05s !important; }
}
