/* =========================================================================
   Werwolf · Nächte in Mondtal – gemeinsames Design (Handy, Spielleitung, Bildschirm)
   ========================================================================= */

@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dm-sans.woff2') format('woff2'); font-weight: 100 1000; font-style: normal; font-display: swap; }

:root {
  --bg: #0B1020;
  --panel: #141B30;
  --raised: #1C2542;
  --line: rgba(243, 233, 210, 0.14);
  --line-strong: rgba(243, 233, 210, 0.28);
  --ivory: #F3E9D2;
  --muted: #BDB5A4;
  --dim: #948F86;
  --amber: #F2A541;
  --amber-hi: #FFC977;
  --moon: #8FC1C9;
  --ember: #EE8358;
  --violet: #B9A1F0;
  --green: #9FD3A8;
  --display: 'Fraunces', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ivory); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber); }
a:hover { color: var(--amber-hi); }
[hidden] { display: none !important; }

.disp { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; letter-spacing: -0.01em; }
.accent { color: var(--amber); font-style: italic; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.kicker { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Himmel, Wald, Mond ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.sky .forest { top: auto; bottom: 0; height: 26%; }
.tw { animation: twinkle 3.2s ease-in-out infinite; }
.ff { animation: drift 6s ease-in-out infinite; }
.pulse { animation: pulse 2s infinite; }
.moonglow { animation: glow 6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) } 50% { transform: translate(6px, -10px) } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,165,65,.55) } 70% { box-shadow: 0 0 0 12px rgba(242,165,65,0) } }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 18px rgba(243,233,210,.35)) } 50% { filter: drop-shadow(0 0 34px rgba(243,233,210,.6)) } }
@keyframes rise { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes flip { from { transform: rotateY(90deg) } to { transform: rotateY(0) } }
.rise { animation: rise .45s ease-out both; }
@media (prefers-reduced-motion: reduce) { .tw, .ff, .pulse, .moonglow, .rise { animation: none !important; } }

/* ---------- Bausteine ---------- */
.brand { display: flex; align-items: center; gap: 8px; }
.brand b { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 700; font-size: 19px; }
.wordmark { display: flex; align-items: center; gap: 14px; }
.wordmark .name { font-family: var(--display); font-weight: 750; line-height: 1; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.wordmark .tag { letter-spacing: .28em; text-transform: uppercase; color: var(--amber); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(243,233,210,0.07); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill.amber { color: var(--amber); }
.pill.green { color: var(--green); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(243,233,210,0.06); border: 1px solid var(--line); font-size: 15px; color: var(--muted); white-space: nowrap; }

.btn { text-decoration: none; width: 100%; min-height: 56px; padding: 0 22px; border-radius: var(--radius); border: none; background: var(--amber); color: var(--bg); font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 10px 30px -10px rgba(242,165,65,.6); transition: transform .08s ease, background .15s ease, opacity .15s; }
.btn:hover { background: var(--amber-hi); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ivory); border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: rgba(243,233,210,0.06); }
.btn.small { min-height: 44px; font-size: 15px; width: auto; padding: 0 16px; border-radius: 12px; }
.btn.danger { background: transparent; color: var(--ember); border: 1.5px solid rgba(238,131,88,.45); box-shadow: none; }
.btn:focus-visible, .target:focus-visible, .seat:focus-visible, input:focus-visible { outline: 3px solid var(--moon); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; }
.input { height: 54px; padding: 0 16px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line-strong); color: var(--ivory); font-size: 18px; outline: none; width: 100%; }
.input:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(242,165,65,0.14); }
.input.code { font-family: var(--display); letter-spacing: .08em; text-transform: uppercase; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(143,193,201,0.08); border: 1px solid rgba(143,193,201,0.22); font-size: 14px; line-height: 1.5; color: var(--muted); }
.error { color: #FFB49A; background: rgba(238,131,88,.12); border: 1px solid rgba(238,131,88,.35); padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* Avatar mit Sitznummer */
.avatar { position: relative; flex-shrink: 0; }
.avatar .face { border-radius: 50%; background: var(--raised); border: 2px solid currentColor; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 650; font-variation-settings: 'SOFT' 100, 'WONK' 1; width: 100%; height: 100%; }
.avatar .badge { position: absolute; right: -4px; bottom: -4px; border-radius: 999px; background: var(--ivory); color: var(--bg); font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.avatar.dead .face { opacity: .38; }
.avatar .skull { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.avatar .offline { position: absolute; left: -2px; top: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ember); border: 2px solid var(--bg); }

/* Auswahlzeilen (Nacht & Abstimmung) – für alle Rollen identisch */
.targets { display: flex; flex-direction: column; gap: 8px; }
.target { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line); color: var(--ivory); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.target:hover:not(:disabled) { border-color: var(--line-strong); }
.target:disabled { cursor: default; }
.target.selected { border: 2px solid var(--amber); background: rgba(242,165,65,0.10); }
.target.wolf.selected { border-color: var(--ember); background: rgba(238,131,88,0.10); }
.target .who { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.target .who b { font-size: 16px; font-weight: 600; }
.target .marks { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(243,233,210,0.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.selected .radio { border-color: var(--amber); }
.selected .radio::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); }
.wolf.selected .radio { border-color: var(--ember); }
.wolf.selected .radio::after { background: var(--ember); }

.timerbar { height: 4px; border-radius: 2px; background: rgba(243,233,210,0.08); overflow: hidden; }
.timerbar > div { height: 100%; background: rgba(243,233,210,0.55); transition: width .25s linear; }

/* Rollenkarte */
.rolecard { position: relative; width: 286px; height: 420px; border-radius: 26px; background: var(--panel); border: 1.5px solid var(--line-strong); overflow: hidden; transform: rotate(-2.5deg); margin: 0 auto; animation: flip .5s ease-out both; }
.rolecard.Werewolf { border-color: rgba(238,131,88,0.55); box-shadow: 0 30px 70px -20px rgba(238,131,88,0.45); }
.rolecard.Seer { border-color: rgba(185,161,240,0.55); box-shadow: 0 30px 70px -20px rgba(185,161,240,0.4); }
.rolecard.Villager { border-color: rgba(143,193,201,0.55); box-shadow: 0 30px 70px -20px rgba(143,193,201,0.35); }
.rolecard .art { position: absolute; left: 0; right: 0; top: 60px; display: flex; justify-content: center; }
.rolecard .text { position: absolute; left: 24px; right: 24px; bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.rolecard .title { font-family: var(--display); font-size: 40px; font-weight: 750; line-height: 1; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.rolecard .desc { font-size: 15px; line-height: 1.45; color: var(--muted); }
.rolecard.covered { display: flex; align-items: center; justify-content: center; cursor: pointer; border-style: dashed; animation: none; }
.corner { position: absolute; width: 26px; height: 26px; }
.c-Werewolf { color: var(--ember); } .c-Seer { color: var(--violet); } .c-Villager { color: var(--moon); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 92vw; padding: 12px 18px; border-radius: 14px; background: #2A2033; border: 1px solid rgba(238,131,88,.45); color: var(--ivory); font-size: 15px; box-shadow: 0 20px 40px rgba(0,0,0,.5); }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(11,16,32,0.88); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }

/* ---------- Handy ---------- */
.phone { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; min-height: 100dvh; padding: 20px 20px 24px; display: flex; flex-direction: column; }
.phone h1 { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 600; font-size: 32px; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
.phone h2 { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 600; font-size: 28px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.phone .topbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 10px; }
.phone .timer { font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seat { height: 48px; border-radius: 14px; font-family: var(--display); font-size: 19px; cursor: pointer; background: var(--panel); color: var(--ivory); border: 1.5px solid var(--line); }
.seat.on { background: var(--amber); color: var(--bg); border: none; font-weight: 700; }
.seat:disabled { background: transparent; color: var(--dim); border-color: rgba(243,233,210,0.1); text-decoration: line-through; cursor: not-allowed; }
.foot-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--dim); text-align: center; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: none; }

/* ---------- Spielleitung ---------- */
.host { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; display: flex; flex-direction: column; gap: 24px; }
.host h1 { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 600; font-size: 40px; line-height: 1.05; margin: 0; }
.host h2 { font-family: var(--display); font-weight: 650; font-size: 24px; margin: 0; font-variation-settings: 'SOFT' 100; }
.host .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.host .players { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.host .player { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.host .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.host .form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.host .form .input { height: 48px; font-size: 16px; }
.login { position: relative; z-index: 1; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .box { width: min(500px, 100%); display: flex; flex-direction: column; gap: 22px; padding: 36px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 40px 100px -30px rgba(0,0,0,.8); }

/* ---------- Spielserver-Bildschirm (1600×900, skaliert) ---------- */
.stage-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg); }
.stage { position: relative; width: 1600px; height: 900px; overflow: hidden; flex-shrink: 0; transform-origin: center center; }
.stage .abs { position: absolute; }
.stage .headline { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; }
.stage .seatcard { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 8px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.stage .seatcard.free { background: transparent; border: 2px dashed rgba(243,233,210,0.22); justify-content: center; }
.qrcard { position: relative; width: 340px; height: 340px; padding: 30px; background: var(--ivory); border-radius: 28px; box-shadow: 0 30px 80px -20px rgba(242,165,65,.35), 0 0 0 8px rgba(243,233,210,0.06); transform: rotate(-2deg); }
.qrcard svg.qr { width: 280px; height: 280px; display: block; }
.qrcard .logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 66px; height: 66px; border-radius: 50%; background: var(--ivory); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px var(--ivory); }
.status-pill { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-radius: 999px; background: rgba(11,16,32,0.78); border: 1px solid var(--line); font-size: 18px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); }
.display-controls { position: fixed; right: 12px; bottom: 12px; z-index: 30; display: flex; gap: 8px; opacity: .25; transition: opacity .2s; }
.display-controls:hover, .display-controls:focus-within { opacity: 1; }
