/* Laser Lines Arena: the shared look for splash, phone and TV. A dark arena, two lasers: cyan and
   amber, picked because they stay apart for every common kind of colour blindness (and each has its
   own shape too: circles and diamonds). No web fonts, no remote anything: the party rig is offline,
   so every asset is local (test/pages.test.ts fails on an external URL). */
:root {
  --bg: #04060c; --bg2: #0a1022; --panel: #0f1730; --panel2: #16213f; --line: #27376190; --edge: #2c3f6e;
  --ink: #eaf6ff; --dim: #8fa5cc; --dark: #04101a;
  --c0: #2fe6ff; --c0d: #0b8fa6; --c1: #ffab2e; --c1d: #b36a00;
  --good: #5dffb0; --bad: #ff4d6d;
  --me: var(--c0);
  /* the kit's shared end screen (client/endscreen.ts), in this game's colours */
  --cs-end-bg: radial-gradient(120% 90% at 50% -10%, #16213f 0%, #04060c 62%); --cs-end-fg: #eaf6ff; --cs-end-dim: #8fa5cc;
  --cs-end-accent: #2fe6ff; --cs-end-win: #5dffb0; --cs-end-loss: #ff4d6d; --cs-end-panel: #0f1730;
  --display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cs-end-font: var(--body);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); font: 500 16px/1.4 var(--body); -webkit-tap-highlight-color: transparent;
  background: var(--bg) radial-gradient(ellipse at 50% -10%, #16213f, var(--bg) 70%) fixed; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; letter-spacing: .04em; text-transform: uppercase; }
h1 { color: var(--c0); font-size: 34px; line-height: 1.05; text-shadow: 0 0 18px #2fe6ff66; }
h2 { color: var(--ink); font-size: 20px; }
button { background: var(--panel2); border: 1.5px solid var(--edge); color: var(--ink); padding: 10px 14px; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer; }
button.primary { background: var(--c0); border-color: var(--c0); color: var(--dark); }
button:disabled { opacity: .4; cursor: default; }
select, input { font: inherit; padding: 8px; border-radius: 8px; background: var(--bg2); color: var(--ink); border: 1.5px solid var(--edge); }
a { color: var(--c0); }
.muted, .hint, .tagg { color: var(--dim); }
.tagg { font-size: 13px; margin-left: 6px; }
.av { border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.s0 { --c: var(--c0); --cd: var(--c0d); } .s1 { --c: var(--c1); --cd: var(--c1d); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(160px); background: var(--ink); color: var(--dark);
  padding: 10px 18px; border-radius: 10px; transition: transform .25s; z-index: 50; max-width: 92vw; font-weight: 700; }
#toast.show { transform: translateX(-50%) translateY(0); }
#conn { position: fixed; top: 8px; right: 8px; background: var(--bad); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 13px; display: none; z-index: 60; }
#conn.show { display: block; }

/* ---- kit phone shell: join + lobby ---- */
.join, .lobbyv { max-width: 480px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 12px; }
.join input { font-size: 20px; padding: 12px; }
.join button, .lobbyv button { font-size: 17px; padding: 12px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow button { flex: 1 1 auto; }
.seat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: #0008; border: 1px solid var(--line); border-radius: 10px; margin: 4px 0; }
.levers { display: grid; gap: 8px; }
.levers label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--dim); font-weight: 700; }
.levers select { max-width: 68%; }

/* ---- the sheet (client/shared/board.ts) ---- */
.board { display: block; width: 100%; height: 100%; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.board .lab { fill: var(--dim); font: 700 22px var(--display); text-anchor: middle; }
.board .grid { stroke: #5f7cc044; stroke-width: 1.5; stroke-dasharray: 2 7; }
.board .dot { fill: #9db4e0; }
.board .rg { fill: var(--c); fill-opacity: .13; fill-rule: evenodd; stroke: none; }
.board .ln { stroke: var(--c); stroke-linecap: round; fill: none; }
.board .ln.glow { stroke-width: 15; opacity: .22; }
.board .ln.core { stroke-width: 5; }
.board .ln.fresh { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ll-draw .75s .15s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes ll-draw { to { stroke-dashoffset: 0; } }
.board .fizz { stroke: var(--c); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: ll-fizz 1.5s ease-out forwards; }
@keyframes ll-fizz { 0% { stroke-dashoffset: 1; opacity: 1; } 35% { stroke-dashoffset: 0; opacity: 1; } 55% { opacity: .2; } 70% { opacity: .9; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.board .spark line { stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.board .spark circle { fill: #fff; }
.board .spark { opacity: 0; animation: ll-spark 1.3s .3s ease-out forwards; }
@keyframes ll-spark { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.board .pt { fill: none; stroke: var(--c); stroke-width: 3.5; opacity: .95; }
.board .mk { fill: var(--c); stroke: var(--dark); stroke-width: 2; }
.board .num { fill: var(--dark); font: 800 21px var(--body); text-anchor: middle; pointer-events: none; }
.board .num.two { font-size: 17px; }
.board .x line { stroke: var(--bad); stroke-width: 5.5; stroke-linecap: round; }
.board .x.fresh { animation: ll-burn 1.4s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes ll-burn { 0% { opacity: 0; transform: scale(2.6); } 40% { opacity: 1; transform: scale(1); } 55% { opacity: .3; } 70% { opacity: 1; } }
.board .here { fill: none; stroke: var(--c); stroke-width: 3.5; opacity: .9; transform-box: fill-box; transform-origin: center; animation: ll-here 1.8s ease-in-out infinite; }
@keyframes ll-here { 50% { transform: scale(1.18); opacity: .35; } }
.board .legal { fill: var(--c); fill-opacity: .07; stroke: var(--c); stroke-width: 2.5; stroke-dasharray: 5 6; opacity: .8; }
.board .aim { stroke: var(--c); stroke-width: 4.5; stroke-dasharray: 12 10; stroke-linecap: round; fill: none; animation: ll-march .7s linear infinite; }
.board .aim.ring { stroke-dasharray: none; stroke-width: 5; fill: var(--c); fill-opacity: .2; animation: none; }
.board .aim.locked { stroke-dasharray: 3 9; opacity: .75; animation: none; }
.board .aim.locked.ring { stroke-dasharray: none; fill-opacity: .12; }
@keyframes ll-march { to { stroke-dashoffset: -22; } }
.board .hit { fill: transparent; cursor: pointer; }
.board.still .here { animation: none; }
@media (prefers-reduced-motion: reduce) { .board .here, .board .aim { animation: none; } }

/* ---- score chips and the move tracker ---- */
.sc { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 6px 10px; border-radius: 12px;
  background: var(--panel); border: 1.5px solid var(--line); min-width: 0; }
.sc.me { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.sc-shape, .t-shape { width: 16px; height: 16px; background: var(--c); border-radius: 50%; flex: none; }
.s1 .sc-shape, .s1 .t-shape { border-radius: 2px; transform: rotate(45deg) scale(.82); }
.sc-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sc-name em { font-style: normal; color: var(--dim); font-weight: 600; font-size: .85em; }
.sc-n { grid-row: 1 / 3; grid-column: 3; font: 800 30px/1 var(--display); color: var(--c); min-width: 1.2ch; text-align: right; }
.sc-lock { grid-column: 1 / 3; font-size: 12px; color: var(--dim); letter-spacing: .04em; }
.sc-lock.on { color: var(--good); font-weight: 800; text-transform: uppercase; }
.bot, .off { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; padding: 1px 6px; border-radius: 99px; background: var(--panel2); color: var(--dim); margin-right: 5px; vertical-align: middle; }
.off { background: #ff4d6d33; color: #ffb3c0; margin: 0 0 0 5px; }
.tk { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tk th, .tk td { padding: 3px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tk thead th { color: var(--c, var(--dim)); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; max-width: 9ch; }
.tk tbody th { color: var(--dim); font-weight: 600; width: 3.2em; }
.tk td { font-weight: 800; color: var(--c); }
.tk s { color: var(--dim); font-weight: 600; }
.tk-x { color: var(--bad); margin-left: 4px; }
.tk-plus { color: var(--good); margin-left: 6px; font-size: .9em; }
.tk-pass { color: var(--dim); font-weight: 600; }
.tk-none { color: var(--dim); font-size: 14px; }

/* ---- the phone: a fixed skeleton that never scrolls the page (the rig's panels are 960x540 with
   no scrollbar: a control below the fold there is not a control) ---- */
.g { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr); gap: 7px;
  padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; overflow: hidden; }
.g.s0 { --me: var(--c0); } .g.s1 { --me: var(--c1); }
.g-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.g-title { font: 800 19px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--c0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-round { margin-left: auto; white-space: nowrap; color: var(--dim); font-weight: 800; font-size: 14px; }
.help { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 20px; }
.help.pulse { animation: helppulse 1.6s ease-in-out infinite; border-color: var(--c0); }
@keyframes helppulse { 50% { box-shadow: 0 0 0 6px #2fe6ff55; } }
.g-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#cs-pres-slot { display: flex; justify-content: center; min-height: 0; }
.g-coach { background: var(--panel); border-left: 4px solid var(--edge); border-radius: 6px 12px 12px 6px; padding: 7px 11px; font-size: 14.5px; line-height: 1.3; min-height: 52px; display: flex; align-items: center; color: var(--dim); }
.g.mine .g-coach { border-left-color: var(--me); color: var(--ink); }
.g-board { justify-self: center; width: min(100%, calc(100dvh - 330px)); min-width: 250px; aspect-ratio: 1; background: #060a16; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.g-btns { display: grid; grid-template-columns: 1fr 2.2fr; gap: 8px; }
.g-btns button { min-height: 50px; padding: 6px 8px; font-size: 16.5px; line-height: 1.15; }
.g-btns .primary { background: var(--me); border-color: var(--me); }
.g-track { min-height: 0; overflow: hidden; }

/* The kit's pill (table-dock.ts: "Table", or "Sound") opens the sheet with what happened, and the phone's
   sound switches. Its own spot is the bottom right corner, which is where the fire button lives, so it is
   moved up beside "?" and the header keeps a gap for it (.g-pillgap). Off the top centre and the top right:
   the rig's launcher owns those on a panel. */
body.phone #cs-pill { top: max(8px, env(safe-area-inset-top)); bottom: auto; left: 60px; right: auto; height: 40px; width: 96px; padding: 0 6px;
  font-size: 13.5px; white-space: nowrap; text-align: center; }
.g-pillgap { flex: none; width: 96px; }
@media (max-width: 400px) { .g-title { display: none; } }

/* A rig panel, a phone on its side or a desktop window: the sheet on the left at full height, everything
   you read and press in a column on the right. Nothing a player presses is below the fold. */
@media (min-aspect-ratio: 5/4) {
  .g { max-width: none; grid-template-columns: auto minmax(260px, 1fr); grid-template-rows: auto auto auto auto auto minmax(0, 1fr); column-gap: 16px; padding: 8px 14px 10px;
    justify-content: center; }
  .g-board { grid-column: 1; grid-row: 1 / -1; width: min(calc(100dvh - 18px), 62vw); align-self: center; }
  .g-head, .g-score, #cs-pres-slot, .g-coach, .g-btns, .g-track { grid-column: 2; max-width: 520px; }
  .g-title { display: inline; }
  /* the kit's pill goes back to its own corner: down here that is the tracker, not a button */
  body.phone #cs-pill { top: auto; left: auto; bottom: 10px; right: 14px; }
  .g-pillgap { display: none; }
  .lobbyv { max-width: 900px; grid-template-columns: 1fr 1fr; align-items: start; padding: 44px 16px 10px; gap: 8px 16px; }
  .lobbyv h1 { grid-column: 1 / -1; font-size: 26px; }
  .lobbyv > div:nth-child(2) { grid-row: span 4; }
  .join { padding-top: 44px; }
}

/* ---- the end screen's sheet (server/debrief.ts puts the finished sheet in the reveal) ---- */
.end-board { width: min(100%, 440px); aspect-ratio: 1; margin: 4px auto; background: #060a16; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }

/* ---- coach marks (table/client/coach.ts draws them; these are its classes) ---- */
.coach { position: fixed; inset: 0; z-index: 2300; color: var(--ink); -webkit-user-select: none; user-select: none; animation: cmin .18s ease-out; }
@keyframes cmin { from { opacity: 0; } to { opacity: 1; } }
.cm-svg { position: absolute; inset: 0; display: block; }
.cm-dim { fill: rgba(2, 4, 10, .84); }
.cm-ring { fill: none; stroke: var(--c0); stroke-width: 2; }
.cm-ln { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.cm-dot { fill: var(--c0); stroke: var(--dark); stroke-width: 1.5; }
.cm-call { position: absolute; padding: 9px 12px 10px; border-radius: 14px; font-size: 14.5px; line-height: 1.33; background: var(--panel); border: 1.5px solid var(--c0); box-shadow: 0 10px 28px #000a; }
.cm-call .cm-n { float: left; width: 22px; height: 22px; margin: 0 8px 0 0; border-radius: 50%; display: grid; place-items: center; background: var(--c0); color: var(--dark); font: 700 13px/1 var(--body); }
.cm-call .cm-t { font: 800 15.5px/22px var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.cm-call .cm-b { margin-top: 3px; clear: both; } .cm-call .cm-b b { color: #fff; }
.cm-measure { visibility: hidden; left: -9999px; top: 0; pointer-events: none; }
.cm-none { text-align: center; }
.cm-pager { position: absolute; display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 16px; background: #05080ff7; border: 1px solid var(--edge); box-shadow: 0 8px 26px #000a; }
.cm-pager button { min-height: 44px; padding: 0 16px; font-size: 16px; border-radius: 12px; }
.cm-pager .cm-close { width: 44px; padding: 0; font-size: 26px; line-height: 1; border-radius: 50%; flex: none; }
.cm-pager .cm-count { flex: 1; text-align: center; color: var(--dim); font-weight: 700; white-space: nowrap; }
.cm-last { position: absolute; left: 8px; right: 8px; display: flex; overflow: auto; overscroll-behavior: contain; }
.cm-lastin { margin: auto; width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; padding: 14px 16px 16px; border-radius: 18px; border: 2px solid var(--c0); background: var(--panel); font-size: 15px; line-height: 1.4; -webkit-user-select: text; user-select: text; }
.cm-lastin .cm-kick { text-align: center; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--c0); }
.cm-lastin h2 { margin: 0 0 8px; text-align: center; font-size: 22px; padding-bottom: 7px; border-bottom: 1px solid var(--edge); }
.cm-lastin ul { margin: 0; padding-left: 1.2em; } .cm-lastin li { margin: 0 0 6px; } .cm-lastin b { color: #fff; }

/* ---- splash + help ---- */
.wrap { max-width: 900px; margin: 0 auto; padding: 28px 18px 60px; }
.hero { position: relative; }
.hero h1 { font-size: clamp(40px, 9vw, 76px); }
.hero h1 span { color: var(--c1); text-shadow: 0 0 18px #ffab2e66; }
.tag { font-size: 1.2em; color: var(--dim); margin: 8px 0 4px; }
.cta { display: inline-block; margin: 14px 10px 6px 0; padding: 12px 20px; border-radius: 14px; background: var(--c0); color: var(--dark); font-weight: 800; text-decoration: none; }
.cta.alt { background: var(--panel2); color: var(--ink); border: 1.5px solid var(--edge); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 26px; }
.how div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; } .how h3 { color: var(--c1); margin-bottom: 4px; font-size: 17px; }
.rooms { margin-top: 30px; } .rooms .room { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border-radius: 12px; padding: 10px 14px; margin: 6px 0; }
.rooms .code { font-family: var(--display); color: var(--c0); letter-spacing: 3px; font-size: 22px; }
#rejoin { display: none; background: var(--panel); border-left: 4px solid var(--c0); border-radius: 8px; padding: 12px 16px; margin-top: 18px; } #rejoin.show { display: block; }
footer { margin-top: 40px; color: var(--dim); font-size: .9em; }
.credit { margin-top: 26px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--edge); color: var(--dim); }
.credit b { color: var(--ink); }
.helppage h2 { margin: 26px 0 6px; color: var(--c1); } .helppage li { margin-bottom: 6px; } .helppage .back { text-decoration: none; font-weight: 700; }
.helppage figure { margin: 22px 0; } .helppage figure img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--edge); display: block; }
.helppage figure.phone img { max-width: 300px; margin: 0 auto; }
.helppage figcaption { color: var(--dim); margin-top: 8px; font-size: .95em; }
