:root {
  --bg: #120c08;
  --bg-alt: rgba(40, 28, 18, 0.85);
  --panel: #22170f;
  --panel-alt: #2e2015;
  --border: rgba(217, 179, 106, 0.26);
  --text: #f5ebd6;
  --text-dim: #bfae92;
  --gold: #d9b36a;
  --gold-bright: #f4d58d;
  --accent: #c8963e;
  --accent-dark: #7a5518;
  --danger: #c0392b;
  --success: #3ecf8e;
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 70% 38% at 50% 0%, rgba(255, 168, 92, 0.32), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 110%, rgba(20, 60, 70, 0.45), transparent 60%),
    linear-gradient(180deg, #3b2418 0%, #22160f 38%, #140d09 70%, #0d0906 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3 { margin: 0 0 0.4em 0; font-family: var(--serif); }
.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 14px;
}
#screen-home, #screen-lobby { align-items: center; min-height: 100vh; }
#screen-home { flex-direction: column; gap: 14px; }
#screen-game { display: block; padding: 0; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; position: relative; }

/* Startseite und Lobby: dieselben Glas-Panels wie das Spiel-HUD */
body::before {
  content: ''; position: fixed; inset: auto 0 0 0; height: 38vh; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 200, 140, 0.035) 0 2px, transparent 2px 14px);
  mask-image: linear-gradient(180deg, transparent, #000 40%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%);
}
.screen { position: relative; z-index: 1; }
.card {
  background: linear-gradient(180deg, rgba(34, 24, 15, 0.86), rgba(20, 14, 9, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 240, 210, 0.06) inset;
}
.home-card { text-align: center; }
.home-card h1 { font-size: 2.3rem; color: var(--gold-bright); text-shadow: 0 0 18px rgba(217,179,106,0.45); }
.subtitle { color: var(--text-dim); margin-bottom: 20px; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 14px; }
.eyebrow { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--text-dim); cursor: pointer; font-weight: 600;
}
.tab-btn.active { background: linear-gradient(180deg, #f0cd84, #c8963e); color: #1a1205; border-color: #f0cd84; }
.tab-panel label { display: block; font-size: 0.8rem; color: var(--text-dim); margin: 12px 0 4px; }

input, select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--text); font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid rgba(233, 196, 122, 0.7); outline-offset: 1px; }
input::placeholder { color: rgba(191, 174, 146, 0.55); }
.player-list li { backdrop-filter: none; }
input[type="checkbox"] { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-alt); color: var(--text); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: transform 0.05s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #f0cd84 0%, #d6a44f 55%, #b3833a 100%); border-color: #f0cd84; color: #24170a; width: 100%; margin-top: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 230, 170, 0.25) inset; }
.btn.primary:hover { filter: none; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 18px rgba(240, 205, 132, 0.45); }
.btn.secondary { background: linear-gradient(180deg, #5a4024, #3a2816); border-color: rgba(217, 179, 106, 0.45); color: var(--text); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: white; }

.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(24, 17, 11, 0.92); border: 1px solid rgba(233, 196, 122, 0.6); color: var(--text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 10px 18px; border-radius: 10px; z-index: 999;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); max-width: 90vw; text-align: center;
}

/* ---------------- Lobby ---------------- */
.lobby-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.room-code { font-size: 1.8rem; font-weight: 700; letter-spacing: 0.12em; color: var(--gold-bright); }
.room-code.small { font-size: 1rem; }
.player-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--border);
}
.player-list li.disconnected { opacity: 0.5; }
.player-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tag { font-size: 0.68rem; padding: 2px 6px; border-radius: 6px; background: var(--panel-alt); color: var(--text-dim); }
.tag.host { background: var(--gold); color: #241a05; }
.remove-bot-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer;
}
.remove-bot-btn.confirm { background: var(--danger); color: white; border-color: var(--danger); width: auto; padding: 0 10px; font-size: 0.8rem; white-space: nowrap; }
.bot-controls { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.lobby-settings { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.lobby-settings label { font-size: 0.85rem; color: var(--text-dim); }
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text) !important; }

/* ---------------- Charakter-Editor ---------------- */
.lobby-layout { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; width: 100%; }
.lobby-layout > .card { flex: 1 1 380px; max-width: 460px; }
.editor-card { padding: 20px 22px; }
.editor-head { display: flex; justify-content: space-between; align-items: center; }
.editor-head h3 { margin: 0; }
.av-preview { position: relative; height: 260px; margin: 8px -6px 0; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #f6c89a 0%, #d98f62 45%, #4a2e1e 100%); border: 1px solid var(--border); }
.preview-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.av-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5rem; }
.drag-hint { text-align: center; margin: 4px 0 10px; font-size: 0.75rem; }
.av-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.av-label { flex: 0 0 92px; font-size: 0.82rem; color: var(--text-dim); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); cursor: pointer; padding: 0; position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
.swatch.sel { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(244,213,141,0.45); transform: scale(1.1); }
.swatch.none { background: repeating-linear-gradient(45deg, #3a2a1c 0 4px, #24190f 4px 8px); }
.swatch.none::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--text-dim); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text-dim); font-size: 0.8rem; cursor: pointer; font-weight: 600; }
.seg button.sel { background: var(--accent); border-color: var(--gold); color: #1a1205; }
.player-list .duck-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255,255,255,0.3); flex: 0 0 auto; }

/* =====================================================================
   SPIEL-HUD – schwebende Overlay-Elemente über der 3D-Szene
   ===================================================================== */
:root {
  --hud-bg: rgba(22, 16, 11, 0.74);
  --hud-bg-strong: rgba(18, 13, 9, 0.86);
  --hud-line: rgba(217, 179, 106, 0.28);
  --hud-line-strong: rgba(233, 196, 122, 0.7);
  --hud-cream: #f5ebd6;
  --hud-muted: #bfae92;
  --hud-gold: #e3b765;
  --hud-gold-soft: rgba(227, 183, 101, 0.18);
  --hud-red: #b3261e;
  --hud-red-dark: #6e1510;
  --hud-radius: 14px;
  --hud-gap: clamp(8px, 1.1vw, 18px);
  --hud-shadow: 0 8px 28px rgba(0, 0, 0, 0.38), 0 1px 0 rgba(255, 240, 210, 0.06) inset;
  --hud-ease: cubic-bezier(.2, .8, .2, 1);
}
/* Große Bildschirme: die HUD-Bausteine als Ganzes vergrößern (px-Maße wachsen mit) */
@media (min-width: 1800px) and (min-height: 900px) { :root { --hud-zoom: 1.15; } }
@media (min-width: 2300px) and (min-height: 1200px) { :root { --hud-zoom: 1.4; } }
@media (min-width: 3200px) and (min-height: 1700px) { :root { --hud-zoom: 1.85; } }
.crew-panel, .hud-nav, .hud-side, .action-dock { zoom: var(--hud-zoom, 1); }
.bid-badge { font-size: calc(1em * var(--hud-zoom, 1)); white-space: nowrap; width: max-content; }

#screen-game { font-size: 16px; }
.stage { position: absolute; inset: 0; overflow: hidden; background: #f0b58a; }
.canvas-host { position: absolute; inset: 0; }
.scene3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; transition: opacity 0.35s ease; cursor: grab; }
.scene3d-canvas:active { cursor: grabbing; }

/* Glas-Panel (Basis für alle HUD-Flächen) */
.hud-panel {
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  border-radius: var(--hud-radius);
  box-shadow: var(--hud-shadow);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  color: var(--hud-cream);
}
.hud-label { font: 700 0.66em/1 "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hud-muted); }

/* ---- Buttons ---- */
.icon-btn, .hud-btn, .step-btn, .liar-btn, .face-btn {
  font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform 0.12s var(--hud-ease), box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.icon-btn:disabled, .hud-btn:disabled, .step-btn:disabled, .face-btn:disabled { opacity: 0.32; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn {
  position: relative; width: 2.5em; height: 2.5em; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1em; line-height: 1; color: var(--hud-cream);
  background: var(--hud-bg); border: 1px solid var(--hud-line); box-shadow: var(--hud-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.icon-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--hud-line-strong); box-shadow: var(--hud-shadow), 0 0 14px var(--hud-gold-soft); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn.on { border-color: var(--hud-line-strong); background: rgba(80, 58, 28, 0.8); }
.icon-leave { color: #f0b3a8; }
.icon-leave:hover { border-color: rgba(220, 90, 70, 0.7) !important; box-shadow: var(--hud-shadow), 0 0 14px rgba(200, 60, 40, 0.3) !important; }

.hud-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  padding: 0.62em 1.05em; border-radius: 12px; font-weight: 700; font-size: 0.9em; color: var(--hud-cream);
  background: var(--hud-bg); border: 1px solid var(--hud-line); box-shadow: var(--hud-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--hud-line-strong); box-shadow: var(--hud-shadow), 0 0 16px var(--hud-gold-soft); }
.hud-btn:active:not(:disabled) { transform: scale(0.96); }
.hud-btn.secondary.on { background: rgba(92, 66, 30, 0.86); border-color: var(--hud-line-strong); }
.hud-btn.primary {
  color: #24170a; border-color: #f0cd84;
  background: linear-gradient(180deg, #f0cd84 0%, #d6a44f 55%, #b3833a 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 230, 170, 0.25) inset;
}
.hud-btn.primary:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 18px rgba(240, 205, 132, 0.45); }
.hud-btn.spot { color: #eaf7ee; background: linear-gradient(180deg, #2f6e4c, #1c4430); border-color: rgba(120, 200, 150, 0.5); }
.hud-btn.small { font-size: 0.78em; padding: 0.5em 0.85em; }

/* Tooltip */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 60;
    font: 600 12px/1.2 "Segoe UI", Arial, sans-serif; color: var(--hud-cream);
    background: var(--hud-bg-strong); border: 1px solid var(--hud-line); animation: tip-in 0.15s ease;
  }
  .hud-side [data-tip]:hover::after, .action-dock [data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); }
  .hud-nav [data-tip]:last-child:hover::after { left: auto; right: 0; transform: none; }
}
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- Oben rechts: Navigation ---- */
.hud-nav {
  position: absolute; top: calc(var(--hud-gap) + env(safe-area-inset-top)); right: var(--hud-gap); z-index: 40;
  display: flex; gap: 6px;
}

/* ---- Lautstärke-Regler (klappt unter dem Ton-Symbol auf) ---- */
.volume-pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 230px; padding: 12px 14px; z-index: 70;
  display: flex; flex-direction: column; gap: 10px; animation: panel-in 0.2s var(--hud-ease);
}
.vol-head { display: flex; justify-content: space-between; align-items: baseline; }
.vol-value { font: 700 0.85em "Segoe UI", Arial, sans-serif; color: var(--hud-gold); }
.volume-pop.muted .vol-value { color: var(--hud-muted); }
.vol-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; padding: 0; border: 0; border-radius: 3px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--hud-gold) 0 var(--fill, 80%), rgba(255, 240, 210, 0.16) var(--fill, 80%) 100%);
}
.volume-pop.muted .vol-range { filter: grayscale(1) brightness(0.8); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #f0cd84; border: 2px solid #3a2410; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.vol-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #f0cd84; border: 2px solid #3a2410; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.vol-range:focus-visible { outline: 2px solid rgba(233, 196, 122, 0.7); outline-offset: 4px; }
.volume-pop .hud-btn { align-self: flex-start; }

@media (hover: hover) { .hud-nav .icon-btn.on[data-tip]:hover::after { display: none; } }

.settings-pop { width: 260px; }
.q-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.q-seg button { padding: 7px 0; border-radius: 9px; border: 1px solid var(--hud-line); background: rgba(255, 240, 210, 0.05); color: var(--hud-muted); font: 700 0.78em "Segoe UI", Arial, sans-serif; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.q-seg button:hover { border-color: var(--hud-line-strong); color: var(--hud-cream); }
.q-seg button.sel { background: linear-gradient(180deg, #f0cd84, #c8963e); border-color: #f0cd84; color: #24170a; }
.q-hint { margin: 0; font-size: 0.74em; line-height: 1.35; color: var(--hud-muted); }

/* Schmale Handys: Symbolleiste etwas kompakter, Raum-Code in der eingeklappten Crew ausblenden */
@media (max-width: 480px) {
  .hud-nav { gap: 4px; }
  .hud-nav .icon-btn { width: 2.25em; height: 2.25em; font-size: 0.95em; }
  .crew-panel.collapsed .room-tag { display: none; }
  .crew-panel.collapsed { max-width: calc(100vw - 6 * 2.2em - 6 * 4px - 3 * var(--hud-gap)); }
  .crew-panel.collapsed .round-badge .sub { display: none; }
  .volume-pop, .settings-pop { right: -2px; width: min(260px, calc(100vw - 24px)); }
}

/* ---- Zuschauen ---- */
.spect-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; animation: panel-in 0.3s var(--hud-ease); }
.spect-name { min-width: 7em; text-align: center; font-weight: 700; color: var(--hud-cream); white-space: nowrap; }
.spect-dice { display: inline-flex; gap: 4px; }
.spect-dice .die { --s: 22px; }
.spect-bar .step-btn { width: 2em; height: 2em; }
.crew-row.watcher { opacity: 0.72; font-style: italic; }
.crew-row.watcher .pips { font-size: 0.8em; color: var(--hud-muted); }
.crew-row .fdice { display: inline-flex; gap: 2px; }
.crew-row .fdice .die { --s: 14px; border-radius: 3px; }
@media (max-width: 720px) { .spect-bar { gap: 6px; padding: 6px 8px; } .spect-name { min-width: 5em; font-size: 0.9em; } .spect-dice .die { --s: 18px; } }

/* ---- Oben links: Runde + Crew ---- */
.crew-panel {
  position: absolute; top: calc(var(--hud-gap) + env(safe-area-inset-top)); left: var(--hud-gap); z-index: 30;
  width: clamp(190px, 15vw, 250px); padding: 10px 10px 8px; max-height: calc(100% - 200px); overflow-y: auto;
}
.crew-panel.collapsed .crew-list { display: none; }
.crew-panel.collapsed { width: auto; padding-bottom: 10px; }
.crew-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 8px; }
.crew-panel.collapsed .crew-head { padding-bottom: 0; }
.round-badge { font: 700 0.95em var(--serif); color: var(--hud-gold); white-space: nowrap; }
.round-badge .sub { font: 600 0.72em "Segoe UI", Arial, sans-serif; color: var(--hud-muted); letter-spacing: 0.02em; margin-left: 4px; }
.room-tag { font: 700 0.66em "Segoe UI", Arial, sans-serif; letter-spacing: 0.14em; color: var(--hud-muted); opacity: 0.8; }
.crew-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.crew-row {
  display: grid; grid-auto-flow: column; grid-template-columns: 12px minmax(0, 1fr); grid-auto-columns: auto; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; font-size: 0.84em;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.crew-row .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 240, 210, 0.18); }
.crew-row .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-row .nm small { font-weight: 500; color: var(--hud-muted); margin-left: 4px; font-size: 0.85em; }
.crew-row .pips { display: inline-flex; align-items: center; gap: 3px; }
.crew-row .pip { width: 7px; height: 7px; border-radius: 2px; background: #efe3c6; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.crew-row .pip.lost { background: transparent; box-shadow: 0 0 0 1px rgba(239, 227, 198, 0.3); }
.crew-row .peek { font-size: 0.8em; margin-right: 2px; opacity: 0.85; }
.crew-row.turn { background: rgba(227, 183, 101, 0.12); border-color: rgba(227, 183, 101, 0.55); box-shadow: 0 0 14px rgba(227, 183, 101, 0.18); }
.crew-row.turn .nm { color: #ffe6b0; }
.crew-row.me .nm::after { content: ' · du'; color: var(--hud-muted); font-weight: 500; font-size: 0.85em; }
.crew-row.out { opacity: 0.4; }
.crew-row.out .nm { text-decoration: line-through; }
.crew-row.out .pips::before { content: '☠'; font-size: 0.9em; }

/* ---- Gebots-Badge (schwebt über dem Bieter) ---- */
.bid-badge {
  position: absolute; left: 0; top: 0; z-index: 25; pointer-events: none;
  transform: translate(-50%, -100%); will-change: transform;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px 7px; border-radius: 12px;
  background: var(--hud-bg-strong); border: 1px solid var(--hud-line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 16px rgba(227, 183, 101, 0.18);
  color: var(--hud-cream);
}
.bid-badge::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  background: var(--hud-bg-strong); border-right: 1px solid var(--hud-line-strong); border-bottom: 1px solid var(--hud-line-strong);
}
.bid-badge.no-tail::after { display: none; }
.bid-badge .who { font: 600 0.68em "Segoe UI", Arial, sans-serif; color: var(--hud-muted); letter-spacing: 0.04em; white-space: nowrap; }
.bid-badge .val { display: flex; align-items: center; gap: 6px; font: 800 1.35em/1 var(--serif); }
.bid-badge .val .die { --s: 1.05em; }
.bid-badge .inner { display: contents; }
.bid-badge.pop { animation: badge-pop 0.55s var(--hud-ease); }
@keyframes badge-pop {
  0% { opacity: 0; margin-top: 10px; scale: 0.8; box-shadow: 0 0 0 rgba(227, 183, 101, 0); }
  55% { opacity: 1; margin-top: 0; scale: 1.06; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 28px rgba(227, 183, 101, 0.55); }
  100% { scale: 1; }
}

/* ---- Unten links: Nebenaktionen ---- */
.hud-side {
  position: absolute; left: var(--hud-gap); bottom: calc(var(--hud-gap) + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; gap: 6px; align-items: center;
}

/* ---- Unten mittig: Status + Aktionen ---- */
.action-dock {
  position: absolute; left: 50%; bottom: calc(var(--hud-gap) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 2 * var(--hud-gap));
}
.dock-row { display: flex; align-items: stretch; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px; min-height: 2.4em;
  font-size: 0.86em; max-width: 100%;
}
.status-pill.solo { padding-left: 14px; }
.status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--hud-cream); }
.status-text b { color: var(--hud-gold); font-weight: 700; }
.status-pill.mine { border-color: var(--hud-line-strong); box-shadow: var(--hud-shadow), 0 0 16px rgba(227, 183, 101, 0.22); }
.host-controls { display: flex; gap: 6px; }
.host-controls:empty { display: none; }

/* Zug-Timer als Ring */
.turn-ring { position: relative; width: 1.9em; height: 1.9em; flex: 0 0 auto; }
.turn-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.turn-ring circle { fill: none; stroke-width: 3; }
.turn-ring .track { stroke: rgba(255, 240, 210, 0.14); }
.turn-ring .prog { stroke: var(--hud-gold); stroke-linecap: round; stroke-dasharray: 97.4; transition: stroke-dashoffset 0.2s linear, stroke 0.3s; }
.turn-ring.low .prog { stroke: #e0553f; }
.turn-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 0.62em "Segoe UI", Arial, sans-serif; color: var(--hud-cream); font-variant-numeric: tabular-nums; }

/* Gebotspanel */
.bid-panel { display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 20px; animation: panel-in 0.35s var(--hud-ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.bid-main { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 6.4em; }
.bid-preview { display: flex; align-items: center; gap: 8px; font: 800 2.1em/1 var(--serif); color: #fff3da; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.bid-preview .die { --s: 1em; }
.bid-preview.bump { animation: bump 0.22s var(--hud-ease); }
@keyframes bump { 50% { transform: scale(1.08); } }
.bid-inputs { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; row-gap: 8px; padding: 0 16px; border-left: 1px solid var(--hud-line); border-right: 1px solid var(--hud-line); }
.face-row { display: flex; gap: 5px; }
.face-btn { border: 1px solid transparent; background: rgba(255, 240, 210, 0.04); padding: 4px; border-radius: 10px; line-height: 0; }
.face-btn .die { --s: 1.75em; }
.face-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--hud-line); }
.face-btn:active:not(:disabled) { transform: scale(0.93); }
.face-btn.sel { border-color: var(--hud-gold); background: rgba(227, 183, 101, 0.16); box-shadow: 0 0 14px rgba(227, 183, 101, 0.35); }
.qty-stepper { display: inline-flex; align-items: center; gap: 4px; }
.step-btn {
  width: 2.1em; height: 2.1em; border-radius: 10px; font-size: 1em; font-weight: 700; color: var(--hud-cream);
  background: rgba(255, 240, 210, 0.06); border: 1px solid var(--hud-line);
}
.step-btn:hover:not(:disabled) { border-color: var(--hud-line-strong); background: rgba(255, 240, 210, 0.1); }
.step-btn:active:not(:disabled) { transform: scale(0.9); }
.qty-value { min-width: 2.2ch; text-align: center; font: 800 1.3em var(--serif); color: #fff3da; font-variant-numeric: tabular-nums; }
.bid-go { font-size: 1.02em; padding: 0.85em 1.4em; align-self: stretch; }

/* Lügner! – die wichtigste Gegenaktion */
.call-controls { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.liar-btn {
  position: relative; min-width: 7.2em; padding: 0.7em 1.3em; border-radius: 16px;
  font: 800 1.45em/1 var(--serif); letter-spacing: 0.02em; color: #fff4ea;
  background: radial-gradient(120% 140% at 50% 0%, #d23a2f 0%, #9c1f17 55%, var(--hud-red-dark) 100%);
  border: 1px solid rgba(255, 150, 130, 0.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 22px rgba(200, 45, 30, 0.38), 0 1px 0 rgba(255, 220, 200, 0.35) inset;
  text-shadow: 0 2px 6px rgba(60, 0, 0, 0.6);
}
.liar-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 34px rgba(220, 60, 40, 0.6), 0 1px 0 rgba(255, 220, 200, 0.35) inset; }
.liar-btn:active { transform: scale(0.95); }
.liar-btn.impact { animation: liar-impact 0.42s var(--hud-ease); }
@keyframes liar-impact {
  0% { transform: scale(0.92); }
  25% { transform: scale(1.06) rotate(-2deg); }
  45% { transform: scale(1.02) rotate(2deg); }
  65% { transform: rotate(-1deg); }
  100% { transform: none; }
}

/* Eigene Würfel beim Nachschauen */
.peek-hud { display: flex; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--hud-bg); border: 1px solid var(--hud-line); box-shadow: var(--hud-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: panel-in 0.25s var(--hud-ease); }
.peek-hud .die { --s: 2.1em; }

/* Würfel-Symbol (HTML) */
.die {
  --s: 38px; width: var(--s); height: var(--s); border-radius: 22%;
  background: radial-gradient(circle at 40% 35%, #fbf4e0, #d9c9a2); position: relative;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), 0 2px 5px rgba(0,0,0,0.4);
  display: inline-block; flex: 0 0 auto;
}
.die i { position: absolute; width: 19%; height: 19%; border-radius: 50%; background: #1c130b; transform: translate(-50%, -50%); }
.die.v1 i { background: #9a1a1a; width: 26%; height: 26%; }
.die.match { box-shadow: 0 0 0 3px var(--gold-bright), 0 0 14px 3px rgba(244,213,141,0.8); }
.die.dim { filter: brightness(0.5); }
.die.sm { --s: 22px; }

/* Aufdeck-Ergebnis (oben mittig) */
.banner {
  padding: 10px 20px 12px; text-align: center; max-width: min(92vw, 34em); animation: panel-in 0.35s var(--hud-ease);
}
.banner .big { font: 700 1.4em var(--serif); color: #fff0d0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.banner .big .die { --s: 1.1em; }
.banner .small { font-size: 0.8em; color: var(--hud-muted); margin-top: 4px; }
.banner .next-up { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hud-line); font-size: 0.82em; color: var(--hud-gold); }
.banner .next-up b { color: #ffe6b0; }
.banner.good { border-color: rgba(110, 200, 140, 0.6); }
.banner.bad { border-color: rgba(224, 107, 91, 0.7); }

/* "Du bist dran" – Bildschirmrand leuchtet kurz auf; letzte Sekunden sanft rot */
.turn-flash { position: absolute; inset: 0; pointer-events: none; z-index: 11; }
.turn-flash.flash { animation: edge-flash 1.2s ease-out 1; }
.turn-flash.hurry { animation: edge-hurry 1.6s ease-in-out infinite; }
@keyframes edge-flash {
  0% { box-shadow: inset 0 0 0 0 rgba(227,183,101,0); }
  30% { box-shadow: inset 0 0 70px 10px rgba(227,183,101,0.55); }
  100% { box-shadow: inset 0 0 0 0 rgba(227,183,101,0); }
}
@keyframes edge-hurry {
  0%, 100% { box-shadow: inset 0 0 30px 2px rgba(200,60,40,0.12); }
  50% { box-shadow: inset 0 0 60px 8px rgba(200,60,40,0.32); }
}

@media (prefers-reduced-motion: reduce) {
  .bid-badge.pop, .bid-panel, .liar-btn.impact, .banner, .peek-hud, .bid-preview.bump, .volume-pop, .spect-bar { animation: none; }
  .turn-flash.hurry { animation: none; }
}

/* Kleinere Bildschirme: Gebotspanel kompakter */
@media (max-width: 1100px) {
  .bid-panel { gap: 12px; padding: 10px 10px 10px 14px; }
  .bid-inputs { padding: 0 12px; }
  .face-btn .die { --s: 1.55em; }
  .bid-preview { font-size: 1.8em; }
  .liar-btn { font-size: 1.25em; min-width: 6em; }
}
@media (max-width: 860px) {
  .dock-row { flex-direction: column; align-items: stretch; }
  .call-controls { flex-direction: row; }
  .liar-btn { flex: 1; }
}
@media (max-width: 720px) {
  :root { --hud-gap: 8px; }
  .crew-panel { width: auto; max-width: 60vw; font-size: 0.92em; }
  .icon-btn { width: 2.3em; height: 2.3em; border-radius: 10px; }
  .hud-nav { gap: 4px; }
  .hud-side { bottom: auto; top: calc(var(--hud-gap) + 2.3em + 8px + env(safe-area-inset-top)); right: var(--hud-gap); left: auto; flex-direction: column; align-items: flex-end; }
  .hud-side .hud-btn .lbl { display: none; }
  .hud-side .hud-btn { width: 2.3em; height: 2.3em; padding: 0; border-radius: 10px; }
  .action-dock { width: calc(100% - 2 * var(--hud-gap)); }
  .bid-panel { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px 12px; width: 100%; }
  .bid-main { flex-direction: row; justify-content: flex-start; gap: 10px; min-width: 0; }
  .bid-preview { font-size: 1.55em; }
  .bid-inputs { grid-column: 1 / -1; grid-row: 2; border: 0; padding: 0; column-gap: 8px; }
  .bid-go { grid-column: 2; grid-row: 1; padding: 0.6em 1.2em; }
  .face-row { gap: 4px; }
  .face-btn .die { --s: 1.7em; }
  .status-pill { font-size: 0.8em; }
  .banner { font-size: 0.9em; }
}

/* 2D-Fallback */
.flat-table { position: absolute; inset: 0; padding-top: 70px !important; padding-bottom: 200px !important; display: flex; flex-wrap: wrap; gap: 10px; align-content: center; justify-content: center; padding: 12px; background: radial-gradient(circle, #6b4526 0%, #3a2412 70%); }
.flat-seat { background: rgba(8,16,24,0.7); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-width: 150px; text-align: center; }
.flat-seat.turn { border-color: var(--gold-bright); box-shadow: 0 0 12px rgba(244,213,141,0.5); }
.flat-seat .row { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.flat-seat .bubble { margin-top: 6px; color: var(--gold-bright); font-weight: 700; display: flex; gap: 4px; justify-content: center; align-items: center; }

/* ---------------- Modals ---------------- */
.modal { position: fixed; inset: 0; background: rgba(8,5,2,0.55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 14px; }
.modal-content { position: relative; background: rgba(24, 18, 12, 0.92); border: 1px solid rgba(217,179,106,0.3); border-radius: 16px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.modal-close { position: absolute; top: 10px; right: 10px; }
.rules-text h3 { margin-top: 1em; color: var(--gold-bright); font-size: 0.98rem; }
kbd { display: inline-block; min-width: 1.5em; padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(217, 179, 106, 0.45); border-bottom-width: 2px; background: rgba(255, 240, 210, 0.07); font: 700 0.8em "Segoe UI", Arial, sans-serif; color: var(--text); text-align: center; }
.rules-text p.keys { line-height: 2; }
.rules-text p { font-size: 0.88rem; line-height: 1.45; color: var(--text); margin: 0.3em 0; }
.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.log-list li { padding: 5px 10px; background: rgba(255, 240, 210, 0.05); border: 1px solid rgba(227, 183, 101, 0.12); border-radius: 8px; color: var(--hud-cream, #f3e6c8); }
/* Siegerbildschirm als Schriftrolle (seitlich, damit die jubelnde Ente sichtbar bleibt) */
#result-modal { background: linear-gradient(90deg, transparent 40%, rgba(8, 5, 2, 0.35)); justify-content: flex-end; padding: 24px clamp(14px, 4vw, 64px); }
.result-content {
  max-width: 400px; text-align: center; color: #3a2412; overflow: visible;
  background: linear-gradient(90deg, #d8bf8c 0%, #f3e3bd 12%, #f7ead0 50%, #f3e3bd 88%, #d8bf8c 100%);
  border: 0; border-radius: 6px; padding: 30px 26px 24px; backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(140, 90, 30, 0.25);
  animation: scroll-open 0.7s var(--hud-ease) both;
}
.result-content::before, .result-content::after {
  content: ''; position: absolute; left: -14px; right: -14px; height: 20px; border-radius: 10px;
  background: linear-gradient(180deg, #8a5a2c 0%, #5a3818 50%, #3a2410 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.result-content::before { top: -10px; }
.result-content::after { bottom: -10px; }
@keyframes scroll-open { from { clip-path: inset(48% -20px 48% -20px); opacity: 0.4; } to { clip-path: inset(-20px -20px -20px -20px); opacity: 1; } }
.result-title { color: #7a1e12; font-size: 1.7rem; }
.result-crown { font-size: 2.6rem; }
.placements { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.placements li { display: flex; gap: 10px; padding: 6px 10px; border-radius: 6px; background: rgba(120, 80, 30, 0.1); border-bottom: 1px dashed rgba(90, 56, 24, 0.3); }
.placements li.first { background: linear-gradient(90deg, rgba(214, 164, 79, 0.45), rgba(214, 164, 79, 0.12)); font-weight: 700; }
.placements .pl { width: 28px; color: #8a5a1c; font-weight: 800; font-family: var(--serif); }
.result-note { text-align: center; color: #6a4a2a; font-size: 0.85rem; margin: 6px 0 12px; font-style: italic; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.result-actions .btn { margin-top: 0; width: auto; }
.result-actions .btn.ghost { color: #3a2412; border-color: rgba(90, 56, 24, 0.45); }
.result-actions .btn.ghost:hover { background: rgba(120, 80, 30, 0.12); }
@media (max-width: 720px) {
  #result-modal { justify-content: center; align-items: flex-end; background: linear-gradient(180deg, transparent 40%, rgba(8, 5, 2, 0.4)); }
  .result-content { padding: 22px 18px 18px; }
  .result-crown { display: none; }
}
@media (prefers-reduced-motion: reduce) { .result-content { animation: none; } }
.back-hub-home { align-self: center; }

@media (max-width: 720px) {
  .card { padding: 22px; }
  .av-preview { height: 220px; }
  .av-label { flex-basis: 78px; }
}
}
