/* Codenames – Stil */
:root {
  --bg: #0e131c;
  --bg2: #151c28;
  --panel: #1a2230;
  --line: #2a3446;
  --text: #e9edf3;
  --muted: #8f9bb0;
  --red: #e0533f;
  --red-d: #a8321f;
  --red-l: #f4c1b6;
  --blue: #3a7bea;
  --blue-d: #1f4fa8;
  --blue-l: #bcd2fa;
  --paper: #ece3cd;
  --paper-d: #d8ccb0;
  --ink: #1d1a14;
  --neutral: #cdbb94;
  --assassin: #15171c;
  --ok: #3fb37f;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(1200px 600px at 50% -200px, #1b2536 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.45 var(--font);
}
a { color: #9cc0ff; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: .2em 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.warn { color: #ffb24a; }
[hidden] { display: none !important; }

/* ---------- Grundlayout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.topbar nav a { color: var(--text); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; font-size: .92rem; }
.topbar nav a:hover { background: var(--panel); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-decoration: none; font-size: .95rem; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; flex: none; background:
  linear-gradient(var(--red), var(--red)) 0 0 / 46% 46% no-repeat,
  linear-gradient(var(--paper), var(--paper)) 100% 0 / 46% 46% no-repeat,
  linear-gradient(var(--paper), var(--paper)) 0 100% / 46% 46% no-repeat,
  linear-gradient(var(--blue), var(--blue)) 100% 100% / 46% 46% no-repeat; }
.brand-mark.big { width: 54px; height: 54px; border-radius: 10px; }
.page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.page.narrow { max-width: 440px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.grid-2 .card { margin: 0; }
.grid-2 + .card { margin-top: 1.2rem; }
.hero { margin: .5rem 0 1.5rem; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.login-card { text-align: center; margin-top: 2rem; }
.login-card .stack { text-align: left; }
.login-emblem { display: flex; justify-content: center; margin-bottom: 1rem; }

label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .55rem; color: var(--text); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: .65rem .75rem; width: 100%; min-width: 0;
}
input[type=checkbox] { width: auto; accent-color: var(--blue); transform: scale(1.2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; font-size: 1.2rem; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 650; color: var(--text); background: #263044; border: 1px solid #344058;
  border-radius: 10px; padding: .65rem 1.1rem; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform .08s, background .15s; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #2e3a52; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.primary:hover { background: #fff6df; }
.btn.ghost { background: transparent; }
.btn.danger { background: #5a1f1f; border-color: #7a2a2a; }
.btn.small { padding: .38rem .7rem; font-size: .84rem; border-radius: 8px; }
.btn.big { padding: .9rem 1.2rem; font-size: 1.05rem; }
.danger-text { color: #ff8a7a; }
.icon-btn { background: transparent; border: 0; color: var(--text); width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--panel); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.small { width: 30px; height: 30px; font-size: .85rem; }
.pill { display: inline-block; font-size: .72rem; padding: .12rem .5rem; border-radius: 99px; background: #33405a; color: var(--text); font-weight: 600; }

.flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.flash-ok { background: #173a2b; border: 1px solid #23573f; }
.flash-err { background: #3c1a1a; border: 1px solid #6a2a2a; }

.game-list { list-style: none; margin: 0; padding: 0; }
.game-list li { display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); padding: .6rem 0; }
.game-list li:first-child { border-top: 0; }
.game-list li > a:first-child { flex: 1; display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; color: var(--text); text-decoration: none; }
.code-chip { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .12em; background: var(--bg2); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.gl-status { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: #2b3448; }
.gl-status.st-playing { background: #1e4a35; }

.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-radius: 9px; text-decoration: none; color: var(--muted); background: var(--panel); border: 1px solid var(--line); }
.tabs a.active { color: var(--ink); background: var(--paper); border-color: var(--paper); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
form.inline { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
form.inline input { width: 150px; padding: .38rem .55rem; font-size: .84rem; }
.sys { margin: 0; padding-left: 1.1rem; }

/* ---------- Spielseite ---------- */
.game-page { --accent: var(--paper); }
.game-page[data-team=red] { --accent: var(--red); }
.game-page[data-team=blue] { --accent: var(--blue); }
.game-page { border-top: 4px solid var(--accent); }
.game-main { max-width: 900px; margin: 0 auto; padding: 0 .6rem calc(1rem + env(safe-area-inset-bottom)); }
.game-top { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; max-width: 900px; margin: 0 auto; }
.brand.small { font-size: .8rem; }
.top-actions { display: flex; gap: .1rem; }
.offline .game-top::after { content: 'Verbindung …'; position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: #6a2a2a; color: #fff; font-size: .8rem; padding: .25rem .7rem; border-radius: 99px; z-index: 50; }

.scorebar { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem; }
.score { display: flex; align-items: center; gap: .45rem; padding: .32rem .6rem; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; transition: box-shadow .2s, background .2s; }
.score-red { justify-content: flex-start; }
.score-blue { justify-content: flex-end; flex-direction: row-reverse; }
.score-team { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.score-left { font-size: 1.25rem; font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: center; }
.score-red .score-left { color: var(--red); }
.score-blue .score-left { color: var(--blue); }
.score-red.active { background: rgba(224, 83, 63, .18); border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.score-blue.active { background: rgba(58, 123, 234, .18); border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.score-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.score-wins { font-weight: 800; font-variant-numeric: tabular-nums; }
.score-round { font-size: .7rem; color: var(--muted); }

.status-line { min-height: 2.6rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .7rem; text-align: center; padding: .35rem .3rem .55rem; }
.t-red { color: var(--red); }
.t-blue { color: var(--blue); }
.t-red-bg { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
.t-blue-bg { background: var(--blue) !important; border-color: var(--blue) !important; color: #fff !important; }
.clue { display: inline-flex; align-items: stretch; border-radius: 9px; overflow: hidden; border: 2px solid currentColor; font-family: var(--display); }
.clue-word { background: var(--paper); color: var(--ink); padding: .2rem .75rem; font-weight: 800; letter-spacing: .06em; font-size: 1.15rem; }
.clue-num { padding: .2rem .6rem; font-weight: 800; font-size: 1.15rem; color: #fff; background: currentColor; }
.clue.t-red .clue-num { background: var(--red); }
.clue.t-blue .clue-num { background: var(--blue); }
.your-turn { color: var(--ok); }
.guesses { font-size: .85rem; }

/* Spielfeld */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(4px, 1.3vw, 10px); user-select: none; -webkit-user-select: none; }
.cardw {
  position: relative; aspect-ratio: 1.42; border: 0; border-radius: clamp(5px, 1.2vw, 10px); padding: 0 3px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-d) 100%); color: var(--ink);
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: default;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 2px 4px rgba(0, 0, 0, .35);
  font: inherit; -webkit-tap-highlight-color: transparent; transition: transform .12s, box-shadow .15s, filter .2s;
}
.cardw::before { /* Namensfeld wie auf der Karte */
  content: ''; position: absolute; left: 7%; right: 7%; top: 50%; height: 1px; background: rgba(0, 0, 0, .08); transform: translateY(clamp(9px, 2.8vw, 18px));
}
.cardw .word {
  display: block; width: 100%; text-align: center; white-space: nowrap; overflow: hidden;
  font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  font-size: clamp(9px, 2.9vw, 19px); line-height: 1.1;
}
.cardw.clickable { cursor: pointer; }
.cardw.clickable:hover { transform: translateY(-2px); }
.cardw.clickable:active { transform: scale(.96); }
.cardw.marked { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .35); }
.cardw.mine { box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 2px var(--accent), 0 4px 10px rgba(0, 0, 0, .5); transform: translateY(-2px); }
.cardw .marks { position: absolute; top: 2px; left: 2px; right: 2px; display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; pointer-events: none; }
.cardw .marks i { font-style: normal; font-size: clamp(7px, 1.8vw, 11px); background: var(--accent); color: #fff; border-radius: 4px; padding: 0 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.game-page[data-team=''] .cardw .marks i { background: #333; }

/* Geheimdienstchef-Sicht: unaufgedeckte Karten getönt */
.board.spy .cardw.c-red:not(.revealed), .board.over .cardw.c-red:not(.revealed) { background: linear-gradient(180deg, var(--red-l), #e8a698); box-shadow: inset 0 0 0 3px var(--red), 0 2px 4px rgba(0, 0, 0, .35); }
.board.spy .cardw.c-blue:not(.revealed), .board.over .cardw.c-blue:not(.revealed) { background: linear-gradient(180deg, var(--blue-l), #9dbcf2); box-shadow: inset 0 0 0 3px var(--blue), 0 2px 4px rgba(0, 0, 0, .35); }
.board.spy .cardw.c-neutral:not(.revealed), .board.over .cardw.c-neutral:not(.revealed) { background: linear-gradient(180deg, #e6dcc4, #cfc3a5); }
.board.spy .cardw.c-assassin:not(.revealed), .board.over .cardw.c-assassin:not(.revealed) { background: linear-gradient(180deg, #3a3d45, #1d1f24); color: #f2f2f2; box-shadow: inset 0 0 0 3px #000, 0 2px 4px rgba(0, 0, 0, .35); }
.board.over .cardw:not(.revealed) { filter: saturate(.8); }

/* Aufgedeckt: Agentenkarte liegt drauf */
.cardw.revealed { color: rgba(255, 255, 255, .55); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 1px 2px rgba(0, 0, 0, .3); animation: flip .45s ease-out; }
.cardw.revealed.c-red { background: repeating-linear-gradient(135deg, var(--red) 0 10px, #d24a37 10px 20px); }
.cardw.revealed.c-blue { background: repeating-linear-gradient(135deg, var(--blue) 0 10px, #336fd8 10px 20px); }
.cardw.revealed.c-neutral { background: repeating-linear-gradient(135deg, #b9a77f 0 10px, #b19f77 10px 20px); color: rgba(0, 0, 0, .45); }
.cardw.revealed.c-assassin { background: #0a0b0d; color: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 2px #e0533f; }
.cardw.revealed::before { display: none; }
.cardw.revealed .word { font-size: clamp(7px, 2vw, 13px) !important; position: absolute; bottom: 4%; left: 0; }
.cardw .agent { position: absolute; top: 18%; left: 50%; width: 30%; aspect-ratio: 1; transform: translateX(-50%); opacity: .85;
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.9) 0 22%, transparent 23%), radial-gradient(ellipse at 50% 105%, rgba(255,255,255,.9) 0 46%, transparent 47%); }
.cardw.c-neutral .agent { filter: invert(1); opacity: .35; }
.cardw.c-assassin .agent { background: radial-gradient(circle, transparent 0 36%, #e0533f 37% 44%, transparent 45%), linear-gradient(#e0533f, #e0533f) center / 8% 100% no-repeat, linear-gradient(#e0533f, #e0533f) center / 100% 8% no-repeat; opacity: 1; }
.board.spy .cardw.revealed { filter: brightness(.6) saturate(.8); }
@keyframes flip { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

.banner { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .9rem; }
.board-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

/* Aktionsleiste */
.actions { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 0 .4rem; }
.actions > .btn { width: 100%; }
.actions .row { justify-content: center; }
.actions .row .btn { flex: 1; }
.clue-form { display: grid; grid-template-columns: 1fr 4.5rem auto; gap: .5rem; }
.clue-form input { text-transform: uppercase; font-weight: 700; letter-spacing: .05em; font-size: 1.05rem; }
.clue-form select { font-size: 1.05rem; font-weight: 700; text-align: center; }
.result { text-align: center; font-weight: 800; font-size: 1.3rem; padding: .8rem; border-radius: 12px; letter-spacing: .02em; }
.result.t-red-bg { background: var(--red); }
.result.t-blue-bg { background: var(--blue); }
.reveal-btn { animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: .6; } to { transform: none; opacity: 1; } }

/* Lobby */
.lobby { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.team-col { border-radius: var(--radius); padding: .9rem; border: 1px solid var(--line); background: var(--panel); }
.team-col h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 1.05rem; }
.team-red { border-top: 4px solid var(--red); }
.team-red h2 { color: var(--red); }
.team-blue { border-top: 4px solid var(--blue); }
.team-blue h2 { color: var(--blue); }
.role-block { padding: .5rem 0 .7rem; border-top: 1px dashed var(--line); }
.role-block:first-of-type { border-top: 0; }
.role-block h3 { font-size: .72rem; margin-bottom: .3rem; }
.role-block h3 .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.role-block ul, .unassigned ul { list-style: none; margin: 0 0 .5rem; padding: 0; }
.role-block li, .unassigned li { padding: .12rem 0; display: flex; align-items: center; gap: .4rem; overflow: hidden; text-overflow: ellipsis; }
li.is-me { font-weight: 700; }
.unassigned, .lobby-invite { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; }
.unassigned ul { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.lobby-invite { display: flex; gap: 1rem; align-items: center; }
.lobby-invite canvas { border-radius: 8px; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4a5468; flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* Seitenpanel */
.panel { position: fixed; inset: 0; background: rgba(5, 8, 12, .55); z-index: 40; display: flex; justify-content: flex-end; }
.panel-inner { width: min(380px, 92vw); height: 100%; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--line); padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom)); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h3 { margin-top: 1.3rem; }
.me-box { background: var(--panel); border-radius: 10px; padding: .8rem; display: flex; flex-direction: column; gap: .6rem; border-left: 4px solid var(--accent); }
.pgroup ul { list-style: none; padding: 0; margin: 0 0 .8rem; }
.pgroup li { display: flex; align-items: center; gap: .45rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.pgroup .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pgroup .pname small { display: block; color: var(--muted); font-size: .74rem; }
.pgroup select { width: auto; padding: .25rem .3rem; font-size: .78rem; }
.pg-red h4 { color: var(--red); }
.pg-blue h4 { color: var(--blue); }
.host-tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.foot-mini { color: var(--muted); font-size: .75rem; margin-top: 2rem; }

.log { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.log li { padding: .35rem 0 .35rem .7rem; border-left: 3px solid var(--line); margin-bottom: 2px; }
.log time { color: var(--muted); font-size: .74rem; margin-right: .45rem; font-variant-numeric: tabular-nums; }
.log .lc-red { border-left-color: var(--red); }
.log .lc-blue { border-left-color: var(--blue); }
.log .lc-neutral { border-left-color: var(--neutral); }
.log .lc-assassin { border-left-color: #000; background: rgba(224, 83, 63, .08); }
.log .lg-clue, .log .lg-win { font-weight: 650; }
.log .lg-info { color: var(--muted); }

/* Modal & Toast */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 12, .7); display: grid; place-items: center; padding: 1rem; }
.modal-box { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; width: min(400px, 100%); text-align: center; animation: pop .2s ease-out; }
.modal-box .stack { text-align: left; }
.modal-x { position: absolute; top: .5rem; right: .5rem; }
.qr-wrap { display: flex; justify-content: center; margin: 1rem 0 .6rem; }
.qr-wrap canvas { border-radius: 12px; }
.code-big { font-family: ui-monospace, Menlo, monospace; font-size: 1.8rem; font-weight: 800; letter-spacing: .3em; margin-bottom: .8rem; padding-left: .3em; }
.link-field { font-size: .78rem; margin-bottom: .8rem; color: var(--muted); }
.modal-box .row { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: #2a3446; color: #fff; padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: 90vw; }
.toast.err { background: #7a2a2a; }
.toast.ok { background: #1e5a3e; }

/* ---------- Tisch-Ansicht ---------- */
.board-mode .game-main { max-width: none; padding: 1rem 1.2rem; }
.board-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.4rem; align-items: start; min-height: calc(100vh - 2rem); }
.board-left { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.board-mode .board { max-width: calc((100vh - 15rem) * 1.42 + 48px); margin: 0 auto; width: 100%; gap: 12px; }
.board-mode .cardw .word { font-size: clamp(12px, 2vw, 34px); }
.board-mode .cardw.revealed .word { font-size: clamp(9px, 1.1vw, 18px) !important; }
.scorebar.big .score-left { font-size: 2rem; }
.scorebar.big .score-team { font-size: 1rem; }
.status-line.big { font-size: 1.3rem; min-height: 3.6rem; }
.status-line.big .clue-word, .status-line.big .clue-num { font-size: 2rem; padding: .2rem 1rem; }
.board-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.side-qr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.side-qr canvas { border-radius: 10px; max-width: 100%; height: auto !important; }
.side-code { margin-top: .5rem; font-size: 1.1rem; letter-spacing: .1em; }
.side-code strong { font-family: ui-monospace, Menlo, monospace; letter-spacing: .25em; }
.side-team { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; font-size: .9rem; }
.side-team p { margin: .2rem 0; }
.side-red { border-left: 4px solid var(--red); }
.side-red h3 { color: var(--red); }
.side-blue { border-left: 4px solid var(--blue); }
.side-blue h3 { color: var(--blue); }
.log.compact { font-size: .8rem; }

@media (max-width: 860px) {
  .board-layout { grid-template-columns: 1fr; }
  .board-side { position: static; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .hide-xs { display: none; }
  .score { padding: .28rem .45rem; }
  .score-team { font-size: .68rem; letter-spacing: .06em; }
  .lobby { gap: .5rem; }
  .team-col { padding: .7rem; }
  .lobby-invite { flex-direction: column; text-align: center; }
  .clue-form { grid-template-columns: 1fr 4rem; }
  .clue-form .btn { grid-column: 1 / -1; }
  .page { padding: 1rem .9rem 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.clue-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .92rem; }
.lobby-invite.first { order: -1; }
