/* =====================================================================
   GamesUP — web client styles (CLAUD.md §14)
   ===================================================================== */
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #141B3C; --deep: #0B1028; --navy-2: #1E2756; --gold: #F5B41A; --gold-2: #FFE08A; --gold-d: #C98A00;
  --coral: #FF5A5F; --teal: #2EC4B6; --mint: #7FF5E8; --purple: #8E5BD8;
  --ink: #FFFFFF; --ink-2: rgba(255,255,255,.72); --ink-3: rgba(255,255,255,.45);
  --line: rgba(255,255,255,.12); --glass: rgba(255,255,255,.06); --glass-2: rgba(255,255,255,.1);
  --r: 18px; --shadow: 0 14px 34px rgba(0,0,0,.45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Tajawal", system-ui, sans-serif; color: var(--ink); background: var(--deep);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, #26306a 0%, rgba(20,27,60,0) 60%),
    url("../img/pattern.svg");
  background-attachment: fixed; overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
a { color: var(--gold); }
button { font-family: inherit; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }
.wrap-wide { max-width: 1080px; }

/* ---------------------------------------------------------------- top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1080px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, var(--coral), #7A1E3A); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(255,90,95,.35); font-size: 22px; }
.brand b { font-size: 22px; font-weight: 900; letter-spacing: .5px; direction: ltr; }
.brand b span { color: var(--gold); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pill.gold { color: var(--deep); background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; }

/* ------------------------------------------------------------ announcement */
.announce { background: linear-gradient(90deg, var(--gold), #FFD36A); color: #3A2400; text-align: center; font-weight: 800; padding: 8px 16px; font-size: 14px; }

/* ------------------------------------------------------------ sound toggles */
.soundbox { display: flex; gap: 6px; margin-inline-start: auto; }
.soundbox button { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink-3); font-size: 18px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.soundbox button.on { color: var(--gold); border-color: rgba(245,180,26,.4); }

/* ---------------------------------------------------------------- buttons */
.btn-g { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 16px; font-weight: 800; font-size: 17px; color: #3A2400;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-d)); box-shadow: 0 6px 0 #8F6100, 0 12px 24px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s, filter .2s; text-decoration: none; }
.btn-g:active { transform: translateY(4px); box-shadow: 0 2px 0 #8F6100, 0 6px 12px rgba(0,0,0,.35); }
.btn-g:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn-g.coral { color: #fff; background: linear-gradient(180deg, #FF8A8D, var(--coral) 55%, #C93A47); box-shadow: 0 6px 0 #7A1E3A, 0 12px 24px rgba(0,0,0,.35); }
.btn-g.teal  { color: #062A27; background: linear-gradient(180deg, #8FF3E9, var(--teal) 55%, #1C8E84); box-shadow: 0 6px 0 #0F5E57, 0 12px 24px rgba(0,0,0,.35); }
.btn-g.ghost { color: var(--ink); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn-g.ghost:active { transform: translateY(1px); }
.btn-g.block { width: 100%; }
.btn-g.sm { padding: 9px 14px; font-size: 14px; border-radius: 12px; box-shadow: 0 4px 0 #8F6100; }
.btn-g.ghost.sm { box-shadow: inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------------ panels */
.panel { background: linear-gradient(180deg, rgba(30,39,86,.85), rgba(20,27,60,.85)); border: 1px solid rgba(245,180,26,.25); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.panel h2 { margin: 0 0 14px; font-size: 20px; font-weight: 900; }
.muted { color: var(--ink-2); }
.tiny { font-size: 13px; color: var(--ink-3); }

.field { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0,0,0,.25); color: #fff; font: 700 18px "Tajawal", sans-serif; outline: none; transition: border-color .2s; }
.field:focus { border-color: var(--gold); }
.code-input { text-align: center; letter-spacing: 10px; font-size: 26px; text-transform: uppercase; direction: ltr; }

.avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.avatars button { aspect-ratio: 1; border-radius: 14px; border: 2px solid transparent; background: var(--glass); font-size: clamp(17px, 4.6vw, 24px); padding: 0; cursor: pointer; transition: transform .15s, border-color .15s; }
.avatars button.on { border-color: var(--gold); background: rgba(245,180,26,.15); transform: scale(1.06); }

/* -------------------------------------------------------------- landing */
.hero { text-align: center; padding: 10px 0 22px; }
.hero h1 { margin: 0; font-size: clamp(30px, 8vw, 46px); font-weight: 900; line-height: 1.2; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { margin: 8px 0 0; color: var(--ink-2); font-size: 17px; }
.fan { position: relative; height: 230px; margin: 10px auto 6px; max-width: 420px; }
.fan img { position: absolute; width: 132px; left: 50%; top: 10px; border-radius: 12px; box-shadow: var(--shadow); transition: transform .4s; }
.fan img:nth-child(1) { transform: translateX(-120%) rotate(-14deg) translateY(14px); }
.fan img:nth-child(2) { transform: translateX(-50%) rotate(0deg); z-index: 2; }
.fan img:nth-child(3) { transform: translateX(20%) rotate(14deg) translateY(14px); }
.fan:hover img:nth-child(1) { transform: translateX(-135%) rotate(-18deg) translateY(10px); }
.fan:hover img:nth-child(3) { transform: translateX(35%) rotate(18deg) translateY(10px); }
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.game-tile { position: relative; border-radius: 20px; padding: 14px; background: var(--glass); border: 1px solid var(--line); overflow: hidden; min-height: 120px; }
.game-tile img { position: absolute; left: -12px; bottom: -40px; width: 84px; transform: rotate(12deg); opacity: .95; }
.game-tile b { display: block; font-size: 18px; }
.game-tile small { color: var(--ink-3); }
.game-tile .soon { position: absolute; top: 10px; left: 10px; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.12); }
.game-tile { text-align: start; color: inherit; font-family: inherit; cursor: default; }
button.game-tile { cursor: pointer; }
.game-tile.on { box-shadow: 0 0 0 2px var(--gold), 0 10px 26px rgba(245,180,26,.25); }
.game-tile.live { border-color: rgba(255,90,95,.6); background: linear-gradient(160deg, rgba(255,90,95,.22), rgba(255,255,255,.04)); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); margin: 16px 0; font-size: 14px; }
.or:before, .or:after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------- game card */
.gcard { position: relative; container-type: inline-size; aspect-ratio: 2/3; width: 100%; }
.gcard img { width: 100%; height: 100%; display: block; border-radius: 6.6%; filter: drop-shadow(0 16px 26px rgba(0,0,0,.55)); }
.gcard .t { position: absolute; left: 20%; right: 20%; top: 82.4%; transform: translateY(-50%); text-align: center; white-space: nowrap; font-weight: 900; color: #3A2400; font-size: 9.5cqw; line-height: 1; text-shadow: 0 1px 0 #FFE9A8; }
.gcard .d { position: absolute; left: 14%; right: 14%; top: 71%; transform: translateY(-50%); text-align: center; font-weight: 500; color: #fff; opacity: .9; font-size: 4.2cqw; line-height: 1.5; }
.gcard .w { position: absolute; left: 26%; right: 26%; top: 49%; transform: translateY(-50%); text-align: center; white-space: nowrap; font-weight: 900; color: var(--navy); font-size: 9cqw; }

/* flip */
.flip { perspective: 1400px; width: min(78vw, 300px); margin: 0 auto; cursor: pointer; }
.flip-in { position: relative; transition: transform .7s cubic-bezier(.2,.9,.25,1.2); transform-style: preserve-3d; }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip .face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face.front { position: absolute; inset: 0; transform: rotateY(180deg); }
.flip:not(.on) .face.back { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
.shuffle { animation: shuffle .6s ease; }
@keyframes shuffle { 25% { transform: translateX(-30px) rotate(-8deg); } 60% { transform: translateX(30px) rotate(8deg); } }

/* ------------------------------------------------------------------ lobby */
.room-code { text-align: center; }
.room-code .code { font-size: 54px; font-weight: 900; letter-spacing: 12px; direction: ltr; color: var(--gold); line-height: 1; margin: 6px 0; text-shadow: 0 4px 0 #8F6100; }
.qr { width: 132px; height: 132px; margin: 8px auto 0; background: #fff; border-radius: 14px; padding: 8px; }
.qr img, .qr svg { width: 100%; height: 100%; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.member { position: relative; text-align: center; padding: 12px 6px 10px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); animation: pop .35s ease; }
.member .av { font-size: 38px; line-height: 1.1; }
.member .nm { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .tag { position: absolute; top: -8px; right: -6px; font-size: 18px; }
.member .x { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); color: #fff; cursor: pointer; font-size: 14px; line-height: 24px; padding: 0; }
.member.me { border-color: var(--gold); }
.member.off { opacity: .45; }
.member.empty { border-style: dashed; color: var(--ink-3); display: grid; place-items: center; min-height: 92px; cursor: pointer; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.mix { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mix span { padding: 6px 12px; border-radius: 999px; background: var(--glass-2); font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 12px; border-radius: 9px; font-weight: 800; cursor: pointer; }
.seg button.on { background: var(--gold); color: #3A2400; }

/* ------------------------------------------------------------------ table */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.timer { font-size: 26px; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--coral); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.mycard { width: 56px; cursor: pointer; position: relative; }
.mycard .gcard .t { font-size: 13cqw; }
.mycard-hint { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-3); white-space: nowrap; }

.table-wrap { position: relative; width: 100%; aspect-ratio: 1; max-width: min(520px, calc(100vh - 270px)); min-width: 280px; margin: 4px auto 0; }
.majlis { position: absolute; inset: 15%; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #7A3E22 0%, #4C2412 55%, #2E150A 100%);
  box-shadow: inset 0 0 0 6px #C98A00, inset 0 0 0 9px #3A1A0A, inset 0 0 0 12px rgba(245,180,26,.6), 0 20px 50px rgba(0,0,0,.6); }
.majlis:before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: url("../img/pattern.svg"); opacity: .55; box-shadow: inset 0 0 0 2px rgba(245,180,26,.5); }
.majlis .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 34px; }
.majlis .center small { display: block; font-size: 13px; color: var(--gold-2); margin-top: 4px; font-weight: 700; }
svg.gaze { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
svg.gaze line { stroke: rgba(255,255,255,.35); stroke-width: .5; stroke-dasharray: 1.4 1; animation: dash 1.2s linear infinite; }
svg.gaze line.mine { stroke: var(--mint); stroke-width: .7; }
svg.gaze line.mutual { stroke: var(--gold); stroke-width: .9; stroke-dasharray: none; filter: drop-shadow(0 0 1px var(--gold)); }
svg.gaze line.at-me { stroke: var(--coral); stroke-width: .7; }
@keyframes dash { to { stroke-dashoffset: -4.8; } }

.seat { position: absolute; width: 19%; transform: translate(-50%, -50%); text-align: center; cursor: pointer; transition: filter .2s; }
.seat .bub { position: relative; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(22px, 6.5vw, 36px);
  background: radial-gradient(circle at 35% 30%, #2C3878, #141B3C); border: 3px solid rgba(255,255,255,.18); box-shadow: 0 8px 18px rgba(0,0,0,.45); transition: transform .2s, border-color .2s; }
.seat .nm { margin-top: 4px; font-size: clamp(11px, 2.8vw, 14px); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 4px #000; }
.seat.me .bub { border-color: var(--gold); }
.seat.target .bub { border-color: var(--mint); transform: scale(1.08); box-shadow: 0 0 0 4px rgba(127,245,232,.25), 0 8px 18px rgba(0,0,0,.45); }
.seat.suspected .bub:after { content: "🤔"; position: absolute; top: -6px; left: -6px; font-size: 16px; }
.seat.spot .bub { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(245,180,26,.3), 0 0 40px rgba(245,180,26,.6); animation: spot 1.2s ease-in-out infinite; }
@keyframes spot { 50% { transform: scale(1.1); } }
.seat.dead { filter: grayscale(1) brightness(.6); cursor: default; }
.seat.dead .bub { border-style: dashed; }
.seat .badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font-size: 12px; font-weight: 900; display: grid; place-items: center; background: var(--teal); color: #062A27; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.seat .badge.s { right: auto; left: -6px; background: var(--coral); color: #fff; }
.seat .stare { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font-size: 10px; background: var(--coral); color: #fff; border-radius: 8px; padding: 1px 6px; white-space: nowrap; font-weight: 800; }
.seat .fx { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.seat .fx.blink { animation: blinkfx .5s ease; }
@keyframes blinkfx { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); } 100% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } }
.seat .ghost { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1em; }
.seat .seen { position: absolute; bottom: -2px; right: -2px; font-size: 14px; }

/* --------------------------------------------------------------- controls */
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(11,16,40,0), rgba(11,16,40,.92) 30%); z-index: 20; }
.dock-in { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.modes { display: flex; gap: 6px; flex: 1; }
.mode { flex: 1; border: 0; border-radius: 14px; padding: 8px 4px; background: var(--glass-2); color: var(--ink-2); font-weight: 800; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.mode i { font-size: 20px; }
.mode.on { background: rgba(127,245,232,.16); color: var(--mint); box-shadow: inset 0 0 0 2px var(--mint); }
.mode.accuse.on { background: rgba(255,90,95,.18); color: var(--coral); box-shadow: inset 0 0 0 2px var(--coral); }
.mode:disabled { opacity: .35; }
.blink-btn { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer; flex: none; font-size: 40px;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-d)); box-shadow: 0 7px 0 #8F6100, 0 14px 30px rgba(0,0,0,.5); transition: transform .08s; }
.blink-btn:active { transform: translateY(5px) scale(.97); box-shadow: 0 2px 0 #8F6100; }
.blink-btn small { position: absolute; bottom: 9px; left: 0; right: 0; font-size: 11px; font-weight: 900; color: #3A2400; }
.blink-btn svg { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); transform: rotate(-90deg); pointer-events: none; }
.blink-btn svg circle { fill: none; stroke-width: 5; }
.blink-btn.warn { animation: shake .4s infinite; }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.hint { text-align: center; color: var(--ink-2); font-size: 14px; min-height: 22px; margin-top: 8px; }

/* -------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(6,9,24,.82); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.overlay .box { width: 100%; max-width: 420px; text-align: center; }
.doomed { background: radial-gradient(circle, rgba(255,90,95,.5), rgba(60,8,20,.95)); }
.doomed h1 { font-size: 56px; margin: 0; animation: shake .5s infinite; }
.doomed h2 { font-size: 30px; margin: 6px 0 4px; font-weight: 900; }
.styles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.styles button { border: 0; border-radius: 18px; padding: 16px 8px; font-size: 30px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-weight: 800; }
.styles button span { display: block; font-size: 14px; margin-top: 4px; }
.peek { width: min(70vw, 280px); margin: 0 auto; }

.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast-g { padding: 12px 16px; border-radius: 16px; background: rgba(20,27,60,.95); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 800; text-align: center; animation: drop .35s cubic-bezier(.2,.9,.3,1.3); }
.toast-g.coral { border-color: var(--coral); }
.toast-g.gold { border-color: var(--gold); }
.toast-g.teal { border-color: var(--teal); }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }

/* ---------------------------------------------------------------- results */
.winner { text-align: center; padding: 8px 0 16px; }
.winner .big { font-size: 64px; animation: pop .6s cubic-bezier(.2,.9,.3,1.4); }
.winner h1 { font-size: 30px; margin: 4px 0; font-weight: 900; }
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.reveal .r { text-align: center; animation: pop .5s both; }
.reveal .r .nm { font-weight: 800; font-size: 13px; margin-top: 4px; }
.reveal .r.win .nm:after { content: " 🏆"; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; display: flex; gap: 8px; }
.log li b { color: var(--gold); direction: ltr; min-width: 44px; }

.center-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.waiting { text-align: center; padding: 20px 0; }
.dots:after { content: "..."; animation: dots 1.4s steps(4) infinite; display: inline-block; width: 1.2em; text-align: start; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } }
.order { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.order span { padding: 4px 10px; border-radius: 999px; background: var(--glass); font-size: 13px; font-weight: 700; }
.order span.done { color: var(--teal); }
.order span.now { background: var(--gold); color: #3A2400; }

.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--glass-2); border-top-color: var(--gold); animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- game picker */
.game-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game-pick button { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--glass); color: #fff; font: 800 16px "Tajawal", sans-serif; cursor: pointer; overflow: hidden; }
.game-pick button img { width: 38px; border-radius: 4px; transform: rotate(-8deg); }
.game-pick button.on { border-color: var(--gold); background: rgba(245,180,26,.12); }
.game-pick button:disabled { cursor: default; }
.game-pick button:disabled:not(.on) { opacity: .45; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.toggle { width: 54px; height: 30px; border-radius: 15px; border: 0; background: rgba(255,255,255,.15); position: relative; cursor: pointer; flex: none; }
.toggle span { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: right .2s; }
.toggle.on { background: var(--teal); }
.toggle.on span { right: 27px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cats button { border: 1px solid var(--line); background: var(--glass); color: var(--ink-3); border-radius: 999px; padding: 6px 12px; font: 700 14px "Tajawal", sans-serif; cursor: pointer; }
.cats button.on { color: #062A27; background: var(--teal); border-color: var(--teal); }

/* ------------------------------------------------------------- spy game */
.pchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--glass-2); color: #fff; font: 800 15px "Tajawal", sans-serif; cursor: pointer; transition: transform .15s; }
.pchip span { font-size: 22px; }
.pchip:active { transform: scale(.96); }
.pchip.on { border-color: var(--coral); background: rgba(255,90,95,.22); }
.pchips.big .pchip { padding: 12px 18px 12px 14px; font-size: 17px; }
.spot-panel { margin-top: 6px; }
.duel { display: flex; align-items: center; justify-content: center; gap: 14px; }
.duelist { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; }
.duelist .bub { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; background: radial-gradient(circle at 35% 30%, #2C3878, #141B3C); border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(245,180,26,.35); animation: spot 1.6s ease-in-out infinite; }
.duelist .bub.ghosty { border-style: dashed; border-color: var(--line); animation: none; box-shadow: none; color: var(--ink-3); }
.duel .arrow { font-size: 28px; }
.bigq { margin: 14px 0 4px; text-align: center; font-size: 20px; font-weight: 800; color: var(--gold-2); }
.qa { list-style: none; margin: 0; padding: 0; }
.qa li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.qa .who { font-size: 14px; color: var(--ink-2); }
.qa .q { margin-top: 4px; font-weight: 700; }
.qa .a { margin-top: 2px; color: var(--mint); font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.choices button { padding: 14px 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--glass-2); color: #fff; font: 800 18px "Tajawal", sans-serif; cursor: pointer; }
.choices button:not(:disabled):hover { border-color: var(--gold); }
.choices button:disabled { opacity: .7; cursor: default; }
.secret { font-size: 40px; font-weight: 900; color: var(--gold); margin: 4px 0; }

/* ---------------------------------------------------------------- guess */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teambox { border-radius: 20px; padding: 12px; text-align: center; border: 2px solid var(--line); background: var(--glass); transition: transform .2s; }
.teambox.ta { border-color: rgba(245,180,26,.45); background: linear-gradient(180deg, rgba(245,180,26,.18), rgba(245,180,26,.04)); }
.teambox.tb { border-color: rgba(255,90,95,.45); background: linear-gradient(180deg, rgba(255,90,95,.18), rgba(255,90,95,.04)); }
.teambox.now { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.tscore { font-size: 44px; font-weight: 900; line-height: 1.1; }
.tmem { font-size: 20px; letter-spacing: 2px; }
.pill.ta { background: var(--gold); color: #3A2400; }
.pill.tb { background: var(--coral); color: #fff; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.wchip.ok { background: rgba(46,196,182,.2); color: var(--mint); }
.wchip.no { background: rgba(255,255,255,.08); color: var(--ink-3); text-decoration: line-through; }
.wordcard { width: min(72vw, 300px); margin: 0 auto; }
.gcard .w.big { left: 14%; right: 14%; top: 47%; font-size: 13cqw; color: #fff; text-shadow: 0 3px 0 #7A1E3A, 0 0 24px rgba(0,0,0,.5); background: rgba(20,27,60,.55); border-radius: 14px; padding: 6px 4px; }
.markbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 360px; margin: 16px auto 6px; }
.markbtns .btn-g { font-size: 20px; padding: 18px; }
.forehead { position: relative; min-height: 62vh; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #FF7A7E, #C93A47 70%); box-shadow: inset 0 0 0 6px rgba(245,180,26,.6), var(--shadow); }
.fh-word { font-size: clamp(42px, 14vw, 96px); font-weight: 900; text-align: center; line-height: 1.15; text-shadow: 0 5px 0 #7A1E3A; word-break: break-word; }
.fh-side { font-weight: 800; opacity: .75; font-size: 16px; }
.countdown { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; font-size: 160px; font-weight: 900; color: var(--gold); background: rgba(6,9,24,.75); text-shadow: 0 8px 0 #8F6100; animation: pop .4s; }
.flash-ok { animation: flashok .5s; }
.flash-no { animation: flashno .4s; }
@keyframes flashok { 30% { filter: drop-shadow(0 0 30px var(--teal)) brightness(1.3); transform: scale(1.03); } }
@keyframes flashno { 30% { transform: translateX(-14px); } 60% { transform: translateX(10px); } }

/* ---------------------------------------------------------------- rules */
.howto { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--gold); background: rgba(0,0,0,.25); border-radius: 999px; padding: 3px 10px; position: relative; z-index: 2; }
.helpbtn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid rgba(245,180,26,.4); background: var(--glass); color: var(--gold); font: 900 20px "Tajawal", sans-serif; cursor: pointer; padding: 0; }
.rules-ov { align-items: start; overflow-y: auto; }
.rules { position: relative; width: 100%; max-width: 560px; margin: 24px auto; padding: 22px 18px; text-align: start; }
.rclose { position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 16px; cursor: pointer; }
.rhead { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.rhead h2 { margin: 2px 0 4px; font-size: 26px; }
.rhead p { margin: 0; font-size: 15px; line-height: 1.6; }
.rcover { width: 84px; flex: none; transform: rotate(-6deg); }
.rtabs { display: flex; width: 100%; margin-bottom: 14px; }
.rtabs button { flex: 1; }
.rbody { min-height: 260px; }
.rbody h3 { font-size: 18px; margin: 18px 0 8px; color: var(--gold-2); }
.rbody ul { margin: 0; padding-inline-start: 20px; line-height: 1.8; }
.rbody li { margin-bottom: 4px; }
.rstep { text-align: center; padding: 10px 6px; animation: pop .3s; }
.ricon { font-size: 64px; line-height: 1.2; }
.rnum { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.rstep h3 { font-size: 22px; margin: 6px 0; color: #fff; }
.rstep p { font-size: 17px; line-height: 1.8; margin: 0 auto; max-width: 420px; color: var(--ink-2); }
.rstep p b { color: var(--gold-2); }
.rdots { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.rdots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.2); cursor: pointer; }
.rdots i.on { background: var(--gold); width: 24px; border-radius: 5px; }
.rnav { display: flex; justify-content: space-between; gap: 10px; }
.rmeta { display: flex; gap: 8px; flex-wrap: wrap; }
.rmeta span { background: var(--glass-2); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px; }
.rroles { display: flex; flex-direction: column; gap: 10px; }
.rrole { display: flex; gap: 12px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.rrole .rcard { width: 64px; flex: none; }
.rrole p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.rmix { width: 100%; border-collapse: collapse; font-size: 14px; }
.rmix td { padding: 7px 8px; border-bottom: 1px dashed var(--line); }
.rmix td:first-child { font-weight: 900; color: var(--gold); white-space: nowrap; width: 60px; }
.rules-page .rtabs-page { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 16px; }

/* ------------------------------------------------------------ five seconds */
.mix span.now { box-shadow: 0 0 0 2px var(--gold); }
.bombwrap { width: 120px; margin: 10px auto; transform: rotate(-6deg); }
.bombwrap img { width: 100%; border-radius: 8px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.five-stage { text-align: center; }
.bombtimer { position: relative; width: 120px; height: 120px; margin: 8px auto; }
.bombtimer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.bombtimer circle { fill: none; stroke-width: 8; }
.bombtimer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 900; color: var(--gold); }
.bombtimer.shake { animation: shake .25s infinite; }
.challenge { font-size: clamp(26px, 7vw, 40px); font-weight: 900; margin: 8px 0 14px; line-height: 1.4; color: #fff; text-shadow: 0 4px 0 #7A1E3A; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.slot { min-height: 52px; border-radius: 14px; border: 2px dashed var(--line); display: grid; place-items: center; font-weight: 800; color: var(--ink-3); padding: 6px; font-size: 16px; }
.slot.new { border-style: solid; border-color: var(--gold); color: #fff; background: rgba(245,180,26,.1); animation: pop .3s; }
.slot.ok { border-style: solid; border-color: var(--teal); color: var(--mint); background: rgba(46,196,182,.12); animation: pop .3s; }
.five-input { display: flex; gap: 8px; margin-top: 12px; }
.five-stage.boom { animation: boomfx .6s; }
@keyframes boomfx { 0% { box-shadow: 0 0 0 0 rgba(255,90,95,.9); transform: scale(1.03); } 100% { box-shadow: 0 0 0 40px rgba(255,90,95,0); transform: none; } }

@media (min-width: 900px) {
  .landing-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; } }
.rquick { line-height: 1.9; padding-inline-start: 20px; } .rquick b { color: #fff; }
