:root {
  --bg: #0b0820;
  --bg-2: #1c1245;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f2ff;
  --muted: #a89fcf;
  --gold: #ffcc4d;
  --gold-2: #ffa92e;
  --accent: #7c5cff;
  --accent-2: #5a8bff;
  --danger: #ff5a6a;
  --ok: #2ed47a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(255, 90, 180, 0.16), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); font-weight: 600; }
kbd {
  font: 600 0.7em/1 "Outfit", sans-serif;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 4px;
  vertical-align: middle;
}

/* ---------- buttons ---------- */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.12s, filter 0.2s, background 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.btn-ghost:disabled { opacity: 0.4; }
.btn-lg { padding: 16px 28px; font-size: 1.15rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg circle { fill: currentColor; stroke: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-weight: 600;
}
.chip b { color: var(--gold); letter-spacing: 0.12em; }
.chip.linked { border-color: rgba(46, 212, 122, 0.5); }
.chip.small { padding: 6px 12px; font-size: 0.85rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 90, 106, 0.2); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 212, 122, 0.2); }

/* ---------- setup ---------- */
.setup { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.setup-card {
  position: relative;
  width: min(640px, 100%);
  background: rgba(20, 14, 50, 0.7);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.logo { margin: 0; font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 900; letter-spacing: -0.02em; }
.logo span, .host-brand span {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.setup-card > .muted { margin: 6px 0 24px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; font-weight: 600; }
.field.inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.field span, .field > label, .label { color: var(--muted); font-weight: 600; }
.corner-links { position: absolute; top: 16px; right: 18px; display: flex; gap: 4px; }
.corner-links a, .corner-links label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none;
  cursor: pointer; opacity: 0.7; transition: opacity 0.2s, background 0.2s;
}
.corner-links a:hover, .corner-links label:hover { opacity: 1; background: var(--panel-2); color: var(--text); }
.corner-links svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.import-msg { font-size: 0.85rem; color: var(--ok) !important; }
.import-msg:empty { display: none; }
.import-msg.bad { color: var(--danger) !important; }
select, .team-input, .code-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
select:focus, .team-input:focus, .code-input:focus { border-color: var(--accent); }
select option { background: #1c1245; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 12px; flex-wrap: wrap; }
.field-row.options { margin: 20px 0; }
.stepper { display: flex; align-items: center; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); border-radius: 12px; }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.4rem; font-weight: 700; }
.stepper output { min-width: 32px; text-align: center; font-weight: 800; font-size: 1.2rem; }
.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.team-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-left: 5px solid var(--team);
}
.team-row .team-input { flex: 1; min-width: 0; font-weight: 700; color: var(--team); }
.swatch {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: var(--team);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 0 16px var(--team);
  cursor: pointer; position: relative; overflow: hidden;
}
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.setup-actions { display: flex; gap: 12px; }
.setup-actions #startBtn { flex: 1; }

/* ---------- game (TV) ---------- */
.game {
  height: 100vh;
  display: flex; flex-direction: column;
  gap: clamp(10px, 1.6vh, 20px);
  padding: clamp(12px, 2vh, 28px) clamp(12px, 2.5vw, 40px);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.game-title { margin: 0; font-size: clamp(1.3rem, 2.4vw, 2.2rem); font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 190px;
  display: grid; padding: 6px;
  background: #1d1446; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.menu button { text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.menu button:hover { background: var(--panel-2); }

.board {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--rows, 5), minmax(0, 1fr));
  gap: clamp(6px, 1vw, 16px);
}
.cat, .tile {
  border-radius: var(--radius);
  display: grid; place-items: center; text-align: center;
}
.cat {
  padding: clamp(10px, 1.6vh, 22px) 10px;
  font-weight: 800;
  font-size: clamp(0.9rem, 1.45vw, 1.5rem);
  line-height: 1.15;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.35), rgba(124, 92, 255, 0.12));
  border: 1px solid rgba(160, 140, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tile {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(58, 40, 130, 0.75), rgba(28, 18, 70, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.25);
  font-weight: 900;
  font-size: clamp(1.4rem, 3.6vw, 4rem);
  color: var(--gold);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 204, 77, 0.25);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
button.tile:hover, button.tile:focus-visible {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 204, 77, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 204, 77, 0.4), 0 12px 30px rgba(255, 204, 77, 0.18);
  outline: none;
}
.tile.used {
  background: rgba(0, 0, 0, 0.25);
  border-style: dashed;
  color: rgba(255, 255, 255, 0.18);
  text-shadow: none;
  font-size: clamp(1rem, 2vw, 2rem);
}
.tile.used[style] { border: 1px solid color-mix(in srgb, var(--team) 40%, transparent); background: color-mix(in srgb, var(--team) 10%, rgba(0, 0, 0, 0.3)); }
.tile .won { font-size: clamp(0.7rem, 1.1vw, 1.1rem); font-weight: 700; color: var(--team); opacity: 0.8; padding: 0 6px; }
.tile.empty { visibility: hidden; }

.scores {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(8px, 1vw, 16px);
}
.score-card {
  position: relative;
  padding: clamp(8px, 1.4vh, 16px) 12px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--team) 22%, transparent), rgba(0, 0, 0, 0.25));
  border: 1px solid color-mix(in srgb, var(--team) 45%, transparent);
  border-top: 5px solid var(--team);
  transition: box-shadow 0.3s, transform 0.3s;
}
.score-card .team-name { font-weight: 800; font-size: clamp(0.9rem, 1.4vw, 1.4rem); color: var(--team); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-card .team-score { font-weight: 900; font-size: clamp(1.6rem, 3.2vw, 3.2rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-card .crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%) scale(0); font-size: 1.6rem; transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.score-card.leader { box-shadow: 0 0 0 2px var(--team), 0 0 30px color-mix(in srgb, var(--team) 45%, transparent); }
.score-card.leader .crown { transform: translateX(-50%) scale(1); }
.score-card.bump { animation: bump 0.6s; }
.score-card.shake { animation: shake 0.5s; }
.float {
  position: absolute; left: 50%; top: 0;
  font-weight: 900; font-size: clamp(1.4rem, 2.6vw, 2.6rem);
  pointer-events: none;
  animation: floatUp 1.4s ease-out forwards;
}
.float.up { color: var(--ok); text-shadow: 0 0 20px rgba(46, 212, 122, 0.6); }
.float.down { color: var(--danger); text-shadow: 0 0 20px rgba(255, 90, 106, 0.6); }

@keyframes bump { 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -90px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(8, 5, 25, 0.78);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s;
}
.q-card {
  position: relative;
  width: min(1300px, 94vw);
  max-height: 94vh; overflow: auto;
  padding: clamp(20px, 4vh, 48px) clamp(20px, 4vw, 56px);
  border-radius: 28px;
  background: linear-gradient(160deg, #2d1f78, #150e3a);
  border: 1px solid rgba(160, 140, 255, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 80px rgba(124, 92, 255, 0.25);
  text-align: center;
  animation: pop 0.35s cubic-bezier(.2, 1.3, .4, 1);
}
.q-head { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.q-cat { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-size: clamp(0.9rem, 1.4vw, 1.3rem); }
.q-value {
  font-weight: 900; color: #1a1033;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  padding: 4px 14px; border-radius: 999px;
  font-size: clamp(0.9rem, 1.4vw, 1.3rem);
}
.q-text { font-size: clamp(1.6rem, 3.6vw, 3.6rem); font-weight: 700; line-height: 1.2; margin: clamp(16px, 4vh, 40px) auto; max-width: 28ch; text-wrap: balance; }
.q-image {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  margin: clamp(16px, 3vh, 32px) auto;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}
.q-image-error { color: var(--muted); margin: 40px 0; font-size: 1.2rem; }
.q-answer {
  display: inline-block;
  margin: 0 auto clamp(16px, 3vh, 32px);
  padding: 14px 32px;
  border-radius: 18px;
  font-size: clamp(1.4rem, 3vw, 3rem); font-weight: 900;
  color: #1a1033;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 50px rgba(255, 204, 77, 0.45);
  animation: pop 0.4s cubic-bezier(.2, 1.5, .4, 1);
}
.q-timer { position: absolute; top: clamp(14px, 2.5vh, 28px); right: clamp(14px, 2.5vw, 28px); width: clamp(56px, 6vw, 90px); aspect-ratio: 1; display: grid; place-items: center; cursor: pointer; }
.q-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.q-timer circle { fill: none; stroke-width: 8; }
.q-timer .track { stroke: rgba(255, 255, 255, 0.12); }
.q-timer .bar { stroke: var(--gold); stroke-linecap: round; }
.q-timer span { font-weight: 900; font-size: clamp(1.2rem, 2vw, 2rem); }
.q-timer.urgent .bar { stroke: var(--danger); }
.q-timer.urgent span { color: var(--danger); animation: bump 1s infinite; }
.q-timer.expired span { color: var(--danger); }
.q-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.join-card, .win-card {
  position: relative;
  width: min(480px, 100%);
  padding: 32px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(160deg, #2d1f78, #150e3a);
  border: 1px solid rgba(160, 140, 255, 0.35);
  box-shadow: var(--shadow);
  animation: pop 0.3s cubic-bezier(.2, 1.3, .4, 1);
}
.join-card h2 { margin: 0 0 18px; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: min(280px, 70vw); margin: 0 auto 16px; }
.qr svg { display: block; width: 100%; height: auto; }
.join-code { font-size: 3rem; font-weight: 900; letter-spacing: 0.25em; color: var(--gold); padding-left: 0.25em; }
.note { font-size: 0.9rem; color: var(--gold); background: rgba(255, 204, 77, 0.1); border-radius: 12px; padding: 10px 12px; }
.close-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 2rem; color: var(--muted); }

.win-overlay canvas { position: fixed; inset: 0; pointer-events: none; }
.win-card { width: min(560px, 100%); }
.trophy { font-size: 5rem; animation: bump 1.2s infinite; }
.win-card h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 8px 0 20px; font-weight: 900; }
.standings { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; counter-reset: rank; }
.standings li {
  counter-increment: rank;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--team) 16%, rgba(0, 0, 0, 0.3));
  border-left: 5px solid var(--team);
  font-weight: 700; font-size: 1.2rem;
}
.standings li::before { content: counter(rank); color: var(--muted); width: 1.5em; }
.standings li span { flex: 1; text-align: left; color: var(--team); }
.win-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  padding: 12px 20px; border-radius: 999px;
  background: rgba(20, 14, 50, 0.95); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-weight: 600;
  animation: fadeIn 0.2s;
  max-width: calc(100vw - 32px);
}

/* ---------- host (phone) ---------- */
.host { padding-bottom: env(safe-area-inset-bottom); }
.host-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(11, 8, 32, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.host-brand { font-weight: 900; font-size: 1.3rem; }
.host-brand small { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-left: 4px; }
.host-join { max-width: 420px; margin: 0 auto; padding: 48px 16px; text-align: center; }
.host-join h1 { margin: 0 0 6px; font-size: 2rem; }
.host-join form { display: grid; gap: 12px; margin-top: 24px; }
.code-input { text-align: center; font-size: 2.4rem; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase; padding: 14px; }
.host-main { max-width: 560px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.waiting { text-align: center; color: var(--muted); padding: 32px 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.q-panel { border-color: rgba(255, 204, 77, 0.45); background: linear-gradient(160deg, rgba(58, 40, 130, 0.6), rgba(28, 18, 70, 0.7)); }
.q-panel .q-head { justify-content: space-between; }
.h-question { font-size: 1.15rem; font-weight: 600; line-height: 1.35; margin: 12px 0; }
.h-image { display: block; max-width: 100%; max-height: 200px; margin: 12px auto; border-radius: 12px; object-fit: contain; }
.h-answer { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 204, 77, 0.12); border: 1px dashed rgba(255, 204, 77, 0.5); margin-bottom: 12px; }
.h-answer span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); font-weight: 700; }
.h-answer b { font-size: 1.25rem; }
.h-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h-controls .btn { padding: 12px 10px; }
.h-teams { display: grid; gap: 8px; margin: 12px 0; }
.h-team, .score-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--team) 14%, rgba(0, 0, 0, 0.3));
  border-left: 5px solid var(--team);
}
.h-team-name { flex: 1; font-weight: 800; color: var(--team); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-team button, .score-row button {
  border: 0; border-radius: 12px; min-height: 48px; font-weight: 800;
  transition: transform 0.1s;
}
.h-team button:active, .score-row button:active { transform: scale(0.94); }
.h-team .award { background: var(--ok); color: #06301a; padding: 0 16px; }
.h-team .miss { background: rgba(255, 90, 106, 0.2); color: var(--danger); width: 48px; font-size: 1.1rem; }
.h-team.out { opacity: 0.4; }
.steps { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.step { flex: none; border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.step.active { background: var(--gold); color: #1a1033; border-color: var(--gold); }
.score-rows { display: grid; gap: 8px; }
.score-info { flex: 1; min-width: 0; display: grid; }
.score-info b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.score-row .adj { min-width: 72px; padding: 0 10px; font-size: 1rem; }
.score-row .minus { background: rgba(255, 90, 106, 0.18); color: #ff8a95; }
.score-row .plus { background: rgba(46, 212, 122, 0.2); color: #6ff0a8; }
.mini-board { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 4px; }
.mini-cat { font-size: 0.62rem; font-weight: 700; color: var(--gold); text-align: center; line-height: 1.1; padding: 4px 1px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; align-self: end; }
.mini-tile {
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(58, 40, 130, 0.7);
  color: var(--gold); font-weight: 800; font-size: 0.85rem;
  height: 40px; padding: 0;
}
.mini-tile:disabled { opacity: 0.45; }
.mini-tile.active { opacity: 1; outline: 2px solid var(--gold); }
.mini-tile.used { background: rgba(0, 0, 0, 0.3); border-style: dashed; display: block; }
.mini-tile.used[style] { background: color-mix(in srgb, var(--team) 35%, transparent); border: 0; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 12px; justify-self: center; }

/* Small TV/laptop windows */
@media (max-width: 520px) {
  .corner-links { position: static; justify-content: flex-end; margin: -8px -8px 8px 0; }
}
@media (max-width: 760px) {
  .game { height: auto; min-height: 100vh; }
  .board { min-height: 70vh; }
  .scores { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
  .tv #roomLabel { display: none; }
}
