:root {
  --bg: #05060b;
  --panel: rgba(10, 12, 24, 0.8);
  --line: rgba(150, 140, 255, 0.18);
  --text: #e8ebff;
  --muted: #7f86a8;
  --human: #7df9ff;
  --inf: #ff2e63;
  --gold: #ffd166;
  --evac: #5cff9d;
  --friend: #c3a6ff; /* party friends: a lavender marker that holds whatever team they're on */
  /* edges kept clear of phone notches and home bars (viewport-fit=cover) */
  --st: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'Chakra Petch', system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
  /* phones: no pull-to-refresh, no double-tap zoom, no long-press callouts or tap flashes */
  overscroll-behavior: none; touch-action: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
button { touch-action: manipulation; }

#game { position: fixed; inset: 0; display: block; }
#overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.hidden { display: none !important; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.25); border-bottom-width: 3px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 1px;
}
kbd.wide { min-width: 64px; }
/* controller face buttons: round, in muted versions of the usual colours */
kbd.pad { width: 26px; min-width: 26px; padding: 0; border-radius: 50%; border-bottom-width: 1px; }
kbd.pa { color: var(--evac); border-color: rgba(92, 255, 157, 0.55); }
kbd.pb { color: var(--inf); border-color: rgba(255, 46, 99, 0.55); }
kbd.px { color: var(--human); border-color: rgba(125, 249, 255, 0.55); }
kbd.py { color: var(--gold); border-color: rgba(255, 209, 102, 0.55); }

/* prompts for the device used last: .ok keys, .op controller, .ot touch */
body:not([data-input="keys"]) .ok, body:not([data-input="pad"]) .op, body:not([data-input="touch"]) .ot { display: none !important; }

/* ---------- menu ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(5, 6, 11, 0.35), rgba(5, 6, 11, 0.9));
  overflow-y: auto; touch-action: pan-y;
}
.card {
  width: min(460px, 100%); padding: 32px 28px; text-align: center;
  margin: auto; /* centred, but scrollable from the top if it's taller than the screen */
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.logo {
  font-size: clamp(46px, 11vw, 70px); font-weight: 700; line-height: 1; letter-spacing: 6px; color: #fff;
  text-shadow: 0 0 22px rgba(255, 46, 99, 0.7), 3px 0 0 rgba(255, 46, 99, 0.9), -3px 0 0 rgba(125, 249, 255, 0.9);
  animation: glitch 3.2s infinite;
}
.tag { color: var(--muted); margin: 10px 0 22px; font-size: 16px; letter-spacing: 1px; }
input {
  width: 100%; padding: 12px; outline: none; text-align: center;
  font: inherit; font-size: 20px; letter-spacing: 2px;
  color: var(--text); background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line);
  user-select: text; -webkit-user-select: text;
}
input:focus { border-color: var(--human); }
#classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cls {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; cursor: pointer;
  font: inherit; color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); text-align: center;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.cls svg { width: 34px; height: 34px; }
.cls b { font-size: 14px; letter-spacing: 2px; color: var(--text); }
.cls .role { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.cls p { font-size: 11px; line-height: 1.35; margin-top: 2px; }
.cls-desc { display: none; }
.cls kbd { position: absolute; top: 6px; left: 6px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; border-bottom-width: 2px; }
.cls:hover { border-color: rgba(125, 249, 255, 0.5); }
.cls.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); box-shadow: inset 0 0 18px rgba(125, 249, 255, 0.15); }
.btn {
  width: 100%; margin-top: 12px; padding: 14px; border: 0; cursor: pointer;
  font: inherit; font-size: 22px; font-weight: 700; letter-spacing: 6px; color: #05060b;
  background: var(--human); box-shadow: 0 0 26px rgba(125, 249, 255, 0.45);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: filter 0.1s, transform 0.08s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.98); }
.btn kbd { margin: -4px 12px 0 0; vertical-align: middle; color: #05060b; border-color: rgba(5, 6, 11, 0.5); background: rgba(5, 6, 11, 0.08); }
/* where the controller is on the menu: a steady outline, no pulsing */
.pf { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn.pf { box-shadow: inset 0 0 0 3px var(--gold), 0 0 26px rgba(125, 249, 255, 0.45); } /* clip-path would hide an outline */
#view { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 11px; letter-spacing: 2px; color: var(--muted); }
#view span { margin-right: 4px; }
#view button {
  padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
#view button small { font-size: 9px; font-weight: 600; letter-spacing: 1px; opacity: 0.8; }
#view button.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); }
/* the passive pick, under the classes */
.passive-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.passive-row span { margin-right: 4px; }
.passive-row button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.passive-row button small { font-size: 9px; letter-spacing: 1px; opacity: 0.85; }
.passive-row button.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); }
/* a passive emblem (Radar: a dish), grey until it shares with the team, then cyan */
svg.emb { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; flex: none; fill: #b0b8d6; stroke: #b0b8d6; stroke-width: 1.4; stroke-linecap: round; }
svg.emb .ln { fill: none; }
svg.emb.on { fill: var(--human); stroke: var(--human); }
.pf-passive h4 { display: flex; align-items: center; gap: 8px; }
.pf-passive h4 small { color: var(--muted); letter-spacing: 1px; }
.pf-equip { margin-left: auto; padding: 4px 10px; font-size: 10px; }
.pf-equip.on { color: var(--human); border-color: var(--human); }
.pf-ladder { display: grid; gap: 3px; padding: 0; margin: 6px 0 0; text-align: left; }
.pf-ladder li { list-style: none; display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.02); }
.pf-ladder li b { min-width: 18px; color: var(--muted); }
.pf-ladder li.got { color: var(--text); }
.pf-ladder li.got b { color: var(--human); }
.pf-ladder li.cur { border-left: 2px solid var(--human); }
.pf-ladder li em { font-style: normal; font-size: 9px; letter-spacing: 1px; color: var(--gold); }
.pf-ladder li em.nx { color: var(--human); }
.pf-ladder .sd { min-width: 62px; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.pf-ladder li.side-human .sd { color: var(--human); }
.pf-ladder li.side-infected .sd { color: var(--inf); }
/* each level: what it does plainly, then the numbers in grey */
.pf-ladder .tx { flex: 1; min-width: 0; }
.pf-ladder .dt { font-size: 11px; color: var(--muted); }
.pf-ladder .tags { display: flex; gap: 6px; margin-left: auto; }
.pf-ladder li.upcoming { color: var(--text); outline: 1px dashed rgba(125, 249, 255, 0.45); outline-offset: -1px; }
.pf-ladder li.later { opacity: 0.7; }
.pf-ladder li.gap { justify-content: center; padding: 2px 8px; background: none; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.prog-list .dt, .prog-next .dt { font-size: 11px; color: var(--muted); }
/* a passive level: side and name on the first line, the detail on its own line under the name */
.pv { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }
.pv > small { grid-row: 1; margin-right: 0 !important; }
.pv-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pv-detail { grid-column: 2; margin-top: 1px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.keys { display: grid; gap: 9px; margin-top: 22px; text-align: left; }
.keys div { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.kbds { display: flex; gap: 3px; min-width: 120px; }
.rules { margin-top: 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.rules b { color: var(--gold); }
.best { margin-top: 10px; color: var(--gold); font-weight: 600; letter-spacing: 1px; }
/* ranks: a small numbered badge by a name, your rank and its progress on the menu and the results */
.rk { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 16px; margin-right: 6px; padding: 0 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0; line-height: 1; color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.5); border-radius: 3px; vertical-align: 1px; }
.rank-line, .res-xp { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--text); }
.rank-line .rk, .res-xp .rk { margin-right: 0; }
.rank-line small, .res-xp small { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); }
.res-xp b { color: var(--gold); }
.res-xp:empty { display: none; }
.rk-bar { position: relative; width: 90px; height: 4px; background: rgba(255, 255, 255, 0.12); }
.profile-btn { margin-top: 10px; }
/* titles: a small line by a player's name */
.ttl { font-size: 10px; font-weight: 600; letter-spacing: 1px; color: var(--gold); opacity: 0.85; }
.members li .nm .ttl { display: block; margin-top: 1px; }
#boardList .ttl { margin-left: 4px; }
#resList small .ttl { font-weight: 600; }
.ttl-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.ttl-pick button { padding: 5px 10px; cursor: pointer; font: inherit; font-size: 11px; letter-spacing: 1px; color: var(--muted); background: none; border: 1px solid var(--line); }
.ttl-pick button.on { color: var(--gold); border-color: rgba(255, 209, 102, 0.6); background: rgba(255, 209, 102, 0.08); }
.col-pick button { display: inline-flex; align-items: center; gap: 6px; }
.col-pick i { width: 10px; height: 10px; border-radius: 50%; }
.nc { font-weight: 700; }
/* what's new */
.news-btn { display: block; margin: 8px auto 0; }
.privacy-link { display: block; width: max-content; margin: 6px auto 0; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.privacy-link:hover, .privacy-link:focus-visible { color: var(--text); }
.news-btn.unseen::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; vertical-align: 2px; border-radius: 50%; background: var(--gold); }
#news { z-index: 12; }
.news-card { width: min(600px, 100%); padding: 24px 24px 20px; text-align: left; }
/* the notes scroll inside the card, so GOT IT is always on screen */
.news-card { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
#newsBody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding-right: 4px; }
.news-card .kicker { text-align: center; }
.news-card h4 { margin: 14px 0 8px; font-size: 12px; letter-spacing: 3px; color: var(--text); }
.news-card h4 small { margin-left: 6px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.news-list { display: grid; gap: 8px; padding: 0; }
.news-list li { display: grid; gap: 2px; list-style: none; padding: 8px 10px; background: rgba(255, 255, 255, 0.03); border-left: 2px solid var(--human); }
.news-list b { font-size: 13px; letter-spacing: 1px; }
.news-list span { font-size: 13px; line-height: 1.4; color: var(--muted); }
#newsClose { display: block; margin: 14px auto 0; }
.news-card h4 em { margin-right: 4px; padding: 1px 5px; font-style: normal; font-size: 10px; letter-spacing: 1px; color: #05060b; background: var(--gold); }
.news-card .fresh .news-list li { border-left-color: var(--gold); }
/* what's new: the highlights, then each update folded */
.news-hl { display: grid; gap: 6px; padding: 0; margin: 0; }
.news-hl li { display: grid; gap: 1px; list-style: none; padding: 9px 12px; background: rgba(255, 255, 255, 0.03); border-left: 3px solid var(--human); }
.news-hl li.fresh { border-left-color: var(--gold); }
.news-hl b { font-size: 15px; letter-spacing: 0.5px; }
.news-hl span { font-size: 13px; color: var(--muted); }
.news-card details { margin-top: 6px; }
.news-card summary { cursor: pointer; padding: 6px 0; font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--text); list-style: none; }
.news-card summary::-webkit-details-marker { display: none; }
.news-card summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.news-card details[open] summary::before { content: '▾'; }
.news-card summary small { margin-left: 6px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.news-card summary em { margin-right: 4px; padding: 1px 5px; font-style: normal; font-size: 10px; letter-spacing: 1px; color: #05060b; background: var(--gold); }
.news-card details .news-list { margin: 4px 0 8px; }
.news-card details.fresh .news-list li { border-left-color: var(--gold); }
.news-card .news-earlier { margin-top: 20px; color: var(--muted); }
.news-card section:not(.fresh) { opacity: 0.8; }
/* the profile screen */
#profile { z-index: 12; }
.profile-card { width: min(680px, 100%); padding: 24px 24px 20px; }
.pf-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 10px 0 16px; }
.pf-head .rk-bar { width: min(320px, 80%); height: 6px; }
.pf-head small { font-size: 12px; letter-spacing: 1px; color: var(--muted); }
.pf-rank { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; letter-spacing: 4px; }
.pf-rank .rk { min-width: 30px; height: 24px; font-size: 14px; margin: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pf-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.pf-tile b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.pf-tile span { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--human); }
.pf-tile small { font-size: 11px; line-height: 1.3; color: var(--muted); }
#pfBody h4 { margin: 18px 0 8px; font-size: 11px; letter-spacing: 4px; color: var(--muted); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-table th, .pf-table td { padding: 6px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.pf-table thead th { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pf-table tbody th { text-align: left; white-space: nowrap; font-size: 12px; letter-spacing: 2px; }
.pf-table tbody th svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; color: var(--human); }
.pf-table small, .pf-x { color: var(--muted); font-size: 11px; }
.pf-recent { display: grid; gap: 3px; padding: 0; text-align: left; }
.pf-recent li { display: grid; grid-template-columns: 72px 1fr 22px 1.3fr 48px; align-items: center; gap: 8px; padding: 5px 8px; list-style: none; font-size: 13px; background: rgba(255, 255, 255, 0.03); }
.pf-recent li.won .pf-res { color: var(--evac); }
.pf-recent svg { width: 16px; height: 16px; color: var(--human); }
.pf-when { color: var(--muted); font-size: 11px; }
.pf-res { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.pf-res small { font-weight: 600; letter-spacing: 0.5px; color: var(--pz, #ff7020); }
.pf-xp { text-align: right; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-note { margin: 14px 0 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }
#pfClose { margin-top: 14px; }
.pf-tabs { display: flex; justify-content: center; gap: 4px; margin: 0 0 12px; }
.pf-tabs button { padding: 7px 14px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--muted); background: none; border: 1px solid var(--line); }
.pf-tabs button.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); }
#pfBody h4 small { margin-left: 8px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
/* challenges */
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; text-align: left; }
.ch { padding: 8px 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ch.done { border-color: rgba(255, 209, 102, 0.45); }
.ch.soon { opacity: 0.55; }
.ch-top { display: flex; align-items: baseline; gap: 6px; }
.ch-top b { font-size: 13px; letter-spacing: 1px; }
.ch-pips { font-size: 9px; letter-spacing: 2px; color: var(--gold); }
.ch-xp { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.ch p { margin: 3px 0 6px; font-size: 12px; line-height: 1.35; color: var(--text); opacity: 0.85; }
.ch-bar { position: relative; height: 4px; background: rgba(255, 255, 255, 0.1); }
.ch-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--human); }
.ch.done .ch-bar i { background: var(--gold); }
.ch small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 0.5px; color: var(--muted); }
/* unlocks */
.ul-tracks { display: grid; gap: 8px; text-align: left; }
.ul-track { padding: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ul-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ul-head svg { width: 18px; height: 18px; color: var(--human); }
.ul-head b { letter-spacing: 2px; }
.ul-head span { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.ul-stars { color: var(--gold) !important; letter-spacing: 1px; }
.ul-track .rk-bar { width: 100%; }
.ul-track > small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.ul-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin: 8px 0 0; padding: 0; text-align: left; }
.ul-list li { list-style: none; font-size: 12px; color: var(--muted); }
.ul-list li span { display: inline-block; width: 14px; }
.ul-list li.got { color: var(--text); }
.ul-list li.got span { color: var(--gold); }
.ul-list li small { font-size: 10px; color: var(--muted); }
.ul-next { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
/* ready to prestige: what the next pass unlocks, on its stand, beside why to start over */
.ul-pnext { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; padding: 8px 10px; text-align: left;
  border: 1px solid rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.05); }
.ul-pnext .pvw-wrap { margin-top: 0; }
.ul-pnext-t { display: grid; gap: 3px; flex: 1 1 160px; }
.ul-pnext-t small { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: var(--gold); }
.ul-pnext-t b { font-size: 15px; letter-spacing: 1px; color: var(--text); }
.ul-pnext-t span { font-size: 11px; line-height: 1.4; color: var(--muted); }
.ul-prestige { margin-top: 8px; }
/* PROFILE & STATS: your code, for playing as yourself on another device */
.pf-move { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.pf-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pf-code code { padding: 7px 10px; font: 700 14px/1 ui-monospace, Consolas, monospace; letter-spacing: 1px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.pf-code code.blur { filter: blur(5px); user-select: none; }
.pf-code input { flex: 1 1 220px; min-width: 0; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
.pf-code .sure { border-color: var(--gold); color: var(--gold); }
.ul-prestige.sure { border-color: var(--gold); color: var(--gold); }
/* results: the challenges a round finished */
.res-ch { width: 100%; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.res-ch b { color: var(--text); }
.res-ch i { font-style: normal; color: var(--gold); }
.res-ch small { letter-spacing: 0.5px; }
@media (max-width: 560px) {
  .ch-grid, .ul-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-x { display: none; }
  .pf-recent li { grid-template-columns: 58px 1fr 18px 1.2fr 40px; font-size: 12px; }
}
.rk-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }
/* ---------- parties ---------- */
.btn2 {
  padding: 11px 14px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 3px;
  color: var(--human); background: rgba(125, 249, 255, 0.06); border: 1px solid rgba(125, 249, 255, 0.45);
  transition: background 0.12s, border-color 0.12s;
}
.btn2:hover { background: rgba(125, 249, 255, 0.14); border-color: var(--human); }
.btn2.pf { outline: 2px solid var(--gold); outline-offset: 3px; }
.party-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.join-form { display: flex; align-items: center; gap: 8px; min-width: 0; }
.join-form label { flex: none; font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: 2px; text-align: right; color: var(--muted); }
.join-form input { flex: 1; min-width: 96px; padding: 9px 6px; font-size: 18px; letter-spacing: 8px; text-align: center; text-transform: uppercase; }
.join-form input::placeholder { letter-spacing: 8px; color: rgba(127, 134, 168, 0.45); }
.join-form .btn2 { flex: none; padding-left: 18px; padding-right: 18px; }
/* in a party's round: its code under the clock, so you can read it out to a friend */
.party-line { margin-top: 4px; font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.party-line b { margin-left: 4px; font-size: 13px; letter-spacing: 4px; color: var(--text); }
.link { margin-top: 12px; padding: 4px; cursor: pointer; font: inherit; font-size: 13px; letter-spacing: 1px; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 6px; color: var(--muted); }
.party-code {
  margin: 4px 0 10px; font-size: clamp(52px, 14vw, 76px); font-weight: 700; line-height: 1; letter-spacing: 14px; padding-left: 14px;
  color: #fff; text-shadow: 0 0 20px rgba(125, 249, 255, 0.55);
  user-select: text; -webkit-user-select: text;
}
.invite { display: flex; gap: 6px; align-items: stretch; }
.invite-link {
  flex: 1; min-width: 0; padding: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; letter-spacing: 1px; color: var(--text); background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line);
  user-select: text; -webkit-user-select: text;
}
.lobby-hint { margin: 10px 0 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.lobby-hint b { color: var(--text); }
.members { display: grid; gap: 4px; text-align: left; }
.members li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; list-style: none; font-size: 15px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; }
.members li svg { width: 18px; height: 18px; flex: none; color: var(--human); }
.members li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members li .tag { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.members li .tag.host { color: var(--gold); }
.members li.me { border-color: rgba(255, 209, 102, 0.4); }
.members li.me .nm { color: var(--gold); font-weight: 700; }
.members li.open { color: var(--muted); font-size: 13px; justify-content: center; background: none; border: 1px dashed var(--line); }
.lobby-wait { margin-top: 12px; font-size: 14px; color: var(--muted); }
.lobby-wait:empty { display: none; }
/* class chips: the lobby, and the round results on touch */
.pick { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.pick button {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
.pick svg { width: 18px; height: 18px; }
.pick kbd, #resPick kbd { min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; border-bottom-width: 2px; }
.pick button.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); }
.res-party { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.res-party b { color: var(--human); letter-spacing: 2px; }
.res-party .me { color: var(--gold); }
.net-note { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--human); letter-spacing: 0.5px; }
.net-note:empty { display: none; }
.net-note.bad { color: var(--inf); }
.net-note a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* online: a steady (never blinking) tag while snapshots have stopped arriving */
#netBadge { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); z-index: 7; padding: 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--inf); background: rgba(9, 12, 22, 0.85); border: 1px solid rgba(255, 46, 99, 0.5); pointer-events: none; }

/* a line from the admin page to everyone online ("a quick update in 5 minutes") */
#notice { position: fixed; left: 50%; top: calc(64px + var(--st, 0px)); transform: translateX(-50%); z-index: 30; max-width: min(560px, calc(100vw - 32px));
  padding: 8px 14px; font-size: 14px; font-weight: 600; letter-spacing: 1px; text-align: center; color: #f4f6ff; background: rgba(9, 12, 22, 0.92);
  border: 1px solid rgba(255, 209, 102, 0.6); border-radius: 4px; pointer-events: none; transition: opacity 0.6s; }
#notice.fade { opacity: 0; }

/* ---------- HUD ---------- */
#top {
  position: fixed; top: calc(14px + var(--st)); left: 50%; transform: translateX(-50%); z-index: 5;
  width: min(360px, 56vw); text-align: center; pointer-events: none;
}
#phase { font-size: 12px; letter-spacing: 4px; color: var(--muted); }
#timer { font-size: 40px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
#timer.hot { color: var(--inf); text-shadow: 0 0 16px rgba(255, 46, 99, 0.7); }
#bar { position: relative; height: 6px; margin-top: 8px; overflow: hidden; background: var(--human); box-shadow: 0 0 12px rgba(125, 249, 255, 0.5); }
#bar i { position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: var(--inf); box-shadow: 0 0 12px rgba(255, 46, 99, 0.8); transition: width 0.3s; }
#counts { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
#counts .h { color: var(--human); }
#counts .z { color: var(--inf); }
#counts .e { color: var(--evac); }
#phase.evac { color: var(--evac); text-shadow: 0 0 10px rgba(92, 255, 157, 0.6); }
#phase.last { color: var(--gold); }

#board {
  position: fixed; right: calc(16px + var(--sr)); top: calc(16px + var(--st)); z-index: 5; width: 220px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; pointer-events: none;
}
#board h3 { margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
#boardList li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; list-style: none; white-space: nowrap; }
#boardList .n { overflow: hidden; text-overflow: ellipsis; }
#boardList .n::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; vertical-align: 1px; background: var(--human); }
#boardList .infected .n::before { background: var(--inf); transform: rotate(45deg); }
#boardList .me { color: var(--gold); font-weight: 700; }
#boardList .v { color: var(--muted); font-variant-numeric: tabular-nums; }

#feed {
  position: fixed; left: calc(16px + var(--sl)); top: calc(16px + var(--st)); z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  max-width: max(280px, calc(50vw - 215px)); font-size: 16px; line-height: 1.35; pointer-events: none;
}
#feed div { padding: 6px 12px; background: rgba(0, 0, 0, 0.5); border-left: 3px solid transparent; animation: feedIn 0.2s ease-out; transition: opacity 0.5s; }
#feed span { font-weight: 600; }
#feed .h { color: var(--human); }
#feed .z { color: var(--inf); }
#feed .e { color: var(--evac); }
#feed .mine { border-left-color: var(--gold); }
#feed .friend { border-left-color: var(--friend); }
/* a multi-kill, a spree, or a spree ended, after the kill it came with */
#feed em { margin-left: 8px; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); white-space: nowrap; }
#feed em.end { color: var(--text); opacity: 0.7; }

#toasts { position: fixed; left: 50%; top: 23%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.toast { font-size: clamp(26px, 5vw, 46px); font-weight: 700; letter-spacing: 4px; white-space: nowrap; color: #fff; text-shadow: 0 0 22px currentColor; animation: pop 1.8s ease-out forwards; }
.toast.red { color: var(--inf); }
.toast.cyan { color: var(--human); }
.toast.gold { color: var(--gold); }
.toast.green { color: var(--evac); }
.toast.small { font-size: clamp(15px, 2.6vw, 20px); letter-spacing: 2px; }

/* your kills, just over your score: the points, and the name of a multi-kill or a spree */
#callouts { position: fixed; left: 50%; bottom: calc(96px + var(--sb)); transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.callout { display: flex; flex-direction: column; align-items: center; color: var(--human); text-shadow: 0 0 14px currentColor; animation: pop 1.3s ease-out forwards; }
.callout.inf { color: var(--inf); }
.callout.big { animation-duration: 2.4s; }
.callout b { font-size: clamp(24px, 3.8vw, 36px); font-weight: 700; letter-spacing: 4px; white-space: nowrap; color: var(--gold); text-shadow: 0 0 18px rgba(255, 209, 102, 0.5); }
.callout span { font-size: 17px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.callout i { font-style: normal; color: var(--gold); }

#bottom { position: fixed; left: 50%; bottom: calc(16px + var(--sb)); transform: translateX(-50%); z-index: 5; display: flex; align-items: stretch; gap: 8px; pointer-events: none; }
#role { display: flex; align-items: center; padding: 0 16px; white-space: nowrap; border: 1px solid currentColor; background: var(--panel); font-size: 14px; font-weight: 700; letter-spacing: 3px; }
#role.human { color: var(--human); box-shadow: inset 0 0 14px rgba(125, 249, 255, 0.18); }
/* a Striker's momentum: the chip fills from the left as it builds */
#role { background-image: linear-gradient(90deg, rgba(125, 249, 255, 0.22) calc(var(--mom, 0) * 100%), transparent calc(var(--mom, 0) * 100%)); }
#role.infected { color: var(--inf); box-shadow: inset 0 0 14px rgba(255, 46, 99, 0.25); }
#role.last { color: var(--gold); box-shadow: inset 0 0 14px rgba(255, 209, 102, 0.25); }
#role.out { color: var(--evac); box-shadow: inset 0 0 14px rgba(92, 255, 157, 0.2); }
#role.gone { color: var(--muted); }
/* the round's end, in a line at the top while the next round comes (client.js showResults): who won, your score
   and what it was worth */
.round-banner {
  position: fixed; left: 50%; top: calc(14px + var(--st)); transform: translateX(-50%); z-index: 7; pointer-events: none;
  display: grid; justify-items: center; gap: 2px; padding: 9px 22px 8px; text-align: center; min-width: 240px;
  background: rgba(9, 12, 22, 0.84); border: 1px solid rgba(255, 255, 255, 0.14);
  animation: miIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.round-banner .rb-t { font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--text); }
.round-banner .rb-t.escaped { color: var(--human); }
.round-banner .rb-t.infected { color: var(--inf); }
.round-banner .rb-sub { font-size: 12px; letter-spacing: 1px; color: var(--text); }
.round-banner .rb-me { font-size: 12px; color: var(--muted); }
.round-banner .rb-me b { color: var(--text); }
.round-banner .rb-xp { color: var(--gold); font-weight: 700; }
.round-banner .rb-next { margin-top: 2px; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
/* the screens between rounds are now the session summary, when you leave: no round board, class pick, vote or timer.
   It sits over the main menu it leads back to */
#results.summary { z-index: 11; pointer-events: auto; }
#results.summary #resSub { display: block !important; }
body.summary-open #menu { visibility: hidden; } /* the summary on its own, over the arena; DONE brings the menu */
/* the game menu's class row */
.gm-cls { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; margin: 4px 0 10px; }
.gm-cls-h { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.gm-cls button { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; font: inherit; font-size: 11px;
  font-weight: 700; letter-spacing: 1px; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); cursor: pointer; }
.gm-cls button svg { width: 16px; height: 16px; }
.gm-cls button.on { border-color: var(--human); color: var(--human); background: rgba(125, 249, 255, 0.08); }
#results.summary .res-foot, #results.summary > .next, #results.summary .res-timer,
#results.summary [data-page="recap"] { display: none !important; }
/* the round's best play: a card at the top while it plays back, the HUD out of the way */
.replay-card {
  position: fixed; left: 50%; top: calc(18px + var(--st)); transform: translateX(-50%); z-index: 8; pointer-events: none;
  display: grid; justify-items: center; gap: 2px; padding: 10px 22px 9px; text-align: center;
  background: rgba(9, 12, 22, 0.86); border: 1px solid rgba(255, 209, 102, 0.6); box-shadow: 0 0 24px rgba(255, 209, 102, 0.18);
  animation: miIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.replay-card small { font-size: 10px; font-weight: 700; letter-spacing: 4px; color: var(--gold); }
.replay-card b { font-size: 22px; letter-spacing: 2px; color: var(--human); }
.replay-card.inf b { color: var(--inf); }
.replay-card span { font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--text); }
.replay-card em { margin-top: 4px; font-style: normal; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.replay-card kbd { min-width: 16px; height: 16px; padding: 0 4px; font-size: 9px; border-bottom-width: 2px; }
body.replaying #hud, body.replaying #minimap, body.replaying #touch, body.replaying #menuBtn, body.replaying #tip, body.replaying #chCard,
body.replaying #modeIntro, body.replaying #toasts, body.replaying #callouts { visibility: hidden; }
body.replaying .replay-card { visibility: visible; }
/* letterbox bars, so it reads as a replay */
body.replaying::before, body.replaying::after { content: ''; position: fixed; left: 0; right: 0; height: 7vh; z-index: 5; background: #000; pointer-events: none; }
body.replaying::before { top: 0; }
body.replaying::after { bottom: 0; }
/* a new player's tip (client.js tip): small, above the abilities, gone in a few seconds */
.tip {
  position: fixed; left: 50%; bottom: calc(100px + var(--sb)); transform: translateX(-50%); z-index: 6; width: min(420px, calc(100vw - 32px));
  padding: 9px 14px 10px; pointer-events: none; text-align: center;
  background: rgba(9, 12, 22, 0.86); border: 1px solid rgba(125, 249, 255, 0.45); box-shadow: 0 0 18px rgba(125, 249, 255, 0.12);
}
.tip.in { animation: miIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.tip.out { animation: miOut 0.35s ease-in both; }
.tip b { display: block; font-size: 13px; letter-spacing: 3px; color: var(--human); }
.tip span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--text); }
.tip kbd { min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; border-bottom-width: 2px; vertical-align: 1px; }
/* on a phone the thumbs own the bottom corners: the tip sits under the round's clock */
body[data-input="touch"] .tip { top: calc(84px + var(--st)); bottom: auto; width: min(380px, 54vw); padding: 7px 12px 8px; }
body[data-input="touch"] .tip span { font-size: 12px; }
/* a variant's pregame card: the mode, your goal, and how it plays, over the countdown and the round's first seconds */
.mode-intro {
  position: fixed; left: 50%; bottom: calc(96px + var(--sb)); transform: translateX(-50%); z-index: 6; width: min(440px, calc(100vw - 32px));
  padding: 12px 16px 15px; pointer-events: none; text-align: center;
  background: rgba(9, 12, 22, 0.88); border: 1px solid rgba(255, 209, 102, 0.55); box-shadow: 0 0 22px rgba(255, 209, 102, 0.14);
}
.mode-intro.in { animation: miIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.mode-intro.out { animation: miOut 0.35s ease-in both; }
@keyframes miIn { from { opacity: 0; transform: translate(-50%, 14px) scale(0.92); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes miOut { to { opacity: 0; transform: translate(-50%, 10px) scale(0.96); } }
.mode-intro small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.mode-intro b { display: block; margin: 2px 0 6px; font-size: 22px; letter-spacing: 4px; color: var(--gold); }
.mode-intro .mi-goal { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--human); }
.mode-intro .mi-goal.inf { color: var(--inf); }
.mode-intro ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.mode-intro li { font-size: 12px; line-height: 1.35; color: var(--text); opacity: 0.88; }
.mode-intro .chc-timer i { background: var(--gold); }
@media (max-height: 500px) { .mode-intro { bottom: calc(80px + var(--sb)); padding: 8px 12px 11px; } .mode-intro b { font-size: 17px; margin-bottom: 3px; } .mode-intro li { font-size: 11px; } }
/* spectating: who you're watching, with buttons to switch (the keys and the d-pad do it too) */
.spec-bar {
  position: fixed; left: 50%; bottom: calc(112px + var(--sb)); transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; pointer-events: auto;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
}
.spec-bar span { white-space: nowrap; }
.spec-bar span b { color: var(--gold); }
.spec-bar span small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.spec-bar button { width: 34px; height: 34px; cursor: pointer; font: inherit; font-size: 14px; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.spec-bar button:hover { border-color: var(--gold); color: var(--gold); }
#abilities { display: flex; gap: 8px; }
.ab { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 600; letter-spacing: 2px; }
.ab i { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--human); transform-origin: left; }
.ab.cool { color: var(--muted); }
.ab.cool i { background: rgba(255, 255, 255, 0.3); }
.ab.inf i { background: var(--inf); }
.ab.off { opacity: 0.3; }
.ab.pill { color: var(--human); border-color: rgba(125, 249, 255, 0.5); }
.ab.pill.down { color: var(--muted); border-color: var(--line); }
.ab.pill.gold { color: var(--gold); border-color: rgba(255, 209, 102, 0.6); }
#myScore { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 16px; background: var(--panel); border: 1px solid var(--line); }
#myScore b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
#myScore span { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
#myScore.streak span { color: var(--human); }
#myScore.spree { border-color: rgba(255, 209, 102, 0.5); }
#myScore.spree span { color: var(--gold); }
/* the class you'll play next round, in a small tag over the role: Q or Y switches it any time
   (touch players tap a chip on the results) */
.ab.cls-next { position: absolute; left: 0; bottom: calc(100% + 6px); gap: 6px; padding: 3px 8px; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); }
.ab.cls-next kbd { min-width: 18px; height: 18px; padding: 0 4px; font-size: 9px; border-bottom-width: 2px; }
.ab.cls-next kbd.pad { width: 18px; min-width: 18px; padding: 0; border-bottom-width: 1px; }
.ab.cls-next.set { color: var(--human); border-color: rgba(125, 249, 255, 0.5); }
.ab.cls-next span { display: inline !important; }
body[data-input="touch"] #clsNext { display: none; }

#minimap { position: fixed; right: calc(16px + var(--sr)); bottom: calc(16px + var(--sb)); z-index: 5; width: 180px; height: 126px; border: 1px solid var(--line); pointer-events: none; }

/* ---------- menu (Esc): the settings live here, off the playfield ---------- */
#menuBtn {
  position: fixed; left: calc(16px + var(--sl)); bottom: calc(16px + var(--sb)); z-index: 11;
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 2px;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
}
#menuBtn:hover { color: var(--text); border-color: rgba(125, 249, 255, 0.45); }
#menuBtn kbd { min-width: 0; height: 18px; padding: 0 5px; font-size: 9px; border-bottom-width: 2px; }
#menuBtn .bars, #menuBtn .bars::before, #menuBtn .bars::after { display: block; width: 14px; height: 2px; background: currentColor; }
#menuBtn .bars { position: relative; }
#menuBtn .bars::before, #menuBtn .bars::after { content: ''; position: absolute; left: 0; }
#menuBtn .bars::before { top: -5px; }
#menuBtn .bars::after { top: 5px; }
body.menu-open #menuBtn { display: none; }
/* ---------- party chat ---------- */
#chat {
  position: fixed; left: calc(16px + var(--sl)); bottom: calc(58px + var(--sb)); z-index: 11;
  width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 4px; pointer-events: none;
}
#chatLog { display: flex; flex-direction: column; gap: 3px; }
#chatLog div {
  align-self: flex-start; max-width: 100%; padding: 4px 9px; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere;
  color: var(--text); background: rgba(5, 6, 11, 0.62); border-left: 2px solid var(--line); transition: opacity 0.6s;
}
#chatLog div b { font-weight: 700; margin-right: 6px; color: var(--friend); }
#chatLog div.mine b { color: var(--gold); }
#chatLog div.sys { color: var(--muted); font-style: italic; border-left-color: transparent; }
#chatLog div.old { opacity: 0; }
#chat.typing #chatLog div.old { opacity: 1; }
#chatInput { pointer-events: auto; padding: 8px 10px; font-size: 14px; letter-spacing: 0.5px; text-align: left; border-color: var(--friend); }
#chatHint { font-size: 10px; letter-spacing: 2px; color: var(--muted); opacity: 0.7; }
#chat.typing #chatHint { display: none; }
#chatBtn { display: none; }
body.in-party[data-input="touch"] #chatBtn { display: block; }
#chatBtn {
  position: fixed; left: calc(96px + var(--sl)); top: calc(10px + var(--st)); z-index: 11; padding: 8px 10px; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--friend);
  background: var(--panel); border: 1px solid rgba(195, 166, 255, 0.45);
}
/* phones: the chat sits under the top-left buttons, clear of the thumb stick */
body[data-input="touch"] #chat { top: calc(52px + var(--st)); bottom: auto; width: min(320px, 44vw); }
body[data-input="touch"] #chatLog div { font-size: 12px; }

/* a side panel rather than a full-screen overlay, so the round stays in view behind it */
#gameMenu {
  position: fixed; left: calc(16px + var(--sl)); top: 50%; transform: translateY(-50%); z-index: 12;
  width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 18px 14px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  touch-action: pan-y; animation: fade 0.15s ease-out;
}
.gm-note { margin: 4px 0 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.gm-note:empty { display: none; }
.gm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gm-grid button, #gameMenu .party-btn {
  padding: 10px 8px; cursor: pointer; min-height: 40px;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 2px;
  color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
.gm-grid button:hover, #gameMenu .party-btn:hover { border-color: rgba(125, 249, 255, 0.45); }
.gm-grid .wide { grid-column: 1 / -1; }
.gm-slider {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 40px;
  font-size: 11px; font-weight: 600; letter-spacing: 2px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
.gm-slider span { width: 52px; color: var(--text); }
.gm-slider input { flex: 1; min-width: 0; accent-color: var(--human); cursor: pointer; }
.gm-slider b { width: 44px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
#gameMenu .party-btn { width: 100%; margin-top: 8px; color: var(--human); border-color: rgba(125, 249, 255, 0.45); }
#gameMenu .btn { margin-top: 12px; padding: 11px; font-size: 18px; letter-spacing: 5px; }
#gameMenu .link { display: block; margin: 8px auto 0; }

/* the profile's UNLOCKS: tracks of rewards drawn as themselves */
.ul-grid { display: grid; gap: 10px; text-align: left; }
.ul-trk { display: grid; gap: 10px; padding: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ul-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ul-top svg { width: 18px; height: 18px; color: var(--human); flex: none; }
.ul-top b { letter-spacing: 2px; white-space: nowrap; }
.ul-top .rk-bar { flex: 1; width: auto; min-width: 40px; }
.ul-top > span { font-size: 11px; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.ul-top .ul-lv { color: var(--human); font-weight: 700; }
.ul-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.ul-tile { width: 40px; display: grid; justify-items: center; gap: 4px; padding: 7px 0 4px; cursor: pointer; font: inherit;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); opacity: 0.4; }
.ul-tile:hover, .ul-tile:focus-visible { opacity: 0.85; outline: none; border-color: rgba(125, 249, 255, 0.5); }
.ul-tile.got { opacity: 1; border-color: rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.05); }
.ul-tile.next { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.22); }
.ul-tile.acct { border-style: dashed; }
.ul-mark { height: 14px; display: grid; place-items: center; }
.ul-tile small { font-size: 10px; font-weight: 700; color: var(--muted); }
.ul-tile.got small, .ul-tile.next small { color: var(--text); }
.ul-say { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); }
.ul-say small { font-size: 10px; letter-spacing: 2.5px; color: var(--gold); }
.ul-say em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); }
.ul-plate { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg); border: 1px solid var(--line); }
.ul-plate b { font-size: 17px; }
.ul-won { display: flex; flex-wrap: wrap; gap: 6px; }
.ul-trk .ttl-pick { justify-content: flex-start; }
/* YOUR LOOK's bodies: the stand on the left, the class and its form and finish picks beside it */
.wr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.wr-stand { flex: none; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.wr-side { flex: 1; min-width: 210px; display: grid; gap: 6px; }
.wr-side > small { font-size: 10px; letter-spacing: 2.5px; color: var(--muted); }
.wr-side .pf-note { margin: 0; }
.wr-cls { margin-bottom: 2px; }
.mr-tg { width: 16px; height: 9px; flex: none; background: var(--gold); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.mr-fin { width: 13px; height: 13px; flex: none; border-radius: 50%; background: conic-gradient(#ffe7a8, #b8862b, #fff3cf, #8a6a28, #ffe7a8); }
.mr-sk { width: 12px; height: 12px; flex: none; background: var(--inf); clip-path: polygon(50% 0, 62% 35%, 100% 30%, 70% 58%, 85% 100%, 50% 75%, 15% 100%, 30% 58%, 0 30%, 38% 35%); }

/* ---------- the menu's rails (PC): up next on the left, progress on the right, either side of the menu's card */
.menu-rail { display: none; position: fixed; top: 50%; transform: translateY(-50%); z-index: 1; width: 340px; max-height: calc(100vh - 48px);
  overflow-y: auto; flex-direction: column; gap: 10px; text-align: left; }
.menu-rail.left { right: calc(50% + 254px); }
.menu-rail.right { left: calc(50% + 254px); }
@media (min-width: 1240px) and (min-height: 600px) {
  body:not([data-input="touch"]) .menu-rail.ready { display: flex; }
}
.menu-rail button { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.menu-rail button:focus-visible { outline: 2px solid var(--human); outline-offset: 2px; }
.mr-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.mr-h small { font-size: 11px; letter-spacing: 1px; font-weight: 600; }
.mr-empty { margin: 0; font-size: 13px; color: var(--muted); }
.mr-card { display: grid; gap: 10px; width: 100%; padding: 12px; background: var(--panel); border: 1px solid var(--line); }
button.mr-card:hover, .mr-next:hover, .mr-ring:hover { border-color: rgba(125, 249, 255, 0.45); }
.mr-eta { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.mr-bar { display: block; height: 5px; background: rgba(255, 255, 255, 0.08); }
.mr-bar i { display: block; height: 100%; background: var(--gold); }
.mr-bar.cyan i { background: var(--human); }
/* up next */
.mr-next { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; padding: 11px 12px;
  background: var(--panel); border: 1px solid var(--line); }
.mr-next.urgent { border-left: 3px solid var(--gold); }
.mr-ic { grid-row: span 2; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.mr-ic svg { width: 24px; height: 24px; }
.mr-ic svg.emb { width: 22px; height: 22px; }
.mr-rk { font-size: 18px; color: var(--gold); }
.mr-hl { font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: 0.5px; color: var(--text); }
.mr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.mr-rt { grid-row: span 2; display: grid; gap: 4px; justify-items: end; }
.mr-chip { padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.4); white-space: nowrap; }
.mr-next .mr-bar { grid-column: 2 / 4; }
/* rewards as themselves */
.mr-rw { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.mr-sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.mr-fr { width: 14px; height: 9px; border: 2px solid var(--muted); flex: none; }
.mr-st { width: 18px; height: 5px; flex: none; background: linear-gradient(90deg, transparent, #ff9a50); }
.mr-em { width: 9px; height: 9px; flex: none; border: 2px solid var(--human); transform: rotate(45deg); }
.mr-sp { width: 9px; height: 9px; flex: none; background: var(--human); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.mr-ttl { justify-self: start; padding: 2px 12px; font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--gold); border: 1px solid var(--gold);
  background: rgba(255, 209, 102, 0.06); clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
/* rank */
.mr-rank { grid-template-columns: 104px 1fr; align-items: center; gap: 14px; }
.mr-dial { position: relative; width: 104px; height: 104px; }
.mr-dial svg, .mr-r svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mr-n { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.mr-n b { font-size: 36px; line-height: 1; }
.mr-n small { font-size: 10px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.mr-rwd { display: grid; gap: 6px; min-width: 0; }
.mr-rwd > small { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: var(--muted); }
/* class rings */
.mr-rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mr-ring { display: grid; justify-items: center; gap: 5px; padding: 10px 4px; text-align: center !important; background: var(--panel); border: 1px solid var(--line); }
.mr-ring.on { border-color: var(--human); background: rgba(125, 249, 255, 0.05); }
.mr-r { position: relative; width: 68px; height: 68px; }
.mr-i { position: absolute; inset: 0; display: grid; place-items: center; }
.mr-i svg { width: 26px; height: 26px; }
.mr-lv { position: absolute; right: -5px; bottom: -3px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--bg); border: 1px solid var(--human); color: var(--human); border-radius: 50%; }
.mr-nm { font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.mr-nx { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 5px; font-size: 11px; color: var(--muted); }
.mr-nx b { color: var(--muted); font-weight: 700; }
/* passive track */
.mr-ptop { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: 3px; }
.mr-ptop small { color: var(--muted); letter-spacing: 1px; }
.mr-ptop svg.emb { width: 18px; height: 18px; }
.mr-nodes { position: relative; display: grid; grid-template-columns: repeat(20, 1fr); align-items: center; height: 24px; }
.mr-nodes::before { content: ''; position: absolute; left: 2%; right: 2%; top: 50%; height: 2px; background: var(--line); }
.mr-fill { position: absolute; left: 2%; top: 50%; height: 2px; background: var(--muted); }
.mr-node { --c: var(--friend); position: relative; justify-self: center; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); background: var(--bg); opacity: 0.45; }
.mr-node.s-human { --c: var(--human); }
.mr-node.s-infected { --c: var(--inf); }
.mr-node.got { background: var(--c); opacity: 1; }
.mr-node.team { border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }
.mr-node.up { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.3); }
.mr-node.cur::after { content: ''; position: absolute; left: 50%; top: -12px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text); }
.mr-node.team.cur::after { transform: translateX(-50%) rotate(-45deg); }
.mr-pnext { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.mr-pnext > small { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: var(--gold); }
.mr-what { grid-column: 1 / 3; font-size: 14px; font-weight: 700; letter-spacing: 0.5px; }
.mr-what em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.mr-pnext .mr-bar { align-self: center; }
/* your look */
.mr-plate { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.mr-emb { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid rgba(176, 184, 214, 0.5); }
.mr-emb svg.emb { width: 14px; height: 14px; }
.mr-plate b { font-size: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-pt { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); white-space: nowrap; }
.mr-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mr-slots button { position: relative; padding: 7px 4px; text-align: center !important; font-size: 11px; font-weight: 700; letter-spacing: 2px; background: var(--panel); border: 1px solid var(--line); }
.mr-slots button:hover { border-color: rgba(125, 249, 255, 0.45); }
.mr-new { position: absolute; top: -7px; right: -6px; padding: 0 5px; font-size: 9px; letter-spacing: 1px; background: var(--gold); color: var(--bg); }

/* ---------- round results ---------- */
#results {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7;
  width: min(420px, calc(100vw - 32px)); padding: 22px 24px; text-align: center; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade 0.3s ease-out;
}
#resTitle { font-size: clamp(28px, 6vw, 40px); font-weight: 700; letter-spacing: 4px; }
#resTitle.human { color: var(--human); text-shadow: 0 0 18px rgba(125, 249, 255, 0.6); }
#resTitle.infected { color: var(--inf); text-shadow: 0 0 18px rgba(255, 46, 99, 0.6); }
#resTitle.escaped { color: var(--evac); text-shadow: 0 0 18px rgba(92, 255, 157, 0.6); }
#resSub { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }
#resList li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; list-style: none; font-size: 15px; }
#resList li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
#resList .me { color: var(--gold); font-weight: 700; }
#resList small { margin-left: 8px; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
#resMe { margin-top: 14px; font-size: 15px; }
#resMe b { color: var(--gold); }
.next { margin-top: 10px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.next kbd { min-width: 20px; height: 20px; padding: 0 5px; font-size: 10px; vertical-align: -4px; border-bottom-width: 2px; }
.next kbd.pad { width: 20px; min-width: 20px; padding: 0; border-bottom-width: 1px; }
/* class chips for the next round: tap or click one, or press its number */
#resPick { display: flex; justify-content: center; gap: 8px; margin-top: 10px; pointer-events: auto; }
#resPick button {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
#resPick svg { width: 18px; height: 18px; }
#resPick button.on { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.08); }
/* the time to the next round: a bar that drains from full */
.res-timer { height: 4px; margin-top: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.res-timer i { display: block; height: 100%; background: var(--human); transform-origin: left center; }
/* the screens between rounds: XP, class and passive, stepped through with NEXT */
#results { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden auto; }
#resPick { flex-wrap: wrap; }
/* the class pick and the vote are the last screen's; the round's line under the title, the first's and the last's */
#results:not(.at-next) .res-foot { display: none; }
#results.paged:not(.at-next) #resSub { display: none; }
.chd-d { display: block; margin-top: 1px; font-size: 11px; font-weight: 500; letter-spacing: 0.3px; color: var(--muted); white-space: normal; }
#results.paged #resTitle { margin-bottom: 8px; font-size: 22px; letter-spacing: 3px; }
.res-h { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.xp-rows { margin: 0; padding: 0; list-style: none; text-align: left; }
.xp-rows li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 8px; font-size: 14px; }
.xp-rows li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.xp-rows li small { margin-left: 6px; font-size: 11px; color: var(--muted); }
.xp-rows b { color: var(--gold); font-variant-numeric: tabular-nums; }
.xp-rows .chrow span { color: var(--gold); }
.xp-rows .total { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); background: none; font-weight: 700; letter-spacing: 2px; }
.xp-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 8px; }
.xp-tags:empty { display: none; }
.xp-tags em { padding: 2px 8px; font-size: 11px; font-style: normal; font-weight: 700; letter-spacing: 2px; color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.4); }
.prog-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: 3px; }
.prog-head svg { width: 24px; height: 24px; }
.prog-head b { color: var(--gold); }
.prog-bar { height: 8px; margin: 10px 0 4px; background: rgba(255, 255, 255, 0.08); }
.prog-bar i { display: block; height: 100%; background: var(--gold); transition: width 0.9s ease-out; }
.prog-sub { font-size: 12px; color: var(--muted); }
.prog-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 2px; }
.prog-row .prog-bar { flex: 1; margin: 0; }
.prog-row small { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); }
.prog-row .rk { margin-right: 0; }
.prog-sub b { color: var(--gold); }
.prog-up { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--gold); }
.prog-list { margin: 8px 0 0; padding: 0; list-style: none; text-align: left; font-size: 13px; }
.prog-list li { padding: 3px 8px; }
.prog-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.prog-list small, .prog-next small { margin-right: 6px; font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.prog-list small.human, .prog-next small.human { color: var(--human); }
.prog-list small.infected, .prog-next small.infected { color: var(--inf); }
.prog-next { margin-top: 10px; padding: 8px 10px; text-align: left; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); }
.prog-next b { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: 2px; color: var(--text); }
/* the screens between rounds: each one pops in, and the one before pops out first (going back runs the other way) */
@keyframes resIn { from { opacity: 0; transform: translateX(22px) scale(0.94); } 65% { opacity: 1; transform: translateX(-2px) scale(1.012); } to { opacity: 1; transform: none; } }
@keyframes resInBack { from { opacity: 0; transform: translateX(-22px) scale(0.94); } 65% { opacity: 1; transform: translateX(2px) scale(1.012); } to { opacity: 1; transform: none; } }
@keyframes resOut { to { opacity: 0; transform: translateX(-18px) scale(0.95); } }
@keyframes resOutBack { to { opacity: 0; transform: translateX(18px) scale(0.95); } }
.res-page.res-in { animation: resIn 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.res-page.res-in.back { animation-name: resInBack; }
.res-page.res-out { animation: resOut 0.15s ease-in both; }
.res-page.res-out.back { animation-name: resOutBack; }
/* challenges finished this round, on the XP screen: each card lands after the last, its star spins in with a ring of
   sparks, and one soft shine runs across it, once (nothing blinks) */
.chd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin-top: 10px; text-align: left; }
.chd-list .res-h { grid-column: 1 / -1; margin-bottom: 0; }
.chd {
  position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.15), rgba(255, 209, 102, 0.03)); border: 1px solid rgba(255, 209, 102, 0.45);
  animation: chdIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) var(--d) both;
}
.chd-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.chd-clip i { position: absolute; top: 0; bottom: 0; left: -45%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 240, 200, 0.3), transparent);
  animation: chdShine 0.9s ease-out calc(var(--d) + 0.3s) both; }
@keyframes chdIn { from { opacity: 0; transform: scale(0.7) translateY(8px); } 70% { opacity: 1; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes chdShine { from { transform: translateX(0); } to { transform: translateX(330%); } }
.chd-star { position: relative; flex: none; width: 24px; height: 24px; color: var(--gold); }
#chCard .chd-star { width: 28px; height: 28px; }
.chd-star svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.55)); animation: chdStar 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3) calc(var(--d, 0s) + 0.05s) both; }
@keyframes chdStar { from { transform: scale(0) rotate(-140deg); } to { transform: none; } }
.chd-sp { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--gold); opacity: 0;
  animation: chdSpark 0.7s ease-out calc(var(--d, 0s) + 0.12s) both; }
@keyframes chdSpark { 0% { opacity: 0; transform: rotate(var(--a)) translateX(4px); } 25% { opacity: 0.9; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(22px) scale(0.4); } }
.chd-t { flex: 1; min-width: 0; }
.chd-t small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.chd-t b { display: block; font-size: 14px; line-height: 1.2; letter-spacing: 1px; color: var(--gold); }
.chd-t em { display: block; font-size: 11px; font-style: normal; color: var(--text); opacity: 0.85; }
.chd-x { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
#chCard .chd-t b { font-size: 15px; white-space: normal; }
/* a challenge finished mid-round: a card on the left, its bar running down while it shows */
#chCard {
  position: fixed; left: calc(16px + var(--sl)); top: 40%; z-index: 6; display: flex; align-items: center; gap: 10px;
  width: min(290px, 60vw); padding: 10px 12px 13px; pointer-events: none;
  background: rgba(9, 12, 22, 0.9); border: 1px solid rgba(255, 209, 102, 0.6); box-shadow: 0 0 18px rgba(255, 209, 102, 0.16);
}
#chCard.in { animation: chcIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
#chCard.out { animation: chcOut 0.25s ease-in both; }
@keyframes chcIn { from { opacity: 0; transform: translateX(-30px) scale(0.85); } 70% { opacity: 1; transform: translateX(3px) scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes chcOut { to { opacity: 0; transform: translateX(-24px) scale(0.92); } }
#chCard .chd-t em { color: var(--muted); opacity: 1; }
.chc-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.chc-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left center; animation: chcDrain var(--ms, 6s) linear both; }
@keyframes chcDrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
body[data-input="touch"] #chCard { top: 30%; width: min(250px, 46vw); padding: 8px 10px 11px; }
/* the menu's next challenges */
.gm-goals { margin: 0 0 12px; }
.gm-h { margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.gm-h small { margin-left: 6px; font-weight: 600; letter-spacing: 1px; opacity: 0.8; }
.gm-goal { margin-top: 5px; padding: 7px 9px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.gm-goal.done { border-color: rgba(255, 209, 102, 0.55); }
.gm-gt { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.gm-gt b { letter-spacing: 1px; }
.gm-gt span { flex: none; font-size: 12px; font-weight: 700; color: var(--gold); }
.gm-goal p { margin: 2px 0 5px; font-size: 12px; line-height: 1.3; color: var(--text); opacity: 0.85; }
.gm-gb { position: relative; height: 5px; background: rgba(255, 255, 255, 0.08); }
.gm-gb i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }
.gm-gb i.now { background: var(--human); }
.gm-goal small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
@media (max-height: 560px) { .gm-goal p { display: none; } .gm-gt { margin-bottom: 4px; } }
@media (prefers-reduced-motion: reduce) {
  .res-page.res-in, .res-page.res-out, .chd, .chd-clip i, .chd-star svg, .chd-sp, #chCard.in, #chCard.out { animation-duration: 0.01s; animation-delay: 0s; }
}
/* previews of what's next, under the "next" lines between rounds: a name plate, an effect, a body on a stand, or a
   passive's next level on a little HUD. They float gently; nothing blinks. */
.pvw-wrap { display: flex; justify-content: center; margin-top: 8px; }
.pvw-wrap:empty { display: none; }
.pvw { display: block; animation: pvwFloat 3.2s ease-in-out infinite; }
@keyframes pvwFloat { 50% { transform: translateY(-3px); } }
.pvw-3d { width: 170px; height: 132px; animation: none; }
.pvw-fx { width: 220px; height: 84px; }
.pvw-psv { position: relative; width: 300px; max-width: 100%; height: 150px; animation: none; overflow: hidden; background: #2c3454; border: 1px solid var(--line); }
.pvw-psv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pvw-plate { display: grid; justify-items: center; gap: 1px; padding: 7px 16px 6px; background: rgba(9, 12, 22, 0.75); border: 1px solid var(--line); }
.pvw-plate b { font-size: 15px; letter-spacing: 2px; color: var(--gold); }
.pvw-plate span { font-size: 10px; font-weight: 700; letter-spacing: 3px; color: var(--text); opacity: 0.85; }
.pvw-frame { border-width: 2px; }
/* an emblem by your name, and a party banner behind it */
.pvw-emblem { grid-auto-flow: column; align-items: center; gap: 9px; padding: 8px 18px; }
.pvw-emblem svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pvw-banner { position: relative; overflow: hidden; min-width: 210px; padding: 9px 24px 8px; }
.pvw-banner i { position: absolute; inset: 0; opacity: 0.9; }
.pvw-banner small, .pvw-banner b { position: relative; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); }
.pvw-banner small { font-size: 9px; font-weight: 700; letter-spacing: 3px; color: rgba(255, 255, 255, 0.9); }
.pvw-banner b { color: #fff; }
.pvw-frame.f-steel { border-color: #b8c4d6; }
.pvw-frame.f-chrome { border-color: #e9eef7; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 8px rgba(233, 238, 247, 0.25); }
.pvw-frame.f-neon { border-color: var(--human); box-shadow: 0 0 10px rgba(125, 249, 255, 0.35); }
.pvw-frame.f-ember { border-color: #ff8a4c; box-shadow: 0 0 10px rgba(255, 138, 76, 0.3); }
.pvw-frame.f-gold { border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 209, 102, 0.3); }
.pvw-frame.f-prismatic { border-image: linear-gradient(90deg, #7df9ff, #b99cff, #ff9ec7, #ffd166, #7dffc8) 1; }
@media (prefers-reduced-motion: reduce) { .pvw { animation: none; } }
.lobby-mode button small { font-size: 8px; letter-spacing: 1px; color: var(--gold); }
#phase.warn { color: var(--inf); text-shadow: 0 0 10px rgba(255, 46, 99, 0.5); }
/* the party lobby: the host picks the first round's mode */
.lobby-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin: 0 0 10px; font-size: 11px; letter-spacing: 2px; }
.lobby-mode span { margin-right: 4px; font-weight: 700; color: var(--muted); }
.lobby-mode b { color: var(--gold); }
.lobby-mode button { padding: 5px 8px; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.lobby-mode button.on { color: var(--gold); border-color: var(--gold); }
.res-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; pointer-events: auto; }
.res-nav button {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
}
.res-nav .res-next { color: var(--text); border-color: var(--human); background: rgba(125, 249, 255, 0.12); }
.res-nav kbd { min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; border-bottom-width: 2px; }
.res-nav kbd.pad { width: 18px; min-width: 18px; padding: 0; border-bottom-width: 1px; }
.res-dots { display: flex; gap: 5px; margin-right: auto; }
.res-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.res-dots i.on { background: var(--human); }

/* ---------- touch controls ---------- */
#touch { display: none; position: fixed; inset: 0; z-index: 4; pointer-events: none; }
body.playing[data-input="touch"] #touch { display: block; }
#stickZone { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; }
/* the stick sits faintly where a thumb would go, and jumps to wherever the thumb actually lands */
#stick { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0.3; transition: opacity 0.2s; }
#stick.on { opacity: 1; transition: none; }
#stick::before {
  content: ''; position: absolute; left: -56px; top: -56px; width: 112px; height: 112px; border-radius: 50%;
  border: 1.5px solid rgba(125, 249, 255, 0.45); background: radial-gradient(circle, rgba(125, 249, 255, 0.07), rgba(125, 249, 255, 0.02) 70%);
}
#stick i {
  position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(125, 249, 255, 0.2); border: 1.5px solid rgba(125, 249, 255, 0.75); box-shadow: 0 0 14px rgba(125, 249, 255, 0.3);
}
.tbtn {
  position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%;
  pointer-events: auto; touch-action: none; cursor: pointer;
  font: inherit; font-weight: 700; letter-spacing: 2px; color: var(--text);
  background: rgba(10, 12, 24, 0.55); border: 1px solid rgba(125, 249, 255, 0.4);
  box-shadow: 0 0 16px rgba(125, 249, 255, 0.16), inset 0 0 14px rgba(125, 249, 255, 0.1);
  transition: transform 0.08s, background 0.12s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.tbtn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.tbtn circle { fill: none; stroke-width: 4; }
.tbtn .trk { stroke: rgba(255, 255, 255, 0.07); }
.tbtn .arc { stroke: var(--human); stroke-dasharray: 289.03; stroke-dashoffset: 0; stroke-linecap: round; }
.tbtn span { position: relative; font-size: 13px; }
#tAct { right: calc(28px + var(--sr)); bottom: calc(28px + var(--sb)); width: 104px; height: 104px; }
#tAlt { right: calc(146px + var(--sr)); bottom: calc(100px + var(--sb)); width: 72px; height: 72px; }
#tAlt span { font-size: 11px; letter-spacing: 1px; }
/* ping and quick chat: small, in a column above ACT */
.tbtn.tsmall { width: 46px; height: 46px; font-size: 18px; letter-spacing: 0; color: var(--muted); border-color: rgba(255, 255, 255, 0.22); box-shadow: none; }
#tPing { right: calc(57px + var(--sr)); bottom: calc(146px + var(--sb)); color: var(--gold); border-color: rgba(255, 209, 102, 0.45); }
#tChat { right: calc(57px + var(--sr)); bottom: calc(202px + var(--sb)); }

/* the quick chat wheel: six lines around a hub, in the middle of the screen */
#qcWheel { position: fixed; left: 50%; top: 50%; z-index: 9; width: 0; height: 0; pointer-events: none; }
#qcWheel .qc-hub { position: absolute; left: -46px; top: -16px; width: 92px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); }
.qc-slot { position: absolute; transform: translate(-50%, -50%); min-width: 116px; padding: 8px 12px; pointer-events: auto; cursor: pointer; touch-action: manipulation;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; white-space: nowrap; color: var(--text);
  background: rgba(9, 12, 22, 0.9); border: 1px solid var(--line); border-radius: 4px; }
.qc-slot kbd { margin-right: 6px; min-width: 18px; height: 18px; font-size: 10px; }
.qc-slot:hover, .qc-slot.on { border-color: var(--human); color: #fff; background: rgba(20, 40, 56, 0.95); }
#qcWheel.inf .qc-slot:hover, #qcWheel.inf .qc-slot.on { border-color: var(--inf); background: rgba(56, 16, 30, 0.95); }
.tbtn.cool { color: var(--muted); border-color: var(--line); box-shadow: none; }
.tbtn.cool .arc { stroke: rgba(255, 255, 255, 0.35); }
.tbtn.inf { border-color: rgba(255, 46, 99, 0.45); box-shadow: 0 0 16px rgba(255, 46, 99, 0.16), inset 0 0 14px rgba(255, 46, 99, 0.1); }
.tbtn.inf .arc { stroke: var(--inf); }
.tbtn.inf.cool { border-color: var(--line); box-shadow: none; }
.tbtn.off { opacity: 0.3; }
.tbtn.down { transform: scale(0.93); background: rgba(125, 249, 255, 0.16); }
.tbtn.inf.down { background: rgba(255, 46, 99, 0.16); }

/* the HUD around the touch controls: the buttons show the cooldowns, the minimap moves up out of the thumb's way */
body[data-input="touch"] #abilities, body[data-input="touch"] #board { display: none; }
body[data-input="touch"] #minimap { top: calc(12px + var(--st)); right: calc(12px + var(--sr)); bottom: auto; }
/* phones: the MENU button tucks into the top-left corner, clear of the thumb stick */
body.playing[data-input="touch"] #menuBtn { top: calc(10px + var(--st)); left: calc(10px + var(--sl)); bottom: auto; padding: 8px 10px; }
body.playing[data-input="touch"] #feed { top: calc(76px + var(--st)); }

/* portrait on a phone: the game's name over the live map behind, dimmed, asking for landscape. Someone opening a
   shared link on their phone sees this first, so it shows them the game, not a blank screen */
#rotate {
  display: none; position: fixed; inset: 0; z-index: 30; padding: 24px;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(5, 6, 11, 0.55), rgba(5, 6, 11, 0.92) 75%); background-color: rgba(5, 6, 11, 0.4);
  color: var(--human);
}
#rotate .logo { font-size: clamp(40px, 13vw, 58px); letter-spacing: 5px; }
#rotate .rotate-tag { margin: 0 0 26px; font-size: 14px; letter-spacing: 1px; color: var(--muted); }
#rotate svg { width: 64px; height: 64px; margin-bottom: 2px; }
#rotate b { font-size: 18px; letter-spacing: 3px; color: var(--text); }
#rotate span { font-size: 14px; letter-spacing: 1px; color: var(--muted); }
@media (orientation: portrait) {
  body[data-input="touch"] #rotate { display: flex; }
  /* only the game's own picture shows behind it: the menu and the HUD wait for landscape */
  body[data-input="touch"] > *:not(#rotate):not(canvas):not(script) { visibility: hidden; }
  body[data-input="touch"] #overlay { visibility: hidden; }
}

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  10% { transform: scale(1.12); opacity: 1; }
  20% { transform: scale(1); }
  75% { opacity: 1; }
  100% { transform: translateY(-24px); opacity: 0; }
}
@keyframes glitch {
  0%, 91%, 100% { transform: none; }
  93% { transform: translateX(3px) skewX(-8deg); text-shadow: 0 0 22px rgba(255, 46, 99, 0.7), -5px 0 0 rgba(255, 46, 99, 0.9), 5px 0 0 rgba(125, 249, 255, 0.9); }
  95% { transform: translateX(-2px); }
}
@keyframes feedIn { from { transform: translateX(-16px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 760px) {
  #board, #feed { display: none; }
  .cls p { display: none; }
  #minimap { width: 120px; height: 84px; }
  .ab span { display: none; }
  #menuBtn { bottom: auto; top: calc(16px + var(--st)); }
}

/* short landscape screens (phones on their side): a two-column menu, tighter results and HUD */
/* a laptop's height (720 to 960): the menu card tightens so it fits without scrolling. The controls run in rows, and
   CREATE PARTY sits beside the party code. */
@media (min-height: 541px) and (max-height: 960px) and (min-width: 561px) {
  #menu .card { padding: 22px 26px 18px; }
  #menu .logo { font-size: 56px; }
  #menu .tag { margin: 6px 0 14px; font-size: 15px; }
  #menu #name { padding: 9px; font-size: 18px; }
  #menu .cls { padding: 9px 6px 8px; }
  #menu .cls svg { width: 28px; height: 28px; }
  #menu .cls p { display: none; }
  #menu .cls-desc { display: block; min-height: 2.9em; margin: 7px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
  #menu .party-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  #menu .keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 14px; }
  #menu .keys div { gap: 7px; font-size: 12px; }
  #menu .kbds { min-width: 0; }
  #menu .rules { margin-top: 12px; font-size: 13px; line-height: 1.45; }
  #menu .link { margin-top: 8px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .overlay { padding: calc(10px + var(--st)) calc(10px + var(--sr)) calc(10px + var(--sb)) calc(10px + var(--sl)); }
  /* the main menu starts under the MENU button in the corner, not behind it */
  body:not(.playing) #menu { padding-top: calc(42px + var(--st)); }
  /* the screens between rounds side by side, so each fits without scrolling before it moves on: what happened on
     the left, what's next (and its preview) on the right */
  #results .res-page:not([data-page="next"]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 18px; align-items: start; }
  #results .res-page > * { grid-column: 1; }
  #results .res-page > .prog-next, #results [data-page="recap"] > .res-done,
  #results [data-page="xp"] > .prog-row, #results [data-page="xp"] > .prog-sub, #results [data-page="xp"] > .pvw-wrap { grid-column: 2; }
  #results .res-page > .prog-next, #results [data-page="recap"] > .res-done { grid-row: 1 / span 12; margin-top: 0; }
  #results .pvw-psv { height: 128px; }
  /* name and PLAY on the left, the class picks and the rest on the right */
  .card {
    width: min(700px, 100%); padding: 14px 18px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 20px; align-items: start;
  }
  .logo { grid-area: 1 / 1; font-size: 38px; letter-spacing: 4px; }
  .tag { grid-area: 2 / 1; margin: 2px 0 8px; font-size: 13px; }
  #name { grid-area: 3 / 1; padding: 8px; font-size: 16px; }
  .btn { grid-area: 4 / 1; margin-top: 8px; padding: 14px; font-size: 20px; }
  .best { grid-area: 5 / 1; margin-top: 6px; font-size: 13px; }
  /* the party row's two lines stay short, so the card still fits a phone on its side */
  .party-row { gap: 6px; margin-top: 6px; }
  #menu .party-row .btn2, #profileBtn { padding: 7px 10px; font-size: 12px; }
  .join-form input { padding: 6px; font-size: 16px; }
  #classes { grid-area: 1 / 2 / 3; margin-top: 0; }
  #view { grid-area: 3 / 2; margin-top: 8px; }
  .keys { grid-area: 4 / 2; }
  .rules { grid-area: 5 / 2; margin-top: 8px; font-size: 12px; line-height: 1.4; }
  .cls { padding: 8px 4px 6px; gap: 2px; }
  .cls svg { width: 24px; height: 24px; }
  .cls b { font-size: 12px; }
  .cls p { display: none; }
  .keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 10px; }
  .keys div { gap: 6px; font-size: 11px; }
  .kbds { min-width: 0; }
  .keys kbd { min-width: 20px; height: 20px; padding: 0 5px; font-size: 9px; }
  .keys kbd.wide { min-width: 0; }
  .keys kbd.pad { width: 20px; padding: 0; }
  /* the MENU button: top-left, clear of the menu card; the panel uses the full height */
  #menuBtn { top: calc(6px + var(--st)); left: calc(8px + var(--sl)); bottom: auto; padding: 5px 8px; font-size: 10px; }
  #gameMenu { top: calc(8px + var(--st)); bottom: calc(8px + var(--sb)); transform: none; max-height: none; padding: 12px 14px 10px; }
  .gm-grid button, #gameMenu .party-btn { min-height: 36px; padding: 8px 6px; font-size: 10px; }

  #board, #feed { display: none; }
  #top { top: calc(8px + var(--st)); width: min(300px, 40vw); }
  #phase { font-size: 10px; letter-spacing: 3px; }
  #timer { font-size: 28px; }
  #bar { height: 5px; margin-top: 4px; }
  #counts { margin-top: 3px; font-size: 10px; }
  #toasts { top: 30%; }
  #callouts { bottom: calc(58px + var(--sb)); }
  .callout b { font-size: clamp(18px, 6vh, 28px); }
  .callout span { font-size: 14px; }
  .toast { font-size: clamp(22px, 7vh, 40px); }
  .toast.small { font-size: clamp(13px, 4vh, 18px); }
  #bottom { bottom: calc(10px + var(--sb)); }
  #role { padding: 0 12px; font-size: 12px; letter-spacing: 2px; }
  #myScore { padding: 3px 12px; }
  #myScore b { font-size: 18px; }
  #minimap { width: 132px; height: 92px; }

  #results { width: min(700px, calc(100vw - 24px)); padding: 10px 16px 12px; } /* wide: its screens sit side by side (above) */
  #resTitle { font-size: 26px; letter-spacing: 3px; }
  #resSub { margin: 2px 0 8px; font-size: 12px; }
  #resList li { padding: 2px 8px; font-size: 13px; }
  #resMe { margin-top: 8px; font-size: 13px; }
  .next { margin-top: 6px; font-size: 11px; }
  #resPick { margin-top: 6px; }
  #resPick button { min-height: 40px; padding: 6px 10px; font-size: 11px; }
  .xp-rows li, .prog-list li { padding: 1px 8px; font-size: 12px; }
  .prog-head { font-size: 15px; }
  .prog-bar { margin: 6px 0 3px; }
  .prog-next { margin-top: 6px; padding: 5px 8px; font-size: 12px; }
  .res-nav { margin-top: 6px; }
  .res-nav button { min-height: 36px; padding: 5px 10px; font-size: 11px; }
}

/* the profile screen and what's new on a phone on its side: one column, not the main menu's two, and tighter */
@media (max-height: 540px) and (orientation: landscape) {
  .profile-card { display: block; width: min(720px, 100%); padding: 12px 16px 14px; }
  .news-card { display: flex; width: min(640px, 100%); padding: 12px 16px 12px;
    max-height: calc(100vh - 20px - var(--st) - var(--sb)); max-height: calc(100dvh - 20px - var(--st) - var(--sb)); }
  #newsClose { margin-top: 10px; }
  .pf-head { margin: 4px 0 10px; gap: 4px; }
  .pf-rank { font-size: 18px; }
  .pf-tile { padding: 6px; }
  .pf-tile b { font-size: 18px; }
  #pfBody h4 { margin: 12px 0 6px; }
}
