:root {
  --ink: #edf7ff;
  --muted: #8ea7b8;
  --bg: #06131b;
  --panel: #0b202c;
  --panel-2: #0d2a38;
  --line: rgba(140, 199, 230, .22);
  --cyan: #54d9ff;
  --blue: #1489bd;
  --red: #ff5c4d;
  --orange: #ff9c41;
  --yellow: #ffd768;
  --green: #5ee1a4;
  --steel: #91a9b7;
  --cell: clamp(28px, 4.5vw, 48px);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(42, 119, 152, .18), transparent 35%),
    radial-gradient(circle at 85% 40%, rgba(15, 83, 113, .16), transparent 30%),
    linear-gradient(180deg, #081923 0%, var(--bg) 68%);
  color: var(--ink);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
.hidden { display: none !important; }

.sea-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.app-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(84,217,255,.55);
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, rgba(84,217,255,.12), transparent 62%);
  box-shadow: inset 0 0 18px rgba(84,217,255,.08);
}
.brand-mark::before, .brand-mark::after, .radar-ring {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(84,217,255,.22);
}
.brand-mark::before { inset: 9px; }
.brand-mark::after { inset: 17px; }
.radar-ring { inset: 24px 6px 24px 6px; border-radius: 0; border-width: 1px 0 0; transform: rotate(-35deg); transform-origin: center; }
.radar-dot { position:absolute; width:5px; height:5px; background:var(--cyan); border-radius:50%; left:33px; top:16px; box-shadow: 0 0 10px var(--cyan); }

.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: .12em; line-height: 1; }
h2, h3 { margin: 3px 0 0; }

.connection-pill, .board-badge, .mini-badge {
  border: 1px solid var(--line);
  background: rgba(9,28,38,.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  white-space: nowrap;
}
.connection-pill span { display:inline-block; width:8px; height:8px; border-radius:50%; background:#5a6972; margin-right:7px; }
.connection-pill.online { color:var(--green); border-color: rgba(94,225,164,.35); }
.connection-pill.online span { background:var(--green); box-shadow:0 0 10px rgba(94,225,164,.75); }
.board-badge.danger { color:#ffb0a8; border-color:rgba(255,92,77,.3); }

.login-panel {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 40px;
  align-items: center;
  padding: 54px 5vw;
  margin-top: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(7,30,41,.92), rgba(8,23,32,.92)),
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255,255,255,.015) 31px);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.login-panel::after {
  content: "";
  position:absolute;
  width:420px; height:420px; border:1px solid rgba(84,217,255,.10); border-radius:50%; right:-170px; top:-90px;
  box-shadow: 0 0 0 60px rgba(84,217,255,.025), 0 0 0 120px rgba(84,217,255,.018);
}
.profile-panel::before {
  content:"PRIZE LOCKED TO WINNER";
  position:absolute;
  left:5vw;
  bottom:28px;
  font-size:11px;
  letter-spacing:.18em;
  color:rgba(84,217,255,.42);
  font-weight:900;
}
.login-copy, .login-form { position:relative; z-index:1; }
.login-copy h2 { font-size: clamp(34px, 5vw, 64px); max-width: 800px; line-height: .98; letter-spacing: -.035em; }
.login-copy p { color:var(--muted); max-width:680px; font-size:17px; line-height:1.6; }
.login-copy strong { color:var(--ink); }
.login-form { background:rgba(4,17,24,.7); border:1px solid var(--line); border-radius:16px; padding:24px; }
.login-form label { display:block; font-size:11px; font-weight:800; letter-spacing:.16em; color:var(--muted); margin-bottom:8px; }
.login-form .second-label { margin-top:16px; }
.login-form input, .login-form select {
  width:100%; height:54px; border-radius:10px; border:1px solid rgba(84,217,255,.3); background:#061721; color:var(--ink); padding:0 15px; font-weight:800; outline:none;
}
.login-form input { letter-spacing:.03em; }
.login-form select { appearance:auto; }
.login-form input:focus, .login-form select:focus { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(84,217,255,.08); }
.login-form .primary-btn { width:100%; margin-top:14px; }
.form-message { min-height:22px; color:#ff9d92; font-size:13px; margin-top:10px; }

.primary-btn, .small-btn, .ghost-btn, .airstrike-btn {
  border-radius: 9px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 850;
  letter-spacing: .07em;
  font-size: 12px;
}
.primary-btn { border:1px solid rgba(84,217,255,.55); background:linear-gradient(180deg,#1da6dd,#137aa8); color:#f4fbff; box-shadow:inset 0 1px rgba(255,255,255,.18); }
.primary-btn:hover:not(:disabled) { filter:brightness(1.08); }
.small-btn { border:1px solid var(--line); background:#0b2430; color:var(--ink); }
.small-btn:hover:not(:disabled) { border-color:rgba(84,217,255,.55); }
.ghost-btn { border:1px solid transparent; background:transparent; color:var(--muted); }
.ghost-btn:hover { color:var(--ink); }
.airstrike-btn { border:1px solid rgba(255,215,104,.42); color:#ffe38d; background:linear-gradient(180deg,#3a3020,#272116); }
.airstrike-btn.armed { border-color:#ffd768; color:#fff4c0; box-shadow:0 0 0 2px rgba(255,215,104,.12), 0 0 24px rgba(255,156,65,.16); }
.compact { min-height:44px; }

.game { margin-top: 22px; }
.player-strip { display:grid; grid-template-columns:1fr auto 1fr; gap:14px; align-items:stretch; margin-bottom:14px; }
.player-card { border:1px solid var(--line); border-radius:13px; padding:14px 16px; background:linear-gradient(135deg,rgba(10,39,53,.88),rgba(6,27,37,.74)); min-width:0; }
.player-card.opponent-card { background:linear-gradient(135deg,rgba(48,24,25,.5),rgba(24,22,29,.72)); }
.player-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.player-card strong { display:block; margin-top:7px; font-size:clamp(18px,2.4vw,26px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reward-label { display:block; margin-top:10px; color:var(--muted); font-size:10px; letter-spacing:.11em; font-weight:800; text-transform:uppercase; }
.reward-value { display:block; margin-top:3px; font-size:14px; color:#fff1bc; font-weight:800; }
.mini-badge { padding:6px 9px; font-size:9px; color:#ffe38d; border-color:rgba(255,215,104,.28); }
.versus { align-self:center; color:#5d7b8c; font-size:12px; font-weight:950; letter-spacing:.18em; }

.status-row {
  display:flex; justify-content:space-between; gap:20px; align-items:center;
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(9,31,42,.65);
}
.status-title { font-size:clamp(20px, 3vw, 30px); font-weight:850; margin-top:2px; }
.status-sub { color:var(--muted); font-size:13px; margin-top:2px; }
.status-tools { display:flex; align-items:stretch; }
.round-box, .streak-box { text-align:center; min-width:88px; border-left:1px solid var(--line); padding-left:20px; margin-left:20px; }
.round-box span, .streak-box span { display:block; color:var(--muted); font-size:9px; letter-spacing:.12em; font-weight:800; }
.round-box strong { font-size:27px; }
.streak-box strong { display:block; font-size:13px; color:var(--green); margin-top:5px; }
.streak-box.active strong { color:#ffe38d; text-shadow:0 0 12px rgba(255,215,104,.35); }

.battle-layout { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; }
.board-panel { min-width:0; border:1px solid var(--line); border-radius:14px; background:rgba(8,29,40,.75); padding:16px; overflow:hidden; }
.enemy-panel { position:relative; }
.board-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:13px; }
.board-heading h2 { font-size:21px; }
.target-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.airstrike-hint { margin:-2px 0 11px; padding:9px 11px; border:1px solid rgba(255,215,104,.3); border-radius:8px; background:rgba(69,49,19,.38); color:#ffe8a4; font-size:11px; font-weight:800; letter-spacing:.05em; }

.board-wrap {
  display:grid;
  grid-template-columns:26px auto;
  grid-template-rows:24px auto;
  justify-content:center;
  overflow:auto;
  padding-bottom:3px;
}
.grid-corner { grid-column:1; grid-row:1; }
.col-labels { grid-column:2; grid-row:1; display:grid; grid-template-columns:repeat(10,var(--cell)); }
.row-labels { grid-column:1; grid-row:2; display:grid; grid-template-rows:repeat(10,var(--cell)); }
.col-labels span, .row-labels span { display:flex; align-items:center; justify-content:center; color:#6f91a5; font-size:10px; font-weight:800; }
.board {
  grid-column:2;
  grid-row:2;
  display:grid;
  grid-template-columns:repeat(10,var(--cell));
  grid-template-rows:repeat(10,var(--cell));
  border-left:1px solid rgba(84,217,255,.32);
  border-top:1px solid rgba(84,217,255,.32);
  background:linear-gradient(135deg, rgba(24,92,118,.16), rgba(4,28,39,.06));
}
.cell {
  width:var(--cell); height:var(--cell);
  border:0;
  border-right:1px solid rgba(84,217,255,.19);
  border-bottom:1px solid rgba(84,217,255,.19);
  background:rgba(8,41,55,.48);
  position:relative;
  padding:0;
  overflow:visible;
}
.cell::after { content:""; position:absolute; inset:7%; border-radius:4px; opacity:0; transition:.12s; }
.cell.ship::after { opacity:1; background:linear-gradient(180deg,#9bacb6,#657b88); border:1px solid rgba(255,255,255,.24); box-shadow:inset 0 -5px 8px rgba(0,0,0,.18); }
.cell.ship::before { content:""; position:absolute; z-index:2; width:5px; height:5px; border-radius:50%; background:#314a58; left:50%; top:50%; transform:translate(-50%,-50%); }
.cell.miss::after { opacity:1; width:8px; height:8px; inset:50% auto auto 50%; transform:translate(-50%,-50%); border-radius:50%; background:#d7efff; box-shadow:0 0 0 3px rgba(215,239,255,.12); }
.cell.hit::after { opacity:1; inset:24%; border-radius:50%; background:var(--red); box-shadow:0 0 10px rgba(255,92,77,.8), 0 0 0 5px rgba(255,92,77,.12); }
.cell.sunk { background:rgba(117,25,24,.34); }
.cell.revealed::before { content:""; position:absolute; inset:11%; border:1px dashed rgba(173,194,206,.4); border-radius:4px; }
.enemy .cell.targetable:hover { background:rgba(84,217,255,.14); box-shadow:inset 0 0 0 2px rgba(84,217,255,.42); z-index:2; }
.enemy .cell.targetable:hover::before { content:""; position:absolute; width:18px; height:18px; border:1px solid rgba(84,217,255,.75); border-radius:50%; left:50%; top:50%; transform:translate(-50%,-50%); }
.enemy .cell.targetable:hover::after { content:""; opacity:1; position:absolute; width:4px; height:4px; border-radius:50%; background:var(--cyan); left:50%; top:50%; transform:translate(-50%,-50%); }
.cell.place-preview { background:rgba(94,225,164,.22); }
.cell.place-bad { background:rgba(255,92,77,.22); }
.cell.air-candidate { background:rgba(255,215,104,.10); }
.cell.air-hover { background:rgba(255,156,65,.30) !important; box-shadow:inset 0 0 0 2px rgba(255,215,104,.65); z-index:3; }
.cell.air-hover::before { content:""; position:absolute; inset:22%; border:1px solid rgba(255,238,179,.9); transform:rotate(45deg); }

.control-deck { display:grid; grid-template-columns:1.6fr .7fr; gap:18px; margin-top:18px; }
.fleet-panel, .combat-log { border:1px solid var(--line); border-radius:14px; background:rgba(8,29,40,.75); padding:17px; }
.panel-title-row { display:flex; justify-content:space-between; gap:14px; align-items:center; }
.panel-title-row h3 { font-size:17px; }
.fleet-list { display:grid; grid-template-columns:repeat(5,minmax(110px,1fr)); gap:9px; margin-top:14px; }
.ship-card { min-width:0; min-height:80px; border:1px solid var(--line); border-radius:10px; background:#0a2230; color:var(--ink); text-align:left; padding:10px; position:relative; }
.ship-card.selected { border-color:var(--cyan); box-shadow:inset 0 0 0 1px rgba(84,217,255,.35); background:#0d2b3a; }
.ship-card.placed { border-color:rgba(94,225,164,.38); }
.ship-card .name { display:block; font-size:12px; font-weight:850; }
.ship-card .len { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.ship-mini { display:flex; gap:2px; margin-top:10px; }
.ship-mini i { display:block; width:14px; height:6px; background:#78909d; border-radius:2px; }
.ship-card.placed .ship-mini i { background:var(--green); }
.ship-card .check { position:absolute; right:8px; top:8px; color:var(--green); font-size:12px; }
.placement-actions, .global-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:13px; }
.combat-log { display:flex; flex-direction:column; }
.log-message { margin-top:9px; min-height:58px; color:var(--ink); font-size:14px; line-height:1.5; }
.bonus-rule { border:1px solid rgba(255,215,104,.16); border-radius:9px; background:rgba(43,34,18,.32); padding:10px 11px; color:#b8c6cf; font-size:11px; line-height:1.45; }
.bonus-rule strong { display:block; color:#ffe294; letter-spacing:.1em; font-size:9px; margin-bottom:3px; }
.legend { display:flex; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:11px; border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.legend span { display:inline-flex; gap:6px; align-items:center; }
.legend-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.legend-dot.miss { background:#d7efff; }
.legend-dot.hit { background:var(--red); box-shadow:0 0 8px rgba(255,92,77,.6); }
.legend-dot.ship { background:var(--steel); border-radius:2px; }

.toast {
  position:fixed; left:50%; bottom:22px; transform:translate(-50%,15px); background:#0e2a38; border:1px solid var(--line); color:var(--ink); border-radius:10px; padding:10px 14px; font-size:13px; opacity:0; pointer-events:none; transition:.2s; z-index:110;
}
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast.error { border-color:rgba(255,92,77,.45); color:#ffd2cd; }
.toast.bonus { border-color:rgba(255,215,104,.5); color:#fff0ae; box-shadow:0 0 24px rgba(255,156,65,.12); }

.explosion {
  position:absolute; z-index:20; left:50%; top:50%; width:11px; height:11px; transform:translate(-50%,-50%); border-radius:50%; background:#fff1c7; pointer-events:none;
  animation: blast .68s ease-out forwards;
  box-shadow: 0 0 0 0 rgba(255,156,65,.9);
}
.explosion.heavy { width:18px; height:18px; animation-duration:.95s; }
.explosion::before, .explosion::after { content:""; position:absolute; inset:-9px; border-radius:50%; border:3px solid var(--orange); opacity:.85; }
.explosion::before { animation:ring .6s ease-out forwards; }
.explosion::after { inset:-4px; border-color:var(--red); animation:ring .45s ease-out forwards; }
.debris { position:absolute; z-index:19; left:50%; top:50%; width:4px; height:4px; border-radius:1px; background:#ffd38a; pointer-events:none; animation:debrisFly .72s ease-out forwards; transform:rotate(var(--angle)) translateX(0); }
.fire-flame { position:absolute; z-index:18; left:50%; bottom:18%; width:10px; height:18px; border-radius:60% 40% 65% 35%; background:linear-gradient(180deg,#fff1a8 0%,#ff9c41 45%,#f24835 80%,transparent 100%); transform:translateX(-50%) rotate(45deg); filter:drop-shadow(0 0 7px rgba(255,92,77,.7)); animation:flameFlicker .18s ease-in-out infinite alternate, flameDie 2.4s ease-out forwards; pointer-events:none; }
.fire-flame.f2 { left:35%; width:8px; height:14px; animation-delay:.08s; }
.fire-flame.f3 { left:65%; width:7px; height:12px; animation-delay:.15s; }
.splash-fx { position:absolute; z-index:15; left:50%; top:52%; width:5px; height:5px; border:2px solid #c7efff; border-radius:50%; transform:translate(-50%,-50%); animation:splashRing .75s ease-out forwards; pointer-events:none; }
.splash-fx::before, .splash-fx::after { content:""; position:absolute; width:3px; height:11px; border-radius:50%; background:#d8f4ff; left:50%; top:50%; transform-origin:50% 12px; animation:droplet .65s ease-out forwards; }
.splash-fx::before { transform:translate(-50%,-50%) rotate(-35deg); }
.splash-fx::after { transform:translate(-50%,-50%) rotate(48deg); }

@keyframes blast {
  0% { transform:translate(-50%,-50%) scale(.2); opacity:1; box-shadow:0 0 0 0 rgba(255,156,65,.9); }
  45% { transform:translate(-50%,-50%) scale(2.8); box-shadow:0 0 18px 12px rgba(255,92,77,.45); }
  100% { transform:translate(-50%,-50%) scale(.5); opacity:0; box-shadow:0 0 34px 24px rgba(255,92,77,0); }
}
@keyframes ring { from { transform:scale(.3); opacity:1; } to { transform:scale(2.8); opacity:0; } }
@keyframes debrisFly { 0% { opacity:1; transform:rotate(var(--angle)) translateX(0) scale(1); } 100% { opacity:0; transform:rotate(var(--angle)) translateX(34px) scale(.2); } }
@keyframes flameFlicker { from { transform:translateX(-50%) rotate(42deg) scale(.88,1); } to { transform:translateX(-50%) rotate(48deg) scale(1.12,.94); } }
@keyframes flameDie { 0%,70% { opacity:1; } 100% { opacity:0; } }
@keyframes splashRing { from { width:5px; height:5px; opacity:1; } to { width:46px; height:18px; opacity:0; } }
@keyframes droplet { from { opacity:1; margin-top:0; } to { opacity:0; margin-top:-24px; } }

.victory-overlay { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:22px; background:rgba(2,10,15,.88); backdrop-filter:blur(8px); overflow:hidden; }
.victory-card { width:min(580px,100%); position:relative; z-index:2; text-align:center; border:1px solid rgba(84,217,255,.34); border-radius:22px; background:linear-gradient(160deg,#0c2b39,#071720 72%); padding:42px 28px 30px; box-shadow:0 30px 100px rgba(0,0,0,.45); }
.victory-card::before { content:""; position:absolute; inset:12px; border:1px solid rgba(255,255,255,.05); border-radius:15px; pointer-events:none; }
.victory-kicker { color:var(--green); font-size:11px; letter-spacing:.2em; font-weight:900; }
.victory-card h2 { margin:9px 0 0; font-size:clamp(40px,7vw,72px); line-height:.92; letter-spacing:-.04em; }
.victory-card p { color:var(--muted); margin:18px 0 6px; }
.victory-reward { margin:0 auto 24px; padding:15px 18px; border:1px solid rgba(255,215,104,.34); background:rgba(74,52,19,.38); border-radius:12px; color:#fff0ad; font-size:clamp(20px,4vw,32px); font-weight:900; }
.confetti-field { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.confetti { position:absolute; top:-20px; width:9px; height:16px; border-radius:2px; opacity:.95; animation:confettiFall var(--dur) linear forwards; transform:translate3d(0,0,0) rotate(var(--rot)); }
@keyframes confettiFall { to { transform:translate3d(var(--drift),110vh,0) rotate(calc(var(--rot) + 720deg)); } }

@media (max-width: 1000px) {
  :root { --cell: clamp(27px, 7.4vw, 46px); }
  .battle-layout { grid-template-columns:1fr; }
  .control-deck { grid-template-columns:1fr; }
  .fleet-list { grid-template-columns:repeat(3,minmax(100px,1fr)); }
}
@media (max-width: 720px) {
  .app-shell { width:min(100% - 18px,1500px); padding-top:12px; }
  .topbar { grid-template-columns:auto 1fr; }
  .connection-pill { grid-column:1 / -1; justify-self:start; }
  .login-panel { grid-template-columns:1fr; padding:30px 18px; gap:22px; min-height:0; }
  .login-copy h2 { font-size:38px; }
  .profile-panel::before { display:none; }
  .player-strip { grid-template-columns:1fr; }
  .versus { justify-self:center; }
  .status-row { align-items:flex-start; flex-direction:column; }
  .status-tools { width:100%; justify-content:flex-end; }
  .board-panel { padding:10px 7px 12px; }
  .board-heading { padding:0 4px; align-items:flex-start; }
  .board-badge { display:none; }
  .target-actions { justify-content:flex-start; }
  .fleet-list { grid-template-columns:repeat(2,minmax(105px,1fr)); }
  .panel-title-row { align-items:flex-start; flex-direction:column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  .confetti-field { display:none; }
}

/* Fun / Classic mode controls */
.topbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.fun-toggle { display:inline-flex; align-items:center; gap:9px; min-height:42px; padding:6px 10px; border:1px solid rgba(255,215,104,.28); border-radius:12px; background:rgba(38,31,18,.55); cursor:pointer; user-select:none; }
.fun-toggle input { position:absolute; opacity:0; pointer-events:none; }
.toggle-track { width:42px; height:24px; border-radius:999px; background:#29404c; border:1px solid rgba(255,255,255,.12); padding:2px; transition:.18s ease; }
.toggle-knob { display:block; width:18px; height:18px; border-radius:50%; background:#91a9b7; transition:.18s ease; }
.fun-toggle input:checked + .toggle-track { background:rgba(94,225,164,.28); border-color:rgba(94,225,164,.55); }
.fun-toggle input:checked + .toggle-track .toggle-knob { transform:translateX(18px); background:var(--green); box-shadow:0 0 10px rgba(94,225,164,.55); }
.fun-toggle input:focus-visible + .toggle-track { outline:2px solid var(--cyan); outline-offset:2px; }
.toggle-copy { display:flex; flex-direction:column; line-height:1.05; }
.toggle-copy strong { font-size:10px; letter-spacing:.12em; }
.toggle-copy small { margin-top:3px; color:var(--muted); font-size:8px; letter-spacing:.12em; font-weight:800; }
.fun-off .fun-extra { display:none !important; }
.fun-off .player-card { min-height:76px; }
.fun-off .player-card strong { margin-top:9px; }

/* Hit-question overlay */
.question-overlay { position:fixed; inset:0; z-index:105; display:grid; place-items:center; padding:22px; background:rgba(2,10,15,.84); backdrop-filter:blur(7px); }
.question-card { width:min(700px,100%); position:relative; border:1px solid rgba(84,217,255,.4); border-radius:22px; background:linear-gradient(160deg,#0d3140,#081b25 72%); padding:40px 34px 30px; box-shadow:0 30px 100px rgba(0,0,0,.5); }
.question-card::before { content:""; position:absolute; inset:12px; border:1px solid rgba(255,255,255,.05); border-radius:15px; pointer-events:none; }
.question-x { position:absolute; right:15px; top:13px; width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:#0b2430; color:var(--ink); font-size:28px; line-height:1; z-index:2; }
.question-x:hover:not(:disabled) { border-color:var(--cyan); }
.question-kicker { color:var(--orange); font-size:11px; letter-spacing:.19em; font-weight:950; }
.question-card h2 { margin:10px 54px 0 0; font-size:clamp(24px,4vw,38px); letter-spacing:-.025em; }
.question-text { margin:26px 0 20px; padding:22px; border:1px solid rgba(255,215,104,.3); border-radius:14px; background:rgba(53,42,19,.35); color:#fff3bd; font-size:clamp(24px,4.4vw,40px); line-height:1.18; font-weight:850; letter-spacing:-.025em; }
.question-card p { color:var(--muted); font-size:14px; line-height:1.55; margin:0 0 20px; }
.question-card .primary-btn { min-width:220px; }

@media (max-width: 720px) {
  .topbar-actions { grid-column:1 / -1; justify-content:space-between; width:100%; }
  .fun-toggle { flex:1 1 auto; max-width:220px; }
  .question-card { padding:36px 20px 24px; }
  .question-text { padding:18px; }
  .question-card .primary-btn { width:100%; }
}

/* Player 1 reward editor */
.reward-settings-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 82;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,215,104,.48);
  background: linear-gradient(180deg,#44371d,#2c2518);
  color: #fff0ae;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  box-shadow: 0 10px 32px rgba(0,0,0,.28);
}
.reward-settings-btn:hover:not(:disabled) { border-color:#ffd768; filter:brightness(1.07); }
.reward-settings-btn:disabled { opacity:.52; }
.reward-overlay { position:fixed; inset:0; z-index:108; display:grid; place-items:center; padding:22px; background:rgba(2,10,15,.86); backdrop-filter:blur(7px); }
.reward-editor-card { width:min(680px,100%); max-height:calc(100vh - 44px); overflow:auto; position:relative; border:1px solid rgba(255,215,104,.34); border-radius:22px; background:linear-gradient(160deg,#102b35,#081a23 72%); padding:40px 30px 28px; box-shadow:0 30px 100px rgba(0,0,0,.5); }
.reward-editor-card h2 { margin:9px 54px 0 0; font-size:clamp(28px,4.2vw,42px); letter-spacing:-.03em; }
.reward-editor-card > p { margin:14px 0 22px; color:var(--muted); line-height:1.55; }
.reward-editor-list { display:grid; gap:10px; }
.reward-editor-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:center; }
.reward-editor-row input { width:100%; min-width:0; height:50px; border-radius:10px; border:1px solid rgba(84,217,255,.25); background:#061721; color:var(--ink); padding:0 14px; outline:none; font-weight:750; }
.reward-editor-row input:focus { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(84,217,255,.08); }
.reward-remove-btn { min-height:46px; border-radius:9px; padding:0 12px; border:1px solid rgba(255,92,77,.28); background:rgba(65,24,25,.42); color:#ffb9b2; font-size:10px; font-weight:900; letter-spacing:.08em; }
.reward-remove-btn:disabled { opacity:.35; }
.reward-editor-actions { display:flex; justify-content:space-between; gap:10px; margin-top:16px; flex-wrap:wrap; }
.reward-editor-actions .primary-btn { min-width:180px; }

@media (max-width:720px) {
  .reward-settings-btn { right:12px; bottom:12px; }
  .reward-editor-card { padding:36px 18px 22px; }
  .reward-editor-row { grid-template-columns:1fr; }
  .reward-remove-btn { justify-self:end; min-height:40px; }
  .reward-editor-actions { flex-direction:column; }
  .reward-editor-actions button { width:100%; }
}
