/* Tag Party interface. Font: Fredoka (SIL Open Font License 1.1, see /fonts/OFL.txt), served from this folder. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

:root {
  /* Tag Party's colours, from logo A: yellow (#fff36b to #ffb820), navy #1d1b4f with its shadow #0f0d33, white, and the green of the handprint (#7dff3a to #22c40e) */
  --tp-yellow: #ffc52e; --tp-yellow-top: #fff36b; --tp-yellow-bottom: #ffb820; --tp-green-top: #7dff3a; --tp-green-bottom: #22c40e; --tp-purple: #5b2bd6; --tp-navy: #1d1b4f; --tp-deep: #0f0d33; --tp-white: #ffffff; --tp-green: #35d21f;
  --ink: #1d1b4f;        /* text on the white panels: the logo's navy */
  --ink2: #0f0d33;       /* outlines and shadows */
  --card: #ffffff;       /* panels */
  --cardA: rgba(255, 255, 255, 0.95);
  --soft: #e9edff;       /* quiet buttons, input backgrounds */
  --line: #bcc6f2;
  --dim: #66709e;
  --text: #ffffff;
  --gold: #ffc52e; --goldLip: #d98a00;
  --blue: #1d1b4f; --blueLip: #0c1236;   /* "selected": navy */
  --green: #35d21f; --greenLip: #1c9a0c;
  --red: #f4483c; --redLip: #bf2a21;
  --sky: #9fd8f5;
  --font: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', 'Varela Round', system-ui, sans-serif;
  /* a chunky outline for words that sit straight on the 3D picture (sized with the text) */
  --outline: -0.04em -0.04em 0 var(--ink2), 0.04em -0.04em 0 var(--ink2), -0.04em 0.04em 0 var(--ink2), 0.04em 0.04em 0 var(--ink2), 0 -0.055em 0 var(--ink2), 0.055em 0 0 var(--ink2), -0.055em 0 0 var(--ink2), 0 0.055em 0 var(--ink2), 0 0.11em 0 var(--ink2);
  --outlineBig: -0.026em -0.026em 0 var(--ink2), 0.026em -0.026em 0 var(--ink2), -0.026em 0.026em 0 var(--ink2), 0.026em 0.026em 0 var(--ink2), 0 -0.036em 0 var(--ink2), 0.036em 0 0 var(--ink2), -0.036em 0 0 var(--ink2), 0 0.036em 0 var(--ink2), 0 0.075em 0 var(--ink2); /* the same, for very large words */
  --lipShadow: 0 4px 0 rgba(15, 13, 51, 0.3), 0 8px 18px rgba(15, 13, 51, 0.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--text); font-family: var(--font); font-weight: 500; }
b, strong, h1, h2, h3 { font-weight: 700; }
.hidden { display: none !important; }

#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* a key cap */
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.4em; border-radius: 0.4em; font: inherit; font-weight: 700; font-size: 0.82em; line-height: 1.45; text-align: center; color: var(--ink); background: #fff; box-shadow: 0 2px 0 var(--line); }
.btn kbd { background: rgba(255, 255, 255, 0.55); box-shadow: none; color: inherit; margin-left: 2px; }

/* ---------- buttons: chunky, rounded, with a lip underneath ---------- */
.btn {
  --lip: var(--line);
  font: inherit; font-weight: 700; font-size: 18px; color: var(--ink); background: var(--soft); border: 0; border-radius: 14px;
  padding: 10px 18px 11px; cursor: pointer; box-shadow: 0 4px 0 var(--lip); transition: transform 0.06s, box-shadow 0.06s, filter 0.1s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.primary { background: linear-gradient(var(--tp-yellow-top), var(--tp-yellow-bottom)); color: var(--ink); --lip: var(--goldLip); }
.btn.small { font-size: 14px; padding: 6px 11px 7px; border-radius: 11px; box-shadow: 0 3px 0 var(--lip); }
.btn.small:active { transform: translateY(2px); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.on { background: var(--blue); color: #fff; --lip: var(--blueLip); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }

/* ---------- screens that cover the game (the room-code splash) ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 2.5vh 24px 20px; text-align: center; overflow-y: auto;
  background: linear-gradient(rgba(29, 27, 79, 0.5), rgba(15, 13, 51, 0.85));
}
.note { font-size: 13px; font-weight: 500; color: var(--dim); line-height: 1.4; margin: 8px 0 0; }
#loading, #splash .note, #reconn .note { color: #e3e6ff; }
.error { min-height: 1.4em; margin: 0; padding: 3px 16px; border-radius: 999px; font-size: 16px; font-weight: 700; color: #fff; background: var(--red); }
.error:empty { display: none; }
.card {
  display: flex; flex-direction: column; text-align: left; color: var(--ink);
  background: var(--card); border-radius: 24px; box-shadow: 0 6px 0 rgba(15, 13, 51, 0.4), 0 14px 30px rgba(15, 13, 51, 0.3);
}
.card h2 { margin: 0 0 4px; font-size: 21px; color: var(--ink); }
.card label { font-size: 13px; font-weight: 700; color: var(--dim); margin: 8px 0 4px; }
.card input { font: inherit; font-weight: 700; font-size: 18px; padding: 7px 12px; color: var(--ink); background: var(--soft); border: 3px solid var(--line); border-radius: 14px; width: 100%; }
.card input::placeholder, .lpanel input::placeholder { color: #a3abd4; font-weight: 500; }
.card input.codeInput { font-size: 26px; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; }
.card .btn { margin-top: 14px; }

/* ---------- the title screen: logo on top, your Buddy in the middle (in 3D behind this), panels left and right ---------- */
.screen.landing { display: block; padding: 0; overflow: hidden; background: none; pointer-events: none; }
.landing::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(29, 27, 79, 0.5), rgba(29, 27, 79, 0) 26%, rgba(29, 27, 79, 0) 66%, rgba(15, 13, 51, 0.62)); }
.landing > * { position: absolute; pointer-events: auto; }
.logoA { top: 1.6vh; left: 50%; width: min(31vw, 44vh, 400px); height: auto; pointer-events: none; transform: translateX(-50%); transform-origin: 50% 60%; animation: logoBounce 2.8s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(15, 13, 51, 0.3)); }
@keyframes logoBounce { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1.2deg) scale(1); } 50% { transform: translateX(-50%) translateY(-8px) rotate(1.2deg) scale(1.025); } }
.lpanel {
  top: 53%; transform: translateY(-50%); width: min(292px, 25vw); max-height: 80vh; overflow-y: auto; padding: 14px 16px 16px; text-align: left; color: #fff;
  background: rgba(29, 27, 79, 0.93); border: 3px solid rgba(255, 255, 255, 0.16); border-radius: 26px; box-shadow: 0 7px 0 rgba(15, 13, 51, 0.55), 0 16px 30px rgba(15, 13, 51, 0.3);
  scrollbar-width: thin; scrollbar-color: #4c5aa8 transparent;
}
#custom { left: 20px; } #daily { right: 20px; }
.lpanel h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.15; color: var(--gold); }
.lpanel label { display: block; margin: 9px 0 4px; font-size: 12.5px; font-weight: 700; color: #b9c3f5; }
.lpanel label .note { color: #8e9ad6; font-weight: 500; margin: 0; }
.lpanel #playName { width: 100%; font: inherit; font-weight: 700; font-size: 20px; padding: 6px 12px; color: var(--ink); background: #fff; border: 3px solid #5563b5; border-radius: 13px; }
.lpanel .lookOpts { min-width: 0; gap: 0; }
.lpanel .btn.small { font-size: 13px; padding: 5px 9px 6px; background: #fff; --lip: #8e9ad6; }
.lpanel .lookRow .btn.on, .lpanel .btn.small.on { background: var(--gold); color: var(--ink); --lip: var(--goldLip); }
.lpanel .chip { width: 30px; height: 30px; box-shadow: 0 0 0 2px #5563b5; }
.lpanel .chip.on { box-shadow: 0 0 0 3px var(--gold); }
#homeRandom { margin-top: 12px; }
#playDock { left: 50%; bottom: 3vh; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(92vw, 400px); }
#playForm { display: flex; width: 100%; margin: 0; }
.playBtn { flex: 1; font-size: clamp(34px, 5.6vh, 54px); line-height: 1.1; padding: 9px 24px 13px; border-radius: 26px; letter-spacing: 0.08em; box-shadow: 0 8px 0 var(--lip), 0 16px 26px rgba(15, 13, 51, 0.4); animation: playPulse 1.7s ease-in-out infinite; }
.playBtn:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--lip); animation: none; }
@keyframes playPulse { 0%, 100% { box-shadow: 0 8px 0 var(--lip), 0 16px 26px rgba(15, 13, 51, 0.4), 0 0 0 0 rgba(255, 210, 60, 0.55); } 50% { box-shadow: 0 8px 0 var(--lip), 0 16px 26px rgba(15, 13, 51, 0.4), 0 0 0 12px rgba(255, 210, 60, 0); } } /* (a glow, not a change of size: the button itself keeps still) */
.dockRow { width: 100%; gap: 10px; }
.dockRow .btn { background: #fff; color: var(--ink); --lip: #8e9ad6; white-space: nowrap; font-size: 15px; padding: 8px 10px 9px; }
#playDock #loading { margin: 0; font-size: 12px; min-height: 1.2em; text-shadow: 0 1px 0 var(--ink2); }
#playDock #loading.hidden { display: block !important; visibility: hidden; }
#legal { right: 22px; bottom: 6px; margin: 0; font-size: 12px; color: #dfe4ff; }
#legal a { color: #fff; }
/* small windows over the title screen: join, create, controls */
.pop { position: fixed !important; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(15, 13, 51, 0.62); pointer-events: auto; }
.pop .card { position: relative; width: min(92vw, 350px); padding: 18px 20px 20px; }
#controlsBox .card { width: min(94vw, 470px); }
.popClose { position: absolute; right: 10px; top: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; font: inherit; font-size: 24px; font-weight: 700; line-height: 1; color: var(--ink); background: var(--soft); cursor: pointer; }
#controlsList { font-size: 14px; line-height: 2; color: var(--ink); }
#controlsList h4 { display: none; }
#controlsList span { display: inline-block; margin-right: 12px; white-space: nowrap; }
#controlsList kbd { background: var(--soft); margin-right: 2px; }
#controlsList p { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--dim); }
/* the corner menu */
.cornerBtn { position: fixed; right: 16px; top: 14px; z-index: 25; width: 46px; height: 44px; display: grid; place-content: center; gap: 5px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 4px 0 #8e9ad6; cursor: pointer; }
.cornerBtn span { display: block; width: 22px; height: 4px; border-radius: 2px; background: var(--ink); }
.cornerBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8e9ad6; }
body.ingame .cornerBtn { right: 92px; top: 10px; width: 38px; height: 34px; gap: 4px; border-radius: 11px; box-shadow: 0 3px 0 #8e9ad6; }
body.ingame .cornerBtn span { width: 18px; height: 3px; }
body.locked .cornerBtn, body.locked #menu { display: none; }
#menu { position: fixed; right: 16px; top: 68px; z-index: 26; width: 252px; pointer-events: auto; }
body.ingame #menu { top: 52px; right: 14px; }
#menu h3 { margin: 6px 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
#menu h3:first-child { margin-top: 0; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 5px 0; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.mrow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); cursor: pointer; }
.mrow input[type=range] { flex: 1; min-width: 0; accent-color: var(--ink); cursor: pointer; }
/* locked cosmetics: dimmed, with a small padlock and what unlocks them underneath on hover */
.lookRow .locked { position: relative; opacity: 0.55; }
.lookRow .locked::after { content: ''; position: absolute; right: -4px; top: -5px; width: 15px; height: 13px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 0 2px var(--ink2); }
.lookRow .locked::before { content: ''; position: absolute; right: -1px; top: -12px; width: 5px; height: 8px; border: 2px solid var(--ink2); border-bottom: 0; border-radius: 5px 5px 0 0; background: none; z-index: 1; }
.lockTip { min-height: 1.3em; margin: 6px 0 0; font-size: 12.5px; font-weight: 700; color: var(--gold); }
.lookCard .lockTip { color: #b07a00; }
@media (max-width: 1040px) { .lpanel { width: 232px; padding: 11px 12px 13px; } .lpanel h2 { font-size: 19px; } #custom { left: 10px; } #daily { right: 10px; } }
@media (max-width: 800px) { #daily { display: none; } .lpanel { top: auto; bottom: 178px; transform: none; max-height: 30vh; width: min(94vw, 420px); left: 50% !important; margin-left: max(-47vw, -210px); } .logoA { width: min(58vw, 30vh); } }
@media (max-height: 640px) { .logoA { width: min(24vw, 34vh); top: 0.6vh; } .lpanel { max-height: 86vh; top: 52%; } #playDock { bottom: 1.4vh; gap: 6px; } .playBtn { font-size: 32px; padding: 6px 20px 9px; } }
@media (prefers-reduced-motion: reduce) { .logoA, .playBtn { animation: none; } }

/* ---------- big code splash ---------- */
#splash { background: linear-gradient(rgba(58, 86, 190, 0.97), rgba(38, 38, 79, 0.98)); z-index: 20; justify-content: center; }
.splashLabel { margin: 0; font-size: clamp(20px, 3vw, 34px); font-weight: 700; color: #dfe4ff; }
.splashCode { font-size: clamp(96px, 23vw, 380px); font-weight: 700; line-height: 1.05; letter-spacing: 0.08em; margin-right: -0.08em; color: var(--gold); text-shadow: var(--outlineBig); }
.splashHow { font-size: clamp(16px, 2.2vw, 26px); color: #dfe4ff; margin: 14px 0 2px; }
.splashLink { margin: 0 0 10px; font-size: clamp(18px, 3.3vw, 44px); font-weight: 700; color: #fff; overflow-wrap: anywhere; user-select: text; }
#splash .note { max-width: 46em; font-size: 15px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud .panel, #hud .btn, #chatInput, #dead { pointer-events: auto; }
.panel { position: absolute; color: var(--ink); background: var(--cardA); border-radius: 20px; padding: 12px 14px 14px; box-shadow: var(--lipShadow); }
.panel h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.splashRow { margin-top: 22px; gap: 16px; flex: none; }
.splashRow .btn { flex: none; white-space: nowrap; }

/* infected (green) or "it" (red): a soft glow in the four corners of the screen */
#vignette {
  --g: 60, 232, 95;
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s;
  background:
    radial-gradient(ellipse 30vw 34vh at 0 0, rgba(var(--g), 0.6), rgba(var(--g), 0.22) 45%, rgba(var(--g), 0) 100%),
    radial-gradient(ellipse 30vw 34vh at 100% 0, rgba(var(--g), 0.6), rgba(var(--g), 0.22) 45%, rgba(var(--g), 0) 100%),
    radial-gradient(ellipse 30vw 34vh at 0 100%, rgba(var(--g), 0.6), rgba(var(--g), 0.22) 45%, rgba(var(--g), 0) 100%),
    radial-gradient(ellipse 30vw 34vh at 100% 100%, rgba(var(--g), 0.6), rgba(var(--g), 0.22) 45%, rgba(var(--g), 0) 100%);
}
#vignette.infection { opacity: 1; }
#vignette.tag { --g: 255, 70, 50; opacity: 1; }
/* speed round: a warm tint in the corners (when not already glowing for a role) */
#hud.fastRound #vignette:not(.tag):not(.infection) { --g: 255, 184, 84; opacity: 0.55; }

/* the top stack: timer, role, small reminders, then the one line of news */
#top { position: absolute; top: 12px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#codeBox { display: flex; flex-direction: column; align-items: center; max-width: min(92vw, 900px); color: var(--ink); background: var(--cardA); border-radius: 22px; padding: 8px 28px 12px; box-shadow: var(--lipShadow); }
#codeBox span { font-size: 13px; font-weight: 700; color: var(--dim); }
#codeBox b + span { margin-top: 2px; }
#codeBox b { font-size: clamp(46px, 6.4vw, 78px); line-height: 1.05; letter-spacing: 0.14em; margin-right: -0.14em; color: var(--blue); }
#joinLink { font-size: clamp(16px, 2vw, 26px); font-weight: 700; color: var(--ink); text-align: center; overflow-wrap: anywhere; user-select: text; pointer-events: auto; }
#joinNote { margin: 2px 0 0; text-align: center; }
#joinNote:empty { display: none; }
#copyLink { margin-top: 8px; }
@media (min-width: 1100px) { #codeBox { max-width: calc(100vw - 660px); } }

#timer { font-size: clamp(28px, 3.4vw, 46px); font-weight: 700; line-height: 1.1; color: #fff; text-shadow: var(--outline); font-variant-numeric: tabular-nums; }
#timer.low { color: #ff8d80; }

/* role: big for a moment at the start of a round or when it changes, then a small pill */
#status {
  --bg: var(--blue); --lip: var(--blueLip);
  display: flex; align-items: center; gap: 0.5em; font-size: 16px; font-weight: 700; line-height: 1.25; color: #fff; padding: 3px 14px 4px 10px; border-radius: 999px;
  background: var(--bg); box-shadow: 0 3px 0 var(--lip); transition: font-size 0.3s cubic-bezier(0.2, 1.4, 0.4, 1), padding 0.3s; max-width: 94vw; text-align: center;
}
#status::before { content: ''; flex: none; width: 0.62em; height: 0.62em; border-radius: 50%; background: #fff; opacity: 0.9; }
#status.big::before { display: none; }
#status.big { font-size: clamp(24px, 3.1vw, 40px); padding: 6px 28px 8px; box-shadow: 0 5px 0 var(--lip); }
#status.tag { --bg: var(--red); --lip: var(--redLip); }
#status.infection { --bg: #23ad4d; --lip: var(--greenLip); }
#status.watch { --bg: #6a6fb5; --lip: #474b8c; }
#status.boost::after { content: 'speed boost'; padding: 0 0.6em; border-radius: 999px; background: var(--gold); color: #4a2e00; font-size: 0.8em; }

#chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#twistChip, #zoneWarn { font-size: 13px; font-weight: 700; padding: 2px 11px 3px; border-radius: 999px; }
#twistChip { background: rgba(28, 29, 71, 0.72); color: var(--gold); }
#zoneWarn { background: var(--red); color: #fff; animation: pulse 0.45s infinite alternate; }
@keyframes pulse { to { transform: scale(1.07); } }

/* news: one line at a time, here and nowhere else */
#banner {
  max-width: min(92vw, 720px); margin-top: 4px; padding: 5px 20px 6px; border-radius: 999px; text-align: center;
  font-size: clamp(17px, 1.9vw, 24px); font-weight: 700; color: var(--ink); background: var(--card); box-shadow: 0 4px 0 rgba(28, 29, 71, 0.3);
  animation: noteIn 0.22s cubic-bezier(0.2, 1.5, 0.4, 1) both; transition: opacity 0.3s;
}
#banner.bad { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--redLip); }
#banner.out { opacity: 0; }
@keyframes noteIn { from { transform: translateY(-10px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

#countdown { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: clamp(110px, 20vw, 260px); font-weight: 700; line-height: 1; color: #fff; text-shadow: var(--outlineBig); }

#leaveBtn { position: absolute; top: 10px; right: 12px; font-size: 12px; padding: 3px 10px 4px; border-radius: 9px; opacity: 0.8; box-shadow: 0 2px 0 var(--lip); }
#leaveBtn:hover { opacity: 1; }

/* ---------- results ---------- */
#results { position: absolute; left: 50%; top: max(300px, 42vh); transform: translateX(-50%); min-width: min(92vw, 620px); max-width: 94vw; text-align: center; color: var(--ink); background: var(--card); border-radius: 28px; padding: 18px 30px 22px; box-shadow: 0 7px 0 rgba(28, 29, 71, 0.35), 0 16px 34px rgba(28, 29, 71, 0.28); }
#resTitle { font-size: clamp(36px, 4.8vw, 64px); font-weight: 700; line-height: 1.1; letter-spacing: 0.07em; color: var(--blue); }
#resSub { font-size: clamp(17px, 2.2vw, 25px); margin-top: 8px; }
#resTags { font-size: clamp(15px, 1.8vw, 20px); margin-top: 4px; color: var(--dim); }
#resTags:empty, #resYou:empty, #resNext:empty { display: none; }
#resYou { display: inline-block; font-size: clamp(17px, 2.2vw, 25px); font-weight: 700; margin-top: 12px; padding: 4px 20px 5px; border-radius: 999px; color: #fff; background: var(--green); box-shadow: 0 3px 0 var(--greenLip); }
#resYou.lose { background: #8a8fc4; box-shadow: 0 3px 0 #5d629b; }
#resNext { font-size: clamp(15px, 1.8vw, 20px); margin-top: 12px; color: var(--dim); }
#hud.break #results { top: 13vh; }

/* ---------- scoreboard, lobby panels ---------- */
#leftCol { position: absolute; top: 12px; left: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#board { position: static; min-width: 240px; max-height: calc(100vh - 220px); overflow: hidden; }
#board table { border-collapse: collapse; width: 100%; font-size: 14px; }
#board th { font-size: 11px; font-weight: 700; color: var(--dim); text-align: right; padding: 0 4px 3px 12px; }
#board td { padding: 1px 4px 1px 12px; text-align: right; font-variant-numeric: tabular-nums; }
#board td:first-child { text-align: left; padding-left: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board tr.me td { font-weight: 700; color: var(--blueLip); background: #e4ecff; }
#board tr.me td:first-child { border-radius: 8px 0 0 8px; } #board tr.me td:last-child { border-radius: 0 8px 8px 0; }
#board tr.it td:first-child { color: var(--redLip); }
#board tr.it.inf td:first-child { color: var(--greenLip); }
#board .chip { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 5px; margin-left: 6px; border-radius: 999px; background: var(--soft); color: var(--dim); vertical-align: 1px; }
#board tr.it .chip:last-child { background: var(--red); color: #fff; }
#board tr.it.inf .chip:last-child { background: var(--green); color: #fff; }
#board .dot { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px rgba(28, 29, 71, 0.25); vertical-align: -1px; }
#board .crown { color: var(--goldLip); margin-right: 5px; }
#board.many table { font-size: 12px; } #board.many td { padding-top: 0; padding-bottom: 0; line-height: 1.25; }

#hostPanel, #guestPanel { top: 44px; right: 14px; width: 284px; }
#hostPanel .note { margin-top: 6px; font-size: 12.5px; }
#guestPanel h3 { font-size: 18px; }
.sizeRow { align-items: center; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--dim); }
.sizeRow span { flex: 1.5; }
.optRow span { flex: 0 0 46px; }
.optRow .btn { flex: 1; padding: 4px 2px 5px; font-size: 12px; background: var(--soft); color: var(--dim); }
.optRow .btn i { display: block; font-style: normal; font-size: 11px; }
.optRow .btn.on { background: var(--green); color: #fff; --lip: var(--greenLip); }
.optRow.hidden { display: none; }
.botRow { margin-top: 10px; }
.botRow .btn { padding-left: 4px; padding-right: 4px; }
#startBtn { font-size: 20px; padding: 8px 18px 9px; margin-top: 10px; }
#startBtn + .note { margin-top: 10px; }

#skins { bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; }
.swatch { width: 44px; height: 44px; border: 0; border-radius: 12px; cursor: pointer; pointer-events: auto; font: inherit; font-size: 14px; color: var(--ink); display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px 4px; box-shadow: 0 3px 0 rgba(28, 29, 71, 0.3); }
.swatch.on { outline: 4px solid #fff; outline-offset: 2px; }

/* during a round the lobby furniture goes away */
#hud.round #codeBox, #hud.round #hostPanel, #hud.round #guestPanel, #hud.round #skins { display: none; }
#hud.round #board { display: none; }
#hud.round.showBoard #board { display: block; }
#hud.pub #codeBox, #hud.pub #hostPanel, #hud.pub #guestPanel { display: none; }
#hud.break #board { display: block; }
#hud.break #skins { display: flex; }

/* ---------- where you are: shown for a moment on entering an area ---------- */
#areaTag { padding: 3px 12px 4px; font-size: 14px; font-weight: 700; color: #fff; background: rgba(28, 29, 71, 0.72); border-radius: 999px; border: 0 solid #fff; border-left-width: 10px; opacity: 0; transition: opacity 0.6s; }
#areaTag.show { opacity: 1; transition-duration: 0.15s; }

/* ---------- bottom middle: dash, the pickup slot, first-round help ---------- */
#bottomMid { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(96vw, 700px); }
#hud:not(.round) #bottomMid { bottom: 86px; }
#slots { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; min-height: 0; }
#dash { display: none; grid-column: 2; position: relative; width: 148px; height: 26px; border: 3px solid #fff; border-radius: 999px; background: #5b5f9e; overflow: hidden; box-shadow: 0 3px 0 rgba(28, 29, 71, 0.35); }
#dashFill { position: absolute; inset: 0; width: 100%; background: var(--gold); transform-origin: left; }
#dash.cooling #dashFill { background: #9aa0e0; }
#dashLabel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; color: #4a2e00; }
#dashLabel kbd { box-shadow: none; line-height: 1.3; }
#dash.cooling #dashLabel { color: #fff; }
#hud.round #dash { display: block; }

/* pickup icons (the slot, and the tiny "this is working on you" dots) */
.pico { display: block; flex: none; position: relative; width: 50px; height: 50px; border-radius: 50%; background: var(--c, #fff); border: 3px solid #fff; box-shadow: 0 4px 0 rgba(28, 29, 71, 0.35); }
.pico::after { content: ''; position: absolute; inset: 20%; background: var(--ink2); }
.pico.i-speed::after { clip-path: polygon(58% 0, 18% 56%, 46% 56%, 34% 100%, 82% 40%, 54% 40%, 70% 0); }
.pico.i-decoy::after { clip-path: polygon(8% 100%, 8% 55%, 16% 40%, 10% 22%, 22% 8%, 36% 22%, 30% 40%, 40% 55%, 40% 100%, 56% 100%, 56% 55%, 64% 40%, 58% 22%, 70% 8%, 84% 22%, 78% 40%, 90% 55%, 90% 100%); }
.pico.i-invis::after { clip-path: polygon(15% 100%, 15% 40%, 25% 15%, 50% 2%, 75% 15%, 85% 40%, 85% 100%, 70% 84%, 58% 100%, 42% 84%, 30% 100%); opacity: 0.55; }
.pico.i-shield::after { clip-path: polygon(8% 4%, 92% 4%, 92% 50%, 76% 80%, 50% 100%, 24% 80%, 8% 50%); }
.pico.i-trap::after { clip-path: polygon(50% 0, 62% 26%, 90% 12%, 76% 40%, 100% 54%, 74% 64%, 82% 94%, 56% 78%, 40% 100%, 34% 72%, 4% 80%, 22% 54%, 0 34%, 30% 30%); }
#item { grid-column: 3; justify-self: start; position: relative; display: flex; align-items: center; gap: 12px; animation: itemIn 0.25s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes itemIn { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
#item.hidden { display: none; }
#item kbd { position: absolute; left: 32px; top: 29px; font-size: 16px; line-height: 1.3; background: var(--gold); color: #4a2e00; box-shadow: 0 2px 0 var(--goldLip); }
#item > div { display: none; }
#item.intro > div { display: flex; flex-direction: column; max-width: 176px; padding: 5px 12px 7px; text-align: left; color: var(--ink); background: var(--card); border-radius: 14px; box-shadow: 0 3px 0 rgba(28, 29, 71, 0.3); }
#item b { font-size: 15px; }
#item span { font-size: 12px; line-height: 1.25; color: var(--dim); }
#fxLine { grid-column: 1; justify-self: end; display: flex; gap: 5px; }
#fxLine .pico { width: 26px; height: 26px; border-width: 2px; box-shadow: 0 2px 0 rgba(28, 29, 71, 0.35); }

#moves { display: flex; gap: 10px; }
#moves > div { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 184px; padding: 9px 12px 10px; text-align: center; color: var(--ink); background: var(--cardA); border-radius: 18px; box-shadow: var(--lipShadow); }
#moves kbd { font-size: 16px; background: var(--gold); color: #4a2e00; box-shadow: 0 2px 0 var(--goldLip); padding: 0 10px; }
#moves b { font-size: 17px; }
#moves span { font-size: 12px; color: var(--dim); line-height: 1.3; }

/* "click to look around" and the list of keys: a first round only, afterwards while Tab is held or after pressing ? */
#lockHint { display: none; font-size: 14px; font-weight: 700; color: #fff; text-align: center; padding: 3px 14px 4px; border-radius: 999px; background: rgba(28, 29, 71, 0.6); }
#help { display: none; position: absolute; right: 14px; bottom: 14px; width: 322px; padding: 9px 12px 10px; font-size: 12.5px; line-height: 1.95; color: var(--ink); background: var(--cardA); border-radius: 16px; box-shadow: var(--lipShadow); }
#help h4 { margin: 0 0 1px; font-size: 13px; line-height: 1.4; color: var(--dim); }
#help span { display: inline-block; margin-right: 9px; white-space: nowrap; }
#help kbd { background: var(--soft); margin-right: 1px; }
#help p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--dim); }
#hud.newbie #help, #hud.showBoard #help, #hud.showHelp #help { display: block; }
#hud.newbie #lockHint, #hud.showBoard #lockHint, #hud.showHelp #lockHint { display: block; }
body.locked #lockHint { display: none !important; }
#helpTip { display: none; position: absolute; right: 12px; bottom: 10px; padding: 3px 10px 4px 5px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(15, 13, 51, 0.62); }
#helpTip kbd { box-shadow: none; text-shadow: none; }
#hud:not(.newbie):not(.showBoard):not(.showHelp) #helpTip { display: block; } /* always there, so nobody has to guess where the controls went */

/* ---------- chat ---------- */
#chat { position: absolute; left: 14px; bottom: 14px; width: min(380px, 60vw); }
#chatLog { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; color: #fff; }
#chatLog div { background: rgba(28, 29, 71, 0.62); padding: 2px 11px 3px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; transition: opacity 0.6s; }
#chatLog div.old { opacity: 0; }
#chat.open #chatLog div.old { opacity: 1; }
#chatLog b { color: var(--gold); }
#chatLog .sys { color: #d5d9ff; }
#chatInput { margin-top: 6px; width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 3px solid var(--gold); border-radius: 14px; padding: 7px 12px; }
#quick { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; margin-bottom: 6px; padding: 9px 12px 10px; font-size: 13.5px; color: var(--ink); background: var(--cardA); border-radius: 16px; box-shadow: var(--lipShadow); }
#quick b { display: inline-block; min-width: 1.5em; margin-right: 7px; padding: 0 0.35em; border-radius: 0.4em; text-align: center; font-size: 0.85em; background: var(--soft); box-shadow: 0 2px 0 var(--line); }

/* ---------- overlays ---------- */
#dead { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 20px; align-items: center; justify-content: center; background: rgba(38, 38, 79, 0.92); font-size: 40px; font-weight: 700; }
#reconn { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; background: rgba(38, 38, 79, 0.8); font-size: clamp(22px, 3.2vw, 38px); font-weight: 700; text-align: center; }
#reconn .note { font-size: 16px; }
#mapLoading { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 12px 24px 14px; border-radius: 999px; color: var(--ink); background: var(--card); box-shadow: var(--lipShadow); font-size: 20px; font-weight: 700; z-index: 30; }

/* ---------- big-map helpers: edge glow in first person, the arrow to the nearest survivor ---------- */
.edge { position: absolute; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
#edgeL { left: 0; top: 0; bottom: 0; width: 22vw; background: linear-gradient(to right, rgba(60, 240, 90, 0.75), rgba(60, 240, 90, 0)); }
#edgeR { right: 0; top: 0; bottom: 0; width: 22vw; background: linear-gradient(to left, rgba(60, 240, 90, 0.75), rgba(60, 240, 90, 0)); }
#edgeB { left: 0; right: 0; bottom: 0; height: 26vh; background: linear-gradient(to top, rgba(60, 240, 90, 0.75), rgba(60, 240, 90, 0)); }
#arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-bottom: 26px solid rgba(70, 240, 100, 0.8); filter: drop-shadow(0 0 3px #000); }
#arrowDist { position: absolute; left: 50%; top: calc(50% + 150px); transform: translateX(-50%); font-size: 13px; font-weight: 700; color: #7dff8f; text-shadow: 0 1px 0 var(--ink2), 0 0 4px rgba(28, 29, 71, 0.8); }

/* ---------- look picker ---------- */
#lookPicker { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(38, 38, 79, 0.6); }
.lookCard { display: flex; gap: 18px; align-items: stretch; max-width: min(880px, 96vw); max-height: 94vh; padding: 18px; border-radius: 28px; color: var(--ink); background: var(--card); box-shadow: 0 7px 0 rgba(28, 29, 71, 0.35), 0 18px 50px rgba(28, 29, 71, 0.4); overflow: auto; }
#lookView { width: 300px; height: 400px; flex: none; border-radius: 20px; background: linear-gradient(#63bcff, #c9ecff); }
.lookOpts { display: flex; flex-direction: column; gap: 6px; min-width: 300px; }
.lookOpts h2 { margin: 0 0 2px; font-size: 24px; }
.lookOpts label { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--dim); }
.lookOpts label .note { font-weight: 500; }
.lookRow { display: flex; flex-wrap: wrap; gap: 7px 6px; padding-bottom: 3px; }
.lookRow .btn.on { background: var(--blue); color: #fff; }
#lookRows { display: flex; flex-direction: column; gap: 2px; }
#lookNote { margin: 0; min-height: 1.2em; color: #b07a00; font-weight: 700; }
.chip { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; padding: 0; font: inherit; font-weight: 700; color: var(--ink); }
.chip.auto { background: conic-gradient(#ff5a4f, #ffd23c, #22b3a4, #4f8cff, #9a6bff, #ff5a4f); color: #fff; }
.chip.on { box-shadow: 0 0 0 3px var(--blue); }
.lookEnd { margin-top: auto; padding-top: 12px; justify-content: space-between; }
.lookEnd .btn { flex: none; }
@media (max-width: 720px) { .lookCard { flex-direction: column; align-items: center; } #lookView { width: 220px; height: 280px; } }

/* ---------- a round twist, announced during the countdown ---------- */
#twist { position: absolute; left: 0; right: 0; top: 23%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; pointer-events: none; animation: twistIn 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
#twist.hidden { display: none; }
#twist span { font-size: clamp(16px, 2vw, 24px); font-weight: 700; letter-spacing: 0.16em; padding: 1px 18px 2px; background: var(--ink2); color: var(--gold); border-radius: 999px; }
#twist b { font-size: clamp(50px, 8.6vw, 118px); line-height: 1.05; color: var(--tw, #ffd84a); text-shadow: var(--outlineBig); letter-spacing: 0.03em; padding-bottom: 0.1em; }
#twist p { margin: 0; font-size: clamp(17px, 2.2vw, 28px); font-weight: 700; padding: 5px 22px 7px; color: var(--ink); background: var(--card); border-radius: 999px; box-shadow: 0 4px 0 rgba(28, 29, 71, 0.3); }
#twist.t-lowgrav { --tw: #d6c2ff; } #twist.t-dark { --tw: #a3b4ff; } #twist.t-fast { --tw: #ffb347; } #twist.t-tiny { --tw: #7df0d0; } #twist.t-swarm { --tw: #7dff7a; } #twist.t-bouncy { --tw: #ffa3d6; }
@keyframes twistIn { from { transform: scale(0.3) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
#hud:has(#twist:not(.hidden)) #countdown { top: 56%; font-size: clamp(80px, 13vw, 170px); }
#hud:has(#twist:not(.hidden)) #chips, #hud:has(#twist:not(.hidden)) #banner { display: none; }

@media (max-width: 900px) {
  #board { min-width: 0; font-size: 12px; }
  #hostPanel, #guestPanel { width: 210px; }
  #help, #helpTip { display: none !important; }
  #moves > div { width: 30vw; } #moves span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #banner, #zoneWarn, #item, #twist { animation: none; }
  #status { transition: none; }
}

/* a brand-new player's first countdown: the game in three lines */
#intro { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 620px); pointer-events: none; }
#intro p { margin: 0; padding: 8px 18px 9px 10px; display: flex; align-items: center; gap: 12px; text-align: left; font-size: clamp(15px, 1.9vw, 20px); font-weight: 700; color: var(--ink); background: var(--card); border-radius: 999px; box-shadow: 0 4px 0 rgba(15, 13, 51, 0.3); animation: introIn 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
#intro p:nth-child(2) { animation-delay: 0.5s; } #intro p:nth-child(3) { animation-delay: 1s; }
#intro b { flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--gold); }
#intro p:first-child b { background: var(--green); }
@keyframes introIn { from { transform: translateY(14px) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
#hud:has(#intro:not(.hidden)) #moves, #hud:has(#intro:not(.hidden)) #lockHint { display: none !important; }

/* news on the title screen (a challenge done, something unlocked) */
#homeToast { left: 50%; top: 31%; transform: translateX(-50%); padding: 8px 22px 10px; border-radius: 999px; font-size: 18px; font-weight: 700; color: var(--ink); background: var(--gold); box-shadow: 0 5px 0 var(--goldLip), 0 10px 20px rgba(15, 13, 51, 0.3); pointer-events: none; animation: introIn 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
#resDaily { margin-top: 10px; pointer-events: none; }
/* (pictures of the map taken by the checks hide the interface; the corner button goes with it) */
#hud[style*="hidden"] ~ .cornerBtn, #hud[style*="hidden"] ~ #menu { display: none; }
body.ingame .cornerBtn { right: 78px; }

/* ---------- the moment you are tagged ---------- */
#infFlash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(90, 255, 70, 0.5), rgba(40, 220, 40, 0.86)); }
#infFlash.go { animation: infFlash 0.9s ease-out both; }
@keyframes infFlash { 0% { opacity: 0; } 8% { opacity: 1; } 30% { opacity: 0.55; } 100% { opacity: 0; } }
#infSplash { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; pointer-events: none; z-index: 5; animation: infSplash 1.35s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
#infSplash.hidden { display: none; }
#infSplash b { font-size: clamp(48px, 8vw, 118px); line-height: 1; letter-spacing: 0.02em; white-space: nowrap; color: #7dff3a; text-shadow: var(--outlineBig), 0 0 0.35em rgba(60, 255, 60, 0.7); }
#infSplash span { font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; padding: 4px 22px 6px; border-radius: 999px; color: var(--ink); background: #fff; box-shadow: 0 4px 0 rgba(15, 13, 51, 0.35); }
#infSplash span:empty { display: none; }
@keyframes infSplash { 0% { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; } 14% { transform: translate(-50%, -50%) scale(1.12) rotate(2deg); opacity: 1; } 24% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; } }
#hud:has(#infSplash:not(.hidden)) #banner, #hud:has(#zoneMsg:not(.hidden)) #banner { visibility: hidden; }

/* ---------- the closing zone ---------- */
#zoneVeil { position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.25s; overflow: hidden; background: radial-gradient(ellipse at center, rgba(160, 80, 255, 0.34), rgba(110, 30, 230, 0.72)); }
#zoneDust { position: absolute; inset: 0; }
#zoneDust i { position: absolute; bottom: -4vh; width: var(--s); height: var(--s); border-radius: 50%; background: rgba(240, 205, 255, 0.85); box-shadow: 0 0 10px 3px rgba(190, 110, 255, 0.7); animation: zoneDust var(--d) linear infinite; animation-delay: var(--w); }
@keyframes zoneDust { from { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 0.9; } to { transform: translate(var(--x), -112vh); opacity: 0; } }
#zoneMsg { position: absolute; left: 50%; top: 35%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; pointer-events: none; animation: pulse 0.5s infinite alternate; }
#zoneMsg.hidden { display: none; }
#zoneMsg b { font-size: clamp(34px, 6vw, 84px); line-height: 1; white-space: nowrap; color: #fff; text-shadow: var(--outlineBig), 0 0 0.4em rgba(180, 90, 255, 0.9); }
#zoneMsg span { font-size: clamp(16px, 2.1vw, 26px); font-weight: 700; padding: 3px 20px 5px; border-radius: 999px; color: #fff; background: #7a2df0; box-shadow: 0 4px 0 #3d0f8f; }
#zoneArrow { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
#zoneArrow.hidden { display: none; }
#zoneArrow i { display: block; width: 0; height: 0; border-left: 19px solid transparent; border-right: 19px solid transparent; border-bottom: 34px solid #c77dff; filter: drop-shadow(0 0 2px #0f0d33) drop-shadow(0 0 7px rgba(190, 110, 255, 0.9)); transform: rotate(var(--a)); }
#zoneArrow span { font-size: 14px; font-weight: 700; white-space: nowrap; padding: 2px 11px 3px; border-radius: 999px; color: #fff; background: rgba(90, 30, 190, 0.92); box-shadow: 0 2px 0 rgba(15, 13, 51, 0.5); }
#zoneWarn.soon { background: #7a2df0; animation: none; font-size: 17px; padding: 4px 16px 5px; box-shadow: 0 3px 0 #3d0f8f; }
@media (prefers-reduced-motion: reduce) { #infSplash, #zoneMsg, #zoneDust i { animation-duration: 0.01s; animation-iteration-count: 1; } }
#savedNote { margin: 8px 4px 10px; font-size: 12.5px; line-height: 1.35; color: #cfd6ff; }
/* the wide logo: on the room-code screen, and small in the lobby and on the results screen (not during a round) */
.logoB { display: block; height: auto; }
#splash .logoB { width: min(46vw, 420px); margin: 0 auto 2vh; }
#hudLogo { position: absolute; left: 50%; top: 8px; width: min(22vw, 250px); transform: translateX(-50%); pointer-events: none; display: none; }
#hud.break #hudLogo { display: block; }
