:root {
  color-scheme: dark;
  --bg: #1a1430;
  --bg2: #241c42;
  --panel: #2c2350;
  --line: #ffffff1f;
  --text: #fbf7ff;
  --muted: #c4b8e6;
  --good: #22c55e;
  --bad: #f43f5e;
  --accent: #ff5d73;
  --c: var(--accent);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 60% at 50% 0%, #3a2a70 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 24px); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
input {
  font: inherit; color: var(--text); background: #ffffff12; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; min-width: 0; width: 100%;
}
input:focus { outline: 2px solid var(--c); outline-offset: 1px; }
input::placeholder { color: #c4b8e699; }
h3 { margin: 22px 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
h3 small { font-weight: 400; }
a { color: inherit; }

/* Home */
.hero { text-align: center; padding: 18px 0 8px; }
.logo { display: block; width: 72px; height: 48px; filter: drop-shadow(0 6px 16px #ff5d7366); animation: wobble 4s ease-in-out infinite; }
.hero h1 { margin: 4px 0 2px; font-size: 34px; letter-spacing: -.5px; background: linear-gradient(90deg, #ff8fa3, #ffd36e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

.seg { display: flex; gap: 6px; background: #ffffff10; padding: 5px; border-radius: 16px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-width: 0; padding: 10px 8px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; }
.seg button.on { background: var(--c); color: #fff; box-shadow: 0 4px 14px #0004; }
.filter { margin: 16px 0 12px; --c: #6d4cff; }
.filter button { flex: 1 1 auto; }

.players-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
}
.players-btn > span:first-child { font-size: 24px; }
.players-btn > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.players-btn small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players-btn .go { font-size: 26px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-height: 158px;
  padding: 14px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(155deg, color-mix(in srgb, var(--c) 92%, #fff 8%), color-mix(in srgb, var(--c) 55%, #1a1430));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--c) 70%, #000), inset 0 1px 0 #ffffff40;
  transition: transform .15s;
}
.game-card:active { transform: scale(.97); }
.game-card .emoji { font-size: 34px; line-height: 1.1; }
.game-card strong { font-size: 16.5px; line-height: 1.2; text-shadow: 0 1px 2px #0003; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.game-card small, .card p, .turn, .rules li { hyphens: auto; -webkit-hyphens: auto; }
.game-card small { font-size: 13px; opacity: .92; line-height: 1.3; }
.game-card .tag { margin-top: auto; font-size: 12px; font-weight: 700; background: #0003; padding: 3px 9px; border-radius: 99px; }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
.foot p { margin: 6px 0; }
.foot p a { color: var(--text); }
/* Onyxwright badge (same as Hekiva, Filiz and the Beyza Bayındır site) */
.credit { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: #141414; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); color: #eae6df; font-size: 12.5px; letter-spacing: .02em; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.credit .gem { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #6b6b6b, #0b0b0b 60%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.credit b { font-weight: 700; background: linear-gradient(90deg, #f0d9b5, #c9b8f0, #9fd8e0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.credit span { opacity: .6; }
a.credit:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 10px 24px -12px rgba(0, 0, 0, .6); }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px; font-size: 14px; }
.link.danger { color: #ff8fa3; }

/* Pages */
.bar { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, transparent); }
.bar h1 { flex: 1; margin: 0; font-size: 19px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back, .bar-end { width: 42px; height: 42px; flex: none; }
.back { border-radius: 14px; background: #ffffff14; font-size: 30px; line-height: 1; padding-bottom: 4px; }
.page { padding-top: 4px; }
.lead { color: var(--muted); }
.rules { margin: 4px 0 6px; padding: 14px 16px 14px 34px; background: #ffffff0d; border-radius: 18px; border: 1px solid var(--line); }
.rules li { margin: 4px 0; }
.rules li::marker { color: var(--c); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 18px; border-radius: 16px; font-weight: 700;
  background: var(--c); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--c) 80%, #000); transition: transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.small { padding: 10px 14px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.start { margin-top: 24px; font-size: 18px; padding: 16px; }
.btn.big-btn { font-size: 19px; padding: 18px; }
.btn.ghost { background: #ffffff17; box-shadow: none; }
.btn.good { background: var(--good); }
.btn.bad { background: var(--bad); }
.row { display: flex; gap: 10px; margin-top: 14px; }
.row > * { flex: 1 1 0; min-width: 0; }
.msg { color: #ffb4c0; background: #f43f5e22; padding: 10px 12px; border-radius: 12px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 2px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }

.players-box { background: #ffffff0d; border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.add-player { display: flex; gap: 8px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--panel); padding: 4px 4px 4px 12px; border-radius: 99px; max-width: 100%; }
.chip button { width: 30px; height: 30px; border-radius: 50%; font-size: 18px; color: var(--muted); }
.name-pair { display: flex; align-items: center; gap: 8px; }
.name-pair span { color: var(--muted); font-weight: 700; font-size: 14px; }

/* Play */
.turn { text-align: center; font-size: 20px; margin: 10px 0 12px; }
.turn b { color: color-mix(in srgb, var(--c) 60%, #fff); }
.card {
  position: relative; padding: 46px 20px 28px; border-radius: 26px; text-align: center; min-height: 180px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 85%, #fff 5%), color-mix(in srgb, var(--c) 45%, #1a1430));
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--c) 80%, #000), inset 0 1px 0 #fff4;
  animation: pop .28s ease-out;
}
.card p { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
.card small { font-size: 15px; font-weight: 400; opacity: .9; }
.card .label { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 700; background: #0003; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.card.truth { --c: #3b82f6; }
.card.dare { --c: #ef4444; }
.card.spy { --c: #475569; }
.card.place { --c: #3b82f6; }
.place-emoji { display: block; font-size: 54px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px; border-radius: 24px; font-size: 44px; font-weight: 800; }
.big span { font-size: 19px; }
.big.truth { background: linear-gradient(160deg, #60a5fa, #1d4ed8); }
.big.dare { background: linear-gradient(160deg, #fb7185, #be123c); }

.scores { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.scores li { display: flex; gap: 8px; align-items: center; background: #ffffff10; padding: 6px 12px; border-radius: 99px; font-size: 14px; max-width: 100%; }
.scores li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores li.active { background: var(--c); }
.scores b { font-size: 16px; }

.fingers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fingers button { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #ffffff12; text-align: left; }
.fingers button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fingers button.out { opacity: .5; text-decoration: line-through; }
.fingers b { white-space: nowrap; }

.countdown { text-align: center; font-size: 64px; font-weight: 900; margin: 10px 0 -4px; animation: pop .3s; }

.versus { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.option { padding: 26px 18px; border-radius: 22px; font-size: 21px; font-weight: 700; text-align: center; background: linear-gradient(160deg, #14b8a6, #0f766e); transition: transform .15s, box-shadow .15s; }
.option + .or + .option { background: linear-gradient(160deg, #a78bfa, #6d28d9); }
.option.on { box-shadow: 0 0 0 4px #fff; transform: scale(1.02); }
.or { text-align: center; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; }

.answer { display: flex; gap: 8px; margin-top: 16px; }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.reveal div { background: #ffffff12; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: center; overflow-wrap: anywhere; }
.reveal small { color: var(--muted); }
.reveal b { font-size: 19px; }

.result { text-align: center; padding: 10px 0; }
.result h2 { margin: 6px 0; font-size: 24px; }
.big-emoji { font-size: 64px; animation: pop .4s; }

.timer { text-align: center; font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 10px 0; }
.timer.done { font-size: 40px; color: #ffd36e; }
.timer.small { font-size: 34px; margin: 0; min-width: 64px; height: 64px; border-radius: 50%; background: #ffffff14; display: grid; place-items: center; }
.timer.hurry { color: #fff; background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.places { margin-top: 18px; background: #ffffff0d; border-radius: 16px; padding: 10px 14px; }
.places summary { cursor: pointer; font-weight: 600; }
.places ul { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 14px; }

.taboo-top { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.taboo-card { --c: #f97316; }
.taboo-card .word { font-size: 34px; font-weight: 900; }
.ban { list-style: none; padding: 12px 0 0; margin: 14px 0 0; border-top: 1px solid #fff5; width: 100%; }
.ban li { font-size: 19px; padding: 3px 0; }
.row.three .btn { padding: 16px 6px; }

.table { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 8px auto 0; }
.ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #2fbf7122, #ffffff08 70%); border: 1px dashed var(--line); }
.seat { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateY(calc(-1 * min(43vw, 146px))) rotate(calc(-1 * var(--a))); }
.seat span { position: absolute; transform: translate(-50%, -50%); background: var(--panel); padding: 4px 10px; border-radius: 99px; font-size: 13px; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--line); }
.seat.on span { background: var(--c); font-weight: 700; box-shadow: 0 0 0 3px #fff8; }
.bottle { position: absolute; left: 50%; top: 50%; width: 46px; height: 160px; margin: -80px 0 0 -23px; transform-origin: 50% 50%; }
.bottle svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 10px #0006); }

/* Cells may not grow wider than their column: on short iPhones Safari stretched the cells' height and
   turned it into width through aspect-ratio, pushing the board off the screen. */
.xox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 8px; width: min(100%, 360px); margin: 0 auto; }
.cell { width: 100%; min-width: 0; aspect-ratio: 1; border-radius: 18px; background: #ffffff12; font-size: 48px; line-height: 1; }
.cell:disabled { opacity: 1; }
.cell.win { background: var(--c); }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px; border-radius: 18px; background: #2546c9; width: min(100%, 420px); margin: 0 auto; }
.slot { aspect-ratio: 1; border-radius: 50%; background: var(--bg); }
.slot:disabled { opacity: 1; }
.slot.dR { background: radial-gradient(circle at 35% 30%, #ff8a8a, #e11d48); }
.slot.dY { background: radial-gradient(circle at 35% 30%, #fff3a0, #eab308); }
.slot.win { box-shadow: 0 0 0 3px #fff; }
.slot.drop { animation: drop .3s ease-in; }
@keyframes drop { from { transform: translateY(-160%); } }

/* Duel: full screen, the top half is turned towards the player across the table */
body[data-screen="play-react"] #app { max-width: none; padding: 0; }
.duel { position: fixed; inset: 0; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: none; }
.half { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px; background: #3b2f6b; transition: background .1s; }
.half.p0 { transform: rotate(180deg); background: #4c2a6b; }
.duel.wait .half { background: #9f1239; }
.duel.go .half { background: #16a34a; }
.half .name { font-size: 22px; }
.half .score { font-size: 15px; opacity: .85; }
.half .say { font-size: 34px; font-weight: 900; }
.half small { opacity: .8; }
.duel-exit { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: #000a; font-size: 26px; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
@media (max-width: 360px) {
  .grid { gap: 8px; }
  .game-card { padding: 12px; min-height: 150px; }
  .card p { font-size: 20px; }
  .seg button { font-size: 14px; padding: 9px 4px; }
}

/* Language picker: a native select laid over a small pill */
/* The language picker sits on the logo's line, centred with it. */
.hero-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.hero-top .lang { justify-self: end; }
/* The select fills the whole pill, so a tap anywhere on it opens the list; no square focus box. */
.lang { position: relative; display: inline-flex; align-items: center; background: #ffffff14; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; overflow: hidden; }
.lang select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 99px; color: var(--text); font: inherit; padding: 8px 28px 8px 12px; min-height: 38px; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.lang:has(select:focus-visible) { border-color: var(--text); }
.lang::after { content: '▾'; position: absolute; right: 12px; pointer-events: none; color: var(--muted); }
.lang option { color: #111; }

/* Online rooms */
.online-btn { background: linear-gradient(135deg, #2563eb, #7c3aed); border-color: #ffffff30; }
.online-btn small { color: #e0e7ff; }
.online-form { display: flex; flex-direction: column; gap: 10px; background: #ffffff0d; border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-top: 12px; }
.online-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.online-form .btn.wide { margin-top: 2px; }
.join-row { display: flex; gap: 8px; }
.code-input { text-transform: uppercase; letter-spacing: 4px; font-weight: 800; font-size: 20px; text-align: center; }
.code-input::placeholder { letter-spacing: 0; font-weight: 400; font-size: 16px; }
.code-box { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #2563eb, #7c3aed); border-radius: 20px; padding: 14px 16px; margin-top: 6px; }
.code-box small { color: #e0e7ff; }
.code-box b { flex: 1; font-size: 34px; letter-spacing: 6px; font-weight: 900; font-variant-numeric: tabular-nums; }
.code-box .btn { background: #ffffff26; box-shadow: none; }
.chip.off { opacity: .55; }
.chip small { color: var(--muted); margin-left: 4px; }
.chip .kick-sure { width: auto; height: 30px; padding: 0 12px; margin-left: 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 14px; font-weight: 700; }
ul.chips .chip:not(:has(button)) { padding: 6px 12px; }
.grid.small .game-card { min-height: 104px; padding: 12px; }
.grid.small .game-card .emoji { font-size: 26px; }
.grid.small .game-card strong { font-size: 15px; }
.game-card.picked { outline: 3px solid #fff; outline-offset: 2px; }
.pick-box { margin-top: 18px; scroll-margin-top: 60px; }
.pick-box h2 { margin: 0 0 8px; font-size: 20px; }
.banner { text-align: center; background: #eab30833; color: #fde68a; border-radius: 12px; padding: 8px; margin: 0 0 10px; }
.room-tag { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }
.wait { color: var(--muted); font-style: italic; margin: 18px 0; }
.host-row { margin-top: 22px; }
.pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pick-list button { padding: 14px 10px; border-radius: 14px; background: #ffffff14; font-weight: 600; overflow-wrap: anywhere; }
.pick-list button.on { background: var(--c); box-shadow: 0 0 0 3px #fff8; }
.btn.on { box-shadow: 0 0 0 3px #fff; }
.btn.flag-red { background: #be123c; }
.btn.flag-green { background: #15803d; }
.option small { display: block; font-size: 14px; font-weight: 500; margin-top: 8px; opacity: .9; }
.option:disabled { opacity: 1; }
.flag-result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flag-result span { display: flex; flex-direction: column; gap: 2px; padding: 14px 8px; border-radius: 18px; font-weight: 700; }
.flag-result b { font-size: 34px; }
.flag-result small { font-weight: 400; font-size: 13px; overflow-wrap: anywhere; }
.flag-result .flag-red { background: #be123c; }
.flag-result .flag-green { background: #15803d; }
.result.small h2 { font-size: 20px; }
.guesses { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.guesses button { width: 100%; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; padding: 10px 14px; border-radius: 14px; background: #ffffff12; }
.guesses button:disabled { opacity: 1; }
.guesses button.on { background: var(--good); }
.guesses small { color: var(--muted); grid-column: 1; }
.guesses button.on small { color: #fff; }
.guesses b { grid-column: 1; overflow-wrap: anywhere; }
.guesses span { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 22px; }
.answer small.hint { flex-basis: 100%; order: -1; margin: 0; }
.answer:has(small) { flex-wrap: wrap; }
.answer:has(small) input { flex: 1 1 60%; }
.seen { list-style: none; padding: 10px 14px; margin: 12px 0 0; background: #ffffff0d; border-radius: 14px; font-size: 15px; }
.scores li.dead { opacity: .5; text-decoration: line-through; }

/* New games */
.big-word { font-size: 30px; font-weight: 900; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.say { font-size: 21px; font-weight: 700; margin: 18px 0; }
.countdown.words { font-size: 30px; }
.word-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.word-list li { background: #ffffff10; padding: 4px 10px; border-radius: 99px; font-size: 14px; color: var(--muted); }
.word-list li.ok { background: #15803d; color: #fff; }
.bomb { text-align: center; font-size: 88px; margin: 14px 0 0; }
.bomb.lit { animation: shake .35s infinite; }
@keyframes shake { 25% { transform: rotate(-8deg) scale(1.05); } 75% { transform: rotate(8deg) scale(1.05); } }
.result.boom h2 { font-size: 40px; color: #ffd36e; }

/* Forehead word: full screen; the top half means "got it", the bottom half "pass" */
body[data-screen="play-heads"] #app:has(.heads) { max-width: none; padding: 0; }
.heads { position: fixed; inset: 0; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.heads-half { flex: 1; font-size: 24px; font-weight: 800; color: #fff9; }
.heads-half.ok { background: #15803d; align-content: start; padding-top: calc(var(--safe-top) + 16px); }
.heads-half.pass { background: #9f1239; padding-bottom: calc(var(--safe-bottom) + 16px); }
.heads-word { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; padding: 0 16px; text-align: center; }
.heads-word b { font-size: clamp(34px, 11vw, 64px); line-height: 1.1; background: #000a; padding: 14px 20px; border-radius: 22px; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; max-width: 100%; }
.heads .duel-exit { top: auto; bottom: calc(var(--safe-bottom) + 12px); left: auto; right: 12px; transform: none; }

/* Mangala: stores at the sides, the second player's pits on top (sown right to left) */
.mangala { display: grid; grid-template-columns: 1fr repeat(6, 1.15fr) 1fr; grid-template-rows: auto auto; gap: 6px; padding: 10px; border-radius: 26px; background: linear-gradient(160deg, #9a3412, #7c2d12); box-shadow: inset 0 2px 8px #0006; }
.mangala .store { grid-row: 1 / 3; border-radius: 99px; background: #431407; box-shadow: inset 0 3px 8px #000a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.mangala .store small { font-size: 10px; color: #fed7aa; writing-mode: vertical-rl; letter-spacing: 1px; }
.mangala .store b { font-size: 22px; }
.mangala .s1 { grid-column: 1; } .mangala .s0 { grid-column: 8; }
.pit { aspect-ratio: 1 / 1.25; min-width: 0; border-radius: 99px; background: #431407; box-shadow: inset 0 3px 8px #000a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; }
.pit:disabled { opacity: 1; }
.pit:not(:disabled) { outline: 2px solid #fed7aa; outline-offset: -2px; }
.pit b { font-size: 17px; }
.pit.top b { transform: rotate(180deg); }
.stones { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 30px; }
.stones i { width: 6px; height: 6px; border-radius: 50%; background: #e7e5e4; }
.note { min-height: 1.45em; margin: 8px 0; color: #ffd36e; font-weight: 700; }

/* Dots and boxes: dots, line buttons and boxes in one grid */
.dots { --dot: 12px; display: grid; grid-template-columns: repeat(var(--n), var(--dot) minmax(0, 1fr)) var(--dot); width: min(100%, 380px); margin: 0 auto; }
.dots .dot { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--text); }
.dots .box { aspect-ratio: 1; display: grid; place-items: center; font-weight: 900; font-size: 20px; border-radius: 4px; margin: 3px; }
.dots .box.p0, .swatch.p0 { background: #2563eb; } .dots .box.p1, .swatch.p1 { background: #e11d48; }
/* The line is thin, but its button reaches into the boxes around it so it is easy to tap. */
.dots .dot, .dots .box { pointer-events: none; }
.edge { position: relative; z-index: 1; border-radius: 99px; background: #ffffff1a content-box; }
.edge.h { height: calc(var(--dot) + 24px); margin: -12px 0; padding: 12px 1px; }
.edge.v { width: calc(var(--dot) + 24px); margin: 0 -12px; padding: 1px 12px; }
.edge:disabled { opacity: 1; }
.edge.p0 { background: #60a5fa content-box; } .edge.p1 { background: #fb7185 content-box; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }

/* Find the pairs */
.pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(100%, 360px); margin: 0 auto; }
.flip { aspect-ratio: 1; border-radius: 16px; font-size: 34px; line-height: 1; background: linear-gradient(160deg, #2dd4bf, #0f766e); box-shadow: 0 3px 0 #0006; }
.flip:disabled { opacity: 1; }
.flip.up { background: #ffffff1c; box-shadow: none; animation: pop .25s; }
.flip.got.p0 { background: #1d4ed855; } .flip.got.p1 { background: #be123c55; }

/* Spot on: a scale with scoring bands and the guess needle */
.scale { margin: 16px 0 8px; }
.scale .ends { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 17px; }
.scale .ends b:last-child { text-align: right; }
.track { position: relative; height: 54px; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #a78bfa, #fb7185); overflow: hidden; }
.band { position: absolute; top: 0; bottom: 0; left: calc((var(--x) - var(--w)) * 1%); width: calc(var(--w) * 2%); }
.band.b2 { --w: 20; background: #fff5; } .band.b3 { --w: 12; background: #fff8; } .band.b4 { --w: 5; background: #fff; }
.guess { position: absolute; top: -4px; bottom: -4px; left: calc(var(--x) * 1% - 3px); width: 6px; border-radius: 3px; background: #111; box-shadow: 0 0 0 2px #fff; }
.needle { width: 100%; height: 44px; padding: 0; margin: 0 0 6px; background: none; border: 0; accent-color: var(--c); }

/* Draw it */
.sketch { display: block; width: 100%; height: min(58dvh, 440px); margin: 10px 0; border-radius: 22px; background: #0f0b1f; border: 1px solid var(--line); touch-action: none; }

/* Brain teasers, 20 questions, number hunt */
.card.logic { min-height: 0; }
.card.logic p { font-size: 19px; }
.card.answer { --c: #16a34a; min-height: 0; margin-top: 12px; padding: 40px 18px 20px; }
.card.answer p { font-size: 17px; font-weight: 500; }
.countdown.twenty { font-size: 88px; }
.entry { display: flex; justify-content: center; gap: 10px; margin: 8px 0 14px; }
.entry span { width: 54px; height: 64px; border-radius: 14px; background: #ffffff14; box-shadow: inset 0 0 0 2px #ffffff30; display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keypad .key { padding: 14px 0; border-radius: 14px; background: #ffffff17; font-size: 24px; font-weight: 700; }
.keypad .key:disabled { opacity: .3; }
.keypad .key:last-child { grid-column: span 2; }
.tries { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.tries li { display: flex; align-items: center; gap: 12px; background: #ffffff10; border-radius: 12px; padding: 8px 12px; }
.tries .n { color: var(--muted); font-size: 13px; min-width: 18px; }
.tries .num { font-size: 22px; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.tries .clue { display: flex; gap: 8px; font-size: 18px; }
.tries .plus { color: var(--good); }
.tries .minus { color: #fbbf24; }
.tries small { margin-left: auto; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.play > .link { display: block; margin: 10px auto 0; }
