/* LAB HEIST. A night-time lab, dark only (like the site's other arcade games). Fits 1366 x 768 with no page
   scrolling. Colors are never the only signal: every state also has a text label. Body text >= 16px. */

:root {
  --lh-bg: #070912;
  --lh-bg-2: #0d1226;
  --lh-panel: #121a36;
  --lh-panel-2: #1a2347;
  --lh-line: #2c3870;
  --lh-text: #eef1ff;
  --lh-muted: #aab3dd;
  --lh-teal: #3fd1b8;
  --lh-amber: #ffc857;
  --lh-orange: #f7a13d;
  --lh-red: #ff5d6c;
  --lh-green: #5be49b;
  --lh-purple: #b07cff;
  --lh-focus: #ffe066;
  --lh-radius: 12px;
  --lh-font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --lh-display: 'Righteous', 'Atkinson Hyperlegible', sans-serif;
  --lh-mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.lh-body {
  background: var(--lh-bg);
  background-image:
    radial-gradient(ellipse 50% 40% at 85% -10%, rgba(176, 124, 255, .18), transparent 70%),
    radial-gradient(ellipse 60% 45% at 10% 110%, rgba(63, 209, 184, .14), transparent 70%);
  color: var(--lh-text);
  font: 17px/1.4 var(--lh-font);
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--lh-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.lh-muted { color: var(--lh-muted); }
.lh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.lh-playing .tlg-student { display: none !important; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

#lh-app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 56px 1fr; grid-template-columns: minmax(0, 1fr); }

/* ---- top bar ---------------------------------------------------------------------------------- */
.lh-top { min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--lh-line); background: rgba(7, 9, 18, .9); }
.tlg-overlay ~ #lh-app .lh-top { padding-left: 150px; }
.tlg-overlay ~ #lh-app .lh-back { display: none; }
.lh-back { color: var(--lh-muted); text-decoration: none; font-weight: 700; min-height: 48px; display: inline-flex; align-items: center; padding: 0 6px; }
.lh-brand { font: 26px/1 var(--lh-display); letter-spacing: .06em; white-space: nowrap; }
.lh-brand-a { color: var(--lh-teal); }
.lh-brand-b { color: var(--lh-amber); }
.lh-hud { display: flex; align-items: center; gap: 22px; flex: 1; min-width: 0; }
.lh-roomtag { flex: 0 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-clock { flex: none; font: 600 26px/1 var(--lh-mono); white-space: nowrap; }
.lh-clock-label { font: 700 13px var(--lh-font); color: var(--lh-muted); text-transform: uppercase; letter-spacing: .08em; vertical-align: middle; }
.lh-clock-plus { font-size: 15px; color: var(--lh-amber); margin-left: 6px; }
.lh-alarms { flex: none; display: flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.lh-alarm-pip { width: 22px; height: 22px; border-radius: 4px; border: 2px solid var(--lh-red); background: transparent; display: inline-grid; place-items: center; font-size: 13px; }
.lh-alarm-pip.on { background: var(--lh-red); color: #2a0008; }
.lh-top-tools { flex: none; margin-left: auto; display: flex; gap: 8px; }
.lh-icon-btn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--lh-line); background: var(--lh-panel); font-weight: 700; }
.lh-icon-btn:hover { background: var(--lh-panel-2); }

/* ---- shared ------------------------------------------------------------------------------------ */
.lh-main { min-height: 0; position: relative; }
.lh-screen { height: 100%; padding: 14px 18px; }
.lh-btn { min-height: 52px; padding: 0 22px; border-radius: var(--lh-radius); border: 2px solid var(--lh-teal); background: #0f3b37; font-weight: 800; font-size: 18px; }
.lh-btn:hover:not(:disabled) { background: #155a53; }
.lh-btn-big { min-height: 60px; font-size: 21px; padding: 0 30px; }
.lh-btn-ghost { border-color: var(--lh-line); background: transparent; }
.lh-btn-amber { border-color: var(--lh-amber); background: #4a3712; }
.lh-btn-amber:hover:not(:disabled) { background: #62491a; }
.lh-msg { min-height: 1.4em; margin: 6px 0 0; color: var(--lh-amber); font-weight: 700; }
.lh-msg.err { color: var(--lh-red); }
h1, h2, h3 { margin: 0 0 8px; }
h2 { font-size: 20px; }

/* ---- title ------------------------------------------------------------------------------------- */
.lh-title { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 26px; }
.lh-title-left { display: flex; flex-direction: column; min-height: 0; }
.lh-title-art { width: 100%; height: 210px; border-radius: var(--lh-radius); border: 1px solid var(--lh-line); }
.lh-title h1 { font: 46px/1 var(--lh-display); letter-spacing: .05em; margin: 14px 0 6px; color: var(--lh-amber); }
.lh-lede { margin: 0 0 14px; max-width: 46em; }
.lh-title-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.lh-join { display: flex; align-items: center; gap: 10px; }
.lh-join label { font-weight: 700; }
.lh-join input { width: 150px; min-height: 52px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--lh-line); background: var(--lh-bg-2); font: 700 24px var(--lh-mono); letter-spacing: .12em; text-transform: uppercase; }
.lh-title-actions .lh-msg { flex-basis: 100%; margin: 0; }
.lh-who { margin: 6px 0; color: var(--lh-muted); }
.lh-who a { color: var(--lh-teal); }
.lh-explain { margin-top: 6px; border: 1px solid var(--lh-line); border-radius: var(--lh-radius); background: var(--lh-panel); min-height: 0; overflow: auto; }
.lh-explain summary { min-height: 48px; padding: 12px 16px; font-weight: 800; cursor: pointer; }
.lh-explain-body { padding: 0 16px 12px; }
.lh-explain-body ul { margin: 6px 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.lh-explain-body li { display: flex; gap: 10px; align-items: flex-start; }
.lh-board-panel { background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: var(--lh-radius); padding: 14px; min-height: 0; overflow: auto; }

/* ---- leaderboard (team rows) ------------------------------------------------------------------ */
.lh-board { display: grid; gap: 6px; }
.lh-brow { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--lh-bg-2); }
.lh-brow.hi { outline: 2px solid var(--lh-amber); }
.lh-brow .rank { font: 700 18px var(--lh-mono); color: var(--lh-amber); }
.lh-brow .team { font-weight: 800; }
.lh-brow .heads { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; align-items: center; font-size: 14px; color: var(--lh-muted); }
.lh-brow .head { display: inline-flex; gap: 4px; align-items: center; }
.lh-brow .time { font: 700 20px var(--lh-mono); text-align: right; }
.lh-brow .time small { display: block; font: 13px var(--lh-font); color: var(--lh-muted); }
.lh-head-slot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: rgba(127,127,127,.18); overflow: hidden; }
.lh-head-slot canvas { width: 24px; height: 24px; }   /* v2 head at x1 */

/* ---- lobby ------------------------------------------------------------------------------------- */
.lh-lobby { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 20px; padding-top: 10px; padding-bottom: 10px; }
.lh-lobby .lh-lobby-pick { gap: 6px; }
/* Left: the code, the crew, roles. Right (full height): the heist picker, then Start. */
.lh-lobby-code { background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: var(--lh-radius); padding: 8px 14px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 14px; }
.lh-lobby-code h2 { margin: 0; font-size: 15px; color: var(--lh-muted); text-transform: uppercase; letter-spacing: .08em; grid-column: 1 / -1; }
.lh-code { font: 700 46px/1 var(--lh-mono); letter-spacing: .12em; color: var(--lh-amber); margin: 2px 0; }
.lh-team-name { font: 20px/1.15 var(--lh-display); color: var(--lh-teal); margin: 0; }
.lh-code-tip { grid-column: 1 / -1; margin: 2px 0 0; font-size: 16px; line-height: 1.3; }
.lh-lobby-players { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.lh-lobby-players > h2 { margin: 2px 0 0; font-size: 19px; }
.lh-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.lh-player { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 10px; background: var(--lh-panel); border: 1px solid var(--lh-line); min-height: 52px; }
.lh-player .name { font-weight: 800; }
.lh-player .sub { font-size: 14px; color: var(--lh-muted); }
.lh-player .kick { margin-left: auto; min-height: 40px; border-radius: 8px; border: 1px solid var(--lh-line); background: transparent; padding: 0 10px; }
.lh-avatar-slot { width: 48px; height: 48px; display: grid; place-items: center; flex: none; }
.lh-avatar-slot canvas { width: 48px; height: 48px; }
.lh-seating { background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: var(--lh-radius); padding: 8px 14px; }
.lh-seating h3 { margin: 0 0 2px; }
.lh-seat-row { display: grid; grid-template-columns: 30px 110px 1fr; gap: 8px; align-items: center; margin: 4px 0; }
.lh-seat-row select { min-height: 44px; border-radius: 8px; border: 1px solid var(--lh-line); background: var(--lh-bg-2); padding: 0 8px; }
.lh-seat-role { font-weight: 800; }
.lh-pick-bottom { margin-top: auto; display: flex; align-items: center; gap: 16px; }
.lh-pick-bottom .lh-chip-legend { flex: 1; }
.lh-lobby-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 420px; text-align: right; }
.lh-lobby-actions .lh-msg { margin: 0; font-size: 16px; }

/* ---- game -------------------------------------------------------------------------------------- */
.lh-game { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.lh-left, .lh-right { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.lh-scene-wrap { position: relative; height: clamp(150px, 28vh, 216px); flex: none; }
.lh-scene { width: 100%; height: 100%; border-radius: var(--lh-radius); border: 1px solid var(--lh-line); display: block; }
.lh-banner { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 50%; transform: translateY(-50%); padding: 10px 22px; border-radius: 12px; font: 30px/1.15 var(--lh-display); letter-spacing: .05em; text-align: center; background: rgba(7, 9, 18, .88); border: 3px solid var(--lh-amber); max-width: 92%; }
.lh-banner small { display: block; font: 700 16px var(--lh-font); letter-spacing: 0; margin-top: 4px; color: var(--lh-text); }
.lh-banner.wrong { border-color: var(--lh-red); color: var(--lh-red); }
.lh-banner.open { border-color: var(--lh-green); color: var(--lh-green); }
.lh-story { margin: 0; font-size: 17px; }
.lh-story b { color: var(--lh-amber); }
.lh-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lh-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 10px 10px 0 0; border: 1px solid var(--lh-line); border-bottom: 0; background: var(--lh-bg-2); font-weight: 800; }
.lh-tab[aria-selected="true"] { background: var(--lh-panel-2); border-color: var(--lh-teal); }
.lh-clues { flex: 1; min-height: 0; overflow: auto; background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: 0 var(--lh-radius) var(--lh-radius) var(--lh-radius); padding: 12px 14px; }
.lh-role-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lh-role-head .role { font: 22px var(--lh-display); letter-spacing: .04em; }
.lh-role-head .job { color: var(--lh-muted); }
.lh-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; align-items: start; }
.lh-block { min-width: 0; }
.lh-block.wide { grid-column: 1 / -1; }
.lh-block h4 { margin: 0 0 6px; font-size: 15px; color: var(--lh-muted); text-transform: uppercase; letter-spacing: .06em; }
.lh-block p { margin: 0; }
.lh-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.lh-facts dt { color: var(--lh-muted); }
.lh-facts dd { margin: 0; font-weight: 800; font-size: 19px; }
.lh-table { border-collapse: collapse; width: 100%; font-size: 16px; }
.lh-table th, .lh-table td { padding: 5px 8px; border-bottom: 1px solid var(--lh-line); text-align: left; }
.lh-table th { color: var(--lh-muted); font-size: 14px; font-weight: 700; }
.lh-table td:first-child { font-weight: 700; }
.lh-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(255,255,255,.4); }
.lh-figure { width: 100%; height: 170px; border-radius: 10px; border: 1px solid var(--lh-line); display: block; }
.lh-dkey { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 22px; font-size: 16px; }
.lh-dkey .cp { break-inside: avoid; padding: 2px 0 4px; border-bottom: 1px solid var(--lh-line); margin-bottom: 3px; }
.lh-dkey .cp > div { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; align-items: baseline; line-height: 1.3; }
.lh-dkey .n { font: 700 16px var(--lh-mono); color: var(--lh-amber); }
.lh-dkey .go { font-weight: 800; white-space: nowrap; }
.lh-dkey .go.name { color: var(--lh-green); }
.lh-strand { font: 700 26px/1.3 var(--lh-mono); letter-spacing: .06em; word-break: break-all; }
.lh-strand .end { color: var(--lh-amber); font-size: 18px; }
.lh-strand .grp { margin-right: .45em; }
.lh-codon-grid { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 18px; }
.lh-codon { border-collapse: collapse; font: 16px/1.15 var(--lh-mono); }
.lh-codon caption { text-align: left; font: 800 15px var(--lh-font); color: var(--lh-amber); padding-bottom: 2px; }
.lh-codon th { color: var(--lh-muted); padding: 0 5px; font-size: 14px; font-family: var(--lh-font); }
.lh-codon td { border: 1px solid var(--lh-line); padding: 1px 5px; white-space: nowrap; }
.lh-codon .stop { color: var(--lh-red); font-weight: 700; }
.lh-codon .met { color: var(--lh-green); font-weight: 700; }
.lh-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 4px; }
.lh-chain li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--lh-bg-2); }
.lh-chain .lvl { color: var(--lh-muted); font-size: 15px; }
.lh-chain .org { font-weight: 800; }
.lh-chain li + li::after { content: ''; }
.lh-nothing { color: var(--lh-muted); }

/* team + pings */
.lh-team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lh-mate { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; background: var(--lh-panel); border: 1px solid var(--lh-line); min-height: 50px; }
.lh-mate.me { border-color: var(--lh-teal); }
.lh-mate .nm { font-weight: 800; font-size: 15px; line-height: 1.15; }
.lh-mate .rl { font-size: 13px; color: var(--lh-muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.lh-mate .rl canvas { width: 15px; height: 15px; }
.lh-mate.away { opacity: .6; }
.lh-mate .away-tag { color: var(--lh-amber); font-weight: 800; font-size: 12px; }
.lh-mate .lh-avatar-slot { width: 36px; height: 36px; }
.lh-mate .lh-avatar-slot canvas { width: 24px; height: 24px; }   /* v2 head at x1 (whole scale) */
.lh-mate.pinged { animation: lh-pinged .7s ease-out 3; }
@keyframes lh-pinged { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 87, .9); } 100% { box-shadow: 0 0 0 10px rgba(255, 200, 87, 0); } }
.lh-pings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lh-ping { min-height: 46px; border-radius: 10px; border: 1px solid var(--lh-line); background: var(--lh-bg-2); font-weight: 800; font-size: 14px; line-height: 1.1; padding: 2px 6px; }
.lh-ping:hover:not(:disabled) { background: var(--lh-panel-2); }
.lh-ping-feed { min-height: 30px; display: flex; gap: 6px; flex-wrap: wrap; }
.lh-ping-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; background: var(--lh-amber); color: #241a00; font-weight: 800; font-size: 15px; animation: lh-pop .25s ease-out; }
.lh-ping-chip canvas { width: 24px; height: 24px; }
@keyframes lh-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* lock */
.lh-lock { flex: 1; min-height: 0; overflow: auto; background: #0b1020; border: 2px solid var(--lh-amber); border-radius: var(--lh-radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.lh-lock.readonly { border-color: var(--lh-line); background: var(--lh-panel); }
.lh-lock h3 { font: 20px var(--lh-display); letter-spacing: .05em; color: var(--lh-amber); margin: 0; display: flex; align-items: center; gap: 8px; }
.lh-display { min-height: 56px; border-radius: 10px; background: #02040a; border: 1px solid var(--lh-line); font: 700 32px/56px var(--lh-mono); padding: 0 12px; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.lh-display .unit { font-size: 20px; color: var(--lh-muted); margin-left: auto; }
.lh-display .ph { color: #4a5488; }
.lh-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lh-pad button, .lh-opts button { min-height: 46px; border-radius: 10px; border: 1px solid var(--lh-line); background: var(--lh-panel-2); font-weight: 800; font-size: 20px; }
.lh-pad button:hover, .lh-opts button:hover { background: #26315e; }
.lh-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.lh-opts.aa { grid-template-columns: repeat(5, 1fr); }
.lh-opts.aa button { font: 700 16px var(--lh-mono); min-height: 40px; }
.lh-opts.names button { font-size: 15px; min-height: 50px; text-align: left; padding: 0 10px; }
.lh-opts button[aria-pressed="true"] { border-color: var(--lh-amber); background: #4a3712; }
.lh-slots { display: flex; gap: 6px; flex-wrap: wrap; min-height: 44px; align-items: center; }
.lh-slot { min-width: 64px; min-height: 40px; border-radius: 8px; border: 2px dashed var(--lh-line); display: grid; place-items: center; font: 700 17px var(--lh-mono); }
.lh-slot.filled { border-style: solid; border-color: var(--lh-teal); }
.lh-ratio { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.lh-ratio label { display: grid; gap: 4px; font-weight: 700; font-size: 15px; }
.lh-ratio input { min-height: 56px; border-radius: 10px; border: 2px solid var(--lh-line); background: #02040a; font: 700 30px var(--lh-mono); text-align: center; width: 100%; }
.lh-ratio .colon { font: 700 34px var(--lh-mono); padding-bottom: 6px; }
.lh-lock-actions { display: flex; gap: 8px; margin-top: auto; }
.lh-lock-actions .lh-btn { flex: 1; }
.lh-open { border-color: var(--lh-green); background: #0f3b26; font-size: 20px; }
.lh-open:hover:not(:disabled) { background: #15563a; }
.lh-hint { font-size: 16px; }
.lh-hint .box { border: 2px solid var(--lh-amber); border-radius: 10px; padding: 8px 12px; background: #2a2210; }
.lh-hint .box b { color: var(--lh-amber); }

/* wrong-code flash: color PLUS the WRONG CODE banner and the alarm pip */
.lh-flash { position: fixed; inset: 0; pointer-events: none; background: rgba(255, 40, 60, 0); transition: background .4s; }
.lh-flash.on { background: rgba(255, 40, 60, .28); transition: none; }

/* ---- end --------------------------------------------------------------------------------------- */
.lh-end { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.lh-end-left, .lh-end-right { min-height: 0; overflow: auto; }
.lh-end-left h2 { font: 40px var(--lh-display); color: var(--lh-green); letter-spacing: .04em; }
.lh-final { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.lh-final .big { font: 700 58px/1 var(--lh-mono); color: var(--lh-amber); }
.lh-final .calc { color: var(--lh-muted); }
.lh-recap { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lh-recap li { background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: 10px; padding: 8px 12px; }
.lh-recap .t { font-weight: 800; display: flex; gap: 10px; flex-wrap: wrap; }
.lh-recap .t span { color: var(--lh-muted); font-weight: 600; }
.lh-recap .s { font-size: 16px; }
.lh-end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.lh-stat { background: var(--lh-panel); border: 1px solid var(--lh-line); border-radius: 10px; padding: 8px 12px; }
.lh-stat .k { color: var(--lh-muted); font-size: 14px; }
.lh-stat .v { font-weight: 800; font-size: 20px; }
.lh-stat .v a { color: var(--lh-teal); }
.lh-end-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---- connection status ------------------------------------------------------------------------- */
.lh-status { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--lh-panel-2); border: 2px solid var(--lh-amber); border-radius: 12px; padding: 10px 18px; font-weight: 800; z-index: 20; }

/* ---- narrow screens (phones): stack, allow scrolling ------------------------------------------- */
@media (max-width: 900px) {
  body.lh-body { overflow: auto; }
  #lh-app { height: auto; min-height: 100vh; }
  .lh-title, .lh-lobby, .lh-game, .lh-end { grid-template-columns: 1fr; height: auto; }
  .lh-hud { gap: 10px; }
  .lh-clock-label, .lh-roomtag { display: none; }
  .lh-explain-body ul { grid-template-columns: 1fr; }
  .lh-code { font-size: 56px; }
}
@media (max-height: 700px) and (min-width: 901px) {
  .lh-scene-wrap { height: 140px; }
  .lh-title-art { height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .lh-mate.pinged, .lh-ping-chip { animation: none; }
}

/* ---- heist picker (lobby): course tabs, then unit cards (2 rows of 4 fit 1366 x 768) ------------- */
.lh-lobby-pick { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.lh-pick-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lh-pick-h { margin: 0; font: 22px var(--lh-display); letter-spacing: .05em; }
.lh-pick-now { margin: 0; font-size: 16px; color: var(--lh-muted); }
.lh-pick-now b { color: var(--lh-amber); }
.lh-course-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lh-course-tab { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 2px solid var(--lh-line); background: var(--lh-bg-2); font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 8px; }
.lh-course-tab canvas { width: 24px; height: 24px; }
.lh-course-tab[aria-selected="true"] { border-color: var(--lh-teal); background: #0f2a2a; }
.lh-heist-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: 10px; align-content: start; }
.lh-heist-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--lh-line); background: var(--lh-bg-2); text-align: left; font: inherit; color: inherit; font-size: 16px; line-height: 1.3; min-width: 0; }
.lh-heist-card .unit { font-weight: 800; font-size: 16px; color: var(--lh-teal); }
.lh-heist-card.review .unit { color: var(--lh-purple); }
.lh-heist-card .nm { font: 20px/1.12 var(--lh-display); letter-spacing: .03em; color: var(--lh-text); }
.lh-heist-card .bl { color: var(--lh-muted); }
.lh-heist-card .meta { font-weight: 700; font-size: 16px; }
.lh-heist-card .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 2px; }
.lh-heist-card[aria-checked="true"] { border-color: var(--lh-amber); background: #2d2410; box-shadow: 0 0 0 2px rgba(255,200,87,.25); }
.lh-heist-card { position: relative; }
.lh-heist-card .unit { padding-right: 26px; }
.lh-heist-card[aria-checked="true"]::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--lh-amber); color: #1a1300; font: 800 16px/24px var(--lh-font); text-align: center; }
.lh-heist-card:disabled { cursor: default; opacity: 1; }
.lh-heist-card:not(:disabled):hover { border-color: var(--lh-teal); }
.lh-heist-icon { width: 36px; height: 36px; image-rendering: pixelated; }
.lh-draft { display: inline-block; font-size: 16px; line-height: 1.2; font-weight: 800; color: #1a1300; background: var(--lh-orange); border-radius: 6px; padding: 0 6px; }
.lh-chip { display: inline-block; font: 700 16px/1.2 var(--lh-mono); border-radius: 6px; padding: 0 5px; border: 2px solid var(--lh-teal); white-space: nowrap; }
.lh-chip.pri { background: var(--lh-teal); color: #04151a; }
.lh-chip.sup { background: transparent; color: var(--lh-teal); }
.lh-chip-legend { margin: 0; font-size: 16px; color: var(--lh-muted); }
.lh-chip-legend .lh-chip { font-family: var(--lh-font); font-size: 15px; }
.lh-end-standards { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* ---- leaderboard: course + heist selects ------------------------------------------------------- */
.lh-board-pick { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 8px; }
.lh-board-pick label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; }
.lh-board-pick select { min-height: 44px; max-width: 100%; border-radius: 8px; border: 1px solid var(--lh-line); background: var(--lh-bg-2); padding: 0 8px; font-size: 16px; }
.lh-solo-pick { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.lh-solo-pick select { min-height: 44px; border-radius: 8px; border: 1px solid var(--lh-line); background: var(--lh-bg-2); padding: 0 8px; }

/* ---- lock panel: new entry types --------------------------------------------------------------- */
.lh-pad.wide-keys button { min-height: 40px; }
.lh-pad.wide-keys button[data-k="clear"] { grid-column: span 2; }
.lh-multi { display: grid; gap: 8px; }
.lh-multi label { display: grid; gap: 4px; font-weight: 700; font-size: 16px; }
.lh-multi input { min-height: 56px; border-radius: 10px; border: 2px solid var(--lh-line); background: #02040a; font: 700 30px var(--lh-mono); text-align: center; width: 100%; }
.lh-multi input:focus, .lh-ratio input:focus { border-color: var(--lh-amber); outline: none; }
.lh-lock-tip { margin: 0; font-size: 16px; color: var(--lh-muted); }
.lh-seq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.lh-seq-slot { width: 100%; min-height: 50px; border-radius: 10px; border: 2px dashed var(--lh-line); background: #02040a; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; padding: 0 8px; text-align: left; }
.lh-seq-slot .n { font: 700 15px var(--lh-mono); color: var(--lh-amber); flex: none; }
.lh-seq-slot.filled { border-style: solid; border-color: var(--lh-teal); }
.lh-opts.tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.lh-opts.tiles button { font-size: 16px; min-height: 46px; padding: 0 8px; }
.lh-opts.tiles button[aria-pressed="true"] { opacity: .35; }
.lh-display.cfg { font-size: 26px; min-height: 50px; line-height: 50px; white-space: nowrap; }
.lh-cfg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.lh-cfg-row { display: grid; grid-template-columns: 44px 46px 1fr 46px; gap: 6px; align-items: center; }
.lh-cfg-row .sub { font: 700 20px var(--lh-mono); }
.lh-cfg-row button { min-height: 44px; border-radius: 10px; border: 1px solid var(--lh-line); background: var(--lh-panel-2); font-weight: 800; font-size: 22px; }
.lh-cfg-row .cnt { text-align: center; font: 700 22px var(--lh-mono); }
.lh-cfg-row .cnt small { font-size: 15px; color: var(--lh-muted); }
/* multiField: 2-4 labeled fields (number boxes and option buttons) */
.lh-fields { display: grid; gap: 6px; }
.lh-field { display: grid; gap: 3px; border: 0; padding: 0; margin: 0; min-width: 0; }
.lh-field .lbl { font-weight: 700; font-size: 16px; padding: 0; }
.lh-field-in { display: flex; align-items: center; gap: 8px; }
.lh-field-in input { min-height: 48px; border-radius: 10px; border: 2px solid var(--lh-line); background: #02040a; font: 700 26px var(--lh-mono); text-align: center; width: 100%; min-width: 0; }
.lh-field-in input:focus { border-color: var(--lh-amber); outline: none; }
.lh-field-in .unit { color: var(--lh-muted); font-size: 18px; flex: none; }
.lh-opts.fopts { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.lh-opts.fopts button { overflow-wrap: normal; hyphens: none; }
.lh-opts.fopts button { font-size: 16px; min-height: 44px; padding: 2px 8px; line-height: 1.15; }
/* Name pickers (species, nuclides, star types): wide enough that a name never breaks mid-word. */
.lh-opts.names { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lh-opts.names button { overflow-wrap: normal; hyphens: none; line-height: 1.2; padding: 6px 10px; }

/* ---- lobby picker on narrow screens (after the rules above, so it wins) -------------------------- */
@media (max-width: 900px) {
  .lh-pick-bottom { flex-wrap: wrap; }
  .lh-lobby-actions { align-items: flex-start; text-align: left; }
  .lh-heist-pick { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
