/* Das geheime Wort – look from the Claude Design draft (dark ink, mint, coral). */
:root {
  --bg: #0B0A12; --surface: #121022; --surface-2: #17142A; --surface-3: #1C1838;
  --line: #221E38; --line-2: #2C2748; --line-3: #3A3460;
  --text: #EDEBF5; --text-2: #B9B4CF; --muted: #8E89A8; --placeholder: #6E6990;
  --mint: #5EEAD4; --mint-ink: #06201C; --mint-bg: #0F2A27; --mint-line: #1F5A52; --bar: #3E8F86;
  --coral: #FF7A59; --coral-ink: #2A0D05; --coral-soft: #FFB59F; --coral-bg: #2A1611; --coral-line: #5A2E22;
  --f-head: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-num: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
input::placeholder { color: var(--placeholder); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.num { font-family: var(--f-num); font-weight: 700; font-variant-numeric: tabular-nums; }
.head { font-family: var(--f-head); font-weight: 700; }
.label { font-size: 12px; color: var(--muted); letter-spacing: .12em; font-weight: 600; text-transform: uppercase; }
.hidden { display: none !important; }

/* ---------- buttons, fields ---------- */
.btn { height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-3); background: transparent; color: var(--text); font-weight: 600; font-size: 14px; }
.btn.primary { border: 0; background: var(--mint); color: var(--mint-ink); font-weight: 700; }
.btn.hot { border: 0; background: var(--coral); color: var(--coral-ink); font-weight: 700; }
.btn.danger { border-color: var(--coral-line); color: var(--coral-soft); }
.btn.big { height: 54px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.small { height: 38px; padding: 0 8px; font-size: 13px; border-radius: 10px; white-space: nowrap; }
.field { height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-3); background: var(--surface-2); font-size: 18px; min-width: 0; width: 100%; }
.chip { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-3); background: var(--surface-2); font-weight: 600; font-size: 15px; }
.chip.on { border-color: var(--mint); background: var(--mint-bg); color: var(--mint); }
.chip.joker.on { border-color: var(--coral); background: var(--coral-bg); color: var(--coral-soft); }
.pill { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); font-weight: 600; }
.timer { padding: 8px 14px; border-radius: 999px; background: var(--mint-bg); border: 1px solid var(--mint-line); color: var(--mint); }
.timer.low { background: var(--coral-bg); border-color: var(--coral-line); color: var(--coral); }
.timer.paused { background: var(--surface-2); border-color: var(--line-3); color: var(--muted); }
.card { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: 92vw; padding: 12px 18px; border-radius: 14px; background: var(--coral-bg); border: 1px solid var(--coral-line); color: var(--coral-soft); font-weight: 600; z-index: 50; }
.conn { position: fixed; top: 8px; right: 8px; padding: 6px 10px; border-radius: 999px; background: var(--coral-bg); color: var(--coral-soft); font-size: 12px; z-index: 60; }

/* ---------- login / start ---------- */
.center-screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 32px; padding: 0 28px; max-width: 440px; margin: 0 auto; background: radial-gradient(500px 400px at 50% 20%, #1A1530 0%, var(--bg) 70%); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.brand h1 { margin: 0; font-family: var(--f-head); font-size: 28px; letter-spacing: .12em; }
.brand p { margin: 0; color: var(--text-2); font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }
.choice { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.choice strong { font-family: var(--f-head); font-size: 20px; display: block; }
.choice span { color: var(--text-2); font-size: 14px; }

/* ---------- TV stage (1920 × 1080, scaled to the window) ---------- */
body.tv { overflow: hidden; height: 100vh; }
.stage-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.stage { width: 1920px; height: 1080px; flex: none; transform-origin: center; padding: 56px 72px; display: flex; flex-direction: column; gap: 36px; background: radial-gradient(1200px 700px at 30% 0%, #1A1530 0%, var(--bg) 60%); }
.tv-head { display: flex; align-items: center; justify-content: space-between; }
.tv-brand { display: flex; align-items: center; gap: 20px; font-family: var(--f-head); font-weight: 700; font-size: 34px; letter-spacing: .14em; }
.tv-head .pill { font-size: 22px; padding: 10px 20px; }
.tv-head .timer { font-size: 30px; padding: 10px 24px; }
.tv-body { display: flex; gap: 48px; flex: 1; min-height: 0; }
.tv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.tv-aside { width: 440px; flex: none; display: flex; flex-direction: column; gap: 14px; padding: 32px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line-2); }
.tv-aside .label { font-size: 20px; }
.score-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; }
.score-row.setter { background: var(--surface-3); border-color: var(--mint); }
.score-row .rank { font-size: 22px; color: var(--muted); width: 28px; }
.score-row .name { flex: 1; font-size: 28px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .pts { font-size: 32px; }
.score-row .jk { font-size: 16px; color: var(--coral-soft); }
.rules-note { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line-2); font-size: 19px; color: var(--muted); line-height: 1.5; }
.setter-line { display: flex; align-items: flex-end; justify-content: space-between; }
.setter-line .label { font-size: 20px; }
.setter-name { font-family: var(--f-head); font-weight: 700; font-size: 52px; margin-top: 4px; }
.hint-count { font-size: 24px; color: var(--text-2); }
.hints { display: flex; flex-direction: column; gap: 12px; }
.hint { display: grid; grid-template-columns: 300px minmax(0, 1fr) 170px; align-items: center; gap: 24px; height: 64px; }
.hints.dense { gap: 8px; }
.hints.dense .hint { height: 46px; }
.hints.dense .hint .word { font-size: 28px; }
.hints.dense .hint .val { font-size: 30px; }
.hint .word { font-family: var(--f-head); font-weight: 500; font-size: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint .bar { position: relative; height: 28px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.hint .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 14px; background: var(--bar); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.hint.best .fill { background: var(--mint); }
.hint.hit .fill { background: var(--coral); }
.hint .mark { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--coral); }
.hint .val { text-align: right; font-size: 36px; }
.hint.hit .val { color: var(--coral); }
.hint.pending .fill { width: 30% !important; background: linear-gradient(90deg, transparent, var(--line-3), transparent); animation: scan 1.1s linear infinite; }
.hint.pending .val, .hint.failed .val { color: var(--muted); font-size: 24px; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 20px; }
.legend i { width: 3px; height: 22px; background: var(--coral); display: inline-block; }
.earlier { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 20px; }
.earlier span.e { padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.banner { margin-top: auto; display: flex; align-items: center; gap: 28px; padding: 28px 36px; border-radius: 24px; background: linear-gradient(90deg, var(--coral-bg), var(--surface-2)); border: 1px solid var(--coral-line); }
.banner.calm { background: var(--surface-2); border-color: var(--line-2); }
.banner .big { font-size: 64px; color: var(--coral); }
.banner .label { color: var(--coral-soft); font-size: 20px; }
.banner .text { font-family: var(--f-head); font-weight: 700; font-size: 40px; }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.hero .label { font-size: 24px; }
.hero .title { font-family: var(--f-head); font-weight: 700; font-size: 96px; line-height: 1.05; }
.hero .sub { font-size: 34px; color: var(--text-2); max-width: 1100px; line-height: 1.35; }
.reveal-word { font-family: var(--f-head); font-weight: 700; font-size: 150px; color: var(--coral); letter-spacing: .02em; animation: pop .7s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.podium { display: flex; gap: 24px; align-items: flex-end; }
.podium .pl { width: 300px; padding: 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); text-align: center; }
.podium .pl.first { border-color: var(--coral); background: linear-gradient(180deg, var(--coral-bg), var(--surface)); padding-top: 56px; }
.podium .pl .name { font-family: var(--f-head); font-weight: 700; font-size: 40px; }
.podium .pl .pts { font-size: 44px; margin-top: 8px; }
.players-intro { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.players-intro span { font-size: 30px; padding: 12px 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
@media (prefers-reduced-motion: reduce) { .hint .fill, .reveal-word { transition: none; animation: none; } .hint.pending .fill { animation: none; } }

/* ---------- admin (phone first) ---------- */
body.admin { min-height: 100vh; }
.adm { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.adm-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(11,10,18,.94); backdrop-filter: blur(8px); }
.adm-head .t { font-size: 15px; font-weight: 600; margin-top: 2px; }
.adm-head .timer { font-size: 18px; }
.adm-main { flex: 1; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.adm-foot { position: sticky; bottom: 0; z-index: 10; padding: 12px 18px 18px; border-top: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.kv { display: flex; align-items: center; justify-content: space-between; }
.secret { color: var(--coral); }
.sub3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sub3 div { padding: 8px; border-radius: 10px; background: var(--surface-2); }
.sub3 small { display: block; font-size: 11px; color: var(--muted); }
.reason { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.err { color: var(--coral-soft); font-size: 14px; }
.hint-item { display: flex; flex-direction: column; gap: 10px; }
.hint-item .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hint-item .w { font-family: var(--f-head); font-weight: 700; font-size: 19px; }
.hint-item .s { font-size: 24px; }
.hint-item.hit .s { color: var(--coral); }
.hint-item.old { opacity: .6; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.pl-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pl-row:last-child { border-bottom: 0; }
.pl-row .n { flex: 1; font-weight: 600; }
.env { display: flex; flex-wrap: wrap; gap: 6px; }
.env span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.env span.used { text-decoration: line-through; opacity: .5; }
.cfg { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; }
.cfg input { height: 44px; font-size: 16px; text-align: right; }
details.card summary { cursor: pointer; font-weight: 600; }
a.link { color: var(--mint); }

/* ---------- printable envelopes ---------- */
body.print { background: #fff; color: #111; }
.env-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 24px; }
.env-card { border: 2px dashed #999; border-radius: 12px; padding: 20px; break-inside: avoid; }
.env-card h2 { margin: 0 0 12px; font-family: var(--f-head); }
.env-card li { font-size: 22px; margin: 6px 0; }
@media print { .noprint { display: none; } }
