/* Big screen: HackNet-style netops console. Dark, monospace, neon, panels with header strips. */
:root {
  --bg: #05080d;
  --panel: #08111a;
  --line: #16303d;
  --head: #0c2a36;
  --cyan: #3df2ff;
  --green: #46ff8f;
  --yellow: #ffd23d;
  --red: #ff3d5a;
  --magenta: #ff4fd8;
  --text: #9fb7cc;
  --bright: #e8f6ff;
  --dim: #4b6274;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow: hidden;
}
/* CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  z-index: 100;
}

#app {
  display: grid;
  grid-template-columns: minmax(240px, 20vw) 1fr minmax(240px, 20vw);
  grid-template-rows: auto 1fr;
  height: 100vh;
  gap: 8px;
  padding: 8px;
}

/* ---------- top bar */
#topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.brand { margin-right: auto; font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--bright); }
.brand span { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.brand small { margin-left: 10px; font-size: 11px; font-weight: 400; letter-spacing: 1px; color: var(--dim); }
.flag { padding: 2px 8px; border: 1px solid var(--yellow); color: var(--yellow); font-size: 12px; letter-spacing: 2px; }
.stat { display: flex; flex-direction: column; min-width: 70px; flex: 0 1 auto; overflow: hidden; }
.stat label { font-size: 10px; letter-spacing: 2px; color: var(--dim); white-space: nowrap; }
.stat b { font-size: 20px; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1300px) {
  .brand small { display: none; }
  #topbar { gap: 14px; }
  .stat b { font-size: 16px; }
  .stat.health { min-width: 140px; }
}
.stat.health { min-width: 220px; }
.bar { height: 10px; margin: 3px 0; border: 1px solid var(--line); background: #02060a; }
.bar i { display: block; height: 100%; width: 100%; background: var(--green); transition: width 0.2s, background 0.3s; }
.stat.health b { font-size: 14px; }

/* ---------- side panels */
aside { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); background: var(--panel); }
.panel h2 {
  margin: 0;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  background: var(--head);
  border-bottom: 1px solid var(--line);
}
.panel .body { padding: 10px; }
.grow { flex: 1; }
.muted { color: var(--dim); }
.small { font-size: 11px; line-height: 1.5; }

.cmdr { display: flex; gap: 10px; align-items: flex-start; padding: 10px 10px 0; }
#cmdr-face { margin: 0; color: var(--cyan); font-size: 12px; line-height: 1.15; text-shadow: 0 0 8px rgba(61, 242, 255, 0.6); }
#cmdr-face[data-mood="alarm"] { color: var(--red); text-shadow: 0 0 8px rgba(255, 61, 90, 0.7); }
#cmdr-line { flex: 1; margin: 0; min-height: 5.6em; font-size: 14px; line-height: 1.4; color: var(--bright); }
#ai-status { margin: 4px 10px 8px; }

#log { flex: 1; margin: 0; padding: 8px 10px; list-style: none; overflow-y: auto; font-size: 12px; line-height: 1.45; }
#log li { margin-bottom: 2px; }
#log .ts { color: var(--dim); }
#log .bad { color: var(--red); }
#log .good { color: var(--green); }
#log .event { color: var(--yellow); }
#log .join { color: var(--magenta); }

.rows { margin: 0; padding: 6px 10px; list-style: none; font-size: 13px; overflow-y: auto; }
.rows li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.op-name { color: var(--magenta); font-weight: 700; }
.op-ap, .node-status { margin-left: auto; color: var(--dim); font-size: 12px; }
.node-name { color: var(--bright); }

#join-panel img { display: block; width: 100%; max-width: 280px; margin: 0 auto 8px; image-rendering: pixelated; border: 1px solid var(--line); }
#join-panel code, #join-mini code { display: block; font-size: 12px; color: var(--cyan); word-break: break-all; text-align: center; }
#join-panel p { font-size: 12px; line-height: 1.5; }
.boss-preview-art {
  position: relative;
  margin: 10px 10px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 82, 107, .55);
  background: radial-gradient(ellipse at 50% 62%, rgba(126, 16, 34, .4), rgba(2, 12, 9, .94) 72%);
}
.boss-preview-art img { display: block; width: 100%; height: 118px; object-fit: contain; }
.boss-preview-art span {
  position: absolute;
  left: 8px;
  bottom: 6px;
  padding: 3px 5px;
  background: rgba(5, 8, 13, .86);
  color: #ff7183;
  font-size: 8px;
  letter-spacing: .14em;
}
.boss-preview-copy { padding: 8px 11px 11px; }
.boss-preview-copy h3 { margin: 0 0 5px; color: #ff7183; font-size: 13px; letter-spacing: .15em; }
.boss-preview-copy p { margin: 0 0 8px; font-size: 10px; line-height: 1.45; }
.boss-preview-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.boss-preview-tags span { padding: 3px 5px; border: 1px solid rgba(255, 82, 107, .45); color: #ff9aa7; font-size: 8px; letter-spacing: .08em; }
.room-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12px; letter-spacing: 2px; color: var(--dim); }
.room-line b { font-size: 30px; letter-spacing: 6px; color: var(--bright); text-shadow: 0 0 12px rgba(61, 242, 255, 0.5); }
#room-count { margin-left: auto; color: var(--magenta); letter-spacing: 0; }
.mini .room-line { margin-bottom: 2px; }
.mini .room-line b { font-size: 18px; letter-spacing: 3px; }
.mini { display: flex; gap: 10px; align-items: center; }
.mini img { width: 84px; height: 84px; image-rendering: pixelated; flex: none; }
.mini code { text-align: left !important; }

button {
  font: inherit;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 10px 16px;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--cyan);
  cursor: pointer;
}
button:hover, button:focus-visible { background: rgba(61, 242, 255, 0.12); outline: none; }
button.primary { width: 100%; padding: 14px; font-size: 16px; color: var(--bg); background: var(--cyan); box-shadow: 0 0 18px rgba(61, 242, 255, 0.35); }
button.primary:hover, button.primary:focus-visible { background: var(--bright); }

/* ---------- map */
#map { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#lobby-title { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; }
#lobby-title h1 { margin: 0; font-size: clamp(36px, 5.5vw, 76px); letter-spacing: 8px; color: var(--bright); text-shadow: 0 0 24px rgba(61, 242, 255, 0.35); }
#lobby-title h1 span { color: var(--cyan); }
#lobby-title p { margin: 8px 0 0; font-size: 14px; color: var(--text); }

#banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: rgba(5, 8, 13, 0.92);
  border: 1px solid var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 210, 61, 0.25);
  z-index: 5;
}
#banner.tutorial { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 20px rgba(61, 242, 255, 0.2); }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 13, 0.72);
  z-index: 10;
}
.overlay[hidden] { display: none; }
#countdown-level { font-size: 18px; letter-spacing: 4px; color: var(--cyan); }
#countdown-num { font-size: 160px; font-weight: 700; line-height: 1.1; color: var(--bright); text-shadow: 0 0 40px var(--cyan); }
#countdown-tagline { font-size: 15px; color: var(--text); }

.card { width: min(560px, 90%); padding: 24px 28px; border: 1px solid var(--cyan); background: var(--panel); box-shadow: 0 0 40px rgba(61, 242, 255, 0.15); }
.card h1 { margin: 0 0 4px; font-size: 40px; letter-spacing: 4px; }
.card h1.good { color: var(--green); text-shadow: 0 0 20px rgba(70, 255, 143, 0.4); }
.card h1.bad { color: var(--red); text-shadow: 0 0 20px rgba(255, 61, 90, 0.4); }
#end-sub { margin: 0 0 14px; }
#end-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 14px; }
#end-stats dt { color: var(--dim); }
#end-stats dd { margin: 0; color: var(--bright); font-weight: 700; }
#end-report { margin: 0 0 18px; padding: 10px 12px; border-left: 3px solid var(--cyan); background: rgba(61, 242, 255, 0.05); color: var(--bright); line-height: 1.45; }
.actions { display: flex; gap: 10px; }
.actions button.primary { width: auto; flex: 1; }
.actions button[hidden] { display: none; }

/* ---------- phase visibility */
body:not([data-phase="lobby"]) .lobby-only { display: none; }
body[data-phase="lobby"] .play-only { display: none; }

/* Direction 2: saturated phosphor HUD around the playable network field. */
:root {
  --bg: #010b06;
  --panel: rgba(3, 20, 12, 0.95);
  --line: rgba(38, 255, 151, 0.42);
  --head: rgba(6, 42, 24, 0.82);
  --cyan: #42ffcb;
  --green: #2dffa0;
  --yellow: #ffd44d;
  --red: #ff566e;
  --magenta: #f48cdb;
  --text: #bbdec8;
  --bright: #effff3;
  --dim: #7aa68e;
}
[hidden] { display: none !important; }
body { background: radial-gradient(ellipse at 50% 20%, #0e3820 0, var(--bg) 68%); }
body::after {
  opacity: 0.5;
  background: repeating-linear-gradient(to bottom, rgba(93, 255, 160, 0.045) 0 1px, transparent 1px 4px);
}
#app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(218px, 15vw, 260px);
  grid-template-rows: 62px minmax(0, 1fr);
  gap: 9px;
  height: 100dvh;
  padding: 9px;
}

/* The top status strip stays compact. */
#topbar {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(168px, 1.5fr) minmax(54px, .5fr) minmax(110px, 1fr) minmax(64px, .5fr) minmax(148px, 1.35fr) minmax(62px, .55fr) minmax(62px, .55fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 7px 16px;
  border-color: var(--line);
  border-radius: 5px;
  background: linear-gradient(105deg, rgba(9, 39, 22, .98), rgba(2, 18, 10, .97) 65%);
  box-shadow: inset 0 1px rgba(111, 255, 170, .22), inset 0 -1px rgba(48, 255, 145, .15), 0 0 24px rgba(30, 252, 128, .08);
}
.brand {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--bright);
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 800;
  letter-spacing: .13em;
  white-space: nowrap;
}
.brand span, #lobby-title h1 span { color: var(--green); text-shadow: 0 0 20px rgba(35, 255, 146, .75); }
.brand small {
  display: block;
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .25em;
}
.flag {
  position: absolute;
  top: -6px;
  left: 17%;
  padding: 2px 6px;
  background: var(--bg);
  font-size: 10px;
}
.stat { min-width: 0; gap: 3px; }
.stat label { color: #9cc9a8; font-size: 9px; letter-spacing: .16em; }
.stat b { color: var(--bright); font-size: clamp(14px, 1.35vw, 19px); }
.stat.health {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
}
.stat.health label { grid-column: 1 / -1; }
.stat.health b { color: var(--green); font-size: 13px; text-shadow: 0 0 10px rgba(45, 255, 160, .5); }
.bar { height: 7px; margin: 0; overflow: hidden; border: 1px solid rgba(55, 255, 145, .22); border-radius: 3px; background: rgba(15, 65, 36, .62); }
.bar i { border-radius: inherit; box-shadow: 0 0 16px rgba(27, 255, 141, .9); }

/* Map occupies roughly 80–85% of a wide screen. */
#map {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  border-color: var(--line);
  border-radius: 5px;
  box-shadow: inset 0 0 65px rgba(0, 0, 0, .32), 0 0 0 1px rgba(24, 178, 87, .12), 0 0 28px rgba(17, 212, 91, .09);
}
#canvas { touch-action: none; }

/* Incident detail is a keyboard-accessible disclosure over the map. */
#intel-drawer {
  position: absolute;
  z-index: 6;
  bottom: 14px;
  left: 14px;
  width: min(320px, calc(100% - 28px));
}
#intel-drawer summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(3, 28, 15, .92);
  color: var(--green);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  list-style: none;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px rgba(109, 255, 172, .16), 0 0 18px rgba(39, 255, 123, .11);
}
#intel-drawer summary::-webkit-details-marker { display: none; }
#intel-drawer summary::before { content: "+"; color: var(--bright); font-size: 15px; line-height: 0; }
#intel-drawer[open] summary::before { content: "−"; }
#intel-drawer summary span { margin-left: auto; color: #9bdab1; font-size: 8px; letter-spacing: .08em; }
#intel-drawer summary:hover, #intel-drawer summary:focus-visible { border-color: var(--green); outline: none; background: rgba(8, 39, 26, .95); }
#left { display: flex; flex-direction: column; gap: 5px; max-height: min(56vh, 550px); margin-top: 5px; overflow-y: auto; }
#left .panel { background: rgba(3, 19, 11, .97); backdrop-filter: blur(16px); }
#left .grow { flex: 0 1 auto; min-height: 90px; }

/* Slim utility rail, with the join flow intact. */
#right {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}
.panel {
  flex: none;
  min-width: 0;
  border-color: var(--line);
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(7, 34, 19, .96), rgba(2, 17, 10, .94));
  box-shadow: inset 0 1px rgba(111, 255, 170, .13), 0 0 16px rgba(21, 167, 82, .06);
}
.panel h2 {
  padding: 10px 12px 8px;
  color: var(--green);
  background: linear-gradient(90deg, rgba(34, 128, 65, .27), transparent);
  border-bottom: 1px solid rgba(69, 255, 140, .22);
  font-size: 11px;
  letter-spacing: .19em;
  text-shadow: 0 0 11px rgba(33, 255, 137, .45);
}
.panel .body { padding: 11px 12px 12px; }
.small { font-size: 10px; }
.cmdr { padding: 10px 11px 0; }
#cmdr-face { color: var(--green); font-size: 10px; text-shadow: 0 0 10px rgba(99, 244, 177, .45); }
#cmdr-face[data-mood="alarm"] { color: var(--red); text-shadow: 0 0 10px rgba(255, 102, 120, .5); }
#cmdr-line { min-height: 3.2em; font-size: 12px; }
#ai-status { margin: 4px 11px 9px; }
#log { min-height: 0; max-height: 27vh; padding: 8px 11px 10px; font-size: 11px; }
#log li { margin-bottom: 5px; }
.rows { padding: 6px 11px 8px; font-size: 12px; }
#nodes { max-height: min(40vh, 390px); }
.rows li { min-height: 30px; padding: 0; border-bottom: 1px solid rgba(55, 255, 132, .15); }
.rows li:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; }
.node-name { color: var(--bright); font-weight: 700; }
.op-ap, .node-status { font-size: 11px; text-align: right; font-weight: 700; }
#join-panel img { width: min(100%, 190px); margin: 8px auto 10px; border: 6px solid var(--bright); }
#join-panel code, #join-mini code { font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
#join-panel p { margin: 10px 0; font-size: 11px; }
#join-panel p.small { margin-bottom: 0; font-size: 9px; }
.room-line { gap: 7px; margin-bottom: 6px; font-size: 10px; letter-spacing: .14em; }
.room-line b { font-size: 25px; letter-spacing: .15em; text-shadow: 0 0 15px rgba(99, 244, 177, .28); }
#room-count { font-size: 10px; }
.mini { gap: 9px; }
.mini .room-line { margin-bottom: 2px; }
.mini .room-line b { font-size: 16px; }
.mini img { width: 68px; height: 68px; border: 3px solid var(--bright); }
button {
  padding: 10px 12px;
  border-color: var(--green);
  border-radius: 3px;
  background: rgba(45, 255, 160, .11);
  color: var(--green);
  font-size: 11px;
  letter-spacing: .12em;
}
button:hover, button:focus-visible { background: rgba(45, 255, 160, .22); box-shadow: inset 0 0 0 1px var(--green), 0 0 20px rgba(45, 255, 160, .18); }
button.primary { border-color: var(--green); background: var(--green); color: #032014; font-size: 12px; box-shadow: 0 0 20px rgba(45, 255, 160, .38); }
button.primary:hover, button.primary:focus-visible { background: var(--bright); }

#lobby-title { display: none; }
#banner { max-width: min(80%, 670px); padding: 9px 14px; border-radius: 3px; background: rgba(2, 24, 11, .96); font-size: 13px; line-height: 1.4; }
#banner.tutorial { border-color: var(--green); color: var(--green); box-shadow: 0 0 26px rgba(99, 244, 177, .14); }
.overlay { background: rgba(2, 11, 8, .78); }
#countdown-level { color: var(--green); font-size: 16px; letter-spacing: .2em; }
#countdown-num { font-size: clamp(90px, 12vw, 160px); text-shadow: 0 0 40px rgba(99, 244, 177, .5); }
.card { border-color: var(--line); border-radius: 5px; background: rgba(3, 15, 11, .97); }
#end-report { border-left-color: var(--green); background: rgba(99, 244, 177, .05); }

@media (max-width: 1100px) {
  #app { grid-template-columns: minmax(0, 1fr) 228px; }
  #topbar { gap: 8px; padding-inline: 10px; }
  .brand small { display: none; }
  .stat label { font-size: 8px; }
  .stat b { font-size: 14px; }
  .stat.health b { font-size: 11px; }
}
@media (max-width: 760px) {
  body { height: auto; min-height: 100dvh; overflow: auto; }
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(480px, 66dvh) auto; height: auto; min-height: 100dvh; }
  #topbar { grid-column: 1; grid-row: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 12px; }
  .brand { grid-column: 1 / -1; }
  .flag { top: 8px; right: 9px; left: auto; }
  .stat.health { grid-column: span 2; }
  #map { grid-column: 1; grid-row: 2; }
  #right { grid-column: 1; grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; overflow: visible; }
  #join-panel, #join-mini { grid-column: 1 / -1; }
  .boss-preview { grid-column: 1 / -1; }
  #nodes { max-height: 240px; }
}
@media (max-width: 520px) {
  #topbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand { font-size: 18px; }
  #right { grid-template-columns: 1fr; }
  #join-panel, #join-mini { grid-column: 1; }
  #lobby-title h1 { font-size: 34px; letter-spacing: .05em; }
  #lobby-title p { font-size: 10px; }
  #intel-drawer { bottom: 9px; left: 9px; width: min(300px, calc(100% - 18px)); }
  .actions { flex-wrap: wrap; }
}

/* ---------- score, streak, high scores */
#hud-mult[data-level="2"] { color: var(--green); }
#hud-mult[data-level="3"] { color: var(--yellow); }
#hud-mult[data-level="4"], #hud-mult[data-level="5"] { color: var(--magenta); text-shadow: 0 0 12px var(--magenta); }
.icon-btn { padding: 4px 10px; font-size: 20px; line-height: 1; letter-spacing: 0; }
.highscores { margin: 0; padding: 6px 10px; list-style: none; font-size: 12px; }
.highscores li { display: flex; gap: 8px; padding: 2px 0; }
.highscores .hs-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highscores b { margin-left: auto; color: var(--bright); }
.highscores li.mine { color: var(--magenta); font-weight: 700; }
.card .highscores { max-height: 9em; overflow-y: auto; margin-bottom: 10px; border: 1px solid var(--line); }
.stars { font-size: 34px; letter-spacing: 6px; color: var(--yellow); text-shadow: 0 0 16px rgba(255, 210, 61, 0.5); }
.mvp { margin: 4px 0; color: var(--magenta); font-weight: 700; }
.run { margin: 4px 0; color: var(--bright); }
.rank { margin: 4px 0 8px; color: var(--green); font-weight: 700; }

/* ---------- top bar: brand + 7 stats + full-screen button */
#topbar {
  grid-template-columns:
    minmax(150px, 1.4fr) minmax(52px, .5fr) minmax(90px, .9fr) minmax(54px, .5fr)
    minmax(130px, 1.3fr) minmax(62px, .6fr) minmax(50px, .45fr) minmax(50px, .45fr) auto;
}
.icon-btn { min-width: 44px; min-height: 40px; }

/* ---------- how to play */
.rules { margin: 0; padding: 10px 12px 12px 30px; font-size: 12px; line-height: 1.5; color: var(--text); }
.rules li { margin-bottom: 6px; }
.rules b { color: var(--bright); }
button.secondary { width: 100%; margin-top: 8px; }

/* ---------- rotate prompt (big screen opened on a phone in portrait) */
#rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(1, 11, 6, .96);
}
#rotate-hint h2 { margin: 0; color: var(--bright); font-size: 22px; }
#rotate-hint p { margin: 0; color: var(--text); font-size: 15px; }
#rotate-hint button { min-height: 48px; width: min(320px, 100%); font-size: 14px; }
.rotate-icon { font-size: 54px; animation: tilt 1.6s ease-in-out infinite; }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------- phones viewing the big screen: let the page scroll, bigger touch targets */
@media (max-width: 760px) {
  html, body { height: auto; overflow: auto; overflow-x: hidden; }
  #topbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .icon-btn { justify-self: end; }
}
@media (pointer: coarse) {
  #canvas { touch-action: pan-y; } /* swipe up/down over the map scrolls the page */
  button { min-height: 44px; }
  #intel-drawer summary { min-height: 44px; }
}

/* ---------- accessibility */
:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- logo: mask in the top bar, full lockup over the lobby map */
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mask { height: 22px; width: auto; flex: none; filter: drop-shadow(0 0 6px rgba(45, 255, 160, .5)); }
.brand small { display: none; }
body[data-phase="lobby"] #lobby-title {
  display: flex;
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, 62%);
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 30%, rgba(14, 56, 32, .92), rgba(1, 11, 6, .94));
  box-shadow: 0 0 40px rgba(45, 255, 160, .12);
  pointer-events: none;
}
#lobby-title .logo-mask { width: 62%; }
#lobby-title h1 { font-size: clamp(24px, 2.6vw, 38px); letter-spacing: .14em; color: #bff7e6; }
#lobby-title h1 span { color: var(--green); text-shadow: 0 0 18px rgba(45, 255, 160, .7); }
#lobby-title p { margin: 2px 0 0; font-size: 11px; letter-spacing: .12em; color: var(--dim); text-align: center; }
@media (max-width: 760px) {
  body[data-phase="lobby"] #lobby-title { width: 86%; top: 8px; }
}
@media (max-width: 1100px) {
  .brand { font-size: 0; } /* not enough room: the mask alone is the brand */
  .brand-mask { height: 28px; }
}

/* ---------- team name, daily challenge, leaderboard tabs */
.team-label { display: block; margin: 10px 0 4px; font-size: 10px; letter-spacing: .16em; color: var(--dim); }
.team-row { display: flex; gap: 6px; margin-bottom: 8px; }
.team-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--bright);
  background: rgba(1, 11, 6, .8);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.team-row input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.daily-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: left;
  letter-spacing: .04em;
  border-color: var(--yellow);
  background: rgba(255, 212, 77, .08);
  color: var(--yellow);
}
.daily-btn:hover, .daily-btn:focus-visible { background: rgba(255, 212, 77, .18); box-shadow: 0 0 18px rgba(255, 212, 77, .2); }
.daily-tag { font-size: 10px; letter-spacing: .16em; }
#daily-name { font-size: 15px; color: var(--bright); }
#daily-desc { font-size: 11px; font-weight: 400; color: var(--text); line-height: 1.35; }
.board-tabs { display: flex; gap: 4px; padding: 8px 10px 0; }
.board-tabs button { flex: 1; padding: 6px 0; font-size: 10px; letter-spacing: .08em; min-height: 0; }
.board-tabs button[aria-selected="true"] { background: var(--green); color: #032014; }
.board-title { margin: 6px 0 4px; font-size: 11px; letter-spacing: .16em; color: var(--green); }
