@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url(/fonts/rubik-cyrillic-ext-500-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url(/fonts/rubik-cyrillic-ext-700-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Rubik"; font-weight: 900; font-display: swap; src: url(/fonts/rubik-cyrillic-ext-900-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Rubik Bubbles"; font-display: swap; src: url(/fonts/rubik-bubbles-cyrillic-ext-400-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url(/fonts/rubik-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url(/fonts/rubik-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url(/fonts/rubik-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url(/fonts/rubik-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Rubik"; font-weight: 900; font-display: swap; src: url(/fonts/rubik-cyrillic-900-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 900; font-display: swap; src: url(/fonts/rubik-latin-900-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Rubik Bubbles"; font-display: swap; src: url(/fonts/rubik-bubbles-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik Bubbles"; font-display: swap; src: url(/fonts/rubik-bubbles-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #3b2a7a;
  --card: #4b3a94;
  --card2: #5d4cab;
  --line: #6a5ab8;
  --text: #fff;
  --muted: #d6ceff;
  --ink: #1c1240;
  --pink: #ffb8d9;   --pink-d: #e07fac;
  --coral: #ff8f6b;  --coral-d: #d4603f;
  --green: #5fe08a;  --green-d: #2fae5a;
  --yellow: #ffd23f; --yellow-d: #d9a400;
  --red: #ff5a5f;    --red-d: #c9343a;
  --orange: #ff8a2a;
  --sky: #7fd6ff;    --sky-d: #3fa7d6;
  --shadow: #2a1c5c;
  --radius: 24px;
  /* type scale: display / title / body / label */
  --fs-display: 30px; --fs-title: 20px; --fs-body: 16px; --fs-small: 14px; --fs-label: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  background:
    radial-gradient(circle at 12% 8%, #ffd23f33 0 6px, transparent 7px),
    radial-gradient(circle at 88% 14%, #ffb8d940 0 8px, transparent 9px),
    radial-gradient(circle at 78% 46%, #7fd6ff33 0 5px, transparent 6px),
    radial-gradient(circle at 8% 62%, #5fe08a33 0 7px, transparent 8px),
    radial-gradient(circle at 92% 84%, #ff8f6b33 0 6px, transparent 7px),
    linear-gradient(180deg, #4a37a0 0%, #3b2a7a 55%, #33246b 100%);
  background-attachment: fixed;
}
body {
  font: 500 var(--fs-body)/1.4 "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh;
}
#app { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
h1 { margin: 0; }
h2 { font-size: var(--fs-title); font-weight: 900; line-height: 1.15; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .3px; }
h3 { font-size: var(--fs-label); margin: 0 0 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.center { text-align: center; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }
.spacer { height: 10px; }

/* ---------- logo ---------- */
.hero { text-align: center; padding: 8px 0 4px; }
.hero .mascot { width: 180px; margin: 0 auto -8px; position: relative; z-index: 1; }
.hero .mascot svg { display: block; width: 100%; height: auto; }
.logo {
  /* Rubik 900: its Kazakh letters (ө in «Көсе») are clear; the bubble font made ө look like о */
  font-family: "Rubik", sans-serif; font-weight: 900;
  font-size: clamp(36px, 12vw, 54px); line-height: 1.05; letter-spacing: 0; position: relative; z-index: 2;
  background: linear-gradient(180deg, #ffd25c 0%, #f08a6c 50%, #e64f8a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* outline via shadows, not text-stroke: stroke drew the inner contours of ө */
  filter: drop-shadow(2px 0 0 #2a1c5c) drop-shadow(-2px 0 0 #2a1c5c) drop-shadow(0 2px 0 #2a1c5c) drop-shadow(0 -2px 0 #2a1c5c) drop-shadow(0 5px 0 #1c1240);
}
.tagline { font-weight: 900; text-transform: uppercase; color: var(--yellow); font-size: var(--fs-title); margin-top: 8px; letter-spacing: .5px; }
.tagline small { display: block; color: var(--muted); font-size: var(--fs-label); font-weight: 700; letter-spacing: 1px; margin-top: 4px; }

/* ---------- inputs ---------- */
input, textarea, select {
  width: 100%; font: inherit; font-size: var(--fs-body); font-weight: 700; color: var(--text); background: var(--card2);
  border: 3px solid var(--card2); border-radius: 18px; padding: 14px 16px; outline: none;
}
input::placeholder, textarea::placeholder { color: #777; font-weight: 500; }
input:focus, textarea:focus { border-color: var(--yellow); }
textarea { resize: none; min-height: 80px; }

/* ---------- chunky buttons ---------- */
button {
  font: inherit; font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px;
  border: 0; border-radius: 20px; padding: 16px 18px; width: 100%; cursor: pointer;
  background: var(--card2); color: #fff; box-shadow: 0 6px 0 var(--shadow);
  transition: transform .06s, box-shadow .06s; position: relative; top: 0;
}
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--coral); color: var(--ink); box-shadow: 0 6px 0 var(--coral-d); font-size: 20px; padding: 20px; }
.turn-q { font-size: 18px; font-weight: 700; margin: 6px 0 10px; }
.facts p { font-size: var(--fs-body); }
.facts b { font-weight: 700; }
button.primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--coral-d); }
button.pink { background: var(--pink); color: var(--ink); box-shadow: 0 6px 0 var(--pink-d); }
button.green { background: var(--green); color: var(--ink); box-shadow: 0 6px 0 var(--green-d); }
button.yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 6px 0 var(--yellow-d); }
button.ghost { background: var(--sky); color: var(--ink); box-shadow: 0 6px 0 var(--shadow); }
button.danger { background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-d); }
button.chip { width: auto; padding: 10px 16px; border-radius: 999px; font-size: var(--fs-small); font-weight: 700; text-transform: none; letter-spacing: 0; box-shadow: 0 4px 0 var(--shadow); }
button.chip.on { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-d); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* big mode tiles */
.modes { display: grid; gap: 14px; }
.mode { text-align: center; padding: 22px 16px 18px; border-radius: 26px; color: var(--ink); text-transform: none; }
.mode b { display: block; font-size: min(var(--fs-display), 7.4vw); font-weight: 900; text-transform: uppercase; line-height: 1; margin-bottom: 8px; }
.mode span { display: block; font-weight: 500; font-size: var(--fs-small); line-height: 1.35; text-transform: none; letter-spacing: 0; opacity: .85; }
.mode.m-create { background: var(--coral); box-shadow: 0 7px 0 var(--coral-d); padding: 28px 16px 24px; }
.mode.m-join { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); padding: 28px 16px 24px; }
button.yellow-btn { background: var(--yellow); box-shadow: 0 6px 0 var(--yellow-d); }
.mode.m-online { background: var(--pink); box-shadow: 0 7px 0 var(--pink-d); }
.mode.m-hybrid { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }
.mode.on { outline: 4px solid #fff; outline-offset: 3px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); font-weight: 500; }
.topbar b { color: #fff; font-weight: 700; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--card2); color: #fff; font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.badge.accent { background: var(--yellow); color: var(--ink); }
.badge.pink { background: var(--pink); color: var(--ink); }
.badge.green { background: var(--green); color: var(--ink); }

.players { list-style: none; margin: 0; padding: 0; }
.players li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px solid var(--line); font-weight: 700; font-size: var(--fs-body); }
.players li:last-child { border-bottom: 0; }
.players .name { flex: 1; }
/* player avatar: steppe hero over a letter tile (the letter shows if the picture is missing) */
.ava { --s: 26px; width: var(--s); height: var(--s); flex: none; position: relative; display: inline-block; vertical-align: middle; }
.ava.md { --s: 40px; }
.ava .face { position: absolute; inset: 0; border-radius: 28%; overflow: hidden; display: grid; place-items: center; font-weight: 900; font-size: calc(var(--s) * .45); line-height: 1; color: var(--ink); box-shadow: 0 2px 0 #2a1c5c; }
.ava.md .face { box-shadow: 0 3px 0 #2a1c5c; }
.ava .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 28%; display: block; }
.ava.offline .face { opacity: .5; }
.ava.gone .face { background: #6a5ab8; color: #fff; }
.ava .dot { position: absolute; right: -4px; bottom: -4px; border: 3px solid var(--ring, var(--card)); box-sizing: content-box; }
.vote-btn { --ring: var(--card2); }
.vote-btn.on { --ring: var(--pink); }
.vname, .who-n { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who-n b { color: var(--text); }
.ready-chip .ava, button.chip .ava { margin: -4px 6px -4px -6px; }
.ready-chip { display: inline-flex; align-items: center; white-space: nowrap; }
button.chip { display: inline-flex; align-items: center; white-space: nowrap; }
.with-ava, .turn .small b, .turn p b, .facts b, .nw { white-space: nowrap; }
.turn .small .ava, .turn p .ava, .facts .ava, .nw .ava { margin: -3px 5px 0 0; }
.with-ava .ava { margin: -4px 8px 0 0; }
.qa .who .ava { margin-top: -2px; }
.qa .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* illustration with a drawn fallback underneath (shown when the picture fails to load) */
.pic { display: block; }
.pic > img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 28%; object-fit: cover; }
.pic > .fb { display: none; }
.pic.broken > img { display: none; }
.pic.broken > .fb { display: block; }
.hero .mascot .pic > img { box-shadow: 0 6px 0 #2a1c5c; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #555; flex: none; }
.dot.on { background: var(--green); }
.x { width: auto; padding: 6px 12px; background: transparent; color: var(--muted); box-shadow: none; font-size: var(--fs-body); }

.invite-link { word-break: break-all; font-size: var(--fs-small); background: var(--card2); padding: 12px; border-radius: 14px; font-weight: 700; }
.qr { background: #fff; border-radius: 22px; padding: 14px; margin: 12px auto; width: min(260px, 70vw); box-shadow: 0 7px 0 var(--yellow-d); border: 4px solid var(--yellow); }
.qr svg { display: block; width: 100%; height: auto; }
.code { font-size: var(--fs-display); font-weight: 900; letter-spacing: 3px; color: var(--yellow); }

.timer-card { background: var(--yellow); color: var(--ink); box-shadow: 0 7px 0 var(--yellow-d); }
.timer { font-size: 60px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.timer.low { color: var(--red-d); }
.timer-label { text-align: center; font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; opacity: .75; }

/* role card */
.role { border-radius: 28px; padding: 18px 18px 20px; text-align: center; margin: 14px 0; user-select: none; cursor: pointer; color: var(--ink); }
.role .art { width: 190px; margin: 0 auto 8px; }
.role .art svg { display: block; width: 100%; height: auto; border-radius: 28px; }
.role .big { font-size: var(--fs-display); font-weight: 900; text-transform: uppercase; line-height: 1.05; margin: 4px 0 6px; }
.role .hint { font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: .65; }
.role .small { font-size: var(--fs-small); font-weight: 500; line-height: 1.35; }
.role.hidden { background: var(--sky); color: var(--ink); box-shadow: 0 7px 0 var(--sky-d); }
.role.spy, .role.civ { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); } /* same look for both roles: the colour must not give the role away */

.turn { border: 4px solid var(--pink); background: #5a3f9e; }
.qa { list-style: none; margin: 0; padding: 0; }
.qa li { padding: 12px 0; border-bottom: 2px solid var(--line); }
.qa li:last-child { border-bottom: 0; }
.qa .who { font-size: var(--fs-label); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.qa .q { margin-top: 4px; font-weight: 700; font-size: var(--fs-body); }
.qa .a { margin-top: 6px; padding: 8px 12px; border-radius: 14px; background: var(--card2); }
.qa .a.none { color: var(--muted); font-style: italic; }

.votes { display: grid; gap: 12px; }
.vote-btn { display: flex; justify-content: space-between; align-items: center; text-align: left; text-transform: none; letter-spacing: 0; font-size: 18px; font-weight: 700; }
.vote-btn span + span { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .8px; }
.vote-btn.on { background: var(--pink); color: var(--ink); box-shadow: 0 6px 0 var(--pink-d); }
.bar { height: 10px; background: var(--card2); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--coral); border-radius: 6px; }
.tally li { display: block; }

.locs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.locs button { padding: 12px 8px; font-size: var(--fs-small); text-transform: none; letter-spacing: 0; font-weight: 700; box-shadow: 0 4px 0 var(--shadow); }
.locs button.on { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-d); }
details summary { cursor: pointer; color: var(--muted); padding: 4px 0; font-weight: 700; font-size: var(--fs-small); }
.loclist { columns: 2; font-size: var(--fs-small); color: var(--muted); margin-top: 8px; }

.winner { text-align: center; padding: 20px 16px 22px; color: var(--ink); border-radius: 28px; }
.winner .art { width: 170px; margin: 0 auto 10px; }
.winner .art svg { display: block; width: 100%; height: auto; border-radius: 26px; }
.winner .big { font-size: var(--fs-display); font-weight: 900; text-transform: uppercase; line-height: 1.05; margin-bottom: 6px; }
.winner p { font-weight: 500; font-size: var(--fs-body); }
.winner.spy { background: var(--orange); box-shadow: 0 7px 0 #c95a0c; }
.winner.team { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }

.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); background: #fff; color: #111; font-weight: 700; padding: 12px 18px; border-radius: 16px; max-width: 90vw; font-size: var(--fs-small); z-index: 10; box-shadow: 0 5px 0 var(--shadow); }
.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 5px; z-index: 9; }

.explain { background: var(--card2); border-radius: 16px; padding: 14px 16px; font-size: var(--fs-small); line-height: 1.45; }
.explain b { display: block; font-size: var(--fs-body); margin-bottom: 4px; }
.code-sample { font-weight: 900; letter-spacing: 2px; color: var(--yellow); }
.code-label { font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-top: 6px; }

.hint-card { display: flex; gap: 10px; align-items: flex-start; background: #fff3c4; color: var(--ink); border-radius: 16px; padding: 12px 12px 12px 14px; margin: 12px 0; font-size: var(--fs-small); line-height: 1.4; box-shadow: 0 4px 0 var(--yellow-d); }
.card .hint-card { margin: 10px 0; }
.hint-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.hint-text { flex: 1; font-weight: 500; }
.hint-x { flex: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink); box-shadow: none; font-size: 14px; opacity: .6; }
.rules-btn { width: 30px; height: 30px; padding: 0; border-radius: 50%; background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--yellow-d); font-size: 16px; }
#modal[hidden] { display: none; }
.modal-back { position: fixed; inset: 0; background: #1c1240cc; z-index: 20; }
.modal-card { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; background: var(--card); border-radius: 26px; padding: 20px; box-shadow: 0 8px 0 var(--shadow); }
.modal-card p { font-size: var(--fs-small); line-height: 1.45; }
.rules { padding-left: 20px; margin: 10px 0 16px; font-size: var(--fs-small); line-height: 1.45; }
.rules li { margin-bottom: 8px; }
.rules b { color: var(--yellow); }

/* ready to vote */
.ready-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ready-chip { padding: 6px 12px; border-radius: 999px; background: var(--card2); font-size: var(--fs-small); font-weight: 700; color: var(--muted); }
.ready-chip.on { background: var(--green); color: var(--ink); }
.ready-chip.off { opacity: .5; }
.roster h3 { margin: 0; }

/* time warnings */
.time-warn { margin-top: 8px; background: var(--red); color: #fff; font-weight: 800; border-radius: 12px; padding: 8px 10px; font-size: var(--fs-small); animation: pulse 1s ease-in-out infinite alternate; }
.time-warn[hidden] { display: none; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.03); } }
.vote-banner { background: var(--yellow); color: var(--ink); border-radius: 22px; padding: 16px 18px; font-size: var(--fs-title); font-weight: 900; text-align: center; box-shadow: 0 6px 0 var(--yellow-d); margin-bottom: 14px; }
.vote-banner small { display: block; font-size: var(--fs-small); font-weight: 600; margin-top: 4px; }
.loc-reveal { background: var(--sky); color: var(--ink); border-radius: 22px; padding: 16px 18px; text-align: center; box-shadow: 0 6px 0 var(--shadow); margin-bottom: 14px; }
.loc-reveal b { display: block; font-size: var(--fs-display); font-weight: 900; margin: 4px 0; }
.loc-reveal small { display: block; font-size: var(--fs-small); font-weight: 700; }

/* +1 minute requests */
.extra-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.extra-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; font-size: var(--fs-small); font-weight: 700; }
.ex-auto, .ex-approved { color: var(--green); }
.ex-declined { color: var(--muted); }
.ex-pending { color: var(--yellow); }
.ex-btns { display: flex; gap: 8px; }
.ex-btns button.chip { padding: 8px 14px; }
.locs button[hidden] { display: none; }
#locq { margin-bottom: 4px; }

/* language switch */
.lang-switch { display: inline-flex; gap: 4px; background: var(--card); border-radius: 999px; padding: 3px; }
.lang-switch button { width: auto; padding: 5px 10px; font-size: var(--fs-label); font-weight: 800; border-radius: 999px; background: transparent; color: var(--muted); box-shadow: none; letter-spacing: .5px; }
.lang-switch button.on { background: var(--yellow); color: var(--ink); }
.hero .lang-switch { display: flex; width: max-content; margin: 0 0 6px auto; }

/* sunglasses on the "о" of the logo */
.o-glasses { position: relative; display: inline-block; }
.o-glasses .glasses { position: absolute; left: 50%; top: 38%; width: .9em; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); pointer-events: none; }

/* offline players, room status, "Были в игре" */
.off-label { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--muted); font-size: var(--fs-label); font-weight: 700; white-space: nowrap; vertical-align: middle; }
.room-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.card.gone { opacity: .75; }
.card.gone .ava .face img { filter: grayscale(.6); }
.wait-card p { margin: 6px 0 10px; }

/* location sets: what each set contains */
details.pack { border-top: 2px solid var(--line); padding: 10px 0; }
details.pack:first-of-type { border-top: 0; }
details.pack summary { font-weight: 700; cursor: pointer; }
details.pack.off summary { color: var(--muted); }

/* host: location set switches with a clear on/off state */
.pack-toggles { display: grid; gap: 8px; }
.pack-toggle { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; text-transform: none; letter-spacing: 0; font-size: var(--fs-body); font-weight: 700; background: var(--card2); color: var(--text); box-shadow: 0 4px 0 var(--shadow); text-align: left; }
.pack-toggle .pt-state { flex: none; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--muted); }
.pack-toggle.on { background: var(--green); color: var(--ink); box-shadow: 0 4px 0 var(--green-d); }
.pack-toggle.on .pt-state { background: rgba(0,0,0,.12); color: var(--ink); }

/* "show the locations" under every set, separate from the on/off switch */
.pack-row { display: grid; gap: 4px; }
details.pack-list summary { list-style: none; cursor: pointer; font-size: var(--fs-small); font-weight: 700; color: var(--muted); padding: 4px 6px; }
details.pack-list summary::-webkit-details-marker, details.pack summary::-webkit-details-marker { display: none; }
details.pack summary { list-style: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
details.pack .show-list { margin-left: auto; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.arrow { display: inline-block; transition: transform .15s; }
details[open] > summary .arrow { transform: rotate(90deg); }
details.pack-list .loclist { padding: 0 6px 6px; }

/* text typed by players never widens the screen */
#app { overflow-x: clip; }
.turn-q, .qa .q, .qa .a, .players .name, .who-n, .who-n b, .ready-chip, .vote-btn .vname, .vname, .chips .chip, .locs button, .nw, .card.center h2, .loclist div, .facts, .loc-reveal b, .role .big, .extra-list span { overflow-wrap: anywhere; min-width: 0; }
.players .name, .vote-btn .vname, .vname, .who-n { min-width: 0; }
.nw, .turn .small b, .turn p b, .facts b, .with-ava { white-space: normal; }
.ready-chip, button.chip { white-space: normal; max-width: 100%; }
button.role { display: block; width: 100%; font: inherit; text-transform: none; letter-spacing: 0; font-weight: 400; }
button.role:active:not(:disabled) { transform: translateY(3px); }
.role.compact { padding: 12px 16px; display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.role.compact .big { font-size: var(--fs-title); margin: 0; }

/* host's start button pinned to the bottom */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(59,42,122,0), var(--bg) 35%); pointer-events: none; }
.sticky-inner { max-width: 488px; margin: 0 auto; pointer-events: auto; }
#app:has(.sticky-cta) { padding-bottom: calc(110px + env(safe-area-inset-bottom)); } /* room for the pinned button below the last item */

/* form errors under the field */
input.invalid { border-color: var(--red); }
.field-err { color: #ffb3a8; font-size: var(--fs-small); font-weight: 700; margin: 4px 2px 0; }
.field-err[hidden] { display: none; }
button.small-btn { font-size: 14px; padding: 11px 14px; text-transform: none; letter-spacing: 0; }
button.small-btn.armed { background: var(--pink); color: var(--ink); }
.logo .nw { white-space: nowrap; overflow-wrap: normal; }

/* rules window: close button, page underneath doesn't scroll */
body.modal-open { overflow: hidden; }
.modal-x { position: sticky; top: 0; float: right; width: 40px; height: 40px; padding: 0; margin: -6px -6px 0 8px; border-radius: 50%; font-size: 18px; z-index: 1; }

/* visible keyboard focus */
button:focus-visible, .role:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.topbar > span { min-width: 0; overflow-wrap: anywhere; } .topbar .lang-switch { flex: none; }
.badge { white-space: nowrap; overflow-wrap: normal; }
.live-count { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; color: #fff; font-weight: 600; font-size: var(--fs-small); text-align: center; }
.live-count[hidden] { display: none; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(90,225,140,.6); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(90,225,140,.6); } 70% { box-shadow: 0 0 0 8px rgba(90,225,140,0); } 100% { box-shadow: 0 0 0 0 rgba(90,225,140,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
/* intro cards */
#intro[hidden] { display: none; }
.intro-card { text-align: center; padding: 18px 20px 20px; }
.intro-card h2 { margin: 14px 0 8px; font-size: 24px; line-height: 1.15; }
.intro-card p { font-size: var(--fs-body) !important; line-height: 1.45; color: var(--muted); margin: 0 auto; max-width: 360px; min-height: 6.5em; }
.intro-skip { display: block; margin: -4px -6px 0 auto; background: none; box-shadow: none; color: var(--muted); font-size: var(--fs-small); font-weight: 700; padding: 6px 8px; min-height: 32px; width: auto; }
.intro-pic { height: 150px; display: flex; align-items: center; justify-content: center; }
.i-row { display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.i-row img { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; box-shadow: 0 4px 0 var(--shadow); }
.i-row img[src*="fox-1"] { width: 92px; height: 92px; transform: rotate(-4deg); outline: 4px solid var(--yellow); }
.i-row img[src*="fox-4"] { width: 140px; height: 140px; border-radius: 30px; }
.i-talk { gap: 18px; align-items: flex-start; }
.i-talk > div { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.i-talk > div:last-child { margin-top: 34px; }
.i-talk .bubble { background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 14px; max-width: 120px; line-height: 1.2; }
.i-crowd { flex-wrap: wrap; max-width: 260px; gap: 6px; }
.i-crowd img { width: 58px; height: 58px; border-radius: 16px; }
.intro-dots { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.intro-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--card2); }
.intro-dots span.on { background: var(--yellow); width: 24px; border-radius: 6px; }
.intro-nav { display: flex; gap: 10px; }
.intro-nav button { flex: 1; }
.intro-nav .ghost { flex: 0 0 34%; }
.intro-rules { margin-top: 12px; color: var(--muted); text-decoration: underline; background: none; box-shadow: none; }
@media (max-height: 640px) { .intro-pic { height: 110px; } .i-row img { width: 56px; height: 56px; } .i-row img[src*="fox-4"] { width: 104px; height: 104px; } }
/* home: one main call to action */
.pitch { text-align: center; color: #fff; font-weight: 700; font-size: 17px; line-height: 1.35; margin: 14px auto 18px; max-width: 340px; }
.join-sm { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-d); border-radius: 20px; padding: 14px 16px; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.link-btn { display: block; margin: 18px auto 0; background: none; box-shadow: none; color: var(--muted); font-weight: 700; font-size: var(--fs-small); text-decoration: underline; text-underline-offset: 3px; text-transform: none; letter-spacing: 0; padding: 8px; min-height: 0; width: auto; }
.link-btn:active { transform: none; }
.intro-links { display: flex; justify-content: center; gap: 4px 16px; flex-wrap: wrap; margin-top: 8px; }
.intro-links .link-btn { margin: 0; }
.home-btn { background: #fff; box-shadow: 0 3px 0 #b9b0e6; display: inline-flex; align-items: center; justify-content: center; }
.home-btn svg { width: 18px; height: 18px; }
.back-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border-radius: 18px; padding: 10px 10px 10px 16px; margin: 14px 0 0; color: #fff; font-size: var(--fs-small); }
.back-card .small-btn { width: auto; flex: none; padding: 10px 16px; min-height: 0; font-size: 14px; }
