* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { width:100%; height:100%; overflow:hidden; background:#070a18; }
body {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color:#e8eaff; user-select:none;
}
#game { position:fixed; inset:0; }
canvas { display:block; position:absolute; inset:0; }

/* ---------------- HUD ---------------- */
#hud {
  position:absolute; top:0; left:0; right:0; min-height:92px;
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px 10px;
  padding:10px 14px 6px; pointer-events:none; z-index:5;
}

/* concept strip, sits right under the score cards */
#legend {
  flex:0 0 100%; display:flex; flex-direction:column; align-items:center; gap:3px;
  max-width:min(920px,100%); margin:0 auto; padding:6px 14px;
  border-radius:13px; font-size:12px; font-weight:700; letter-spacing:.02em;
  color:rgba(232,234,255,.72);
  background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.09);
  box-shadow:0 6px 20px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter:blur(9px);
}
#legend .lg-row { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:3px 16px; }
#legend .lg-item { white-space:nowrap; }
#legend .lg-item b { color:#fff; font-weight:900; }
#legend .lg-item i { font-style:normal; opacity:.55; font-weight:600; }
#legend .ico { margin-right:2px; }
#legend .lg-keys { font-size:11px; color:rgba(232,234,255,.6); gap:2px 14px; }
#legend kbd {
  display:inline-block; padding:1px 6px; border-radius:5px; font-size:10px; font-weight:800;
  background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.2); border-bottom-width:2px;
}
#legend .lg-tag {
  padding:1px 9px; border-radius:999px; font-size:10px; letter-spacing:.12em;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14);
}

/* ---- setup options: difficulty + round time + weapons + theme ---- */
.options { display:flex; gap:12px; width:min(600px,100%); margin-bottom:12px; flex-wrap:wrap; }
.options.wide { width:min(700px,100%); }
.opt {
  flex:1 1 240px; display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:9px 12px; border-radius:15px;
  background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.09);
}
.opt-lbl { font-size:10px; letter-spacing:.2em; font-weight:800; opacity:.5; }
.opt-note { font-size:10.5px; letter-spacing:.03em; opacity:.5; font-weight:700; min-height:13px; text-align:center; }
.opt-note b { color:#fff; }
.seg.diffs button { font-size:12.5px; padding:7px 13px; }
.time-row { display:flex; align-items:center; gap:7px; }
.time-row input {
  width:74px; text-align:center; font:inherit; font-size:20px; font-weight:900; letter-spacing:.02em;
  color:#fff; background:rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.16);
  border-radius:11px; padding:5px 4px; outline:none; font-variant-numeric:tabular-nums;
  -moz-appearance:textfield;
}
.time-row input:focus { border-color:rgba(255,190,90,.75); box-shadow:0 0 0 3px rgba(255,180,60,.16); }
.time-row input::-webkit-outer-spin-button,
.time-row input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.time-row .unit { font-size:11px; font-weight:800; opacity:.45; letter-spacing:.08em; }
.stepbtn {
  width:32px; height:32px; border-radius:10px; cursor:pointer; font:inherit;
  font-size:18px; font-weight:900; line-height:1; color:#e8eaff;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
  transition:.14s;
}
.stepbtn:hover { background:rgba(255,255,255,.18); }
.stepbtn:active { transform:scale(.94); }

/* segmented controls */
.seg { display:inline-flex; flex-wrap:wrap; justify-content:center; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); border-radius:999px; padding:4px; gap:4px; }
.seg button {
  font:inherit; font-size:13px; font-weight:800; letter-spacing:.05em; padding:8px 16px; border-radius:999px;
  border:none; background:transparent; color:rgba(255,255,255,.55); cursor:pointer; transition:.16s;
}
.seg button.on { background:linear-gradient(180deg,#ffe08a,#ffb020); color:#241000; box-shadow:0 4px 14px -4px rgba(255,170,50,.8); }
.seg.themes button { font-size:11.5px; padding:7px 11px; letter-spacing:.04em; }
.seg.themes sup { font-size:7.5px; font-weight:900; letter-spacing:.06em; color:#ffd166; margin-left:2px; vertical-align:super; }
.seg.themes button.on sup { color:#7a3c00; }
.seg.counts button { font-size:14px; padding:8px 15px; min-width:38px; }

/* ---------------- score cards ---------------- */
#over .meta { font-size:11px; letter-spacing:.16em; font-weight:800; opacity:.42; margin-bottom:2px; }
.card {
  min-width:118px; padding:7px 11px 8px; border-radius:16px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 6px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.09);
  backdrop-filter: blur(9px);
  display:flex; flex-direction:column; gap:2px;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card.lead { transform:translateY(-3px) scale(1.045); border-color:rgba(255,255,255,.35); box-shadow:0 10px 30px rgba(0,0,0,.45), 0 0 22px -4px var(--c); }
.card.stunned { border-color:#ff5a5a; box-shadow:0 0 22px -2px #ff3b3b, 0 6px 24px rgba(0,0,0,.4); }
.pname { font-size:12px; letter-spacing:.12em; text-transform:uppercase; font-weight:700; opacity:.92; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:4px; }
.pav { font-size:14px; line-height:1; }
.ptxt { overflow:hidden; text-overflow:ellipsis; }
.prow { display:flex; align-items:baseline; gap:7px; }
.pscore { font-size:25px; font-weight:800; color:var(--c); line-height:1; text-shadow:0 0 16px var(--c); font-variant-numeric:tabular-nums; }
.pkeys { font-size:8.5px; letter-spacing:.06em; opacity:.42; font-weight:700; white-space:nowrap; }
.pips { display:flex; align-items:center; gap:9px; font-size:10px; font-weight:800; letter-spacing:.06em; line-height:1; height:11px; }
.pips .ammo { color:rgba(255,255,255,.78); letter-spacing:1.5px; }
.pips .nit { color:rgba(255,255,255,.38); }
.pips .nit.active { color:#ffd166; text-shadow:0 0 10px #ffd166; }

#timerWrap {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:96px; padding:6px 13px; border-radius:16px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(9px);
  box-shadow:0 6px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.09);
}
#timer { font-size:32px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums; letter-spacing:.02em; }
#timer.low { color:#ff6b6b; text-shadow:0 0 22px #ff3b3b; animation:pulse .7s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.09)} }
#timerLbl { font-size:9px; letter-spacing:.22em; opacity:.45; font-weight:800; margin-top:4px; }

/* ---------------- Overlays ---------------- */
.overlay {
  position:absolute; inset:0; z-index:20;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:24px; text-align:center;
  background:radial-gradient(ellipse at 50% 30%, rgba(24,16,64,.72), rgba(4,5,14,.94) 70%);
  backdrop-filter: blur(5px);
  animation:fadein .28s ease;
}
@keyframes fadein { from{opacity:0} to{opacity:1} }
.hidden { display:none !important; }
.menu-scroll { overflow-y:auto; justify-content:flex-start; padding-top:22px; }

.title {
  font-size:clamp(30px, 6.4vw, 70px); font-weight:900; letter-spacing:.03em; line-height:.94;
  background:linear-gradient(180deg,#fff 12%,#ffd76e 48%,#ff9b3d 78%,#ff6fae 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 4px 26px rgba(255,180,80,.42));
  margin-bottom:2px;
}
.subtitle { font-size:clamp(10px,2vw,14px); letter-spacing:.30em; text-transform:uppercase; opacity:.5; font-weight:700; margin-bottom:18px; }

/* ---------------- brand lockup (menu) ---------------- */
.brand { display:flex; align-items:center; justify-content:center; gap:clamp(8px,1.6vw,16px); }
.brand-text { display:flex; flex-direction:column; text-align:left; }
.brand-text .subtitle { margin-bottom:0; }
.brand-mark {
  flex:none; width:clamp(46px,8vw,78px); height:clamp(46px,8vw,78px);
  filter:drop-shadow(0 8px 22px rgba(255,190,90,.35));
  animation:brandfloat 5s ease-in-out infinite;
}
@keyframes brandfloat { 0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-6px) rotate(3deg)} }
@media (max-width:520px){
  .brand { flex-direction:column; gap:8px; margin-bottom:14px; }
  .brand-text { text-align:center; }
}

.setup { display:flex; flex-direction:column; gap:9px; width:min(600px,100%); margin-bottom:4px; }
.setup-hint { font-size:10.5px; letter-spacing:.06em; opacity:.42; font-weight:700; margin-bottom:14px; }
.slot {
  display:flex; align-items:center; gap:10px;
  padding:8px 13px; border-radius:15px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10);
  transition:opacity .2s, transform .2s;
}
.slot.off { opacity:.22; }
.slot.off .avbtn, .slot.off .dot { pointer-events:none; }
.avbtn {
  flex:0 0 auto; width:30px; height:30px; border-radius:10px; cursor:pointer; padding:0;
  font-size:17px; line-height:1; display:grid; place-items:center;
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.14);
  transition:.14s;
}
.avbtn:hover { background:rgba(255,255,255,.16); transform:translateY(-1px); }
.avbtn:active { transform:scale(.93); }
.dot {
  width:16px; height:16px; border-radius:50%; padding:0; border:none; cursor:pointer;
  background:var(--c); box-shadow:0 0 16px var(--c); flex:0 0 auto;
}
.dot:hover { transform:scale(1.15); }
.slot input {
  flex:1; min-width:0; background:transparent; border:none; outline:none; color:#fff;
  font:inherit; font-size:16px; font-weight:700; letter-spacing:.02em;
}
.slot input::placeholder { color:rgba(255,255,255,.3); }
.slot .keys { font-size:9.5px; letter-spacing:.08em; opacity:.5; font-weight:800; white-space:nowrap; }

/* ---- player row grows a second line: one key chip per action ---- */
.slot { flex-direction:column; align-items:stretch; gap:8px; padding:9px 12px; }
.slot-main { display:flex; align-items:center; gap:10px; }
.kbrow { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.kbhead { font-size:8.5px; letter-spacing:.18em; font-weight:800; opacity:.32; margin-right:2px; }
.kbtn {
  min-width:26px; height:24px; padding:0 7px; border-radius:7px; cursor:pointer;
  font:inherit; font-size:10.5px; font-weight:800; letter-spacing:.03em; color:#e8eaff;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
  border-bottom-width:2px; transition:.13s; white-space:nowrap;
}
.kbtn:hover { background:rgba(255,255,255,.18); }
.kbtn.fire  { color:#ffd166; }
.kbtn.nitro { color:#60d7ff; }
.kbtn.listening {
  background:linear-gradient(180deg,#ffe08a,#ffb020); color:#241000; border-color:#ffd166;
  animation:kbPulse .7s infinite;
}
@keyframes kbPulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,190,80,.55)} 50%{box-shadow:0 0 0 6px rgba(255,190,80,0)} }
.kbtn.bad { animation:kbBad .3s 2; }
@keyframes kbBad { 0%,100%{background:rgba(255,80,90,.22)} 50%{background:rgba(255,80,90,.62)} }
.kbtn.moved { animation:kbMoved .3s 2; }
@keyframes kbMoved { 0%,100%{background:rgba(120,200,255,.16)} 50%{background:rgba(120,200,255,.55)} }
.kbreak { width:1px; height:16px; background:rgba(255,255,255,.14); margin:0 2px; }
.kbreset { opacity:.5; font-size:12px; padding:0 6px; }
.slot.off .kbtn { pointer-events:none; }

/* ---- compact numeric steppers ---- */
.time-row.sm input { width:52px; font-size:16px; padding:3px 2px; border-radius:9px; }
.time-row.sm .stepbtn { width:27px; height:27px; font-size:15px; border-radius:8px; }
.stepbtn.auto { width:auto; padding:0 8px; font-size:10px; letter-spacing:.08em; font-weight:800; }
.stepbtn.auto.on { background:linear-gradient(180deg,#ffe08a,#ffb020); color:#241000; border-color:#ffd166; }

/* ---- one compact key hint per player, under START ---- */
.hint-keys { display:flex; flex-wrap:wrap; justify-content:center; gap:4px 16px; margin-bottom:7px; }
.hint-keys .kh { font-size:11px; font-weight:800; letter-spacing:.04em; white-space:nowrap; opacity:.78; }
.hint-keys .kh b { font-weight:900; margin-right:4px; }
.hint-keys .kh kbd { font-size:10px; padding:1px 5px; margin:0 1px; opacity:.9; }

.btn {
  font:inherit; font-weight:800; letter-spacing:.06em;
  padding:14px 38px; border-radius:999px; border:none; cursor:pointer;
  color:#241000; font-size:18px;
  background:linear-gradient(180deg,#ffe08a,#ffb020 60%,#ff8a1f);
  box-shadow:0 10px 30px -6px rgba(255,160,40,.7), inset 0 1px 0 rgba(255,255,255,.65), inset 0 -3px 0 rgba(160,70,0,.28);
  transition:transform .12s ease, box-shadow .18s ease, filter .18s;
}
.btn:hover { transform:translateY(-2px) scale(1.03); box-shadow:0 16px 38px -6px rgba(255,170,50,.85), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -3px 0 rgba(160,70,0,.28); }
.btn:active { transform:translateY(1px) scale(.99); }
.btn.ghost {
  background:rgba(255,255,255,.07); color:#dfe2ff; font-size:14px; padding:12px 26px;
  border:1px solid rgba(255,255,255,.16);
  box-shadow:none;
}
.btn.ghost:hover { background:rgba(255,255,255,.13); box-shadow:none; transform:translateY(-1px); }
.btn.ghost.danger {
  color:#ffc9d0; border-color:rgba(255,90,110,.42); background:rgba(255,70,90,.12);
}
.btn.ghost.danger:hover { background:rgba(255,70,90,.24); border-color:rgba(255,90,110,.72); }

/* ---- EXIT button, pinned in the corner of the live HUD ---- */
.hud-exit {
  position:absolute; top:8px; right:10px; z-index:6; pointer-events:auto;
  display:inline-flex; align-items:center; gap:5px; cursor:pointer;
  padding:6px 11px; border-radius:10px;
  font:800 10.5px/1 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing:.12em; color:rgba(255,226,230,.92);
  background:rgba(255,70,90,.13); border:1px solid rgba(255,90,110,.38);
  box-shadow:0 4px 14px -6px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(8px);
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}
.hud-exit:hover { background:rgba(255,70,90,.26); border-color:rgba(255,90,110,.8); }
.hud-exit:active { transform:scale(.94); }
.hud-exit span { font-size:11px; line-height:1; }

/* endless ammo glyph on the score cards */
.pips .ammo.inf { font-size:15px; letter-spacing:0; color:#ffd166; text-shadow:0 0 10px rgba(255,209,102,.55); }

/* a setting that the current mode ignores */
.time-row input.dim { opacity:.38; }
.time-row input.dim:focus { opacity:1; }

@media (max-width:640px){
  .hud-exit { top:6px; right:6px; padding:5px 8px; font-size:9.5px; border-radius:8px; }
}
.row { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; align-items:center; }
.hint { font-size:12px; opacity:.5; letter-spacing:.05em; margin-top:14px; line-height:1.9; }
.hint kbd {
  display:inline-block; padding:2px 7px; margin:0 2px; border-radius:6px; font-size:11px; font-weight:800;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16); border-bottom-width:2px;
}

/* ---------------- credit line ---------------- */
.credit {
  display:inline-flex; align-items:center; gap:6px; margin-top:16px; margin-bottom:6px;
  font-size:11.5px; font-weight:800; letter-spacing:.14em; text-transform:uppercase;
  color:rgba(232,234,255,.55); text-decoration:none;
  padding:7px 15px; border-radius:999px;
  background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.10);
  transition:.16s;
}
.credit:hover { color:#fff; background:rgba(255,255,255,.11); border-color:rgba(255,255,255,.24); }
.qmark {
  display:inline-grid; place-items:center; width:16px; height:16px; border-radius:50%;
  font-size:10px; font-weight:900; color:#241000;
  background:linear-gradient(180deg,#ffe08a,#ffb020);
}
.credit .qmark { cursor:pointer; }

/* ---------------- Credits screen ---------------- */
.credits-card {
  width:min(430px,100%); padding:26px 26px 22px; border-radius:24px;
  background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.13);
  box-shadow:0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(14px);
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.credits-logo { width:min(310px,94%); height:auto; margin:-2px 0 0; }
.credits-title { font-size:22px; font-weight:900; letter-spacing:.14em;
  background:linear-gradient(180deg,#fff,#ffce6b 60%,#ff9b3d);
  -webkit-background-clip:text; background-clip:text; color:transparent; }
.madeby { font-size:15px; font-weight:700; letter-spacing:.06em; opacity:.9; display:flex; align-items:center; gap:6px; }
.madeby b { color:#ffd166; }
.credlink {
  font-size:12.5px; font-weight:800; letter-spacing:.04em; color:#8fd8ff; text-decoration:none;
  padding:7px 14px; border-radius:999px; background:rgba(120,200,255,.10);
  border:1px solid rgba(120,200,255,.28);
}
.credlink:hover { background:rgba(120,200,255,.2); color:#fff; }
.credits-sub { font-size:9.5px; letter-spacing:.26em; font-weight:800; opacity:.42; margin-top:8px; }
.contacts { display:flex; flex-direction:column; gap:7px; width:100%; }
.contacts a {
  font-size:13.5px; font-weight:700; letter-spacing:.03em; color:#e8eaff; text-decoration:none;
  padding:9px 12px; border-radius:11px; word-break:break-all;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10);
}
.contacts a:hover { background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.24); }
.credits-card .btn { margin-top:8px; }

/* ---------------- End screen ---------------- */
#over .headline { font-size:clamp(26px,5.6vw,54px); font-weight:900; letter-spacing:.02em; margin-bottom:4px; }
#over .crown { font-size:clamp(38px,8vw,70px); line-height:1; margin-bottom:6px; animation:bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-10px) rotate(3deg)} }
.board { width:min(460px,100%); display:flex; flex-direction:column; gap:9px; margin:18px 0 24px; }
.line {
  display:flex; align-items:center; gap:12px; padding:11px 15px; border-radius:14px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.10);
  animation:slide .38s cubic-bezier(.2,.9,.3,1.2) backwards;
}
@keyframes slide { from{opacity:0; transform:translateX(-26px)} to{opacity:1; transform:none} }
.line.top { background:rgba(255,210,90,.12); border-color:rgba(255,210,90,.4); box-shadow:0 0 26px -8px #ffc84a; }
.line .rank { font-size:15px; font-weight:900; opacity:.55; width:20px; }
.line .nm { flex:1; text-align:left; font-size:16px; font-weight:800; color:var(--c); }
.line .sc { font-size:20px; font-weight:900; font-variant-numeric:tabular-nums; }
#over .again { font-size:14px; opacity:.4; letter-spacing:.04em; }

@media (max-height: 700px){
  .title { font-size:clamp(26px,5vw,44px); }
  .subtitle { margin-bottom:12px; }
  .setup { gap:7px; }
  .slot { padding:6px 11px; }
  .setup-hint { margin-bottom:10px; }
  .options { margin-bottom:9px; gap:9px; }
  .opt { padding:7px 10px; gap:4px; }
  .hint { margin-top:10px; line-height:1.6; }
  .btn { padding:11px 30px; font-size:16px; }
}

@media (max-width: 620px){
  #legend { font-size:10.5px; gap:2px; padding:5px 8px; }
  #legend .lg-row { gap:2px 9px; }
  #legend .lg-keys { font-size:9.5px; }
  #hud { gap:6px 8px; padding:8px 8px 5px; }
  .card { min-width:92px; padding:6px 8px; }
  .pscore { font-size:21px; }
  .pips { font-size:9px; gap:6px; }
  #timerWrap { min-width:74px; padding:5px 9px; }
  #timer { font-size:26px; }
  .options { flex-direction:column; }
  .overlay { overflow-y:auto; justify-content:flex-start; padding:16px; }
  .slot .keys { display:none; }
}

/* --- always-visible contact strip under the pre-game menu --- */
.menu-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.62);
  max-width: 100%;
}
.menu-contacts .mc-label {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.42);
}
.menu-contacts a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.menu-contacts a:hover {
  color: #ffd166;
  border-bottom-color: rgba(255, 209, 102, 0.5);
}
@media (max-width: 520px) {
  .menu-contacts {
    font-size: 10.5px;
    gap: 4px 10px;
    padding: 7px 10px;
    border-radius: 16px;
  }
  .menu-contacts a {
    white-space: normal;
  }
}


/* online entry link on the local menu */
.online-cta{display:block;margin-top:8px;text-align:center;text-decoration:none;font-size:12px;letter-spacing:1.6px}


/* ---- per-seat CPU switch ---- */.cpbtn{flex:0 0 auto;height:30px;padding:0 9px;border-radius:10px;cursor:pointer;font:700 9px/1 'Space Grotesk',system-ui,sans-serif;letter-spacing:1.4px;color:#c9c2ff;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);transition:.14s;white-space:nowrap}.cpbtn:hover{background:rgba(255,255,255,.12);color:#fff}.slot.is-cpu .cpbtn{color:#0d0720;background:linear-gradient(180deg,#8ef7c4,#4ade80);border-color:transparent;box-shadow:0 0 14px rgba(74,222,128,.35)}.slot.is-cpu .kbtn{opacity:.45}.slot.is-cpu .kbrow{pointer-events:none}

/* ============================================================
   MENU LAYOUT  -  tips on the left, live summary on the right,
   and an action bar that is always on screen
   ============================================================ */
.menu-scroll{ padding-top:18px; padding-bottom:0; }

.menu-layout{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  gap:26px;
  width:100%;
  max-width:1200px;
  margin:0 auto;
}
.menu-main{
  display:flex;
  flex-direction:column;
  align-items:center;
  flex:0 1 700px;
  min-width:0;
}

/* ---------------------------------------------------------- side panels */
.side-panel{
  position:sticky;
  top:0;
  flex:0 0 220px;
  width:220px;
  text-align:left;
  padding:16px 15px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg,rgba(23,16,52,.86),rgba(9,7,24,.78));
  backdrop-filter:blur(10px);
  box-shadow:0 20px 46px -22px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.06);
}
.side-left{ border-color:rgba(120,190,255,.16); }
.side-right{ border-color:rgba(255,209,102,.18); }

.side-kicker{
  font-size:9px; font-weight:800; letter-spacing:.24em;
  color:rgba(255,255,255,.42); margin-bottom:3px;
}
.side-title{
  font-size:15px; font-weight:900; letter-spacing:.14em;
  background:linear-gradient(180deg,#fff,#ffd76e 70%,#ff9b3d);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  margin-bottom:12px;
}
.side-right .side-title{
  background:linear-gradient(180deg,#fff,#9be7ff 70%,#6ec8ff);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}

/* tips list */
.tips{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.tips li{ display:flex; align-items:flex-start; gap:9px; }
.tips li i{
  flex:none; font-style:normal; font-size:15px; line-height:1.15;
  width:18px; text-align:center; filter:drop-shadow(0 2px 6px rgba(255,190,90,.3));
}
.tips li div{ display:flex; flex-direction:column; min-width:0; }
.tips li b{ font-size:11.5px; font-weight:800; letter-spacing:.08em; color:#fff; line-height:1.25; }
.tips li span{ font-size:10.5px; line-height:1.35; color:rgba(255,255,255,.52); font-weight:600; }

.side-sep{ height:1px; background:rgba(255,255,255,.10); margin:13px 0 11px; }

.side-keys{ display:flex; flex-wrap:wrap; gap:6px 12px; }
.side-keys span{ font-size:10px; font-weight:700; letter-spacing:.08em; color:rgba(255,255,255,.55); display:flex; align-items:center; gap:5px; }
.side-keys kbd{
  font-size:9px; padding:2px 5px; border-radius:5px;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.18);
  color:#fff; font-family:inherit; font-weight:800;
}
.side-note{
  margin-top:11px; font-size:10px; line-height:1.5; font-weight:600;
  color:rgba(255,255,255,.40); letter-spacing:.04em;
}
.side-note b{ color:rgba(255,255,255,.72); }

/* summary rows */
.sum{ display:flex; flex-direction:column; gap:1px; }
.srow{
  display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  padding:5px 0; border-bottom:1px dashed rgba(255,255,255,.07);
}
.srow:last-child{ border-bottom:0; }
.srow span{
  font-size:9px; font-weight:800; letter-spacing:.16em;
  color:rgba(255,255,255,.38); white-space:nowrap;
}
.srow b{
  font-size:11.5px; font-weight:800; letter-spacing:.05em; color:#ffe3a3;
  text-align:right; font-variant-numeric:tabular-nums;
}
.srow b.off{ color:rgba(255,255,255,.36); }
.sum-foot{
  font-size:9.5px; font-weight:700; letter-spacing:.10em; line-height:1.6;
  color:rgba(255,255,255,.40); text-transform:uppercase;
}

/* hide the wings when there is genuinely no room for them */
@media (max-width:1239px){
  .side-panel{ display:none; }
  .menu-layout{ gap:0; }
  .menu-main{ flex:1 1 auto; }
}

/* ------------------------------------------------------- action bar */
.action-dock{
  position:sticky;
  bottom:0;
  z-index:32;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
  width:100%;
  padding:26px 0 14px;
  margin-top:-6px;
  background:linear-gradient(180deg,
    rgba(6,5,16,0) 0%,
    rgba(6,5,16,.72) 32%,
    rgba(6,5,16,.94) 62%,
    rgba(6,5,16,.99) 100%);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}
.action-dock .btn{ margin:0; }
.action-dock .online-cta{ margin-top:0; }

/* ------------------------------- locked (disabled) option controls */
.time-row.locked,
.seg.locked{
  opacity:.34;
  filter:grayscale(.65);
  pointer-events:none;
  cursor:not-allowed;
}
.time-row.locked input,
.time-row.locked button,
.seg.locked button{ cursor:not-allowed; }
input.locked,
input:disabled{
  opacity:.55;
  cursor:not-allowed;
  -webkit-text-fill-color:rgba(255,255,255,.45);
}
.opt-note.lock{ color:#ffb3b3 !important; opacity:.9 !important; }
@media (max-width:520px){
  .action-dock{ padding-top:18px; padding-bottom:10px; }
  .action-dock .btn{ width:100%; }
}

/* =================================================================
   2.5.0 - aim / TURN key, per-player level, players picker,
   bind messages, HUD that fits 800x600 and scales up on 2K / 4K
   ================================================================= */

/* PLAYERS picker - first thing on the menu */
.players-pick { display:flex; align-items:center; justify-content:center; gap:12px; margin:0 0 12px; flex-wrap:wrap; }
.players-pick .opt-lbl { opacity:.75; font-size:11px; }

/* short "swapped / refused / can't start" line under the seat cards */
.bind-msg {
  min-height:0; max-width:min(600px,100%); margin:0 auto 6px; font-size:11.5px; font-weight:800;
  letter-spacing:.03em; color:#ffd166; opacity:0; transition:opacity .2s;
}
.bind-msg.show { opacity:1; min-height:16px; }

/* TURN chip */
.kbtn.turn { color:#c4b5fd; }
.kbtn.unbound { color:#ff9b9b; border-color:rgba(255,120,120,.7); border-style:dashed; }

/* per-player level chip on every human seat */
.lvbtn {
  flex:0 0 auto; display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:62px; height:30px; padding:0 8px; border-radius:10px; cursor:pointer;
  font:800 10px/1.05 "Trebuchet MS", system-ui, sans-serif; letter-spacing:.08em;
  color:rgba(232,234,255,.75); background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14);
  transition:.14s; white-space:nowrap;
}
.lvbtn small { font-size:7px; letter-spacing:.14em; opacity:.6; font-weight:800; }
.lvbtn:hover { background:rgba(255,255,255,.12); color:#fff; }
.lvbtn.own { color:#0d0720; border-color:transparent; }
.lvbtn.own small { opacity:.75; }
.lvbtn.own[data-lv="easy"]   { background:linear-gradient(180deg,#a7f3d0,#34d399); }
.lvbtn.own[data-lv="normal"] { background:linear-gradient(180deg,#bfdbfe,#60a5fa); }
.lvbtn.own[data-lv="hard"]   { background:linear-gradient(180deg,#fecaca,#f87171); }
.lvbtn.hide { display:none; }
.slot.off .lvbtn { pointer-events:none; }

/* score card extras: own level badge + current aim arrow */
.plv { font-size:8px; font-weight:900; letter-spacing:.08em; padding:1px 5px; border-radius:6px; margin-left:4px; color:#0d0720; }
.plv:empty { display:none; }
.plv[data-lv="easy"] { background:#34d399; }
.plv[data-lv="normal"] { background:#60a5fa; }
.plv[data-lv="hard"] { background:#f87171; }
.pips .aim { font-size:12px; color:#fff; min-width:9px; }
.pips .aim:empty { display:none; }

/* ---------- big screens: scale the HTML layers like the canvas (--ui set by game.js) ---------- */
#hud, .overlay { zoom: var(--ui, 1); }

/* ---------- small windows: the HUD must stay compact ---------- */
@media (max-height: 760px), (max-width: 1100px) {
  #hud { gap:5px 6px; padding:6px 70px 4px; min-height:0; }
  .card { min-width:0; flex:0 1 auto; max-width:190px; padding:5px 8px 6px; border-radius:12px; }
  .pname { font-size:10.5px; letter-spacing:.08em; }
  .pscore { font-size:20px; }
  .pkeys { font-size:8px; overflow:hidden; text-overflow:ellipsis; max-width:118px; }
  #timerWrap { min-width:64px; padding:4px 8px; border-radius:12px; }
  #timer { font-size:24px; }
  #timerLbl { font-size:7.5px; margin-top:2px; }
  /* the full rules are on the menu; in-round keep one line of reminders */
  #legend { padding:3px 10px; font-size:10.5px; border-radius:10px; }
  #legend .lg-row:not(.lg-keys) { display:none; }
  #legend .lg-keys { font-size:9.5px; gap:2px 10px; }
  .hud-exit { top:6px; right:8px; padding:5px 8px; }
}
.pk-short { display:none; }
@media (max-height: 760px), (max-width: 1100px) {
  .pk-long { display:none; }
  .pk-short { display:inline; }
  .card { max-width:150px; }
  .prow { gap:5px; }
}

/* =================================================================
   2.6.0 - grouped settings clusters + auto chip
   Related knobs (weapons / nitro / combat) sit together in their own
   small column instead of being spread over four separate rows.
   ================================================================= */
.options.clusters{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:start;
  gap:11px;
  width:min(780px,100%);
}
.opt-cluster{
  display:flex; flex-direction:column; gap:9px; min-width:0;
  padding:8px 8px 9px; border-radius:17px;
  background:rgba(255,255,255,.026);
  border:1px solid rgba(255,255,255,.075);
}
.cluster-lbl{
  font-size:9.5px; letter-spacing:.22em; font-weight:900;
  opacity:.5; text-align:center; color:#ffd166;
}
.opt-cluster .opt{
  flex:1 1 auto; width:100%; min-width:0; padding:8px 9px;
  border-radius:13px;
}
/* the auto chip must never be squeezed by the compact stepper rule
   (.time-row.sm .stepbtn forces 27px, which clipped the word "auto") */
.time-row .stepbtn.auto,
.time-row.sm .stepbtn.auto{
  width:auto; min-width:40px; height:27px; padding:0 9px;
  flex:0 0 auto; white-space:nowrap; overflow:visible;
  font-size:10px; line-height:1;
}
.time-row .stepbtn.auto:disabled,
.time-row.sm .stepbtn.auto:disabled{ cursor:not-allowed; }

/* a locked stepper row reads as dead, not merely dim */
.time-row.locked input,
.time-row.locked .stepbtn{
  opacity:.38; pointer-events:none; filter:grayscale(.55);
}
.opt-note.lock{ opacity:.62; }
.opt-note.lock b{ color:#ff9d9d; }

@media (max-width:820px){
  .options.clusters{ grid-template-columns:1fr 1fr; width:100%; }
}
@media (max-width:560px){
  .options.clusters{ grid-template-columns:1fr; gap:9px; }
  .opt-cluster{ padding:7px; }
  .opt-cluster .opt{ padding:7px 8px; }
}
