:root {
  --bg: #0f1420;
  --card: #1a2233;
  --line: #2c3850;
  --text: #e8edf7;
  --muted: #8b97ad;
  --accent: #5ee08a;
  --accent-deep: #2f8f52; /* the solid edge under a primary button */
  --seeker: #ff5d5d;
  --hider: #57b8ff;
  --ghost: #b8a6ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#game { display: block; width: 100vw; height: 100vh; touch-action: none; }
#touch-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0) 45%, rgba(200,0,0,0.75) 100%); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--seeker); min-height: 1.2em; margin: 8px 0 0; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(3px);
  z-index: 20;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  width: min(420px, 100%);
  max-height: 100%;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.menu-grid { display: flex; gap: 16px; align-items: stretch; max-height: 100%; width: min(880px, 100%); }
.menu-card { text-align: left; flex: 1 1 420px; }
.overlay > .menu-card { flex: 0 1 460px; }
.browser-card { text-align: left; flex: 1 1 380px; display: flex; flex-direction: column; }
.browser-card h2 { margin: 0; font-size: 20px; }
#room-list { margin-top: 12px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.room-row { display: flex; align-items: center; gap: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.room-row .info { flex: 1; min-width: 0; }
.room-row .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-row .meta { font-size: 12px; color: var(--muted); }
.room-row .count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.status { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.status.open { background: rgba(94, 224, 138, 0.15); color: var(--accent); }
.status.playing { background: rgba(252, 196, 25, 0.15); color: #fcc419; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; border: 1px dashed var(--line); border-radius: 12px; }
.menu-card, .browser-card { max-height: calc(100vh - 32px); overflow: auto; }
/* The wordmark. Heavy, tight and slightly tilted, with a hard drop shadow - the same chunky feel as the
   characters, so the title screen and the game look like they belong to each other. */
.menu-card h1 {
  margin: 0 0 2px;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  transform: rotate(-1.5deg);
  transform-origin: left center;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}
.menu-card h1 span {
  color: var(--accent);
  display: inline-block;
  transform: rotate(8deg) scale(1.1);
}
.tagline { color: var(--muted); margin: 4px 0 20px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
/* A heading for a row of buttons (difficulty, message topic): looks like a label, but isn't one - a <label>
   has to belong to a form field. */
.group-label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.contact-card > .group-label { margin-top: 12px; }

input {
  font: inherit;
  color: var(--text);
  background: #0f1522;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
input:focus { border-color: var(--accent); }
#code { text-transform: uppercase; letter-spacing: 4px; font-weight: 700; text-align: center; }

button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #26314a;
  border: 1px solid var(--line);
  /* A solid edge under every button: they read as things to press rather than as links in a box. */
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.12s;
}
button:hover:not(:disabled) { filter: brightness(1.15); }
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.35); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button.primary {
  background: var(--accent);
  color: #0b2415;
  border-color: transparent;
  box-shadow: 0 4px 0 var(--accent-deep);
  font-weight: 800;
  width: 100%;
  margin-top: 12px;
}
button.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-deep); }

.row { display: flex; gap: 8px; }
.row button { flex: 0 0 auto; }
.row button.grow { flex: 1 1 0; width: auto; min-width: 0; }
.row.between { justify-content: space-between; align-items: center; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
button.danger { background: rgba(255, 93, 93, 0.15); border-color: rgba(255, 93, 93, 0.5); color: #ffb3b3; }
button.wide-top { width: 100%; margin-top: 8px; }
.small-btn.wide { width: 100%; margin-top: 10px; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0 10px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.how { margin-top: 18px; color: var(--muted); font-size: 13px; }
.how summary { cursor: pointer; }
.how ul { padding-left: 18px; margin: 8px 0 0; }
kbd { background: #0f1522; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12px; }

/* Lobby panel */
.panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 300px;
  background: rgba(26, 34, 51, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}
/* Sections keep their natural height; when they don't all fit, the panel scrolls instead of squashing them. */
.panel > * { flex-shrink: 0; }
.panel h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.head-buttons { display: flex; gap: 6px; flex: 0 0 auto; }
.room-title { font-size: 18px; font-weight: 800; }

.trait { font-size: 11px; font-weight: 700; color: #cc5de8; background: rgba(204, 93, 232, 0.14); border-radius: 999px; padding: 1px 7px; }
#lobby-pill { position: fixed; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 10; }
#lobby-pill button { background: rgba(26, 34, 51, 0.94); border-radius: 999px; padding: 8px 14px; }
.pill-main { display: flex; align-items: center; gap: 8px; }
#lobby-pill .pill-start { background: var(--accent); color: #0b2415; border-color: transparent; }
.unread { background: var(--seeker); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.code { font-size: 14px; font-weight: 800; letter-spacing: 3px; color: var(--accent); user-select: text; -webkit-user-select: text; }
.small-btn { font-size: 12px; padding: 6px 10px; }

#player-list { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow: auto; }
#player-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 0; }
.mod-actions { flex-basis: 100%; display: flex; justify-content: flex-end; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
#player-list .score { color: var(--muted); font-size: 12px; }
#player-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings label { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; color: var(--text); font-size: 14px; }
.settings input[type="number"] { width: 64px; padding: 4px 6px; text-align: right; }
.settings input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.settings input:disabled { opacity: 0.6; }

#chat-log { flex: 1 0 90px; min-height: 90px; overflow: auto; font-size: 13px; background: #0f1522; border-radius: 10px; padding: 8px; margin-bottom: 8px; user-select: text; -webkit-user-select: text; }
#chat-log b { font-weight: 700; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.small-check { font-size: 12px; margin: 16px 0 8px; color: var(--muted); }
.small-check input { width: 15px; height: 15px; }
.chat-line { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; }
.chat-line .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.censored { cursor: pointer; text-decoration: underline dotted var(--muted); }
.report-btn { flex: 0 0 auto; background: none; border: none; padding: 0 4px; font-size: 12px; color: var(--muted); opacity: 0.5; }
.chat-line:hover .report-btn, .report-btn:focus { opacity: 1; }
.report-btn:disabled { font-size: 10px; opacity: 0.8; }
@media (pointer: coarse) { .report-btn { opacity: 0.8; font-size: 14px; } }
.mod-btn { font-size: 11px; padding: 2px 8px; border-radius: 8px; }
#player-list .score { margin-left: auto; }
#ban-list { list-style: none; margin: 0; padding: 0; }
#ban-list li { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; color: var(--muted); }
#open-pause { position: fixed; top: 64px; right: 74px; z-index: 6; border-radius: 999px; background: rgba(15, 20, 32, 0.85); padding: 8px 12px; display: flex; gap: 6px; align-items: center; }
#open-pause kbd { font-size: 11px; opacity: 0.75; }
#open-chat { position: fixed; top: 64px; right: 12px; z-index: 6; border-radius: 999px; background: rgba(15, 20, 32, 0.85); padding: 8px 14px; display: flex; gap: 6px; align-items: center; }

/* HUD */
#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}
.badge {
  background: rgba(15, 20, 32, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
}
.badge.seeker { border-color: var(--seeker); color: var(--seeker); }
.badge.hider { border-color: var(--hider); color: var(--hider); }
.badge.ghost { border-color: var(--ghost); color: var(--ghost); }
#timer-box { text-align: center; background: rgba(15, 20, 32, 0.85); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
#phase-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
#timer { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
#timer.urgent { color: var(--seeker); }

#heart {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  color: var(--seeker);
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 0 12px rgba(255, 60, 60, 0.8);
}

#prompt, #click-hint {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(15, 20, 32, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}
#click-hint { bottom: 50%; }

#touch-buttons { position: fixed; right: 16px; bottom: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 6; }
#touch-buttons button { width: 76px; height: 76px; border-radius: 50%; background: rgba(15, 20, 32, 0.6); font-size: 14px; }

#feed {
  position: fixed;
  left: 12px;
  bottom: 12px;
  max-width: min(360px, 60vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  z-index: 5;
}
#feed div {
  background: rgba(15, 20, 32, 0.85);
  border-left: 3px solid var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  transition: opacity 0.6s;
}
#feed .catch { border-color: var(--seeker); }
#feed .big { border-color: var(--accent); font-weight: 700; }
#feed .warn { border-color: #fcc419; }

#banner {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 25;
  animation: pop 0.35s ease-out;
}
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } }

#blindfold { background: #05070b; backdrop-filter: none; text-align: center; font-size: 18px; }
#blindfold .big { font-size: 34px; font-weight: 900; color: var(--seeker); }
#blindfold .count { font-size: 96px; font-weight: 900; font-variant-numeric: tabular-nums; }

#scoreboard { text-align: left; padding-left: 24px; }
#scoreboard li { padding: 3px 0; }
#scoreboard li span { float: right; font-weight: 700; }

@media (max-width: 800px) {
  .menu-grid { flex-direction: column; overflow: auto; }
  .menu-card, .browser-card { max-height: none; flex: none; }
  #room-list { max-height: 40vh; }
}

@media (max-width: 700px) {
  #lobby-pill { left: 8px; right: 8px; top: 8px; justify-content: center; }
  .pill-main { min-width: 0; }
  #pill-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 55vh; overflow: auto; }
  #chat-log { min-height: 50px; max-height: 80px; }
  #feed { bottom: auto; top: 80px; }
  body.in-hub #feed { top: calc(var(--hub-h, 104px) + 54px); }
}

/* Shared card bits */
.card-head { margin: 0 0 8px; align-items: center; }
.card-head h2 { margin: 0; }
.close-btn { background: none; border: none; font-size: 20px; padding: 4px 8px; color: var(--muted); }
.grow { flex: 1; }
.link-btn { background: none; border: none; padding: 8px 0 0; color: var(--hider); font-weight: 500; font-size: 13px; }
.info { color: var(--accent); min-height: 1.2em; margin: 8px 0 0; }
a { color: var(--hider); }
.how-list { padding-left: 18px; margin: 0; color: var(--text); font-size: 14px; }
.how-list li { margin: 6px 0; }
#email-form input { margin-bottom: 8px; }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border-color: #dadce0; margin-top: 8px; }

/* First screen and tutorial */
.start-card { width: min(420px, 100%); }
.big-choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 10px; padding: 14px 16px;
  border-radius: 16px; background: #131b2c; border: 2px solid var(--line);
}
.big-choice:hover { border-color: var(--accent); }
.choice-icon { font-size: 30px; }
.choice-main { display: flex; flex-direction: column; font-weight: 800; font-size: 16px; }
.choice-main small { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
#start-bots { border-color: rgba(94, 224, 138, 0.5); }
#tutorial {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 8; max-width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: rgba(10, 14, 22, 0.88); border: 1px solid var(--accent); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: tip-in 0.25s ease-out;
}
#tutorial b { color: var(--accent); white-space: nowrap; }
#tutorial span { font-size: 14px; }
#tutorial button { background: none; border: none; color: var(--muted); padding: 0 2px; font-size: 14px; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 700px) { #tutorial { bottom: 140px; flex-wrap: wrap; } #tutorial b { width: 100%; } }

/* Main lobby toolbar */
#hub-bar {
  position: fixed; top: 12px; left: 12px; z-index: 8;
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(15, 20, 32, 0.85); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.hub-id { display: flex; flex-direction: column; }
.hub-name { font-weight: 800; font-size: 16px; }
.hub-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.hub-buttons button { padding: 8px 12px; font-size: 14px; }
.primary-btn { background: var(--accent); color: #0b2415; border-color: transparent; }

/* XP bar */
#xp {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5;
  width: min(420px, calc(100vw - 200px)); display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.xp-level {
  flex: 0 0 auto; min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd43b, #fab005); color: #3b2a00; font-weight: 900; font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.6); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); padding: 0 4px;
}
.xp-track { flex: 1; height: 12px; background: rgba(15, 20, 32, 0.85); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #5ee08a, #a9e34b); transition: width 0.6s ease-out; }
.xp-text { flex: 0 0 auto; font-size: 12px; color: var(--text); text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.xp-gain { position: absolute; right: 0; bottom: 28px; font-weight: 900; color: #a9e34b; text-shadow: 0 2px 6px #000; opacity: 0; }
.xp-gain.show { animation: xp-rise 1.8s ease-out; }
@keyframes xp-rise { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
#xp.levelup .xp-level { animation: level-pop 0.8s ease-out 2; }
@keyframes level-pop { 50% { transform: scale(1.35); box-shadow: 0 0 24px #ffd43b; } }

/* Wardrobe */
.wardrobe-card { width: min(760px, 100%); text-align: left; }
.wardrobe-grid { display: flex; gap: 20px; }
.preview-col { flex: 0 0 240px; }
#preview { width: 240px; height: 280px; display: block; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #2c3850, #0f1522); margin-bottom: 12px; }
.options-col { flex: 1; min-width: 0; }
.options-col h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.options-col h3 + div { margin-bottom: 14px; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.skin-card { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.skin-card .lock { font-size: 11px; color: var(--muted); font-weight: 500; }
.skin-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.skin-card.locked { opacity: 0.5; }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 2px solid rgba(255, 255, 255, 0.25); }
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

@media (max-width: 700px) {
  #hub-bar { left: 8px; right: 8px; top: 8px; padding: 8px; }
  .hub-buttons button { flex: 1; padding: 8px 6px; font-size: 13px; }
  #xp { width: calc(100vw - 32px); bottom: 8px; }
  #touch-buttons { bottom: 56px; }
  body.in-hub #lobby-pill { top: calc(var(--hub-h, 96px) + 10px); }
  .hub-id { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .hub-id #hub-account { display: none; }
  .hub-buttons { flex-wrap: nowrap; }
  .hub-buttons button { padding: 8px 4px; font-size: 12px; white-space: nowrap; overflow: hidden; }
  .hub-buttons .camera-label { display: none; }
  .hub-buttons button { flex: 1 1 auto; }
}
@media (max-width: 460px) {
  .hub-buttons .lbl { display: none; }
  .wardrobe-grid { flex-direction: column; }
  .preview-col { flex: none; }
  #preview { width: 100%; height: 200px; }
}

/* Room lobby: ready + host controls */
select {
  font: inherit; color: var(--text); background: #0f1522; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 6px;
}
.ready-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.min-players { font-size: 13px; }
.min-players.short { color: var(--seeker); }
.min-players.ok { color: var(--accent); }
.ready-btn { padding: 8px 12px; }
.ready-btn.on { background: var(--accent); color: #0b2415; border-color: transparent; }
.status-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; flex: 0 0 auto; }
.status-tag.ready { background: rgba(94, 224, 138, 0.15); color: var(--accent); }
.status-tag.waiting { background: rgba(139, 151, 173, 0.15); color: var(--muted); }
.status-tag.host { background: rgba(252, 196, 25, 0.15); color: #fcc419; }
.status-tag.seeker { background: rgba(255, 93, 93, 0.18); color: var(--seeker); }
.status-tag.hider { background: rgba(87, 184, 255, 0.18); color: var(--hider); }
.status-tag.ghost { background: rgba(184, 166, 255, 0.18); color: var(--ghost); }
.status-tag.bot { background: rgba(139, 151, 173, 0.15); color: var(--muted); }

/* Round HUD */
.role-card {
  background: rgba(15, 20, 32, 0.88); border: 2px solid var(--line); border-radius: 14px; padding: 8px 14px; min-width: 150px;
}
#role-title { font-weight: 900; font-size: 18px; letter-spacing: 1px; }
#role-desc { font-size: 12px; color: var(--muted); }
.role-card.seeker { border-color: var(--seeker); box-shadow: 0 0 16px rgba(255, 93, 93, 0.35); }
.role-card.seeker #role-title { color: var(--seeker); }
.role-card.hider { border-color: var(--hider); }
.role-card.hider #role-title { color: var(--hider); }
.role-card.ghost #role-title { color: var(--ghost); }
#round-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.timer-line { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
#phase-label { color: var(--muted); font-size: 16px; letter-spacing: 1px; }
.hud-stats { display: flex; gap: 10px; justify-content: center; font-size: 12px; font-weight: 700; }
.hud-stats span:empty { display: none; }
#sky-line { font-size: 11px; color: var(--muted); margin-top: 1px; }
#sky-line:empty { display: none; }
.hud-spacer { min-width: 150px; }

/* Countdown intro */
#intro {
  position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 15; text-align: center;
  pointer-events: none; text-shadow: 0 3px 16px rgba(0, 0, 0, 0.9);
  background: rgba(8, 11, 18, 0.55); border-radius: 20px; padding: 16px 32px;
}
#intro-round { font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.intro-label { margin-top: 6px; font-size: 13px; letter-spacing: 4px; text-transform: uppercase; color: var(--seeker); }
#intro-seeker { font-size: clamp(30px, 6vw, 52px); font-weight: 900; }
#intro-you { font-size: 18px; font-weight: 800; }
#intro-count { font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; }

#standings { text-align: left; padding-left: 24px; }
#standings li { padding: 3px 0; }
#standings li span { float: right; font-weight: 700; }

#touch-camera { position: fixed; right: 16px; top: 120px; z-index: 6; width: 48px; height: 48px; border-radius: 50%; padding: 0; background: rgba(15, 20, 32, 0.7); }
body.in-hub #touch-camera { top: calc(var(--hub-h, 110px) + 56px); }
@media (max-width: 700px) {
  .role-card { min-width: 0; padding: 6px 10px; }
  #role-title { font-size: 14px; }
  #role-desc { display: none; }
  .hud-spacer { display: none; }
  .timer-line { font-size: 18px; }
}

/* Bots */
.segmented { display: flex; gap: 4px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.segmented button { flex: 1; padding: 8px 4px; border: none; background: none; border-radius: 8px; font-size: 14px; }
.segmented button.on { background: var(--accent); color: #0b2415; }
#bot-count { width: 140px; padding: 0; accent-color: var(--accent); }

#connecting {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: rgba(15, 20, 32, 0.92); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 14px;
}

/* Stamina and hiding status */
#stamina {
  position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 5; pointer-events: none;
  width: 160px; height: 6px; border-radius: 999px; background: rgba(15, 20, 32, 0.8); overflow: hidden;
}
#stamina-fill { height: 100%; width: 100%; background: #ffd43b; transition: width 0.15s linear; }
#stamina.low #stamina-fill { background: #ff6b6b; }
#hiding-status {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  background: rgba(8, 11, 18, 0.75); border: 1px solid var(--line); border-radius: 14px; padding: 10px 18px;
  font-weight: 700; text-align: center;
}
#touch-buttons button.on { background: rgba(94, 224, 138, 0.35); border-color: var(--accent); }
@media (max-width: 700px) {
  #touch-buttons { gap: 8px; }
  #touch-buttons button { width: 62px; height: 62px; font-size: 12px; }
}

/* Seeker tools */
#tools {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px;
}
.tool {
  position: relative; width: 56px; height: 56px; padding: 0; border-radius: 14px; overflow: hidden;
  background: rgba(15, 20, 32, 0.88); border: 2px solid rgba(255, 93, 93, 0.6);
  display: grid; place-items: center;
}
.tool .icon { font-size: 24px; line-height: 1; }
.tool .key { position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--muted); }
.tool .pips { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 9px; letter-spacing: 1px; color: #ffd43b; }
.tool .cd { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.tool .cd:empty { display: none; }
.tool.empty { opacity: 0.35; border-color: var(--line); }
.tool.flash { animation: tool-flash 0.4s ease-out; }
@keyframes tool-flash { 50% { transform: scale(1.12); box-shadow: 0 0 18px rgba(255, 93, 93, 0.9); } }
#stamina { bottom: 136px; }

#radar {
  position: fixed; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; z-index: 5;
  pointer-events: none; border-radius: 50%; border: 2px dashed rgba(99, 230, 190, 0.5);
}
#radar-arrow {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; font-size: 34px; color: #63e6be;
  text-shadow: 0 0 12px rgba(99, 230, 190, 0.9);
}
#radar-arrow::before { content: ''; }
#radar-text {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap;
  background: rgba(8, 11, 18, 0.8); border-radius: 999px; padding: 3px 12px; font-weight: 700; color: #63e6be;
}
@media (max-width: 700px) {
  #tools { bottom: 64px; gap: 5px; left: 40%; }
  .tool { width: 46px; height: 46px; }
  .tool .icon { font-size: 20px; }
  #stamina { bottom: 120px; }
}

/* Throwing */
#touch-throw {
  position: fixed; right: 104px; bottom: 24px; z-index: 6; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(255, 146, 43, 0.35); border-color: #ff922b; font-size: 14px;
}
#held {
  position: fixed; left: 16px; bottom: 24px; z-index: 5; pointer-events: none;
  background: rgba(8, 11, 18, 0.75); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px;
  font-size: 13px; font-weight: 700;
}
#held .muted { font-weight: 400; }
/* The name of wherever you have just walked into. It fades in, sits there, and goes - a label, not a
   notification: you are looking at the place, not at the screen. */
#area-name {
  position: fixed; left: 50%; top: 18%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  text-align: center; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  opacity: 0; transition: opacity 0.5s ease;
}
#area-name.showing { opacity: 1; }
#area-name b {
  display: block; font-size: 30px; font-weight: 800; letter-spacing: 0.04em; color: #fff;
}
#area-name span { display: block; margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 700px) { #area-name b { font-size: 22px; } }

/* The torch, underground. It sits where the tools do, because it is one. */
#torch {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 7;
  background: rgba(8, 11, 18, 0.8); border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px;
  color: #cfd6e4; font-weight: 700; font-size: 14px; cursor: pointer;
}
#torch.on { background: rgba(255, 214, 138, 0.22); border-color: #ffd68a; color: #ffe9c0; box-shadow: 0 0 18px rgba(255, 200, 120, 0.25); }
#torch .key {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.12); font-size: 11px;
}
@media (pointer: coarse) { #torch { bottom: 150px; } }

/* The map (M). Big, but see-through at the edges so the game carries on behind it. */
#minimap {
  position: fixed; top: 112px; right: 12px; z-index: 6; width: 160px; height: 160px; padding: 0;
  border-radius: 16px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 20, 32, 0.85); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); cursor: pointer;
}
#minimap canvas { width: 100%; height: 100%; display: block; }
#minimap .minimap-north {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 900;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); pointer-events: none;
}
#minimap .key {
  position: absolute; bottom: 5px; right: 6px; padding: 1px 6px; border-radius: 6px; font-size: 11px;
  background: rgba(8, 11, 18, 0.75); color: #cfd6e4; pointer-events: none;
}
@media (max-width: 700px) { #minimap { width: 112px; height: 112px; top: 108px; } }
#map-view {
  /* Above the room bar, Start button and XP bar (z-index 10 and 5), which used to cover its close button on
     phones - and a phone has no M key to close it with. Windows (.overlay, 20) still go on top. */
  position: fixed; inset: 6vh 6vw; z-index: 12; display: flex; flex-direction: column;
  background: rgba(10, 14, 22, 0.97); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
#map-view .map-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
#map-view .map-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#map-view .map-tools button { padding: 6px 10px; min-width: 36px; }
#map-canvas { flex: 1; width: 100%; min-height: 0; display: block; cursor: grab; touch-action: none; }
#map-canvas:active { cursor: grabbing; }
#map-view .map-hint { padding: 6px 12px; text-align: center; }
@media (max-width: 700px) {
  #map-view { inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
}

#stunned {
  position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  background: rgba(252, 196, 25, 0.2); border: 2px solid #fcc419; border-radius: 14px; padding: 10px 20px;
  font-size: 22px; font-weight: 900; color: #ffe066; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
@media (pointer: coarse) { #held { left: 50%; transform: translateX(-50%); bottom: auto; top: 96px; } }
@media (max-width: 700px) {
  #touch-throw { width: 62px; height: 62px; right: 86px; bottom: 56px; font-size: 12px; }
}

/* Coins, diamonds and the shop */
.wallet { display: inline-flex; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.wallet b { color: #ffe066; }
.wallet span + span b { color: #99e9f2; }
.wallet b.bump { display: inline-block; animation: wallet-bump 0.6s ease-out; }
@keyframes wallet-bump { 40% { transform: scale(1.4); } }
.wallet.big { font-size: 16px; background: #0f1522; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin-left: auto; margin-right: 10px; }
.shop-card { width: min(780px, 100%); text-align: left; }
#shop-preview-slot #preview { margin-bottom: 8px; }
.rarity-tag { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.skin-card .icon { font-size: 22px; line-height: 1.1; }
.skin-card .price { font-size: 11px; font-weight: 700; color: #ffe066; }
.skin-card .price.owned { color: var(--accent); }
.skin-card { border-width: 2px; }
.box-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.box { background: #0f1522; border: 2px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.box .box-icon { font-size: 40px; text-align: center; }
.box .box-name { font-weight: 800; text-align: center; }
.box .odds { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.box .odds div { display: flex; justify-content: space-between; }
.box button { margin-top: auto; }
.box-reveal { position: absolute; inset: 0; background: rgba(8, 11, 18, 0.94); border-radius: inherit; display: grid; place-items: center; z-index: 3; text-align: center; }
.shop-card { position: relative; }
.reveal-box { font-size: 90px; animation: box-shake 0.18s ease-in-out infinite alternate; }
.reveal-box.open { animation: box-pop 0.35s ease-out forwards; }
@keyframes box-shake { from { transform: rotate(-8deg) scale(1); } to { transform: rotate(8deg) scale(1.08); } }
@keyframes box-pop { to { transform: scale(2.2); opacity: 0; } }
.reveal-result { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: reveal-in 0.4s ease-out; min-width: 260px; }
.reveal-icon { font-size: 80px; filter: drop-shadow(0 0 22px var(--glow, #fff)); }
.reveal-result .row { width: 100%; margin-top: 10px; gap: 8px; align-items: stretch; }
.reveal-result .row button { flex: 1; margin: 0; }
@keyframes reveal-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.exchange-preview { font-size: 20px; font-weight: 800; }
#exchange-amount { width: 180px; padding: 0; accent-color: #99e9f2; }
.earn { margin-top: 12px; font-size: 13px; }
.earn summary { cursor: pointer; color: var(--muted); }
.reward-line { font-size: 18px; font-weight: 800; color: #ffe066; margin: 6px 0; }
#standings .reward { font-size: 12px; color: #ffe066; margin-left: 6px; }
@media (max-width: 700px) {
  .wallet.big { font-size: 13px; padding: 3px 8px; margin-right: 6px; }
  .box-list { grid-template-columns: 1fr; }
  .box { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .box .box-icon { font-size: 30px; }
  .box .odds { flex: 1 1 100%; }
}

/* Skin levels */
.skin-level { background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.skin-level-num { font-weight: 900; color: #ffe066; }
.level-pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 6px; }
.level-pips span { height: 8px; border-radius: 4px; background: #26314a; }
.level-pips span.on { background: linear-gradient(90deg, #ffd43b, #fab005); }
.perks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 3px 10px; font-size: 12px; }
.perks li { color: var(--muted); }
.perks li.on { color: var(--text); }
.perks li b { display: inline-block; min-width: 38px; color: #ffe066; }
.perks li:not(.on) b { color: var(--muted); }

/* Contact us */
.contact-card { width: min(560px, 100%); text-align: left; }
.contact-card > label, #contact-email-row label { display: block; margin-top: 12px; }
.contact-card textarea { width: 100%; resize: vertical; min-height: 110px; font: inherit; color: var(--text); background: #0f1522; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 110px; }
.contact-heading { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.my-queries { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow: auto; }
.query { background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.query .top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.query .text { white-space: pre-wrap; word-break: break-word; margin: 4px 0; }
.query .answer { white-space: pre-wrap; word-break: break-word; border-left: 3px solid var(--accent); padding: 4px 10px; margin-top: 6px; background: rgba(94, 224, 138, 0.08); border-radius: 0 8px 8px 0; }
.query .answer small, .reply-card .answer small { display: block; color: var(--muted); }
.status { font-weight: 800; }
.status.open { color: #fcc419; }
.status.answered { color: var(--accent); }
.status.closed { color: var(--muted); }
.reply-card { width: min(480px, 100%); text-align: left; }
.reply-card .quote { white-space: pre-wrap; word-break: break-word; color: var(--muted); border-left: 3px solid var(--line); padding: 4px 10px; margin: 8px 0; max-height: 20vh; overflow: auto; }
.reply-card .answer { white-space: pre-wrap; word-break: break-word; font-size: 16px; background: rgba(94, 224, 138, 0.1); border: 1px solid rgba(94, 224, 138, 0.4); border-radius: 12px; padding: 12px; margin-top: 8px; max-height: 40vh; overflow: auto; }
.link-btn.contact-link { display: inline; padding: 0; }
#query-reply { z-index: 60; }

/* Gifts */
.gift-card { width: min(380px, 100%); text-align: center; }
.gift-icon { font-size: 64px; animation: reveal-in 0.4s ease-out; }
.gift-amount { font-size: 26px; font-weight: 900; color: #ffe066; margin: 6px 0; }
.gift-note { white-space: pre-wrap; word-break: break-word; color: var(--muted); font-style: italic; }
.gift-note:empty { display: none; }
#gift { z-index: 61; }

/* Ranked */
.ranked-card { width: min(560px, 100%); text-align: left; }

.pass-line { color: var(--warn); font-weight: 700; }

/* Daily challenges in the pass window (shared/challenges.js) */
.pass-daily { margin: 6px 0 12px; }
.daily-title { margin: 0; font-size: 14px; }
.daily-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.daily-row .what { flex: 1; font-size: 13px; }
.daily-row .bar { width: 96px; height: 8px; border-radius: 999px; background: #0f1522; border: 1px solid var(--line); overflow: hidden; }
.daily-row .bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.daily-row .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }
.daily-row.done .what { color: var(--accent); }
.daily-row.done .count::after { content: ' ✓'; }

/* All-time boards (shared/records.js) */
.record-board { margin-bottom: 14px; }
.record-title { margin: 0 0 6px; font-size: 14px; }
.record-board .leaderboard { margin: 0 0 4px; }
.owner-tag { background: var(--warn); color: #20160a; font-weight: 800; }

/* Monthly pass (shared/pass.js) */
.pass-card { width: min(620px, 100%); text-align: left; }
.pass-progress { margin: 10px 0 14px; }
.pass-bar { height: 12px; border-radius: 999px; background: #0f1522; border: 1px solid var(--line); overflow: hidden; }
.pass-bar > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ffd43b); transition: width 0.4s ease; }
.pass-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.pass-tier { background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.pass-tier .num { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.pass-tier .what { font-size: 18px; margin: 2px 0; }
.pass-tier .amount { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pass-tier.got { border-color: var(--accent); background: rgba(94, 224, 138, 0.12); }
.pass-tier.next { border-color: var(--warn); }
.pass-tier.skin { background: rgba(252, 196, 25, 0.1); }
.pass-tier.skin .amount { color: var(--warn); }
.pass-tier.got .num::after { content: ' ✓'; color: var(--accent); }
.ranked-head { display: flex; gap: 14px; align-items: center; }
.rank-badge { min-width: 86px; text-align: center; background: #0f1522; border: 2px solid var(--line); border-radius: 14px; padding: 8px; }
.rank-badge .icon { font-size: 34px; display: block; line-height: 1.1; }
.rank-badge .name { font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.ranked-me { flex: 1; min-width: 0; }
.ranked-standing { font-size: 20px; font-weight: 900; }
#ranked-countdown { color: #ff922b; font-weight: 700; }
.leaderboard { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.leaderboard li { display: flex; align-items: center; gap: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.leaderboard li.you { border-color: var(--accent); background: rgba(94, 224, 138, 0.08); }
.leaderboard .pos { width: 34px; font-weight: 900; text-align: center; }
.leaderboard .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .pts { font-weight: 800; color: #ffe066; white-space: nowrap; }
.leaderboard .games { font-size: 11px; color: var(--muted); white-space: nowrap; }
.prize-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.prize { background: #0f1522; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-size: 12px; }
.prize b { display: block; font-size: 18px; }
.rank-ladder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin: 6px 0; }
.rank-ladder span.step { background: #0f1522; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.rank-ladder span.step.mine { border-color: var(--accent); }
.ranked-line { font-weight: 800; color: #ff922b; margin: 4px 0; }
.ranked-banner { background: rgba(255, 146, 43, 0.12); border: 1px solid rgba(255, 146, 43, 0.5); border-radius: 10px; padding: 8px 10px; font-weight: 700; color: #ffc078; }
.gift-xp { font-weight: 800; color: #a9e34b; }
.gift-xp:empty { display: none; }
@media (max-width: 700px) { .prize-list { grid-template-columns: 1fr; } }

/* Friends */
.friends-card { width: min(520px, 100%); text-align: left; }
.friend-code { display: flex; align-items: center; gap: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.friend-code b { font-size: 20px; letter-spacing: 2px; font-family: ui-monospace, Menlo, Consolas, monospace; flex: 1; }
.friend-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow: auto; }
.friend { display: flex; align-items: center; gap: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.friend .status-dot { width: 10px; height: 10px; border-radius: 50%; background: #495057; flex: none; }
.friend.online .status-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.friend .who { flex: 1; min-width: 0; }
.friend .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend .who span { font-size: 12px; color: var(--muted); }
.friend .actions { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
.friend .actions button { padding: 5px 9px; font-size: 12px; }
.badge { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--seeker); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.invite-card { width: min(380px, 100%); text-align: center; }
#invite { z-index: 62; }
.add-friend-btn { color: var(--accent); }
#add-friend-form, #bot-form { align-items: center; }
#bot-form input { flex: 1; min-width: 0; }
#bot-form button { width: auto; margin-top: 0; }
#add-friend-form input { flex: 1; min-width: 0; }
#add-friend-form button { width: auto; margin-top: 0; }
.invite-card .row { margin-top: 12px; }
.invite-card .row button { margin-top: 0; }

/* Party */
#party-chip {
  position: fixed; left: 12px; top: calc(var(--hub-h, 110px) + 20px); z-index: 7; display: flex; align-items: center; gap: 8px;
  background: rgba(15, 20, 32, 0.9); border: 1px solid #cc5de8; border-radius: 999px; padding: 4px 6px 4px 14px; font-size: 13px; max-width: calc(100vw - 24px);
}
#party-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { #party-chip { left: 8px; top: calc(var(--hub-h, 96px) + 56px); } }
.party-box { background: rgba(204, 93, 232, 0.08); border: 1px solid rgba(204, 93, 232, 0.45); border-radius: 12px; padding: 10px; margin: 6px 0 10px; }
.party-box .friend { background: rgba(15, 21, 34, 0.8); }
.party-btn { background: rgba(204, 93, 232, 0.25); border-color: #cc5de8; }

/* Support bot and What's new */
.bot-chat { display: flex; flex-direction: column; gap: 8px; height: min(46vh, 340px); overflow-y: auto; padding: 4px; }
.bubble { max-width: 88%; border-radius: 14px; padding: 8px 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble.bot { background: #0f1522; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.me { background: rgba(94, 224, 138, 0.15); border: 1px solid rgba(94, 224, 138, 0.5); border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble b { color: #fff; }
.bubble .bot-title { display: block; font-weight: 800; margin-bottom: 4px; color: var(--accent); }
.bubble .bot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .bot-actions button { padding: 5px 10px; font-size: 12px; margin: 0; width: auto; }
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.bot-chips button { padding: 5px 10px; font-size: 12px; border-radius: 999px; background: #0f1522; }
.bot-typing { color: var(--muted); font-style: italic; }
.changelog-card { width: min(560px, 100%); text-align: left; }
.changelog-list { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
.release h3 { margin: 0 0 2px; font-size: 16px; }
.release .when { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.release ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.release li { display: flex; gap: 8px; font-size: 14px; line-height: 1.4; }
.change-kind { flex: none; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; border-radius: 999px; padding: 2px 7px; height: fit-content; }
.change-kind.new { background: rgba(94, 224, 138, 0.18); color: var(--accent); }
.change-kind.improved { background: rgba(77, 171, 247, 0.18); color: #4dabf7; }
.change-kind.fixed { background: rgba(252, 196, 25, 0.18); color: #fcc419; }
.release.latest { border-left: 3px solid var(--accent); padding-left: 10px; }

/* Account window */
.account-card { width: min(520px, 100%); text-align: left; }
.tabs { display: flex; gap: 4px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs button { flex: 1; padding: 8px 4px; border: none; background: none; border-radius: 8px; font-size: 14px; }
.tabs button.on { background: #26314a; color: var(--text); }
.account-card h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.profile-head { display: flex; gap: 14px; align-items: center; }
.big-level { min-width: 56px; height: 56px; font-size: 24px; }
.profile-main { flex: 1; min-width: 0; }
.profile-main .xp-track { margin: 6px 0 2px; }
.acct-name { font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; margin: 12px 0 4px; }
.fact { background: #0f1522; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.fact b { display: block; color: var(--text); font-size: 14px; }
.notice { background: rgba(252, 196, 25, 0.1); border: 1px solid rgba(252, 196, 25, 0.4); border-radius: 10px; padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat .value { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .extra { font-size: 11px; color: var(--accent); }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.match { display: flex; align-items: center; gap: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.match .place { font-size: 20px; font-weight: 900; min-width: 44px; text-align: center; }
.match .place.won { color: #ffd43b; }
.match .info { flex: 1; min-width: 0; }
.match .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .meta { font-size: 12px; color: var(--muted); }
.match .xp { font-weight: 800; color: #a9e34b; white-space: nowrap; }
#pref-volume { width: 140px; padding: 0; accent-color: var(--accent); }
.settings select { max-width: 55%; }

/* The frame-time meter (F3, or ?perf=1). Deliberately plain and out of the way: it's a measuring
   instrument, not part of the game, and it must not cost anything to draw. */
#perf {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 60;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(8, 11, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  color: #cfd6e4;
  white-space: nowrap;
  pointer-events: none;
}
#perf b { color: #fff; }

/* Perks that pause in ranked matches, called out where the perk is listed. */
.perk-note {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 146, 43, 0.16);
  color: #ffb066;
  font-size: 11px;
  white-space: nowrap;
}

/* The final-minute warning uses the same banner, in a colour that means "hurry". */
#banner.warn {
  color: #ffd43b;
  font-size: clamp(20px, 4vw, 34px);
}

/* Ban / timed-kick countdown on the removal screen. */
.removed-wait { font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.removed-wait:empty { display: none; }

/* Station signs in the main lobby: page text laid over the 3D view (World.placeSigns), so they stay sharp */
.world-signs { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.world-sign {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 700 26px/1 system-ui, sans-serif; color: #fff; padding: 6px 22px;
  background: rgba(10, 14, 22, 0.8); border: 3px solid #ccc; border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Game modes (shared/modes.js): hider gadgets, the action buttons down the side, emotes, the replay. */
#gadgets {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px;
}
.tool.gadget { border-color: rgba(81, 207, 102, 0.6); }
#torch { bottom: 150px; }
@media (pointer: coarse) { #gadgets { bottom: 64px; gap: 5px; left: 40%; } #torch { bottom: 170px; } }
#mode-actions {
  position: fixed; right: 12px; top: 286px; z-index: 6; display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
#mode-actions button {
  background: rgba(8, 11, 18, 0.8); border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px;
  color: #cfd6e4; font-weight: 700; font-size: 13px; cursor: pointer;
}
#mode-actions button.cooling { opacity: 0.5; }
#mode-actions .key { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); font-size: 11px; }
@media (max-width: 700px) { #mode-actions { top: 228px; } #mode-actions .key { display: none; } }
#emote-wheel {
  position: fixed; right: 12px; top: 286px; z-index: 8; width: min(280px, 80vw); padding: 12px;
  background: rgba(15, 20, 32, 0.95); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
#emote-list, #fx-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#emote-list button, #fx-list button { padding: 6px 2px; font-size: 22px; border-radius: 10px; background: #0f1522; border: 1px solid var(--line); position: relative; }
#emote-list button small, #fx-list button small { display: block; font-size: 9px; color: var(--muted); }
#emote-list button.locked, #fx-list button.locked { opacity: 0.4; }
#fx-list button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.segmented.mods button { font-size: 12px; flex: 1 1 88px; }
.segmented.mods button:disabled { opacity: 0.75; }
.segmented.mods button .votes { margin-left: 4px; color: #ffd43b; }
#mode-blurb { margin: 0 0 6px; }
#replay-tag {
  position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 21; pointer-events: none;
  font: 800 22px/1 system-ui, sans-serif; letter-spacing: 3px; color: #fff; padding: 8px 18px; border-radius: 10px;
  background: rgba(200, 40, 40, 0.75); animation: replay-blink 1s steps(2) infinite;
}
@keyframes replay-blink { 50% { opacity: 0.55; } }
/* While the replay runs, the results card gets out of its way. */
#results.replaying { background: none; backdrop-filter: none; align-items: flex-end; justify-content: flex-end; pointer-events: none; }
#results.replaying .card { width: min(300px, 70%); padding: 14px; font-size: 13px; opacity: 0.94; }
#results.replaying .card h2 { font-size: 17px; margin: 4px 0; }

/* Second batch: playlist, presets, quick marks, highlights, map vote, achievements, the how-to under the countdown. */
#intro-how { margin-top: 10px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.85); line-height: 1.5; }
.preset-row { display: flex; gap: 4px; align-items: center; max-width: 62%; }
.preset-row select { max-width: 100%; }
#mark-btns { display: flex; gap: 4px; }
#mark-btns button { padding: 7px 9px; }
.highlights { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; text-align: left; }
.highlights li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; color: var(--muted); }
.highlights li b { color: var(--text); }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.achievements button { text-align: left; padding: 8px; font-size: 12px; border-radius: 10px; background: #0f1522; border: 1px solid var(--line); }
.achievements button b { display: block; font-size: 13px; }
.achievements button .bar { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.achievements button .bar i { display: block; height: 100%; background: var(--accent); }
.achievements button.locked { opacity: 0.6; cursor: default; }
.achievements button.on { border-color: #ffd43b; box-shadow: 0 0 0 1px #ffd43b inset; }

/* The store (shared/store.js): looks, bundles, premium, the pass's premium row, profile cards, streamer mode. */
#shop-looks .skin-card:disabled { opacity: 0.55; }
#shop-looks .skin-card .price.owned { color: var(--accent); }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.avatar-pick button { width: 38px; height: 38px; padding: 0; font-size: 20px; border-radius: 10px; background: #0f1522; border: 1px solid var(--line); }
.avatar-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bundle { background: #0f1522; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bundle-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.bundle-items { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.bundle-items span { background: rgba(255, 255, 255, 0.07); border-radius: 8px; padding: 3px 7px; }
.bundle-items span.got { opacity: 0.45; text-decoration: line-through; }
.premium-card { background: #0f1522; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.premium-card h3 { margin: 0 0 4px; }
.perks { margin: 6px 0 10px; padding-left: 18px; font-size: 13px; }
.track { display: flex; gap: 4px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.track-name { width: 86px; font-size: 12px; font-weight: 700; color: var(--muted); }
.track .tier { min-width: 40px; text-align: center; padding: 5px 4px; font-size: 13px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.track .tier.got { border-color: var(--accent); background: rgba(81, 207, 102, 0.15); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.product { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 12px; background: #141c2c; border: 1px solid var(--line); }
.product .price { font-weight: 800; color: #ffd43b; }
.purchases { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.purchases li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.purchases .status.refunded, .purchases .status.disputed, .purchases .status.failed { color: #ff8787; }
.passplus-head { margin: 10px 0 6px; align-items: center; }
.pass-tiers.plus { max-height: 30vh; }
.pass-tier.locked { opacity: 0.55; }
#open-event { background: rgba(255, 146, 43, 0.2); border-color: #ff922b; }
.profile-card { position: relative; text-align: center; }
.profile-card .close-btn { position: absolute; right: 10px; top: 10px; }
.profile-card .face { font-size: 54px; line-height: 1.1; }
.profile-card h2, .profile-card p { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.profile-card .stats-grid { margin-top: 10px; }
.card-achievements { margin-top: 8px; font-size: 20px; letter-spacing: 4px; }
#player-list li .name { cursor: pointer; }
/* Streamer mode: nothing on screen that would let a viewer find the room or read the chat. */
body.streamer #room-code, body.streamer #copy-link, body.streamer #room-sub, body.streamer #chat-log, body.streamer #chat-form { visibility: hidden; }
body.streamer #room-code::after { content: '••••'; visibility: visible; }

.preview-note { background: rgba(252, 196, 25, 0.14); border: 1px dashed #fcc419; border-radius: 10px; padding: 8px 10px; font-size: 13px; color: #ffe8a1; }

/* Age gate, codex, crews, reactions, replays. */
.age-gate { margin: 0 0 12px; padding: 10px 12px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; }
.age-gate p { margin: 0 0 8px; }
.codex-card { max-width: 720px; }
.codex-body { max-height: 60vh; overflow: auto; }
.codex-entry { display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.codex-entry .icon { font-size: 26px; text-align: center; }
.codex-entry b { display: block; }
.codex-entry ul { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 13px; }
.codex-entry .muted { font-size: 13px; }
/* The crew forms: a green (primary) button is full width everywhere else, which in this row pushed Create
   off the edge and squeezed the crew name to a sliver. */
#crew-create, #crew-join { align-items: stretch; }
#crew-join { margin-top: 8px; }
#crew-create input, #crew-join input { min-width: 0; }
#crew-new-name, #crew-join-code { flex: 1 1 auto; }
#crew-new-tag { flex: 0 0 72px; }
#crew-create button, #crew-join button { width: auto; margin-top: 0; }
.crew-box { margin-bottom: 12px; padding: 10px; background: #0f1522; border: 1px solid var(--line); border-radius: 12px; }
.crew-tag { font-weight: 800; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); }
.crew-top { font-size: 12px; margin-top: 6px; color: var(--muted); }
.crew-top div { display: flex; justify-content: space-between; }
#reactions { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
#reactions span { position: absolute; bottom: 20%; font-size: 36px; animation: react-up 2.6s ease-out forwards; }
@keyframes react-up { to { transform: translateY(-50vh); opacity: 0; } }
.chat-line.ghost .body { font-style: italic; opacity: 0.8; }
.chat-line.ghost .body::before { content: '👻 '; }

/* Younger players: nothing to buy, no adverts, no presents (the server enforces this as well). */
body.child #money-box, body.child #ad-match, body.child #ad-daily, body.child #gift-row, body.child #shop-tabs button[data-tab="premium"] { display: none !important; }

/* Install help (iPhone) */
.install-steps { margin: 8px 0 12px; padding-left: 22px; line-height: 1.6; }
