/* Stash: a party game for the TV, plus a phone controller.
   Look "Grape": purple full-bleed background with soft rays, white rounded
   cards with a deep-purple drop shade, mint buttons and highlights,
   red team vs navy team, and lots of small motion. */
:root {
  --bg: #6A2BD9; --card: #F3EDFF; --sand: #E2D5FF; --ink: #1C1240; --muted: #6B6390; --line: rgba(28, 18, 64, .14);
  --edge: rgba(28, 18, 64, .12); --shade: #3E1694; --mint: #4CF2B5; --mint-shade: #1E9C70; --on-bg: #fff; --on-bg-soft: rgba(255, 255, 255, .82);
  --red: #FF7A1A; --red-soft: #FFE6D3; --red-seg: #FFC08F;
  --blue: #1C1240; --blue-soft: #E2D5FF; --blue-seg: #8B7BC0;
  --gold: #4CF2B5; --right: #4CF2B5; --wrong: #E8364A; --night: #1C1240;
  --f-body: "Alexandria", "Noto Sans Arabic", system-ui, sans-serif;
  --f-ar-logo: "Lalezar", "Alexandria", sans-serif;
  --f-en-logo: "Bagel Fat One", "Alexandria", sans-serif;
  --bw: 3px; --sh: 5px; --r: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
input, textarea { -webkit-user-select: text; user-select: text; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; } /* no double-tap zoom (Shaimaa 2026-11-23) */
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
#app { height: 100dvh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
b { font-weight: 800; }
svg.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.15em; }

/* Teams: 0 = red, 1 = blue */
.t0 { --tc: var(--red); --tsoft: var(--red-soft); --tseg: var(--red-seg); }
.t1 { --tc: var(--blue); --tsoft: var(--blue-soft); --tseg: var(--blue-seg); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; line-height: 1; padding-top: .12em; }
.logo-tile { display: inline-flex; align-items: center; gap: .2em; font-family: "Rubik", var(--f-body); font-weight: 900; font-size: .78em; line-height: 1.25; color: #fff; background: var(--ink); border-radius: .32em; padding: .06em .3em .12em; box-shadow: .07em .07em 0 var(--gold); white-space: nowrap; }
.logo-tile svg { width: .62em; height: .62em; flex: none; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; color: var(--ink); background: var(--card); border: var(--bw) solid var(--edge);
  border-radius: 16px; padding: .7em 1.2em; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--shade);
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shade); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: 0 4px 0 var(--shade); }
.btn.primary { background: var(--red); color: #fff; }
.btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; box-shadow: none; border-width: 2px; }
.btn.ghost:active { transform: scale(.97); }
.btn.dashed { background: transparent; box-shadow: none; border: 2px dashed var(--muted); color: var(--muted); }
.btn.big { font-size: 1.2rem; padding: .85em 1.6em; border-radius: 18px; }
.btn.sm { font-size: .92rem; padding: .5em .9em; border-radius: 12px; box-shadow: 0 3px 0 var(--shade); }
.btn.xs { font-size: .85rem; padding: .3em .7em; border-radius: 10px; box-shadow: none; border-width: 2px; }
.btn.right { background: var(--right); color: #0B2A1A; }
.btn.wrong { background: var(--card); color: var(--red); }
.btn.team, .btn.award { background: var(--tc); color: #fff; }
.btn.award:not(.pref) { background: var(--card); color: var(--tc); }

/* ---------- toast, sheets, layers ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet-wrap { position: fixed; inset: 0; background: rgba(20, 33, 61, .45); display: grid; place-items: end center; z-index: 40; }
.sheet { background: var(--bg); border: var(--bw) solid var(--edge); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); width: min(520px, 100%); display: grid; gap: 10px; }
.layer { position: fixed; inset: 0; background: var(--bg); z-index: 30; overflow: auto; padding: 16px; }

/* Sadu bands on the sides of big screens */
.sadu { position: fixed; top: 92px; bottom: 28px; width: 30px; border-radius: 4px; z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='60'%3E%3Crect width='30' height='60' fill='%23FFF8EE'/%3E%3Crect width='2.5' height='60' fill='%2314213D'/%3E%3Crect x='27.5' width='2.5' height='60' fill='%2314213D'/%3E%3Cpath d='M2.5 0L8 7.5L2.5 15L8 22.5L2.5 30L8 37.5L2.5 45L8 52.5L2.5 60Z' fill='%23C8323C'/%3E%3Cpath d='M27.5 0L22 7.5L27.5 15L22 22.5L27.5 30L22 37.5L27.5 45L22 52.5L27.5 60Z' fill='%23C8323C'/%3E%3Cpath d='M15 6L22 18L15 30L8 18Z' fill='%2314213D'/%3E%3Cpath d='M15 11L19 18L15 25L11 18Z' fill='%23FFF8EE'/%3E%3Cpath d='M15 15L17 18L15 21L13 18Z' fill='%23C8323C'/%3E%3Cpath d='M10 36L20 54M20 36L10 54' stroke='%2314213D' stroke-width='3'/%3E%3Cpath d='M15 39L18 45L15 51L12 45Z' fill='%23C8323C'/%3E%3C/svg%3E") repeat-y; }
.sadu.r { right: 10px; } .sadu.l { left: 10px; }
.home .sadu, .lobby .sadu { top: 24px; bottom: 24px; }
@media (max-width: 760px), (max-height: 480px) { .sadu { display: none; } }

/* ---------- home ---------- */
.home { height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: safe center; justify-items: center; gap: 26px; padding: 24px 56px; text-align: center; }
.home-hero { display: grid; justify-items: center; gap: 6px; }
.home-hero .logo { font-size: clamp(4.5rem, 10vw, 7.5rem); margin-bottom: .1em; }
.tag { font-size: clamp(1.1rem, 2.4vw, 1.4rem); margin: 0; font-weight: 700; }
.home-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; width: min(420px, 100%); }
.home-actions .btn.primary { width: 100%; }
.join { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.join input, .p-join input, .ed-word input, .team-name {
  flex: 1; font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink); background: var(--card); border: var(--bw) solid var(--edge); border-radius: 14px; padding: .7em 1em; min-width: 0;
}
.join input { text-align: center; letter-spacing: .3em; text-transform: uppercase; }
.join input:placeholder-shown { letter-spacing: normal; }
.join input::placeholder { letter-spacing: normal; text-transform: none; }
.join input:focus, .p-join input:focus, .ed-word input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; width: min(820px, 100%); }
.mode { position: relative; display: grid; gap: 6px; text-align: start; padding: 22px 18px 18px; border-radius: var(--r); border: var(--bw) solid var(--edge); box-shadow: 0 var(--sh) 0 var(--shade); color: #fff; transition: transform .15s; }
.mode:nth-child(1) { transform: rotate(-1.2deg); }
.mode:nth-child(2) { transform: rotate(1.2deg); }
.m-look { background: var(--blue); }
.m-spot { background: radial-gradient(circle at 75% 30%, #3a4f7a 0 18%, var(--night) 46%); }
.mode b { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 900; line-height: 1.1; }
.mode span:last-child { font-size: .98rem; font-weight: 600; opacity: .92; line-height: 1.6; }
.mode-ic { position: absolute; top: -18px; inset-inline-end: 16px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); border: var(--bw) solid var(--edge); box-shadow: 0 3px 0 var(--shade); }
.mode-ic .ic { width: 24px; height: 24px; }
.rule { margin: 0; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-weight: 700; background: var(--card); border: 2px solid var(--edge); border-radius: 999px; padding: .5em 1.1em; }
.rule .ic { color: var(--red); width: 22px; height: 22px; }
@media (max-width: 760px) {
  .home { padding: 18px 16px; gap: 18px; align-content: start; }
  .home-hero .logo { font-size: clamp(4rem, 22vw, 6rem); }
  .modes { grid-template-columns: 1fr; gap: 22px; margin-top: 8px; }
  .rule { border-radius: 16px; }
}


/* ---------- lobby ---------- */
.screen-root { height: 100%; position: relative; }
.lobby { height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(16px, 4vw, 48px); align-items: center; padding: clamp(16px, 4vw, 48px) clamp(16px, 6vw, 72px); max-width: 1240px; margin: 0 auto; position: relative; z-index: 1; }
.lobby-join { display: grid; justify-items: center; text-align: center; gap: 8px; background: var(--card); border: var(--bw) solid var(--edge); box-shadow: 0 8px 0 var(--shade); border-radius: 26px; padding: 22px; }
.lobby-join .logo { font-size: 3.4rem; margin-bottom: 4px; }
.qr { background: #fff; border: var(--bw) solid var(--edge); border-radius: 18px; padding: 8px; width: min(260px, 60vw); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.small { width: 150px; }
.lobby-code { display: flex; gap: 10px; align-items: baseline; }
.lobby-code b { font-size: 2.8rem; letter-spacing: .14em; font-weight: 900; }
.net-line { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #B5BBC6; display: inline-block; flex: none; }
.dot.on { background: var(--right); box-shadow: 0 0 0 4px rgba(91, 191, 138, .25); }
.lobby-teams { display: grid; gap: 16px; }
.team-card { background: var(--tc); border: var(--bw) solid var(--edge); box-shadow: 0 var(--sh) 0 var(--shade); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; color: #fff; }
.team-label { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; color: rgba(255, 248, 238, .85); }
.team-name { font-weight: 900; font-size: 1.3rem; background: #fff; color: var(--ink); border: 2px solid var(--edge); padding: .35em .6em; border-radius: 12px; }
.team-name:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.chip { background: #fff; color: var(--ink); border-radius: 999px; padding: .2em .8em; font-size: .92rem; font-weight: 700; }
.chip.off { opacity: .5; }
.chips .muted { color: rgba(255, 248, 238, .8); }
.lobby-photos { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); flex-wrap: wrap; font-weight: 600; }
@media (max-width: 760px) { .lobby { grid-template-columns: 1fr; align-content: start; } .qr { width: min(200px, 55vw); } }

/* ---------- game layout ---------- */
.game { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; position: relative; }
.game-top { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) clamp(10px, 4.4vw, 56px) 6px; position: relative; z-index: 1; }
#board { flex: 1; min-width: 0; }
.game-meta { display: flex; gap: 6px; align-items: center; }
.code-chip { font-weight: 900; letter-spacing: .14em; background: var(--card); border: 2px solid var(--edge); border-radius: 10px; padding: .2em .6em; font-size: .9rem; }
.q-badge { background: var(--gold); border: 2px solid var(--edge); border-radius: 10px; padding: .2em .6em; font-size: .9rem; font-weight: 800; }
.stage { position: relative; min-height: 0; overflow: hidden; margin: 6px clamp(8px, 4.4vw, 56px) 0; z-index: 1; }
.stage-center { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; }
.controls { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); min-height: 84px; position: relative; z-index: 1; }
.controls .judge-line { flex-basis: 100%; text-align: center; font-weight: 700; }

/* scoreboard: two team pills with 10 segments, logo in the middle */
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(8px, 2vw, 24px); }
.board-logo { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
.pill { display: flex; align-items: center; gap: clamp(6px, 1vw, 12px); min-width: 0; height: clamp(48px, 7vh, 60px); padding-inline: 6px 14px; border-radius: 999px; background: var(--tc); color: #fff; border: var(--bw) solid var(--edge); box-shadow: 0 4px 0 var(--shade); transition: transform .2s; }
.pill.t0 { justify-self: start; }
.pill.t1 { justify-self: end; }
.pill.hot { transform: scale(1.04); }
.pill-score { flex: none; width: clamp(36px, 5.5vh, 46px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--tc); border: 2px solid var(--edge); font-weight: 900; font-size: clamp(1.1rem, 2.6vh, 1.6rem); }
.pill-name { font-weight: 800; font-size: clamp(.95rem, 1.6vw, 1.2rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.segs { display: flex; gap: 3px; direction: ltr; flex: none; }
.pill.t0 .segs { direction: rtl; }
.seg { width: clamp(7px, .95vw, 12px); height: clamp(16px, 2.6vh, 22px); border-radius: 4px; border: 2px solid var(--edge); background: rgba(20, 33, 61, .35); }
.seg.full { background: var(--tseg); }
.seg.pour { animation: segpop .5s ease; }
@keyframes segpop { 40% { transform: scaleY(1.35); } }
@media (max-width: 760px) {
  .game-top { flex-wrap: wrap; padding-inline: 10px; }
  .game-meta { order: -1; width: 100%; justify-content: flex-end; }
  #board { flex-basis: 100%; }
  .board { grid-template-columns: 1fr 1fr; }
  .board-logo { display: none; }
  .pill { height: 46px; padding-inline: 4px 10px; gap: 6px; }
  .pill.t0, .pill.t1 { justify-self: stretch; }
  .segs { display: none; }
  .stage { margin-inline: 8px; }
}

/* cards & frames */
.card { background: var(--card); border: var(--bw) solid var(--edge); box-shadow: 0 var(--sh) 0 var(--shade); border-radius: 24px; }
.kicker { align-self: flex-start; justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: .3em .9em; border-radius: 999px; background: var(--red); color: #fff; border: 2px solid var(--edge); font-weight: 800; font-size: clamp(.9rem, 1.6vw, 1.05rem); }
.kicker.blue { background: var(--blue); }
.kicker.gold { background: var(--gold); color: var(--ink); }
/* A 16:9 picture frame that always fits its box completely (never cropped). */
.fit { position: absolute; inset: 0; container-type: size; display: grid; place-items: center; }
.frame { position: relative; width: min(100cqw, calc(100cqh * var(--ar, 1.7778))); aspect-ratio: var(--ar, 1.7778); border: var(--bw) solid var(--edge); border-radius: 22px; overflow: hidden; background: var(--night); box-shadow: 0 7px 0 var(--shade); }
.frame > img { width: 100%; height: 100%; display: block; object-fit: contain; }
.frame .tag-chip { position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; gap: 6px; align-items: center; padding: .25em .8em; border-radius: 999px; background: var(--card); border: 2px solid var(--edge); font-weight: 700; font-size: .9rem; }
.show-in { animation: appear .25s ease; }
@keyframes appear { from { opacity: 0; transform: scale(.98); } }

/* intro / countdown */
.intro { text-align: center; display: grid; gap: 12px; justify-items: center; padding: clamp(20px, 4vw, 40px) clamp(24px, 6vw, 64px); }
.intro .kicker { justify-self: center; font-size: clamp(1rem, 2vw, 1.3rem); }
.intro-title { font-size: clamp(1.6rem, 4.6vw, 3.2rem); font-weight: 900; line-height: 1.5; }
.intro > .muted { font-size: clamp(1.05rem, 2.1vw, 1.5rem); color: var(--ink); font-weight: 700; margin-top: .2em; }
.count { width: clamp(90px, 16vh, 140px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--gold); border: var(--bw) solid var(--edge); box-shadow: 0 6px 0 var(--shade); font-size: clamp(3rem, 10vh, 5.4rem); font-weight: 900; line-height: 1; }
.count.tick { animation: pop .65s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pop { 0% { transform: scale(.6); opacity: .2; } 35% { transform: scale(1.12); opacity: 1; } 60%, 100% { transform: scale(1); } }

/* One Look: timer ring on the scene */
.ring { position: absolute; top: 10px; inset-inline-end: 10px; width: clamp(44px, 6vw, 70px); height: auto; transform: rotate(-90deg); }
.ring circle { fill: rgba(255, 248, 238, .9); stroke: var(--red); stroke-width: 5; stroke-dasharray: 120; stroke-dashoffset: 0; animation: ring linear forwards; }
@keyframes ring { to { stroke-dashoffset: 120; } }

/* question */
.question { text-align: center; display: grid; gap: 18px; justify-items: center; max-width: 1000px; width: 100%; padding: clamp(22px, 4vw, 44px); }
.question .kicker { justify-self: center; }
.q-text { font-size: clamp(1.8rem, 5.4vw, 3.8rem); font-weight: 900; line-height: 1.8; margin-bottom: .2em; animation: appear .3s ease; }
.q-hint { max-width: 600px; font-weight: 600; margin: 0; }
.banner[hidden] { display: none; }
.banner { display: inline-flex; align-items: center; gap: .4em; font-size: clamp(1.2rem, 3vw, 1.9rem); font-weight: 800; background: var(--tc); color: #fff; padding: .35em 1em; border-radius: 16px; border: var(--bw) solid var(--edge); box-shadow: 0 4px 0 var(--shade); animation: pop2 .35s ease; }
@keyframes pop2 { from { transform: scale(.7); opacity: 0; } }
.frame .banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); white-space: nowrap; animation: none; z-index: 2; }

/* reveal: picture + answer side card */
.reveal { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 26vw, 360px); gap: clamp(12px, 2vw, 22px); }
.reveal .pic { position: relative; min-height: 0; }
.reveal .side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 18px; align-self: center; max-height: 100%; overflow: auto; }
.reveal .side .kicker, .reveal .side .answer-chip { align-self: center; }
.reveal .side .who-line { align-self: stretch; justify-content: center; }
.reveal .side .q-small { font-weight: 800; font-size: clamp(1.05rem, 1.8vw, 1.4rem); line-height: 1.45; }
.answer-chip { align-self: flex-start; padding: .25em .7em; background: var(--gold); border: var(--bw) solid var(--edge); border-radius: 16px; box-shadow: 0 5px 0 var(--shade); font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.35; transform: rotate(-3deg); animation: stamp .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes stamp { 0% { transform: rotate(-3deg) scale(1.5); opacity: 0; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
.who-line { display: flex; align-items: center; gap: 8px; padding: .6em .8em; border-radius: 14px; background: var(--tsoft, var(--sand)); border: 2px solid var(--tc, var(--ink)); font-weight: 700; font-size: .95rem; }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.marks circle { fill: none; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw .8s ease forwards; animation-delay: var(--d); }
.marks .o { stroke: var(--ink); stroke-width: 16; }
.marks .i { stroke: var(--gold); stroke-width: 8; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (max-aspect-ratio: 4/3) {
  .reveal { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .reveal .side { align-self: stretch; padding: 12px 14px; gap: 8px; }
  .answer-chip { font-size: 1.6rem; }
}
/* phone held sideways: short screen, so tighten everything */
@media (max-height: 480px) {
  .game-top { flex-wrap: nowrap; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 2px; }
  .game-meta { order: 0; width: auto; }
  #board { flex: 1; flex-basis: auto; }
  .board { grid-template-columns: 1fr 1fr; }
  .board-logo { display: none; }
  .pill { height: 38px; }
  .segs { display: none; }
  .stage { margin-top: 4px; }
  .controls { min-height: 0; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .btn.stop { padding: .4em 1em; font-size: 1rem; }
  .question { padding: 12px 18px; gap: 8px; }
  .q-text { font-size: clamp(1.15rem, 7vh, 2rem); }
  .q-hint { display: none; }
  .reveal .side { padding: 10px 12px; gap: 8px; }
  .reveal .side .q-small { font-size: 1rem; }
  .answer-chip { font-size: 1.4rem; }
}

/* team stop buttons on the screen */
.btn.stop { flex: 1; max-width: 380px; font-size: clamp(1.05rem, 2.4vw, 1.45rem); padding: .7em 1em; background: var(--tc); color: #fff; }

/* Spotlight (كشّاف) */
.spot { position: absolute; inset: 0; }
.spot .frame { width: 100%; height: 100%; aspect-ratio: auto; }
.spot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pts { position: absolute; bottom: 12px; inset-inline-start: 12px; display: flex; gap: 6px; align-items: center; background: var(--card); padding: 6px 8px; border-radius: 16px; border: 2px solid var(--edge); }
.pts .lbl { font-weight: 800; font-size: .85rem; padding-inline: 4px; }
.pts span[data-p] { width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--edge); color: rgba(20, 33, 61, .35); font-weight: 900; background: var(--card); }
.pts span.on { background: var(--gold); color: var(--ink); box-shadow: 0 2px 0 var(--shade); }
.pts i { position: absolute; left: 10px; right: 10px; bottom: -6px; height: 4px; background: var(--gold); border-radius: 3px; transform-origin: right; }

.wait { display: flex; gap: 24px; align-items: center; max-width: 780px; padding: 24px; }
.end { text-align: center; display: grid; gap: 14px; justify-items: center; padding: clamp(24px, 5vw, 48px) clamp(32px, 8vw, 96px); }
.end .kicker { justify-self: center; }
.end-title { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 900; line-height: 1.15; color: var(--tc, var(--ink)); }
.end-score { font-size: 1.4rem; font-weight: 800; }

/* ---------- phone controller ---------- */
.player { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(22px + env(safe-area-inset-top)) 16px 8px; }
.p-head .logo { font-size: 2rem; }
.p-scores { display: flex; gap: 8px; }
.p-scores span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--tc); color: #fff; border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--shade); font-weight: 900; font-size: 1.3rem; }
.p-me { margin: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: .55em .6em .55em 1em; border-radius: 16px; background: var(--tc); color: #fff; border: var(--bw) solid var(--edge); box-shadow: 0 4px 0 var(--shade); }
.p-me .btn { background: #fff; color: var(--ink); }
.p-main { display: grid; align-content: center; justify-items: center; gap: 22px; padding: 16px; overflow: auto; }
.p-foot { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); font-weight: 600; }
.p-phase { text-align: center; }
.p-phase .muted { font-weight: 700; font-size: .9rem; }
.p-phase b { display: block; font-size: 1.5rem; font-weight: 900; }
.p-stop {
  width: min(66vw, 270px); aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--edge); font: inherit; font-weight: 900; font-size: 1.7rem;
  color: var(--muted); background: var(--sand); box-shadow: 0 8px 0 var(--shade); transition: transform .08s, box-shadow .08s, background .2s; touch-action: manipulation;
}
.p-stop.live { background: var(--red); color: #fff; font-size: 3rem; animation: throb 1s ease-in-out infinite; }
.p-stop.live.pressed, .p-stop.live:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--shade); }
.p-stop.mine { background: var(--right); color: #0B2A1A; }
.p-stop.theirs { background: var(--sand); color: var(--ink); }
.p-stop.look { background: var(--gold); color: var(--ink); font-size: 1.6rem; }
@keyframes throb { 50% { box-shadow: 0 8px 0 var(--shade), 0 0 0 14px rgba(200, 50, 60, .15); } }
.p-photo { display: flex; align-items: center; gap: 12px; padding: 12px; width: min(100%, 420px); text-align: start; }
.p-photo .ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold); border: 2px solid var(--edge); }
.p-photo .txt { flex: 1; display: grid; gap: 2px; min-width: 0; }
.p-photo .txt b { font-size: 1rem; }
.p-photo .txt span { font-size: .8rem; color: var(--muted); }
.p-photo-btns { display: flex; gap: 6px; }
.p-hint { background: var(--gold); border: 2px solid var(--edge); border-radius: 14px; padding: .6em 1em; text-align: center; font-weight: 700; animation: pop2 .3s ease; }
.p-wait { display: grid; justify-items: center; gap: 12px; text-align: center; font-weight: 600; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--red); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-join { display: grid; gap: 14px; justify-items: stretch; align-content: center; padding: 24px 20px; height: 100%; width: min(420px, 100%); margin: 0 auto; text-align: center; overflow: auto; }
.p-join .logo { justify-self: center; font-size: 4rem; }
.p-join label { display: grid; gap: 6px; text-align: start; font-weight: 700; }
.p-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.p-teams .btn { padding: 1.1em .6em; font-size: 1.15rem; }
.p-judge { display: grid; gap: 16px; justify-items: center; text-align: center; width: 100%; }
.p-word { font-size: 1.2rem; font-weight: 700; } .p-word b { display: inline-block; margin-top: 6px; padding: .1em .6em; background: var(--gold); border: 2px solid var(--edge); border-radius: 12px; font-size: 1.6rem; }
.p-judge-q { font-size: 1.3rem; font-weight: 800; }
.p-judge-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.p-judge-btns .btn { padding: 1.2em; font-size: 1.4rem; }

/* ---------- photo editor ---------- */
.editor { display: grid; gap: 12px; width: min(560px, 100%); margin: 0 auto; padding-bottom: 24px; }
.ed-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; text-align: center; padding: 8px 0; font-size: 1.1rem; }
.ed-tip { margin: 0; text-align: center; background: var(--card); border: 2px solid var(--edge); border-radius: 14px; padding: .7em 1em; font-weight: 600; }
.ed-photo { display: grid; place-items: center; }
.ed-photo canvas { border-radius: 14px; border: var(--bw) solid var(--edge); touch-action: manipulation; cursor: crosshair; }
.ed-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-previews figure { margin: 0; display: grid; gap: 6px; }
.ed-previews canvas, .ed-previews img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--night); border-radius: 12px; border: 2px solid var(--edge); }
.ed-previews figcaption { font-size: .85rem; color: var(--muted); text-align: center; font-weight: 600; }
.ed-word { display: grid; gap: 6px; font-weight: 700; }

/* icon buttons, sheets */
.btn.icon-btn { padding: .35em .5em; display: inline-grid; place-items: center; }
.btn.icon-btn .ic { width: 20px; height: 20px; }
.sheet { position: relative; }
.sheet-x { position: absolute; top: 10px; inset-inline-end: 10px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.sheet-x .ic { width: 18px; height: 18px; }
.sheet-q { font-size: 1.3rem; font-weight: 900; text-align: center; padding: 6px 40px 4px; }

/* lobby: host and game length */
.chip { border: 0; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chip.host { background: var(--gold); color: var(--ink); }
.chip .ic, .host-line .ic { width: 16px; height: 16px; vertical-align: -3px; }
.host-line { margin: 0; }
.len { display: grid; gap: 8px; justify-items: center; }
.len-lbl { font-weight: 800; }
.len-opts { display: flex; gap: 8px; }
.len-opts .btn { display: grid; gap: 0; line-height: 1.2; padding: .45em 1em; background: var(--card); }
.len-opts .btn small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.len-opts .btn.on { background: var(--ink); color: #fff; }
.len-opts .btn.on small { color: #fff; opacity: .8; }

/* celebration when a team scores */
.cele { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--tc) 55%, transparent) 0, color-mix(in srgb, var(--tc) 25%, transparent) 45%, transparent 75%); animation: celeIn .25s ease both; }
.cele.out { animation: celeOut .45s ease forwards; }
@keyframes celeIn { from { opacity: 0; } }
@keyframes celeOut { to { opacity: 0; } }
.cele-card { display: grid; justify-items: center; gap: 4px; padding: 18px 44px 22px; background: var(--tc); color: #fff; border: 4px solid var(--edge); border-radius: 28px; box-shadow: 0 8px 0 var(--shade); animation: celePop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes celePop { 0% { transform: scale(.2) rotate(-12deg); } 100% { transform: scale(1) rotate(-3deg); } }
.cele-pts { direction: ltr; font-family: 'Bagel Fat One', 'Alexandria', sans-serif; font-size: clamp(5rem, 16vw, 11rem); line-height: 1; color: var(--gold); -webkit-text-stroke: 3px var(--ink); text-shadow: 0 5px 0 var(--shade); }
.cele-team { font-size: clamp(2rem, 6vw, 4rem); font-weight: 900; line-height: 1.1; }
.cele-who { font-size: clamp(1.1rem, 2.6vw, 1.6rem); font-weight: 700; opacity: .95; }
.cele.small .cele-pts { font-size: 5.5rem; }
.cele.small .cele-team { font-size: 2rem; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 12px; height: 18px; background: var(--c); border: 2px solid var(--edge); border-radius: 3px; animation: fall var(--t) cubic-bezier(.3, .6, .5, 1) var(--d) both; }
.confetti.rain i { animation-iteration-count: infinite; animation-timing-function: linear; animation-duration: calc(var(--t) * 2); animation-delay: calc(var(--d) * 6); }
@keyframes fall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) rotate(var(--r)); } }

/* winner */
.end-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 0; pointer-events: none; }
.end-wrap.t0, .end-wrap.t1 { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tc) 35%, transparent), transparent 70%); }
.end-wrap .end { pointer-events: auto; position: relative; z-index: 1; }
.end-trophy { width: clamp(110px, 16vw, 170px); filter: drop-shadow(5px 6px 0 #14213D); animation: trophy 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.end-trophy svg { display: block; width: 100%; height: auto; }
@keyframes trophy { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
.end-sub { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 800; }
.end-score { font-family: 'Bagel Fat One', 'Alexandria', sans-serif; font-size: clamp(2rem, 5vw, 3.2rem); }
.end-score .t0 { color: var(--red); } .end-score .t1 { color: var(--blue); }
.end-star { font-size: 1.1rem; padding: .4em 1em; background: var(--sand); border: 2px solid var(--edge); border-radius: 999px; }

/* phone: the host's remote */
.p-ctl { width: min(100%, 420px); display: grid; gap: 10px; padding: 12px; border: var(--bw) dashed var(--ink); border-radius: 18px; background: var(--card); }
.p-ctl-head { display: flex; align-items: center; gap: 6px; justify-content: center; }
.p-ctl-head .ic { width: 18px; height: 18px; color: var(--gold); }
.p-ctl-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.p-ctl-btns .btn { flex: 1 1 40%; }
.p-ctl-btns .btn.award { background: var(--tc); color: #fff; }
.p-skip { justify-self: center; }
.p-head .icon-btn { margin-inline-start: 4px; }

.pts-rule { font-weight: 700; background: var(--sand); border: 2px solid var(--edge); border-radius: 999px; padding: .3em 1em; }
.pts-drop { position: absolute; bottom: 66px; inset-inline-start: 12px; transform-origin: bottom right; z-index: 3; font-size: clamp(1.3rem, 3vw, 2.2rem); font-weight: 900; color: #fff; background: var(--red); border: var(--bw) solid var(--edge); box-shadow: 0 6px 0 var(--shade); border-radius: 22px; padding: .15em .7em; opacity: 0; pointer-events: none; white-space: nowrap; }
.pts-drop.go { animation: ptsDrop 1.3s ease both; }
@keyframes ptsDrop { 0% { opacity: 0; transform: scale(1.5); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px) scale(.95); } }
.count { width: clamp(130px, 24vh, 220px) !important; font-size: clamp(4.5rem, 15vh, 8rem) !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.p-main.has-ctl { align-content: start; gap: 14px; }
.has-ctl .p-stop { width: min(52vw, 210px); }
.has-ctl .p-photo, .has-ctl .p-hint { order: 5; }
/* «شنو تغيّر؟» question over the edited scene */
.chg-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; justify-items: center; }
.chg-pic { position: relative; width: 100%; min-height: 0; }
.change-q { white-space: nowrap; font-size: clamp(1.2rem, 3vw, 2.2rem); font-weight: 900; background: var(--red); color: #fff; border: var(--bw) solid var(--edge); box-shadow: 0 5px 0 var(--shade); border-radius: 18px; padding: .2em .9em; animation: pop2 .35s ease; }

/* ---------- phones: polish ---------- */
.home > * { max-width: 100%; }
.btn.stop b { font-weight: 900; }
.p-stop.live { font-size: min(3rem, 14vw); }
.has-ctl .p-stop.live { font-size: min(2.6rem, 11vw); }
@media (max-width: 760px) {
  /* One phone as the screen: two big, equal «ستوب» buttons side by side,
     everything else on its own row underneath. */
  .controls:has(.btn.stop) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .controls:has(.btn.stop) > :not(.btn.stop) { grid-column: 1 / -1; order: 2; justify-self: center; }
  .btn.stop { max-width: none; min-height: 104px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: .5em .4em; border-radius: 22px; line-height: 1.15; }
  .btn.stop .ic { width: 26px; height: 26px; }
  .btn.stop b { font-size: 1.9rem; }
  .btn.stop .stop-team { font-size: .9rem; font-weight: 700; opacity: .92; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn.stop:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--shade); }
  .stage-center { overflow: auto; }
  .change-q { white-space: normal; text-align: center; max-width: calc(100% - 8px); font-size: 1.25rem; }
}
@media (max-width: 420px) {
  .q-text { font-size: 1.6rem; }
  .question { padding: 16px 14px; gap: 10px; }
  .q-hint { font-size: .88rem; }
  .intro-title { font-size: 1.5rem; }
  .reveal { grid-template-rows: minmax(150px, 1fr) auto; gap: 10px; }
  .reveal .side { padding: 10px 12px; gap: 6px; }
  .reveal .side .q-small { font-size: .95rem; }
  .answer-chip { font-size: 1.4rem; }
  .pill { font-size: .9rem; }
  .lobby { padding: 12px; }
  .lobby-join, .lobby-teams > * { max-width: 100%; }
}
/* phone held sideways: stop buttons stay big but short */
@media (max-height: 480px) {
  .controls:has(.btn.stop) { display: flex; }
  .btn.stop { min-height: 0; flex-direction: row; font-size: 1.1rem; padding: .45em 1em; }
  .btn.stop b { font-size: 1.3rem; }
}
@media (max-width: 760px) {
  .btn.stop b { line-height: 1.25; }
  .btn.stop .stop-team { line-height: 1.3; margin-top: 2px; }
  /* «منو يابها؟»: the three choices on one row */
  .controls:has(.btn.award) { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .controls:has(.btn.award) .judge-line { grid-column: 1 / -1; }
  .controls .btn.award, .controls .btn.dashed { padding: .7em .5em; font-size: 1rem; min-width: 0; }
}
@media (max-width: 420px) {
  .reveal .side .kicker { display: none; }
  .reveal .side { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .reveal .side .q-small { flex-basis: 100%; }
}

/* phone score: a row of dots per team that fills up to the target */
.p-dots { margin: 0 16px 10px; display: grid; gap: 6px; }
.p-dots-row { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr); align-items: center; gap: 8px; }
.p-dots-row > span { color: var(--tc); font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-dots-row > div { display: flex; gap: 5px; justify-content: flex-start; }
.p-dots-row i { flex: 0 1 22px; aspect-ratio: 1; max-width: 22px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); }
.p-dots-row i.f { background: var(--tc); }

/* فخّ on the phones */
.p-trap-msg, .p-trap-pick, .p-trap-run { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 8px 16px; }
.p-trap-msg b, .p-trap-pick > b, .p-trap-run > b { font-size: 1.5rem; }
.p-trap-msg { margin-top: 12vh; }
.p-trap-pick { justify-items: stretch; }
.p-trap-pick .kicker, .p-trap-pick > b, .p-trap-pick > .muted { justify-self: center; }
.p-trap-opt { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px; background: var(--card); border: var(--bw) solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--shade); font: inherit; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-align: start; cursor: pointer; }
.p-trap-opt img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 2px solid var(--edge); }
.p-trap-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shade); }
.p-trap-opt:disabled { opacity: .5; }
.p-trap-img { position: relative; width: 100%; aspect-ratio: var(--ar); border: var(--bw) solid var(--edge); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 0 var(--shade); touch-action: none; }
.p-trap-img img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.p-trap-img.miss img { filter: grayscale(1) brightness(.6); }
.p-trap-miss { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.6rem; }
.p-tap { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 2px var(--ink); pointer-events: none; animation: ptap 1.2s ease-out forwards; }
@keyframes ptap { to { transform: scale(1.8); opacity: 0; } }
.p-start { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink), 0 0 0 9999px rgba(15, 26, 51, .45); pointer-events: none; }
.p-ch-btns { display: flex; gap: 10px; justify-content: center; }
.p-ch-ans { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 16px; }
.p-ch-ans > b { font-size: 1.5rem; }
.p-ch-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.p-ch-grid .btn { min-height: 84px; font-size: 1.3rem; white-space: normal; }
.p-ch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-ch-grid .p-trap-opt { grid-template-columns: 1fr; gap: 6px; text-align: center; font-size: 1rem; }
.p-ch-grid .p-trap-opt img { width: 100%; }

/* Home: Arabic logo with the English «stash» under it */
.logo.stack { flex-direction: column; align-items: center; }
.logo-en { font-family: 'Bagel Fat One', sans-serif; color: var(--red); direction: ltr; display: flex; line-height: 1; margin-top: -.2em; margin-bottom: .12em; }
.logo-en span { display: inline-block; -webkit-text-stroke: .04em var(--bg); paint-order: stroke fill; }
.logo-en .a { color: var(--ink); transform: translateY(.06em) rotate(-8deg); }

/* Home: one picture tile per round */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: min(980px, 100%); }
.tile { display: grid; align-content: start; gap: 4px; text-align: start; padding: 8px 8px 12px; border-radius: 18px; border: var(--bw) solid var(--edge); box-shadow: 0 4px 0 var(--shade); color: #fff; }
.tile:nth-child(odd) { rotate: -2deg; }
.tile:nth-child(even) { rotate: 2deg; }
.tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 11px; border: 2px solid var(--edge); display: block; }
.tile b { font-size: 1.15rem; font-weight: 900; padding-inline: 4px; }
.tile span { font-size: .82rem; font-weight: 600; opacity: .92; line-height: 1.45; padding-inline: 4px; }
.tile { background: var(--card); }
.tile span { color: var(--muted); }
.tile .dark { position: relative; border-radius: 11px; overflow: hidden; border: 2px solid var(--edge); }
.tile .dark img { border: 0; border-radius: 0; }
.tile .dark.zoom::after { display: none; }
.tile .dark.zoom img { transform: scale(3.2); }
.tile .dark::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 52% 48%, transparent 0 16%, rgba(8, 12, 30, .96) 26%); }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; gap: 14px; } }

/* ---------- نظرة وحدة with phones ---------- */
.banner.ol-ans { flex-direction: column; gap: .35em; white-space: normal; }
.ol-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; }
.ol-chips i { font-style: normal; background: #fff; color: var(--ink); border: 2px solid var(--edge); border-radius: 12px; padding: .1em .7em; font-size: .85em; }
.ol-chips i.out { opacity: .5; text-decoration: line-through; }
.ol-left { font-family: 'Bagel Fat One', 'Alexandria', sans-serif; font-size: 1.4rem; min-width: 2.2em; text-align: center; background: var(--card); border: var(--bw) solid var(--edge); border-radius: 999px; padding: .1em .5em; }
.next-n { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 999px; background: #fff; color: var(--ink); font-size: .85em; margin-inline-start: .3em; }
.p-left { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; border-radius: 999px; background: var(--ink); color: #fff; font-size: .9em; }
.p-ch-grid .btn.out { text-decoration: line-through; }
.p-ch-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Awards ---------- */
.awards { display: grid; gap: 22px; justify-items: center; }
.awards .kicker { font-size: 1.4rem; }
.aw-list { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 28px); }
.aw { width: clamp(200px, 24vw, 280px); display: grid; gap: 6px; justify-items: center; text-align: center; padding: 22px 16px; border-color: var(--ink); background: var(--tsoft, var(--card));
  opacity: 0; transform: scale(.6) rotate(-4deg); animation: awIn .55s cubic-bezier(.2, 1.6, .4, 1) var(--d) forwards; }
.aw:nth-child(even) { --rot: 3deg; }
@keyframes awIn { to { opacity: 1; transform: scale(1) rotate(var(--rot, -2deg)); } }
.aw-ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); border: var(--bw) solid var(--edge); }
.aw-ic .ic { width: 34px; height: 34px; }
.aw-title { font-weight: 900; color: #B9771B; font-size: 1.3rem; }
.aw-name { font-weight: 900; font-size: clamp(1.6rem, 3.2vw, 2.3rem); color: var(--tc, var(--ink)); line-height: 1.2; }
.aw-sub { font-weight: 700; color: var(--muted); }
.end-aws { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.p-end { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 16px; margin-top: 6vh; }
.p-end > b { font-size: 1.9rem; }
.p-end-score { font-family: 'Bagel Fat One', 'Alexandria', sans-serif; font-size: 2.2rem; }
.p-end-score .t0 { color: var(--red); } .p-end-score .t1 { color: var(--blue); }
.p-aws { width: 100%; display: grid; gap: 8px; }
.p-aw { display: flex; justify-content: space-between; align-items: center; padding: .6em .9em; border-radius: 14px; background: var(--tsoft); border: 2px solid var(--edge); }
.p-aw span { font-weight: 800; color: #B9771B; }
.p-aw b { color: var(--tc); }
.awards .kicker { justify-self: center; }

/* Winner screen: stay inside the play area (never under the buttons) and
   shrink with the screen height, e.g. an iPad in Safari. */
.end-wrap { position: absolute; }
.end-wrap .end { gap: clamp(4px, 1.4vh, 14px); padding: clamp(12px, 3vh, 48px) clamp(28px, 7vw, 96px); max-height: 100%; }
.end-trophy { width: clamp(56px, 15vh, 170px); }
.end-title { font-size: clamp(1.8rem, min(8vw, 9vh), 5rem); }
.end-sub { font-size: clamp(1.1rem, min(3vw, 3.6vh), 2rem); }
.end-score { font-size: clamp(1.6rem, min(5vw, 6vh), 3.2rem); }

/* Winner screen, fun version: pop in, scores roll up, then the winner stamps in. */
.end.fun { animation: endIn .7s cubic-bezier(.2, 1.6, .4, 1) both; overflow: visible; }
@keyframes endIn { from { transform: scale(.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.end.fun .end-trophy { position: relative; }
.end.fun .end-trophy svg { position: relative; z-index: 1; }
.end-rays { position: absolute; left: 50%; top: 45%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(color-mix(in srgb, var(--tc, #E9A23B) 30%, transparent) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: rays 14s linear infinite; }
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.end.fun .end-score span { display: inline-block; min-width: 1ch; }
.end.fun .end-title, .end.fun .end-sub, .end.fun .end-aws, .end.fun .end-loser, .end.fun > .end-star { opacity: 0; }
.end.fun.done .end-title { animation: stamp .55s cubic-bezier(.2, 1.8, .4, 1) both; }
.end.fun.done .end-sub { animation: popUp .5s .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.end.fun.done .end-loser { animation: sticker .6s .9s cubic-bezier(.2, 1.8, .4, 1) both; }
.end.fun.done .end-aws, .end.fun.done > .end-star { opacity: 1; }
.end.fun .end-aws .end-star { opacity: 0; }
.end.fun.done .end-aws .end-star { animation: popUp .45s calc(.6s + var(--i) * .25s) cubic-bezier(.2, 1.6, .4, 1) both; }
.end.fun.done .end-score { animation: thump .4s ease-out; }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.6) rotate(-10deg); } 100% { opacity: 1; transform: scale(1) rotate(-2deg); } }
@keyframes popUp { from { opacity: 0; transform: translateY(14px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes thump { 50% { transform: scale(1.25); } }
@keyframes sticker { from { opacity: 0; transform: scale(2) rotate(14deg); } to { opacity: 1; transform: rotate(8deg); } }
.end-loser { position: absolute; top: -18px; left: -22px; z-index: 2; padding: .35em .9em; font-weight: 900; font-size: clamp(.9rem, 2.2vh, 1.15rem);
  background: var(--tsoft, #fff); color: var(--tc); border: 3px solid var(--edge); border-radius: 12px; box-shadow: 0 4px 0 var(--shade); transform: rotate(8deg); }
.end.fun .end-sub { color: var(--tc, var(--ink)); }
.end.fun .end-star { display: inline-flex; align-items: center; gap: .35em; background: var(--tsoft, var(--sand)); }
.end.fun .end-star svg { width: 1.1em; height: 1.1em; }
.confetti.burst i { top: 55%; animation: burst var(--t) cubic-bezier(.15, .7, .4, 1) calc(var(--d) * .3 + 1.3s) both; }
@keyframes burst { 0% { transform: translate(calc(50vw - var(--x)), 0) scale(.3); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(0, -40vh) rotate(var(--r)); opacity: 0; } }
.confetti.rain i { animation-delay: calc(var(--d) * 6 + 1.8s); }
/* Phones */
.p-end.win > b { font-size: 2.6rem; color: var(--tc); animation: stamp .6s cubic-bezier(.2, 1.8, .4, 1) both; }
.p-end.lose > b { animation: wobble 1.2s ease-in-out 2; }
@keyframes wobble { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.p-end .p-cheer { font-weight: 800; color: var(--tc, var(--ink)); }
.p-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.p-end { position: relative; z-index: 1; }
.end.fun .end-score { font-size: clamp(2.2rem, min(7vw, 8vh), 4.4rem); line-height: 1; }
.p-left.ch-left.warn, #olLeft.warn { background: var(--red); color: #fff; animation: thump .5s ease-in-out infinite; }
.ch-warn { display: block; padding: .5em .8em; border-radius: 12px; background: var(--red-soft); border: 2px solid var(--red); color: var(--red); font-weight: 800; font-size: .95rem; }
.ch-warn[hidden] { display: none; }

/* ================= Grape look ================= */
body { background: radial-gradient(120% 90% at 50% 40%, #7B3BEA 0%, var(--bg) 55%, #5A1FC4 100%) fixed; color: var(--on-bg); }
body::before { content: ""; position: fixed; left: 50%; top: 45%; width: 260vmax; height: 260vmax; margin: -130vmax 0 0 -130vmax; pointer-events: none; z-index: 0;
  background: repeating-conic-gradient(rgba(255, 255, 255, .06) 0 9deg, transparent 9deg 18deg); animation: g-spin 90s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 45%); mask-image: radial-gradient(circle, #000 10%, transparent 45%); }
#app { position: relative; z-index: 1; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.sadu { display: none !important; }
.muted { color: var(--on-bg-soft); }
/* Things that sit on white keep dark text */
.card, .btn, .sheet, .layer, .lobby-join, .rule, .tile, .chip, .code-chip, .ed-tip, .p-ctl, .p-trap-opt, .aw, .end-star, .pts-rule, .pts, .who-line, .p-me .btn, .len-opts .btn, .ol-left, .next-n, .ol-chips i, .question, .reveal, .answer-chip, .sheet-x, .toast { color: var(--ink); }
.card .muted, .lobby-join .muted, .sheet .muted, .layer .muted, .tile .muted, .p-ctl .muted, .aw .muted { color: var(--muted); }
.sheet, .layer { background: var(--card); }
.toast { background: var(--ink); color: #fff; }
/* Logo: dark grape tile, white word, mint lens and shadow */
.logo-tile { background: var(--ink); box-shadow: .07em .07em 0 var(--mint); }
.logo-tile svg { stroke: var(--mint); }
.home-hero .logo, .lobby-join .logo { animation: g-float 3.2s ease-in-out infinite; }
@keyframes g-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
/* Buttons */
.btn { border-color: transparent; border-radius: 999px; }
.btn.primary { background: var(--mint); color: var(--ink); box-shadow: 0 5px 0 var(--mint-shade); }
.btn.primary:active { box-shadow: 0 1px 0 var(--mint-shade); }
.btn.ghost { color: var(--on-bg); border-color: rgba(255, 255, 255, .7); }
.card .btn.ghost, .sheet .btn.ghost, .layer .btn.ghost, .lobby-join .btn.ghost, .p-ctl .btn.ghost, .p-photo .btn.ghost { color: var(--ink); border-color: var(--edge); }
.btn.dashed { color: var(--on-bg-soft); border-color: rgba(255, 255, 255, .6); }
.btn.right { color: var(--ink); }
.btn.stop, .btn.team { border: 3px solid #fff; animation: g-nudge 2.4s infinite; }
.btn.stop:nth-child(2) { animation-delay: 1.2s; }
@keyframes g-nudge { 0%, 80%, 100% { transform: none; } 86% { transform: translateY(-4px) scale(1.04); } 92% { transform: none; } }
/* Cards pop in */
.card, .tile, .team-card, .lobby-join { animation: g-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.tile:nth-child(1) { animation-delay: .05s; } .tile:nth-child(2) { animation-delay: .12s; } .tile:nth-child(3) { animation-delay: .19s; } .tile:nth-child(4) { animation-delay: .26s; }
@keyframes g-pop { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body::before, .home-hero .logo, .lobby-join .logo, .btn.stop, .btn.team, .card, .tile, .team-card, .lobby-join { animation: none !important; } }
/* Text that sits straight on the purple */
.net-line, .lobby-photos { color: var(--on-bg-soft); }
.lobby-join .net-line { color: var(--muted); }
.lobby-photos b { color: var(--mint); }
/* Picture frames: white edge, purple drop shade */
.frame { border: 4px solid #fff; }
/* Score bar: white pill edges, centred score number */
.pill { border: 3px solid #fff !important; }
.pill-score { font-family: "Rubik", var(--f-body); font-weight: 900; line-height: 1; padding-top: .08em; border: 0; }
.seg { border: 0; background: rgba(255, 255, 255, .28); }
.seg.full { background: #fff; }
/* Countdown: no card, number on top in a white circle with rays spinning behind it, text below */
.intro.card { background: none; border: 0; box-shadow: none; color: var(--on-bg); position: relative; isolation: isolate; animation: none; }
.intro .count { order: -1; position: relative; background: #fff; color: var(--ink); border: 0; box-shadow: 0 8px 0 var(--shade); font-family: "Rubik", var(--f-body); padding-top: .06em; margin-bottom: 6px; }
.intro .count.tick { animation: g-beat .65s ease-out both; }
.intro .count::before { content: ""; position: absolute; left: 50%; top: 50%; width: 260vmax; height: 260vmax; margin: -130vmax 0 0 -130vmax; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, .09) 0 10deg, transparent 10deg 20deg); animation: g-spin 18s linear infinite; pointer-events: none; }
.intro .kicker { background: var(--ink); color: var(--mint); border: 0; }
.intro-title { color: var(--mint); text-shadow: 0 4px 0 var(--ink); }
.intro > .muted { color: #fff; }
@keyframes g-beat { 0% { transform: scale(1.3); } 25% { transform: scale(.95); } 40%, 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .intro .count, .intro .count::before { animation: none !important; } }
.stage:has(.intro), .stage:has(.end) { overflow: visible; }
.game-top { position: relative; z-index: 3; }
.intro .count::before { width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax; }
.game, #app { overflow: clip; }
body:has(.intro .count)::before { opacity: 0; }
/* Points: big mint +N slams in over spinning rays, team name rises under it */
.cele { background: radial-gradient(circle, rgba(62, 22, 148, .88) 0, rgba(62, 22, 148, .7) 40%, rgba(62, 22, 148, .35) 75%); overflow: hidden; }
.cele::before { content: ""; position: absolute; left: 50%; top: 50%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax;
  background: repeating-conic-gradient(rgba(255, 255, 255, .1) 0 8deg, transparent 8deg 16deg); animation: g-spin 30s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 40%); mask-image: radial-gradient(circle, #000 8%, transparent 40%); }
.cele-card { position: relative; background: none; border: 0; box-shadow: none; padding: 0; animation: none; }
.cele-pts { font-family: "Rubik", var(--f-body); font-weight: 900; color: var(--mint); -webkit-text-stroke: 0; text-shadow: 0 .08em 0 var(--ink); animation: g-slam .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.cele-team { color: #fff; text-shadow: 0 4px 0 var(--ink); animation: g-rise .5s .25s both; }
.cele-who { color: #fff; animation: g-rise .5s .35s both; }
@keyframes g-slam { 0% { transform: scale(3) rotate(-12deg); opacity: 0; } 50% { transform: scale(.9) rotate(3deg); opacity: 1; } 75% { transform: scale(1.05); } 100% { transform: none; } }
@keyframes g-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cele::before, .cele-pts, .cele-team, .cele-who { animation: none !important; } }
/* Numbers: one font that sits centred in circles and tiles */
.end-score, .ol-left, .p-end-score, .p-scores span, .pill-score { font-family: "Rubik", var(--f-body); font-weight: 900; }
.stage .confetti { position: fixed; }
.end-wrap.t0, .end-wrap.t1 { background: none; }
.join input, .p-join input, .ed-word input, .team-name { background: #fff; }

/* ===== Grape polish: no leftover whites ===== */
/* Rays never clipped into a box, on any screen size */
.stage-center:has(.intro), .stage-center:has(.end) { overflow: visible; }
/* Secondary buttons: dark grape with white text */
.btn:not(.primary):not(.team):not(.stop):not(.award):not(.right):not(.ghost):not(.dashed):not(.wrong) { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #0E0826; }
.btn:not(.primary):not(.team):not(.stop):not(.award):not(.right):not(.ghost):not(.dashed):not(.wrong):active { box-shadow: 0 1px 0 #0E0826; }
.btn.xs:not(.primary) { box-shadow: none; }
.len-opts .btn.btn:not(.on) { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; border: 2px solid rgba(255, 255, 255, .35); }
.len-opts .btn:not(.on) small { color: rgba(255, 255, 255, .8); }
.len-opts .btn.btn.on { background: var(--mint) !important; color: var(--ink) !important; box-shadow: 0 4px 0 var(--mint-shade) !important; }
.len-opts .btn.on small { color: var(--ink); opacity: .75; }
.btn.wrong { background: var(--ink); color: #FF8A8A; }
.code-chip { background: var(--ink); color: #fff; border-color: transparent; }
/* Countdown circle: mint, dark number */
.intro .count { background: var(--mint); color: var(--ink); box-shadow: 0 8px 0 var(--mint-shade); }
/* Picture frames: dark grape edge instead of white */
.frame { border-color: var(--ink); }
/* Score bar: lavender score circles */
.pill-score { background: var(--card); }
/* Trophy rays in theme colours */
.end-rays { background: repeating-conic-gradient(rgba(106, 43, 217, .22) 0 10deg, transparent 10deg 20deg); }
.len-opts .btn.btn:not(.on) { background: rgba(255, 255, 255, .14) !important; color: #fff !important; box-shadow: none !important; }
.count .num-svg { display: inline-flex; height: .78em; gap: .06em; }
.count .num-svg svg { height: 100%; width: auto; fill: none; stroke: currentColor; stroke-width: 19; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.intro .count { padding-top: 0; }

/* Lobby: photo button sits right beside the line, never on its own row */
.lobby-photos { flex-wrap: nowrap; justify-content: flex-start; }
.lobby-photos #qcount { flex: 0 1 auto; min-width: 0; }
.lobby-photos #localPick { flex: none; white-space: nowrap; }

/* Results screen: same look as the share picture */
.end-wrap.res { color: #fff; }
.res-rays { position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, .08) 0 10deg, transparent 10deg 20deg); animation: g-spin 18s linear infinite; pointer-events: none; }
.end.res-body { background: none; border: 0; box-shadow: none; padding: 0 16px; gap: clamp(4px, 1.6vh, 16px); color: #fff; width: min(100%, 980px); animation: endIn .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.res-head { font-family: "Alexandria", var(--f-body); font-weight: 900; font-size: clamp(3rem, min(13vw, 14vh), 7.5rem); line-height: 1; color: var(--mint);
  text-shadow: 0 .08em 0 var(--ink); transform: rotate(-3.5deg); }
.res-ribbon { background: var(--tc, var(--ink)); color: #fff; border: clamp(4px, .7vh, 7px) solid #fff; border-radius: 999px; padding: .12em 1.2em .2em;
  font-weight: 900; font-size: clamp(1.8rem, min(7vw, 8vh), 4.2rem); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 .14em 0 rgba(28, 18, 64, .55); transform: rotate(1.7deg); }
.res-sub { font-weight: 800; font-size: clamp(1.2rem, min(4vw, 4vh), 2.2rem); }
.res-score { display: flex; align-items: flex-start; justify-content: center; gap: clamp(6px, 4vw, 90px); width: 100%; }
.res-dash { font-family: "Rubik", var(--f-body); font-weight: 900; font-size: clamp(2rem, 6vh, 3.4rem); align-self: center; margin-top: -1.2em; }
.res-team { display: grid; justify-items: center; gap: 4px; min-width: 0; flex: 1 1 0; max-width: 320px; }
.res-badge { width: clamp(84px, min(22vw, 19vh), 170px); aspect-ratio: 1; border-radius: 50%; background: var(--tc); border: clamp(5px, .9vh, 9px) solid #fff;
  box-shadow: 0 clamp(5px, .9vh, 9px) 0 rgba(28, 18, 64, .5); display: grid; place-items: center; color: #fff; }
.res-team.win .res-badge { border-color: var(--mint); }
.res-num .num-svg { display: inline-flex; height: clamp(40px, min(10vw, 9vh), 82px); gap: .06em; }
.res-num .num-svg svg { height: 100%; width: auto; fill: none; stroke: currentColor; stroke-width: 19; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.res-name { font-weight: 800; font-size: clamp(1rem, min(3.6vw, 3.2vh), 1.7rem); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-roster { color: rgba(255, 255, 255, .82); font-weight: 700; font-size: clamp(.8rem, min(3vw, 2.4vh), 1.2rem); max-width: 100%; }
.res-aws { display: flex; gap: clamp(8px, 1.6vw, 18px); justify-content: center; width: 100%; flex-wrap: wrap; }
.res-aw { background: #F3EDFF; color: var(--ink); border-radius: 18px; padding: .45em 1.1em; display: grid; justify-items: center; min-width: 0; flex: 0 1 260px;
  box-shadow: 0 6px 0 rgba(28, 18, 64, .45); }
.res-aw small { color: #6A2BD9; font-weight: 800; font-size: clamp(.8rem, 2.2vh, 1.1rem); }
.res-aw b { font-weight: 900; font-size: clamp(1.05rem, 3.2vh, 1.7rem); color: var(--ink); }
.res-aw.t0 b { color: #E0600A; }
/* motion: scores roll, then the rest stamps in */
.res-body .res-ribbon, .res-body .res-sub, .res-body .res-aw { opacity: 0; }
.res-body.done .res-ribbon { animation: resStamp .55s cubic-bezier(.2, 1.8, .4, 1) both; }
.res-body.done .res-sub { animation: popUp .5s .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.res-body.done .res-aw { animation: popUp .45s calc(.6s + var(--i) * .25s) cubic-bezier(.2, 1.6, .4, 1) both; }
.res-body.done .res-team.win .res-badge { animation: thump .5s ease-out; }
@keyframes resStamp { 0% { opacity: 0; transform: scale(2.4) rotate(-8deg); } 100% { opacity: 1; transform: rotate(1.7deg); } }
@media (max-width: 600px) { .res-aw { flex-basis: 30%; padding: .4em .6em; } }
@media (prefers-reduced-motion: reduce) { .res-rays, .res-body * { animation: none !important; opacity: 1 !important; } }
.res-head { font-size: clamp(2.8rem, min(13vw, 11.5vh), 7.5rem); }
.res-ribbon { font-size: clamp(1.6rem, min(7vw, 6.6vh), 4.2rem); }
.res-badge { width: clamp(80px, min(22vw, 16vh), 170px); }
.res-num .num-svg { height: clamp(38px, min(10vw, 7.6vh), 82px); }
.res-aw small, .res-aw b { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .res-aw small { font-size: .78rem; } .res-aw b { font-size: 1.15rem; } }
.res-head { margin-bottom: clamp(10px, 2.6vh, 28px); }

/* No visible scroll bars anywhere (TV browsers show them over the purple); scrolling still works */
*, html, body { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
.marks ellipse { fill: none; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .8s ease forwards; animation-delay: var(--d); }

/* Length picker: preview icon = a ring cut into one piece per point, number in the middle */
.len-opts { flex-wrap: wrap; justify-content: center; }
.len-opts .btn { justify-items: center; gap: 2px; min-width: 84px; padding: .55em .8em .5em; }
.len-ico { position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 2px; }
.len-ico svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.len-ico circle { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: butt; opacity: .9; }
.len-ico .num-svg { display: inline-flex; height: 20px; gap: 1px; }
.len-ico .num-svg svg { position: static; width: auto; height: 100%; fill: none; stroke: currentColor; stroke-width: 19; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.len-opts .btn.on .len-ico circle { stroke: var(--ink); opacity: 1; }
@media (max-width: 480px) { .len-opts .btn { min-width: 0; flex: 1 1 0; padding: .5em .3em; } .len-ico { width: 44px; height: 44px; } }
.len-ico, .len-ico .num-svg { direction: ltr; }
.len-opts .btn small { white-space: nowrap; }
.num-svg { direction: ltr; }
@media (min-width: 481px) { .len-ico { width: 60px; height: 60px; } .len-ico .num-svg { height: 19px; } }

/* Lobby join card: less text (2026-11-22) */
.lobby-join { position: relative; }
.lobby-join .fs-corner { position: absolute; top: 14px; left: 14px; }
.lobby-code { align-items: center; }
.lobby-code .dot { align-self: center; }
.lobby-how { margin: 0; font-weight: 800; font-size: 1.15rem; }
.host-line:empty { display: none; }

/* Lobby join card = ticket (Shaimaa pick A, light purple, 2026-11-22) */
.lobby-join { background: none; border: 0; box-shadow: none; padding: 0; gap: 14px; animation: none; }
.lobby-join .ticket { position: relative; width: 100%; max-width: 440px; background: #E2D5FF; border-radius: 26px; box-shadow: 0 8px 0 var(--shade); overflow: hidden; animation: g-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.tk-top { display: grid; justify-items: center; gap: 10px; padding: 24px 22px 18px; }
.tk-top .qr { background: #fff; border-radius: 18px; padding: 6px; border: 0; }
.tk-tear { position: relative; height: 0; border-top: 3px dashed rgba(28, 18, 64, .28); margin: 0 22px; }
.tk-tear::before, .tk-tear::after { content: ""; position: absolute; top: -18px; width: 34px; height: 34px; border-radius: 50%; background: var(--bg); }
.tk-tear::before { right: -40px; } .tk-tear::after { left: -40px; }
.tk-bot { display: grid; justify-items: center; gap: 4px; padding: 14px 22px 20px; }
.tk-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.tk-code { font-family: "Rubik", var(--f-body); font-weight: 900; font-size: 3rem; letter-spacing: .14em; line-height: 1.05; color: var(--ink); padding-inline-start: .14em; }
.lobby-join .fs-corner { top: 14px; left: 14px; z-index: 1; }
@media (min-width: 761px) {
  .lobby-join { align-self: start; position: sticky; top: 0; height: calc(100dvh - 2 * clamp(16px, 4vw, 48px)); align-content: center; }
  .lobby-join .logo { font-size: 4.3rem; }
}

.judge-line .ans-team { display: inline-flex; align-items: center; gap: 6px; padding: .15em .7em; border-radius: 999px; background: var(--tc, var(--ink)); color: #fff; font-weight: 900; margin-inline-end: 6px; }
.judge-line .ans-team .ic { width: 18px; height: 18px; }

.put-hint { display: inline-block; background: var(--mint); color: var(--ink); font-weight: 800; padding: .1em .7em; border-radius: 999px; margin-inline-start: 8px; animation: g-pop .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.p-trap-run .put-hint { display: block; margin: 6px auto 0; width: fit-content; }
.change-q { position: relative; }
.change-q .put-hint { position: absolute; top: calc(100% + 12px); left: 0; right: 0; margin: 0 auto; width: fit-content; white-space: nowrap; z-index: 3; font-size: .85em; border: var(--bw) solid var(--ink); box-shadow: 0 4px 0 var(--ink); }

/* Smoothness (2026-11-22): a smaller rays layer that the GPU keeps as one texture, and composited confetti. */
body::before { width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 68%); mask-image: radial-gradient(circle, #000 15%, transparent 68%); }
.confetti i { will-change: transform; }
/* All spinning ray layers: sized so the GPU can keep each as one texture (260vmax was far too big for TV browsers). */
/* Keep the page rays as their own slow-spinning layer: when it was static, iPad Safari painted it over the photos. */
body::before { will-change: transform; }
.intro .count::before { width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; will-change: transform;
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%); }
.cele::before { width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; will-change: transform;
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 54%); mask-image: radial-gradient(circle, #000 10%, transparent 54%); }
.res-rays { width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; will-change: transform; }
.end-rays { will-change: transform; }
/* Phone stop pulse: scale instead of an animated shadow (shadows repaint every frame). */
@keyframes throb { 50% { transform: scale(1.04); } }

/* المجازفة */
.bet-teams { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.bet-btn { display: grid; gap: 2px; min-width: 200px; padding: .7em 1.2em; border: 3px solid transparent; opacity: .75; }
.bet-btn b { font-size: 1.3rem; } .bet-btn span { font-size: .95rem; font-weight: 700; }
.bet-btn.on { background: var(--tc); color: #fff; border-color: var(--mint); opacity: 1; transform: scale(1.06); }
.bet-btn[disabled] { opacity: .4; }
.p-bet .p-ch-grid { width: 100%; }
.bet-teams .bet-btn.on.t0 { background: #FF7A1A !important; color: #fff !important; }
.bet-teams .bet-btn.on.t1 { background: #1C1240 !important; color: #fff !important; }
.bet-teams .bet-btn:not(.on) { background: rgba(255,255,255,.14) !important; color: #fff !important; }

/* أوراق (power cards) */
.board .pill { position: relative; }
.pc-tray { position: absolute; top: calc(100% + 4px); inset-inline-end: 22px; z-index: 5; display: flex; gap: 6px; pointer-events: none; }
.pc-mini { width: 30px; height: 40px; border-radius: 7px; display: grid; place-items: center; background: var(--tc); color: #fff; border: 3px solid #fff; box-shadow: 0 3px 0 var(--shade); transform: rotate(-6deg); transition: opacity .3s; }
.pc-mini:nth-child(2) { transform: none; } .pc-mini:nth-child(3) { transform: rotate(6deg); }
.pill.t1 .pc-mini { color: var(--mint); }
.pc-mini .ic, .pc-mini svg { width: 18px; height: 18px; }
.pc-mini.used { opacity: .25; filter: grayscale(1); }
.pc-splash { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(28, 18, 64, .5); z-index: 60; pointer-events: none; animation: g-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.pc-big { display: grid; justify-items: center; gap: 10px; padding: 30px 50px; border-radius: 28px; background: var(--ink); color: #fff; border: 5px solid var(--mint); box-shadow: 0 10px 0 #0E0826; transform: rotate(-3deg); text-align: center; max-width: 86vw; }
.pc-big .ic, .pc-big svg { width: clamp(64px, 9vw, 100px); height: clamp(64px, 9vw, 100px); color: var(--mint); }
.pc-big b { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; color: var(--mint); line-height: 1.3; }
.pc-big span { font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 700; }
.pc-hand { margin: 10px 0 4px; padding: 8px 10px 10px; background: var(--ink); border-radius: 20px; display: grid; gap: 8px; }
.pc-lbl { color: var(--mint); font-weight: 800; font-size: .85rem; text-align: center; }
.pc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pc-card { display: grid; justify-items: center; gap: 2px; padding: 7px 4px 6px; border-radius: 14px; background: var(--tc); color: #fff; border: 3px solid #fff; box-shadow: 0 4px 0 #0E0826; font: inherit; cursor: pointer; }
.pc-card.t1 { background: #3E1694; }
.pc-card .ic, .pc-card svg { width: 26px; height: 26px; }
.pc-card b { font-size: .95rem; font-weight: 900; line-height: 1.3; }
.pc-card small { font-size: .68rem; font-weight: 600; line-height: 1.3; opacity: .9; }
.pc-card:disabled { opacity: .45; cursor: default; }
.pc-card.used { opacity: .2; filter: grayscale(1); }
.pc-card:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #0E0826; }
.pc-frozen { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(28, 18, 64, .93); color: #fff; text-align: center; padding: 20px; }
.pc-frozen .ic, .pc-frozen svg { width: 84px; height: 84px; color: var(--mint); }
.pc-frozen b { font-size: 2rem; font-weight: 900; color: var(--mint); } .pc-frozen span { font-weight: 700; }
.pc-n { width: 88px; height: 88px; border-radius: 50%; background: var(--mint); color: var(--ink); display: grid; place-items: center; font: 900 3rem "Rubik", var(--f-body); margin-top: 6px; }
.pc-peek { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(28, 18, 64, .95); padding: 16px; }
.pc-peek img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 14px; border: 3px solid #fff; }
/* المجازفة on a small screen: team buttons side by side, smaller clock, so «يلا» never covers them */
@media (max-width: 760px) {
  .bet-card { gap: 8px; padding-block: 8px; }
  .bet-card .count { width: clamp(84px, 14vh, 120px) !important; font-size: clamp(3rem, 9vh, 4.6rem) !important; }
  .bet-teams { flex-wrap: nowrap; width: 100%; gap: 10px; margin: 6px 0 0; }
  .bet-btn { min-width: 0; flex: 1 1 0; padding: .55em .5em; }
  .bet-btn b { font-size: 1.05rem; } .bet-btn span { font-size: .8rem; }
  .bet-card .intro-title { font-size: 1.7rem; }
  .bet-card > .muted { font-size: 1rem; }
}
/* Point celebration, lighter for phones and TVs (2026-11-23): the rays stand still (a spinning masked
   layer is costly on Android), confetti without borders, and the overlay fades as one layer. */
.cele { will-change: opacity; }
.cele::before { animation: none !important; will-change: auto; }
.confetti i { border: 0; }

/* «منو صادها؟» logo: the same drawing, font and sizes as «منو قالها؟» (playmnu.com), grape colours */
.logo.mnu { display: inline-flex; flex-direction: row; align-items: center; gap: .05em; padding-top: 0; direction: rtl; font-family: "Alexandria", sans-serif; font-weight: 900; line-height: 1; white-space: nowrap; letter-spacing: -.02em; }
.mnu-mark { flex: none; position: relative; display: inline-block; line-height: 1; width: 2.1em; height: 2.1em; }
.mnu-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mnu-mark-word { position: absolute; left: 48.3%; top: 54.5%; transform: translate(-50%, -50%); font: 900 .588em "Alexandria", sans-serif; white-space: nowrap; letter-spacing: 0; color: #1C1240; }
.logo.mnu .mnu-word { color: var(--mint); }
.logo.mnu.stack { flex-direction: row; }
.home-hero .logo.mnu { font-size: clamp(2.4rem, 4.6vw, 3.6rem); margin-top: .1em; }
@media (max-width: 760px) { .home-hero .logo.mnu { font-size: clamp(2rem, 10vw, 2.8rem); } }

.lobby-join .logo.mnu { font-size: 2.6rem; }
.p-head .logo.mnu, .board-logo .logo.mnu { font-size: .78em; }
.p-join .logo.mnu { font-size: 2.8rem; }
/* Safari tints its top bar from a solid page colour; a gradient alone leaves it white. */
html { background-color: #6A2BD9; }
body { background-color: #6A2BD9; }

/* ---------- buying (purchasing plan, Shaimaa 2026-11-23) ---------- */
.link { font: inherit; font-weight: 700; background: none; border: 0; padding: .3em; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; justify-self: center; }
.link.small { font-size: .88rem; color: var(--muted); }
.link.inline { padding: 0; }
.link.on-bg { color: var(--on-bg); }
.shop-wrap { place-items: center; padding: 16px; z-index: 60; }
.sheet.shop { background: var(--card); border: var(--bw) solid var(--edge); border-radius: 24px; box-shadow: 0 var(--sh) 0 var(--shade); width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 18px; gap: 12px; line-height: 1.7; }
.sheet.shop .btn.big { width: 100%; }
.shop-eye { justify-self: start; font-weight: 800; font-size: .85rem; color: var(--shade); background: var(--sand); padding: .15em .8em; border-radius: 999px; }
.shop-h { margin: 0; font-size: 1.6rem; line-height: 1.6; }
.shop-c { margin: 0; text-align: center; }
.shop-perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shop-perks li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.shop-perks b { font-size: .95rem; }
.shop-perks span { font-size: .8rem; color: var(--muted); line-height: 1.6; }
.deal-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.deal-opt { position: relative; font: inherit; color: var(--ink); background: #fff; border: var(--bw) solid var(--line); border-radius: 16px; padding: 18px 8px 12px; display: grid; justify-items: center; gap: 2px; cursor: pointer; line-height: 1.6; }
.deal-opt b { font-size: 1rem; }
.deal-opt small { font-size: .78rem; color: var(--muted); }
.deal-opt span { font-weight: 800; font-size: 1.1rem; }
.deal-opt.on { border-color: var(--bg); background: var(--sand); box-shadow: 0 4px 0 var(--bg); }
.deal-save { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-weight: 800; font-size: .78rem; padding: .1em .8em; border-radius: 999px; background: var(--red); color: #fff; }
.shop-in { font: inherit; font-size: 1.1rem; width: 100%; padding: .7em .9em; border-radius: 14px; border: var(--bw) solid var(--line); background: #fff; color: var(--ink); text-align: left; }
.shop-in.num { text-align: center; letter-spacing: .4em; font-size: 1.5rem; font-weight: 800; }
.test-tag { justify-self: start; margin: 0; font-weight: 800; font-size: .85rem; color: #0B2A1A; background: var(--mint); padding: .15em .8em; border-radius: 999px; }
.pay-box { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 2px dashed var(--line); }
.pay-box > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.pay-box b { font-size: 1.3rem; }
.pay-box p { margin: 0; }
.pay-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-methods span { font-size: .8rem; font-weight: 700; padding: .2em .7em; border-radius: 8px; background: #fff; border: 2px solid var(--line); }
.free-note { display: grid; gap: 2px; text-align: center; padding: 10px 14px; border-radius: 16px; background: var(--mint); color: #0B2A1A; line-height: 1.7; }
.free-note span { font-size: .9rem; }
.free-note.done { background: #fff; color: var(--ink); }
@media (max-width: 380px) { .shop-perks { grid-template-columns: 1fr; } }
