/* Werwolf – Apple-inspiriertes Nacht-Design */
:root {
  --text: #f5f5f7; --text-2: rgba(235,235,245,.62); --text-3: rgba(235,235,245,.38);
  --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.36); --sep: rgba(255,255,255,.1);
  --glass: rgba(28,28,34,.55); --accent: #0a84ff; --moon: #f5e6b8; --red: #ff453a; --green: #30d158; --wolf: #ff375f;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "New York", "Instrument Serif", ui-serif, Georgia, serif;
  --ease: cubic-bezier(.32,.72,0,1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: #05060f; color: var(--text); font-family: var(--font); letter-spacing: -.012em; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-2); } .small { font-size: 13px; } .mt { margin-top: 14px; } .pad { padding: 16px; } .good { color: var(--green); font-weight: 600; }

/* Hintergrund */
.bg { position: fixed; inset: 0; z-index: -1; transition: background 2s var(--ease);
  background: radial-gradient(60% 50% at 80% 0%, rgba(94,92,230,.32), transparent 70%), radial-gradient(50% 45% at 10% 100%, rgba(255,55,95,.18), transparent 70%), linear-gradient(180deg, #0b0e24, #05060f); }
body[data-phase="day"] .bg, body[data-phase="vote"] .bg, body[data-phase="verdict"] .bg, body[data-phase="dawn"] .bg, body[data-phase="hunter"] .bg {
  background: radial-gradient(60% 55% at 85% 0%, rgba(255,159,10,.42), transparent 70%), radial-gradient(55% 50% at 0% 100%, rgba(255,55,95,.22), transparent 70%), linear-gradient(180deg, #2a1a12, #120a08); }
body[data-phase="end"] .bg { background: radial-gradient(60% 55% at 50% 0%, rgba(255,214,10,.3), transparent 70%), linear-gradient(180deg, #1a1630, #05060f); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 15px; transition: transform .15s var(--ease), background .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--fill-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: #fff; color: #000; }
.btn.primary:hover:not(:disabled) { background: #e8e8ed; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text-2); }
.field { width: 100%; border: 0; border-radius: 14px; background: var(--fill); padding: 14px 16px; font-size: 17px; outline: none; transition: box-shadow .2s; resize: none; }
.field:focus { box-shadow: 0 0 0 3px rgba(10,132,255,.5); }
.field.big { font-size: 20px; text-align: center; padding: 16px; }
.field::placeholder { color: var(--text-3); }
.glass { background: var(--glass); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); border: .5px solid var(--sep); border-radius: 26px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.count { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--fill); font-size: 13px; vertical-align: middle; margin-left: 6px; }

/* Avatare */
.av { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; font-weight: 700; color: #fff; font-size: 17px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 100%, #fff 15%), color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.av.xs { width: 22px; height: 22px; font-size: 11px; } .av.sm { width: 32px; height: 32px; font-size: 14px; }
.av.lg { width: clamp(64px, 7vw, 104px); height: clamp(64px, 7vw, 104px); font-size: clamp(26px, 3vw, 42px); }
.av.dead { filter: grayscale(1) brightness(.5); }
.bot-badge { position: absolute; right: -4px; bottom: -4px; font-size: .55em; background: #1c1c1e; border-radius: 50%; width: 1.6em; height: 1.6em; display: grid; place-items: center; box-shadow: 0 0 0 2px #05060f; }
.av.xs .bot-badge { display: none; }

/* Startseite */
.home { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; overflow: hidden; }
.moon { position: absolute; top: 8%; right: 12%; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff8dc, var(--moon) 60%, #d8c58f); box-shadow: 0 0 120px 30px rgba(245,230,184,.25); animation: glow 6s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 160px 50px rgba(245,230,184,.35); } }
.home-in { position: relative; text-align: center; max-width: 860px; animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.logo { font-size: 72px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
.logo.sm { font-size: 52px; }
.home h1 { font-size: clamp(64px, 12vw, 128px); font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, #fff, rgba(255,255,255,.55)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-size: clamp(17px, 2.2vw, 21px); color: var(--text-2); margin: 16px auto 40px; max-width: 560px; }
.home-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
@media (max-width: 680px) { .home-cards { grid-template-columns: 1fr; } .moon { width: 110px; height: 110px; } }
.glass-card { padding: 24px; border-radius: 26px; background: var(--glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: .5px solid var(--sep); }
.gc-ic { font-size: 34px; margin-bottom: 10px; }
.glass-card h3 { font-size: 22px; margin-bottom: 4px; }
.glass-card p { color: var(--text-2); }
.code-row { display: flex; gap: 8px; margin-top: 12px; }
.field.code { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }
.center-msg { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }

/* ===== TV ===== */
.tv { min-height: 100vh; padding: 36px clamp(20px, 4vw, 60px); position: relative; }
.sound-pill { position: fixed; top: 18px; right: 18px; z-index: 20; padding: 10px 18px; border-radius: 999px; background: #fff; color: #000; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.tv-h1 { font-size: clamp(48px, 6.5vw, 96px); font-weight: 800; letter-spacing: -.045em; line-height: .98; }
.tv-h1.sm { font-size: clamp(40px, 5vw, 72px); }
.lobby { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 1000px) { .lobby { grid-template-columns: 1fr; } }
.qr-card { display: flex; align-items: center; gap: 30px; margin-top: 34px; }
.qr { width: clamp(180px, 20vw, 280px); aspect-ratio: 1; background: #fff; border-radius: 24px; padding: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-fallback { color: #000; font-size: 12px; word-break: break-all; }
.url { font-size: clamp(20px, 2vw, 28px); font-weight: 600; margin: 2px 0; }
.code-big { font-size: clamp(56px, 7vw, 100px); font-weight: 800; letter-spacing: .12em; line-height: 1; margin-top: 10px; background: linear-gradient(90deg, #fff, var(--moon)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-pill { display: inline-block; margin-top: 28px; padding: 8px 14px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 14px; }
.ai-pill.on { background: rgba(48,209,88,.16); color: #63e6be; }
.lobby-right { padding: 24px; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.row-head h2 { font-size: 24px; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.pl { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 30px 8px 8px; border-radius: 14px; background: var(--fill); font-weight: 600; }
.pl small { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: auto; }
.pl.off { opacity: .55; }
.pl .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; color: var(--text-3); font-size: 16px; line-height: 1; opacity: 0; transition: opacity .2s; }
.pl:hover .x { opacity: 1; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.settings { margin-top: 18px; border-top: .5px solid var(--sep); }
.set { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: .5px solid var(--sep); font-weight: 500; }
.set small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 10px; padding: 3px; }
.stepper button { width: 34px; height: 30px; border-radius: 8px; font-size: 18px; }
.stepper button:hover { background: var(--fill-2); }
.stepper b { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.roles { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 4px; }
.role-chip { padding: 7px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; color: var(--text-2); transition: all .2s; }
.role-chip.on { background: rgba(10,132,255,.25); color: #fff; box-shadow: inset 0 0 0 1px rgba(10,132,255,.6); }

.game { display: flex; flex-direction: column; gap: 24px; }
.tv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.tv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.alive-pill { padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 14px; font-weight: 500; }
.timer { font-size: clamp(40px, 5vw, 72px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.timer.urgent, .p-timer.urgent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(96px, 10vw, 150px), 1fr)); gap: clamp(14px, 2vw, 28px); padding: 10px 0; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: transform .4s var(--ease), opacity .4s; }
.seat-name { font-weight: 700; font-size: clamp(15px, 1.5vw, 22px); }
.seat-role { font-size: 13px; color: var(--text-2); }
.seat.dead { opacity: .55; }
.seat.dead .seat-name { text-decoration: line-through; text-decoration-color: rgba(255,255,255,.4); }
.seat.talking { transform: scale(1.1); }
.seat.talking .av { box-shadow: 0 0 0 4px #05060f, 0 0 0 7px #fff, 0 0 40px rgba(255,255,255,.5); }
.votes { position: absolute; top: -6px; right: calc(50% - clamp(40px, 4.5vw, 62px)); min-width: 30px; height: 30px; border-radius: 15px; background: var(--red); color: #fff; font-weight: 800; display: grid; place-items: center; animation: pop .3s var(--ease); box-shadow: 0 4px 14px rgba(255,69,58,.5); }
.is-night .seat .av:not(.dead) { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 30px rgba(94,92,230,.25); }
.subtitle { position: fixed; z-index: 10; left: 50%; bottom: clamp(24px, 5vh, 60px); transform: translate(-50%, 30px); width: min(1100px, 92vw); padding: 22px 30px; border-radius: 28px; opacity: 0; pointer-events: none; transition: all .5s var(--ease);
  background: rgba(20,20,26,.78); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); border: .5px solid rgba(255,255,255,.14); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.subtitle.show { opacity: 1; transform: translate(-50%, 0); }
.sub-who { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.narr { font-size: 22px; }
.sub-text { font-size: clamp(22px, 2.6vw, 36px); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.subtitle.narrator .sub-text { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: 0; }
.tv-bottom { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-top: auto; }
.feed { padding: 16px 18px; max-height: 30vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.fl { color: var(--text-2); } .fl.phase { color: var(--text); font-weight: 700; margin-top: 4px; } .fl.death { color: #ff8a80; } .fl.big { color: var(--moon); font-weight: 700; }
.fc { display: flex; gap: 8px; align-items: flex-start; } .fc b { margin-right: 4px; }
.host-ctl { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.win-banner { text-align: center; padding: 22px; border-radius: 28px; background: linear-gradient(135deg, rgba(255,214,10,.25), rgba(255,159,10,.15)); border: .5px solid rgba(255,214,10,.4); animation: pop .6s var(--ease); }
.win-banner span { font-size: 64px; } .win-banner h2 { font-size: clamp(32px, 4vw, 56px); font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 800px) { .tv-bottom { grid-template-columns: 1fr; } }

/* ===== Handy ===== */
.phone { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.phone.join { justify-content: center; align-items: center; text-align: center; padding: 30px 22px; gap: 10px; }
.phone.join h1 { font-size: 48px; font-weight: 800; letter-spacing: -.04em; }
.phone.join .field { margin-top: 24px; }
.err { color: var(--red); }
.p-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: rgba(5,6,15,.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: .5px solid var(--sep); }
.p-me { display: flex; align-items: center; gap: 10px; } .p-me small { display: block; color: var(--text-2); font-size: 13px; }
.p-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-main { flex: 1; padding: 20px 18px; }
.p-foot { padding: 0 18px 18px; }
.p-wait { text-align: center; padding: 30px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.enter .p-main > * { animation: rise .5s var(--ease); }
.big-emoji { font-size: 72px; margin-bottom: 6px; }
.p-wait h2, .prompt h2, .day h2 { font-size: 26px; letter-spacing: -.03em; }
.mini-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }
.mini { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--fill); font-size: 14px; }
.reveal-list { width: 100%; margin-top: 18px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.rl { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--fill); } .rl span:nth-child(3) { margin-left: auto; font-size: 14px; }

.prompt p { margin: 6px 0 14px; }
.prompt.compact { width: 100%; margin-top: 16px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pbtn { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--fill); text-align: left; font-weight: 600; transition: all .2s var(--ease); }
.pbtn.on { background: #fff; color: #000; transform: scale(1.02); }
.pbtn.on.danger { background: var(--red); color: #fff; }
.victim { padding: 14px; border-radius: 16px; background: rgba(255,69,58,.15); margin: 14px 0; }
.toggle-btn { width: 100%; padding: 14px; border-radius: 16px; background: var(--fill); font-weight: 600; text-align: left; transition: all .2s; }
.toggle-btn.on { background: var(--green); color: #000; }
.wolf-votes { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: rgba(255,55,95,.14); text-align: left; font-size: 15px; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.phone.dark .p-main { background: transparent; }
.night-wait .big-emoji { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.role-card { position: relative; padding: 18px; border-radius: 22px; text-align: center; cursor: pointer; background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: .5px solid var(--sep); transition: all .4s var(--ease); }
.role-card.open.team-wolves { background: linear-gradient(160deg, rgba(255,55,95,.35), rgba(80,10,30,.4)); border-color: rgba(255,55,95,.5); }
.role-card.open.team-village { background: linear-gradient(160deg, rgba(10,132,255,.3), rgba(10,30,80,.4)); border-color: rgba(10,132,255,.5); }
.rc-back { font-size: 34px; opacity: .6; }
.rc-emoji { font-size: 56px; } .rc-name { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.rc-desc { color: var(--text-2); margin-top: 6px; font-size: 15px; }
.rc-hint { color: var(--text-3); font-size: 12px; margin-top: 8px; }
.knowledge { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.25); text-align: left; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.day p { margin: 6px 0 16px; }
.bot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bot-btn { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--fill); font-weight: 600; }
.bot-btn em { margin-left: auto; font-style: normal; }
.bot-btn:active { transform: scale(.97); }
.mini-chat { margin-top: 18px; padding: 12px 14px; border-radius: 16px; background: rgba(0,0,0,.25); font-size: 14px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.mini-chat b { color: var(--text); }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: min(560px, 100%); background: #1c1c1e; border-radius: 28px 28px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .4s var(--ease); display: flex; flex-direction: column; gap: 12px; }
@keyframes up { from { transform: translateY(100%); } }
.sheet-h { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.sheet-h .x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); font-size: 20px; }
.mic { padding: 18px; border-radius: 18px; background: rgba(10,132,255,.2); color: #fff; font-weight: 600; transition: all .2s; }
.mic.on { background: var(--red); animation: pulse 1.2s infinite; }

.toast { position: fixed; z-index: 100; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 999px; background: rgba(44,44,46,.92); backdrop-filter: blur(20px); font-weight: 600; font-size: 15px; transition: all .4s var(--ease); max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
