/* Almarai (SIL OFL 1.1, fonts/OFL.txt), served from this site so the first screen doesn't wait on another server. */
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/almarai-400-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/almarai-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/almarai-700-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/almarai-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/almarai-800-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Almarai"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/almarai-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Jawibni: the majlis card table. Olive felt, bone card stock, black and red suit inks. */
:root {
  --felt: #38450f;
  --felt-2: #2c370b;
  --felt-3: #46561a;
  --bone: #ecebe7;
  --bone-2: #e1dfd9;
  --bone-3: #d3cfc4;
  --ink: #1d2207;
  --muted: #55602f;
  --red: #a3271b;
  --gold: #b8901f;
  --gold-soft: #efe2b4;
  --team0: var(--ink);
  --team1: var(--red);

  --display: "Almarai", system-ui, sans-serif;
  --text: "Almarai", system-ui, sans-serif;

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem);
  --step-display: clamp(5rem, 2rem + 11vw, 11.5rem);

  --card-r: 18px;
  --margin: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--text); font-size: var(--step-body); line-height: 1.55;
  color: var(--ink); background: var(--felt);
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 0; letter-spacing: 0; }
h2 { font-size: var(--step-head); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- Buttons: poker chips are round, so every button is a pill ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 28px; border-radius: 999px;
  background: var(--ink); color: var(--bone);
  font-family: var(--text); font-weight: 700; font-size: 1.0625rem; text-decoration: none;
  transition: transform .18s var(--ease), background .18s;
}
@media (hover: hover) { .btn:hover { transform: translateY(-2px); background: var(--felt-2); } }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-alt { background: var(--red); }
@media (hover: hover) { .btn-alt:hover { background: #8a1f15; } }
.btn-light { background: var(--bone); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
@media (hover: hover) { .btn-outline:hover { background: var(--ink); color: var(--bone); } }
@media (hover: hover) { .btn-light:hover { background: var(--gold-soft); } }
.btn-ghost { background: var(--bone-3); color: var(--ink); }
@media (hover: hover) { .btn-ghost:hover { background: var(--bone-2); } }
.btn-small { min-height: 42px; padding: 6px 20px; font-size: 1rem; }
.btn-lg { min-height: 62px; padding: 12px 40px; font-size: 1.375rem; }
.btn.t0 { background: var(--team0); }
.btn.t1 { background: var(--team1); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 76px; padding: 0 var(--margin);
  background: var(--felt-2); color: var(--bone);
}
.wordmark { font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--bone); text-decoration: none; line-height: 1; white-space: nowrap; }
.nav nav { display: flex; gap: 28px; flex: 1; }
.nav nav a { color: var(--bone); text-decoration: none; font-weight: 500; transition: color .15s; white-space: nowrap; }
/* The links share the bar with the two-word name and the account buttons: tighter, then the least-used ones go. */
@media (max-width: 1360px) { .nav { gap: 18px; } .nav nav { gap: 18px; } }
@media (max-width: 1180px) { .nav nav a[data-scroll="faq"], .nav nav a[data-scroll="action"] { display: none; } }
@media (max-width: 900px) { .nav nav a[data-scroll="suggest"] { display: none; } }
@media (max-width: 820px) { .nav nav { display: none; } }
@media (max-width: 720px) { .nav { gap: 12px; } .wordmark { font-size: 1.5rem; } }
@media (hover: hover) { .nav nav a:hover { color: var(--gold-soft); } }
.nav-sound { width: 42px; height: 42px; border-radius: 50%; background: var(--felt-3); font-size: 18px; flex: none; transition: transform .15s; }
@media (hover: hover) { .nav-sound:hover { transform: scale(1.08); } }

/* ---------- Home: hero is one card dealt on the felt ---------- */
.hero {
  position: relative; min-height: max(640px, calc(100svh - 76px));
  background: var(--felt); padding: 48px var(--margin);
  display: flex; justify-content: center;
}
.hero-card {
  position: relative; width: min(760px, 100%); overflow: hidden;
  background: var(--bone); border-radius: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: clamp(40px, 6vw, 64px) clamp(20px, 5vw, 64px) 0;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px;
}
.pip { position: absolute; font-size: 2.5rem; line-height: 1; }
.pip-top { top: 24px; right: 28px; color: var(--ink); }
.pip-bottom { top: 24px; left: 28px; color: var(--red); }
/* The cup logo (img/brand/cup.svg) beside or above the name. */
.wm-cup { height: 1em; width: auto; vertical-align: -.12em; margin-inline-end: .3em; }
.brand-cup { display: block; height: 96px; width: auto; margin: 0 auto 6px; filter: drop-shadow(0 8px 14px rgb(0 0 0 / .25)); }
.login-card .brand-cup { height: 72px; }
/* The name sits on one line, sized to the card (it is two words wide). */
.hero-card { container-type: inline-size; }
@media (max-width: 640px) { .hero h1 { margin-top: 30px; } .wordmark { font-size: 1.3rem; } .nav { gap: 10px; } .nav-user { gap: 6px; } .nav-user .btn-small { padding-inline: 12px; } }
/* Narrow phones: the two-word name, the sound button and an admin's two buttons must share one row. */
@media (max-width: 420px) {
  .wordmark { font-size: 1.15rem; }
  .nav .wm-cup { display: none; }
  .nav-sound { width: 34px; height: 34px; font-size: 15px; }
  .nav-user { min-width: 0; }
  .nav-user .who { min-width: 0; max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .nav-user .btn-small { padding-inline: 10px; font-size: .8125rem; }
  #navResume { white-space: nowrap; padding-inline: 10px; font-size: .8125rem; }
  /* With «كمّل لعبتك» showing there is no room for the admin link too; the admin page is a desktop job. */
  .nav:has(#navResume:not([hidden])) .nav-user [data-go="admin"] { display: none; }
}
.hero h1 { font-size: min(var(--step-display), 15.5cqi); white-space: nowrap; font-weight: 800; line-height: 1.15; color: var(--ink); padding-bottom: .22em; }
.hero-sub { font-size: var(--step-lead); max-width: 30ch; text-wrap: balance; }
.hero-meta span { white-space: nowrap; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-weight: 500; color: var(--muted); }
.hero-meta b { color: var(--ink); font-weight: 700; }
.hero-meta i { font-style: normal; color: var(--red); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.hero-hand { position: relative; height: 230px; width: 100%; margin-top: auto; flex: none; }
.hero-hand div {
  position: absolute; bottom: 28px; left: 50%; width: 120px; height: 168px; margin-left: -60px;
  background: var(--felt); color: var(--bone); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--display); font-size: 1rem; text-align: center; padding: 8px;
  transform-origin: 50% 140%;
  transform: rotate(var(--r)) translateY(0);
  transition: transform .35s var(--ease);
  animation: deal .8s var(--ease) backwards; animation-delay: var(--d);
}
.hero-hand div:nth-child(even) { background: var(--red); }
.hero-hand div span { font-size: 2.5rem; line-height: 1; }
@media (hover: hover) { .hero-hand:hover div { transform: rotate(calc(var(--r) * 1.4)) translateY(-12px); } }
@keyframes deal { from { transform: rotate(0) translateY(120px); opacity: 0; } }

/* ---------- Home: the category list is a printed menu ---------- */
.menu-sec { background: var(--felt); padding: 24px var(--margin) 160px; }
.menu-sheet {
  max-width: 1180px; margin: 0 auto; background: var(--bone); border-radius: var(--card-r);
  padding: clamp(32px, 5vw, 64px);
}
.menu-sheet > h2 { text-align: center; }
.sheet-sub { text-align: center; color: var(--muted); margin: 12px auto 44px; max-width: 46ch; }
.menu { columns: 3 300px; column-gap: 56px; }
.menu-group { break-inside: avoid; margin-bottom: 40px; }
.menu-group h3 { font-size: 1.375rem; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.menu-item {
  display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 5px 0;
  background: none; text-align: start; font-size: 1.0625rem; color: var(--ink);
  transition: color .15s;
}
.menu-item i { flex: 1; border-bottom: 4px dotted var(--bone-3); transform: translateY(-4px); }
.menu-item b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (hover: hover) { .menu-item:hover { color: var(--red); } }
@media (hover: hover) { .menu-item:hover i { border-color: var(--red); } }

/* ---------- Home: how a game goes, printed on a slip ---------- */
.slip-sec {
  background: var(--felt); padding: 160px var(--margin); color: var(--bone);
  display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: 48px 72px; align-items: start;
  max-width: 1240px; margin: 0 auto; box-sizing: content-box;
}
.slip-intro p { font-size: var(--step-lead); margin-top: 20px; max-width: 30ch; }
.slip {
  background: var(--bone); color: var(--ink); padding: 36px 32px 64px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 95% 100%, 90% calc(100% - 14px), 85% 100%, 80% calc(100% - 14px), 75% 100%, 70% calc(100% - 14px), 65% 100%, 60% calc(100% - 14px), 55% 100%, 50% calc(100% - 14px), 45% 100%, 40% calc(100% - 14px), 35% 100%, 30% calc(100% - 14px), 25% 100%, 20% calc(100% - 14px), 15% 100%, 10% calc(100% - 14px), 5% 100%, 0 calc(100% - 14px));
}
.slip h3 { font-size: 1.25rem; margin: 28px 0 10px; }
.slip h3:first-child { margin-top: 0; }
.slip .row { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 1rem; }
.slip .row i { flex: 1; border-bottom: 4px dotted var(--bone-3); transform: translateY(-4px); }
.slip .row b { font-weight: 700; white-space: nowrap; }
.slip .total { margin: 28px -32px 0; padding: 12px 32px; background: var(--ink); color: var(--bone); justify-content: space-between; }

/* ---------- Home: lifelines are a hand of cards ---------- */
.hand-sec { background: var(--bone); padding: 160px var(--margin); text-align: center; }
.lead { font-size: var(--step-lead); max-width: 42ch; margin: 20px auto 0; }
.hand { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 72px; max-width: 1060px; margin: 0 auto; padding: 64px 0 24px; }
.ll-card {
  position: relative; flex: none; width: 230px; min-height: 330px; margin: 0 -18px;
  background: var(--felt); color: var(--bone); border-radius: var(--card-r);
  padding: 52px 20px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  transform: rotate(var(--r)) translateY(var(--y));
  transition: transform .3s var(--ease);
}
.ll-card:nth-child(even) { background: var(--red); }
@media (hover: hover) { .ll-card:hover { transform: rotate(0) translateY(-24px); z-index: 2; } }
.ll-card .corner { position: absolute; top: 14px; right: 16px; font-size: 1.5rem; line-height: 1; }
.ll-card .ic { font-size: 3.25rem; line-height: 1; }
.ll-card h3 { font-size: 1.5rem; }
.ll-card p { font-size: 1rem; flex: 1; }
.ll-card .when { font-size: var(--step-small); font-weight: 700; background: var(--bone); color: var(--ink); border-radius: 999px; padding: 4px 14px; }
.ll-card .new { position: absolute; top: 14px; left: 16px; font-family: var(--display); font-size: var(--step-small); color: var(--gold-soft); }

/* ---------- Home: action mode, three slips ---------- */
.action-sec { background: var(--felt-2); color: var(--bone); padding: 160px var(--margin); }
.action-head { max-width: 1180px; margin: 0 auto 56px; display: grid; grid-template-columns: auto 1fr; gap: 24px 64px; align-items: end; }
.action-head p { font-size: var(--step-lead); max-width: 48ch; }
.twist-cols { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.twist-col { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 28px 24px; }
.twist-col:nth-child(2) { background: var(--bone-2); }
.twist-col:nth-child(3) { background: var(--gold-soft); }
.twist-col h3 { font-size: 1.75rem; }
.twist-col > p { color: var(--muted); font-weight: 500; margin: 4px 0 16px; }
.twist-col div { display: grid; grid-template-columns: 2rem 1fr; gap: 2px 10px; padding: 10px 0; }
.twist-col div span { grid-row: span 2; font-size: 1.5rem; line-height: 1.2; }
.twist-col div b { font-family: var(--display); font-weight: 600; font-size: 1.125rem; }
.twist-col div small { font-size: 1rem; }

/* ---------- Home: FAQ as filed index cards ---------- */
.faq-sec { background: var(--bone-2); padding: 160px var(--margin); }
.faq-sec h2 { max-width: 900px; margin: 0 auto 72px; }
.drawer { max-width: 900px; margin: 0 auto; }
.fcard { position: relative; border-radius: 0 0 var(--card-r) var(--card-r); margin-top: -12px; padding: 18px 28px 22px; }
.fcard:first-child { margin-top: 0; }
.fcard:nth-child(3n+1) { background: var(--bone); }
.fcard:nth-child(3n+2) { background: var(--gold-soft); }
.fcard:nth-child(3n) { background: var(--bone-3); }
.fcard .tab {
  position: absolute; bottom: 100%; inset-inline-start: calc(var(--t) * (100% - 128px)); height: 34px; white-space: nowrap; padding: 4px 26px 0;
  background: inherit; border-radius: 12px 12px 0 0;
  font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--muted);
}
.fcard + .fcard { margin-top: 30px; }
.fcard button { display: block; width: 100%; text-align: start; background: none; font-size: 1.25rem; font-weight: 700; padding: 0; }
.fcard p { font-size: 1.0625rem; max-width: 60ch; margin-top: 10px; }

/* ---------- Home: closing question ---------- */
.cta {
  min-height: 92svh; background: var(--ink); color: var(--bone);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 40px var(--margin) 32px; text-align: center; gap: 32px;
}
.cta-top, .cta-bottom { font-family: var(--display); font-weight: 700; font-size: clamp(4.5rem, 1rem + 11vw, 10.5rem); line-height: 1; }
.cta-bottom { color: var(--red); }
.cta-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center; }
.cta-row span { color: var(--bone-3); font-size: 1.125rem; }
.cta-note { color: var(--bone-3); margin-top: -12px; }

/* ---------- Footer: the back of the card ---------- */
.foot { background: var(--felt-2); color: var(--bone); padding: 72px var(--margin) 48px; overflow: hidden; }
body:not([data-view="home"]) .foot { display: none; }
.foot-name { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 13vw, 12rem); line-height: 1.1; white-space: nowrap; color: var(--felt-3); }
.foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-top: 48px; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }
.foot-links a { color: var(--bone); font-family: var(--display); font-size: 1.75rem; text-decoration: none; }
@media (hover: hover) { .foot-links a:hover { color: var(--gold-soft); } }
.foot-row > p { max-width: 36ch; color: var(--bone-3); align-self: end; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 40px; }
.foot-legal a { color: var(--bone-3); font-size: var(--step-small); }
.credits { margin-top: 40px; color: var(--bone-3); font-size: var(--step-small); }
.credits summary { cursor: pointer; font-weight: 700; color: var(--bone); }
.credits p { margin: 12px 0; max-width: 70ch; }
.credits ul { columns: 2 320px; margin: 0; padding: 0; list-style: none; }
.credits li { margin-bottom: 4px; break-inside: avoid; }
.credits a { color: inherit; }

/* ---------- Felt views ---------- */
.felt { background: var(--felt); color: var(--bone); min-height: calc(100svh - 76px); }
.page { max-width: 1180px; margin: 0 auto; padding: 48px var(--margin) 80px; }
.page > h2 { margin-bottom: 28px; }

/* Setup */
.teams-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.team-setup {
  position: relative; background: var(--bone); color: var(--ink); border-radius: var(--card-r);
  padding: 24px 24px 22px; cursor: pointer; transition: transform .2s var(--ease), background .2s;
}
.team-setup.active { background: var(--gold-soft); }
.team-setup .suit { position: absolute; top: 14px; left: 20px; font-size: 2.25rem; line-height: 1; }
.team-setup[data-team="1"] .suit { color: var(--red); }
.team-setup label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; padding-left: 48px; }
.team-setup input, .picker-top input, .f-team input {
  font: inherit; font-size: 1.25rem; padding: 10px 16px; border-radius: 12px; border: 0;
  background: var(--bone-2); color: var(--ink);
}
.team-setup.active input { background: var(--bone); }
.team-setup h4 { font-size: 1.125rem; margin: 20px 0 10px; }
.picking { display: none; font-family: var(--text); font-size: var(--step-small); background: var(--ink); color: var(--bone); padding: 2px 12px; border-radius: 999px; margin-inline-start: 6px; }
.team-setup.active .picking { display: inline-block; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot {
  min-height: 56px; border-radius: 12px; background: var(--bone-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 0.9375rem; padding: 6px 8px; text-align: center;
}
.slot.filled { background: var(--felt); color: var(--bone); }
.team-setup[data-team="1"] .slot.filled { background: var(--red); }
.slot.filled span { opacity: .7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; background: var(--bone-2); color: var(--ink);
  font-weight: 500; font-size: 0.9375rem; transition: background .15s, transform .15s;
}
@media (hover: hover) { .chip:hover { transform: translateY(-1px); background: var(--bone-3); } }
.chip.on { background: var(--ink); color: var(--bone); }
.team-setup[data-team="1"] .chip.on { background: var(--red); }

.picker { background: var(--felt-2); border-radius: var(--card-r); padding: 22px; margin-bottom: 20px; }
.picker-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.picker-top h3 { font-size: 1.5rem; }
.picker-top h3 span { color: var(--gold-soft); }
.picker-tools { display: flex; gap: 8px; align-items: center; flex: 0 1 400px; min-width: 0; }
.picker-tools input { flex: 1; min-width: 0; font-size: 1rem; border-radius: 999px; }
.picker-tools .chip { background: var(--gold-soft); }
.sec-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0; scrollbar-width: thin; }
.sec-tabs button { flex: none; padding: 7px 16px; border-radius: 999px; background: var(--felt-3); color: var(--bone); font-weight: 500; font-size: 0.9375rem; }
.sec-tabs button.on { background: var(--bone); color: var(--ink); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; max-height: 460px; overflow-y: auto; padding: 14px 4px 4px; }
.cat-card {
  position: relative; background: var(--bone); color: var(--ink); border-radius: 14px; aspect-ratio: 5 / 6;
  padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .15s var(--ease);
}
@media (hover: hover) { .cat-card:hover { transform: translateY(-3px) rotate(-1deg); } }
.cat-card .ic { font-size: 2.25rem; line-height: 1.1; }
.cat-card b { font-family: var(--display); font-weight: 600; font-size: 1rem; text-align: center; line-height: 1.2; }
.cat-card small { color: var(--muted); font-size: 0.8125rem; }
.cat-card.picked { background: var(--tc); color: var(--bone); }
.cat-card.picked small { color: var(--bone-3); }
.cat-card em {
  position: absolute; top: -10px; inset-inline-start: 8px; font-style: normal; font-size: 0.8125rem; font-weight: 700;
  background: var(--gold-soft); color: var(--ink); padding: 0 10px; border-radius: 999px; max-width: 85%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.empty { grid-column: 1 / -1; text-align: center; color: var(--bone-3); padding: 24px; }

.settings { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 20px 24px; margin-bottom: 16px; }
.settings h3 { font-size: 1.375rem; margin-bottom: 8px; }
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.set-row > span { font-weight: 700; min-width: 130px; }
.set-row .note { font-weight: 400; color: var(--muted); min-width: 0; font-size: 0.9375rem; flex-basis: 100%; }
.error { color: var(--gold-soft); font-weight: 700; min-height: 1.5em; }

/* ---------- Board: card backs on the felt ---------- */
.game { padding: 18px var(--margin); display: flex; flex-direction: column; }
.board { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1400px; width: 100%; margin: 0 auto; }
.col { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; }
.col-head {
  grid-column: 2; grid-row: 1 / span 3; position: relative;
  border-radius: var(--card-r); background: var(--bone); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; text-align: center;
}
.col-head::before { content: attr(data-suit); position: absolute; top: 8px; right: 10px; font-size: 1.125rem; line-height: 1; color: var(--c); }
.col-head .ic { font-size: clamp(2.25rem, 4.5vw, 4rem); line-height: 1.1; }
.col-head b { font-family: var(--display); font-weight: 600; font-size: clamp(0.9375rem, 1.5vw, 1.25rem); line-height: 1.2; }
.cell {
  position: relative; border-radius: 12px; color: var(--bone);
  background-color: var(--felt-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 1l7 7-7 7-7-7z' fill='none' stroke='%2346561a' stroke-width='1.5'/%3E%3C/svg%3E");
  font-family: var(--display); font-weight: 700; font-size: clamp(1.125rem, 2vw, 1.75rem); padding: 10px 0;
  transition: transform .15s var(--ease), background-color .2s;
}
.cell span { background: var(--felt-2); padding: 0 10px; border-radius: 999px; }
@media (hover: hover) { .cell:hover:not(:disabled) { transform: translateY(-3px) rotate(-1.5deg); background-color: var(--red); } }
@media (hover: hover) { .cell:hover:not(:disabled) span { background: var(--red); } }
.cell:disabled { background: var(--felt-3); background-image: none; color: transparent; cursor: default; }
.cell:disabled span { background: none; }
.cell.gold:disabled { background: var(--gold); color: var(--ink); }
.cell .tw { position: absolute; top: 2px; left: 6px; font-size: 0.875rem; color: var(--bone); }
.cell:disabled .tw { opacity: .8; }

.scorebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; max-width: 1400px; width: 100%; margin: 18px auto 0; }
.team-score {
  position: relative; background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 12px 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  transition: background .2s;
}
.team-score.turn { background: var(--gold-soft); }
.team-score h3 { font-size: 1.375rem; color: var(--tc); display: flex; gap: 8px; align-items: center; }
.team-score .fire { font-family: var(--text); font-size: 0.9375rem; color: var(--red); }
.score-row { display: flex; align-items: center; gap: 10px; grid-row: span 2; }
.score-row strong { font-family: var(--display); font-size: 2.5rem; min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.score-row button { width: 34px; height: 34px; border-radius: 50%; background: var(--bone-2); font-size: 1.25rem; font-weight: 700; transition: background .15s; }
@media (hover: hover) { .score-row button:hover { background: var(--bone-3); } }
.log { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.875rem; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.log span { color: var(--muted); }
.log span.up { color: var(--felt); font-weight: 700; }
.log span.down { color: var(--red); font-weight: 700; }
.mini-ll { display: flex; gap: 6px; grid-column: 1 / -1; }
.mini-ll button {
  min-width: 40px; height: 40px; border-radius: 999px; font-size: 1.125rem; background: var(--bone-2); padding: 0 10px;
  transition: transform .15s, background .15s;
}
@media (hover: hover) { .mini-ll button:not(:disabled):hover { transform: translateY(-2px); background: var(--bone-3); } }
.mini-ll button:disabled { opacity: .3; cursor: default; }
.mini-ll button.armed { background: var(--ink); }
.turn-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--bone); text-align: center; }
.turn-pill { font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.turn-mid small { color: var(--bone-3); font-size: 0.875rem; }
.mod-pill { background: var(--gold-soft); color: var(--ink); border-radius: 999px; padding: 4px 14px; font-weight: 700; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- Question: one card face up ---------- */
.q-card {
  position: relative; flex: 1; max-width: 1100px; width: 100%; margin: 0 auto;
  background: var(--bone); color: var(--ink); border-radius: 26px;
  padding: 28px clamp(20px, 5vw, 72px) 40px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  animation: flipin .45s var(--ease);
}
@keyframes flipin { from { transform: perspective(1200px) rotateY(-70deg); opacity: 0; } }
.q-index { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: var(--display); font-weight: 700; color: var(--tc, var(--ink)); }
.q-index b { font-size: 1.5rem; }
.q-index span { font-size: 1.75rem; }
.q-index-top { top: 18px; right: 20px; }
.q-index-bottom { bottom: 18px; left: 20px; transform: rotate(180deg); }
.q-head { width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 56px; }
.q-head span { padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: 1.0625rem; }
.q-cat { background: var(--bone-2); }
.q-turn { color: var(--bone); background: var(--tc, var(--ink)); }
.q-val { background: var(--ink); color: var(--bone); }
.q-val.gold { background: var(--gold); color: var(--ink); }
.timer { position: relative; width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.timer span { font-family: var(--display); font-weight: 700; font-size: 2.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.timer::after {
  content: ""; display: block; width: 100%; height: 10px; border-radius: 999px;
  background: var(--tc, var(--ink)); transform-origin: right; transform: scaleX(var(--p, 1));
  transition: transform 1s linear;
}
.timer.done span { color: var(--red); }
.q-text { font-family: var(--display); font-weight: 700; font-size: clamp(1.625rem, 1rem + 2.4vw, 3rem); line-height: 1.5; margin: 4px 0; max-width: 28ch; transition: filter .4s, opacity .4s; }
.q-text.vanished, .q-media.vanished img { filter: blur(14px); opacity: .25; user-select: none; }
.cat-img { display: inline-block; width: 1.25em; height: 1.25em; border-radius: 24%; object-fit: cover; vertical-align: -.3em; background: var(--bone-2); }
.q-media { margin: 4px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.q-media img { display: block; max-width: min(100%, 720px); max-height: 42vh; border-radius: 16px; background: var(--bone-2); transition: filter .4s, opacity .4s; }
.q-broken { display: none; font-weight: 700; color: var(--red); }
.q-broken button { font-weight: 700; text-decoration: underline; background: none; color: var(--ink); }
.q-media.broken img, .q-media.broken figcaption { display: none; }
.q-media.broken .q-broken { display: block; }
.q-media figcaption { font-size: .75rem; color: var(--muted); max-width: 60ch; }
.q-media figcaption a { color: inherit; }
.q-media .player { display: flex; align-items: center; gap: 16px; width: min(100%, 520px); background: var(--ink); color: var(--bone); border-radius: 999px; padding-block: 10px; padding-inline: 10px 22px; }
.q-media .play { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: var(--bone); font-size: 1.5rem; }
.q-media .bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(236, 235, 231, .2); overflow: hidden; }
.q-media .bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.q-media .q-link { font-size: .9375rem; font-weight: 700; color: var(--red); }
.q-answer { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem); color: var(--bone); background: var(--felt); padding: 10px 32px; border-radius: 16px; }
.q-actions, .q-lifelines { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.q-actions .who { width: 100%; font-family: var(--display); font-weight: 600; font-size: 1.375rem; }
.q-lifelines button, .q-lifelines .locked {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: var(--bone-2); font-weight: 700; transition: background .15s, transform .15s;
}
@media (hover: hover) { .q-lifelines button:not(:disabled):hover { background: var(--gold-soft); transform: translateY(-2px); } }
.q-lifelines button:disabled { opacity: .35; cursor: default; }
.flag { background: var(--gold-soft); color: var(--ink); padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9375rem; }

/* Action twist banner on the card */
.twist {
  display: flex; align-items: center; gap: 14px; text-align: start;
  background: var(--ink); color: var(--bone); border-radius: 16px; padding: 10px 18px 10px 12px; max-width: 640px;
}
.twist .tw-ic { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--felt); border-radius: 12px; flex: none; }
.twist.hard .tw-ic { background: var(--red); }
.twist.easy .tw-ic { background: var(--felt-3); }
.twist.wild .tw-ic { background: var(--gold); }
.twist b { font-family: var(--display); font-weight: 600; font-size: 1.25rem; display: block; }
.twist small { font-size: 0.9375rem; color: var(--bone-2); }
.twist em { display: inline-block; font-style: normal; font-family: var(--text); font-weight: 700; font-size: .875rem; color: var(--ink); background: var(--gold-soft); border-radius: 999px; padding: 0 10px; margin-inline-start: 10px; vertical-align: middle; unicode-bidi: isolate; }
.twist button { margin-inline-start: auto; background: var(--bone); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
@media (hover: hover) { .twist button:hover { background: var(--gold-soft); } }
.twist.spinning .tw-ic { animation: spin .09s linear infinite; }
@keyframes spin { 50% { transform: translateY(-4px) scale(.92); } }
.q-hint { background: var(--gold-soft); border-radius: 16px; padding: 12px 22px; font-size: 1.25rem; font-weight: 700; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(760px, 100%); }
.choices div { background: var(--bone-2); border-radius: 14px; padding: 12px 16px; font-family: var(--display); font-weight: 600; font-size: 1.25rem; display: flex; gap: 10px; align-items: center; text-align: start; }
.choices div i { font-style: normal; color: var(--red); }
.choices div.right { background: var(--felt); color: var(--bone); }
.choices div.right i { color: var(--gold-soft); }

/* ---------- Joker: the card that flips over ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(20, 24, 6, .82); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.j-card {
  position: relative; width: min(440px, 100%); background: var(--bone); color: var(--ink); border-radius: 24px;
  padding: 44px 24px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.j-card::before, .j-card::after { content: "J"; position: absolute; font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1; color: var(--tc); }
.j-card::before { top: 14px; right: 18px; }
.j-card::after { bottom: 14px; left: 18px; transform: rotate(180deg); }
.j-card.flip { animation: flip .6s var(--ease); }
@keyframes flip { from { transform: perspective(900px) rotateY(90deg) scale(.85); opacity: 0; } }
.j-team { font-weight: 700; color: var(--tc); }
.j-icon { font-size: 4.5rem; line-height: 1.1; }
.j-card h3 { font-size: 2.25rem; color: var(--red); }
.j-text { font-size: 1.375rem; font-weight: 700; }
.j-card small { color: var(--muted); font-size: 0.9375rem; }
.j-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- Splash + toast ---------- */
.splash { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none; }
.splash div { background: var(--gold); color: var(--ink); border-radius: 26px; padding: 22px 44px; display: flex; flex-direction: column; align-items: center; }
.splash b { font-family: var(--display); font-size: clamp(2.25rem, 1rem + 5vw, 4.5rem); font-weight: 700; line-height: 1.1; }
.splash small { font-size: 1.375rem; font-weight: 700; }
.splash.go div { animation: pop 1.7s var(--ease) forwards; }
@keyframes pop { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 15% { transform: scale(1.06) rotate(1deg); opacity: 1; } 25% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 160%); opacity: 0; visibility: hidden;
  background: var(--ink); color: var(--bone); padding: 12px 24px; border-radius: 999px; font-weight: 700;
  transition: transform .25s var(--ease), opacity .25s, visibility .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Final wager ---------- */
.final-card { padding-top: 32px; }
.f-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.f-lead { font-size: var(--step-lead); }
.f-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.f-team { background: var(--bone-2); border-radius: var(--card-r); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.f-team h3 { color: var(--tc); font-size: 1.5rem; }
.f-score { font-family: var(--display); font-size: 2.25rem; font-weight: 700; }
.f-team label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; width: 100%; max-width: 260px; }
.f-team input { font-size: 1.5rem; text-align: center; background: var(--bone); }
.f-team .chips { justify-content: center; }
.f-team .chip { background: var(--bone); }
.f-team .chip.on { background: var(--tc); color: var(--bone); }
.f-wager { font-weight: 700; font-size: 1.25rem; }

/* ---------- Results ---------- */
.results { display: flex; justify-content: center; }
/* ---------- My games ---------- */
.mygames { max-width: 960px; color: var(--bone); }
.mine-bar { height: 8px; background: var(--bone-3); border-radius: 999px; overflow: hidden; }
.mine-bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.mine-progress { display: grid; gap: 12px; }
.mine-sec { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 4px 20px; }
.mine-sec summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font-weight: 800; font-size: 1.125rem; }
.mine-sec summary small { font-weight: 400; font-size: var(--step-small); color: var(--muted); }
.mine-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding-bottom: 18px; }
.mine-cat { background: var(--bone-2); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.mine-cat .nm { font-weight: 700; }
.mine-cat .ct { font-size: var(--step-small); color: var(--muted); }
.mine-cat .ct b { color: var(--ink); }
.mine-cat.fresh .mine-bar i { display: none; }
.mine-h { margin: 40px 0 16px; font-size: 1.5rem; }
.mine-list { display: grid; gap: 14px; }
.mine-empty { background: var(--felt-2); border-radius: var(--card-r); padding: 24px; text-align: center; }
.mine-empty a { color: var(--gold-soft); }
.mine-game { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.mine-game.open { box-shadow: inset 0 0 0 3px var(--gold); }
.mine-game header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-weight: 700; }
.mine-tag { background: var(--bone-2); border-radius: 999px; padding: 2px 12px; color: var(--ink); }
.mine-game.open .mine-tag { background: var(--gold-soft); }
.mine-score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mine-score div { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--bone-2); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.mine-score div.won { background: var(--ink); color: var(--bone); }
.mine-score b { font-size: 1.5rem; font-weight: 800; }
.mine-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.mine-cats span { display: inline-flex; align-items: center; gap: 6px; background: var(--bone-2); border-radius: 999px; padding: 3px 12px 3px 4px; font-size: var(--step-small); }
.mine-cats .cat-img { width: 1.6em; height: 1.6em; border-radius: 50%; object-fit: cover; }
.mine-game .btn { align-self: flex-start; }
@media (max-width: 640px) {
  .mine-sec { padding: 4px 12px; }
  .mine-sec summary { flex-direction: column; align-items: flex-start; gap: 2px; }
  .mine-cats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mine-cat { padding: 8px 10px; }
  .mine-cat .nm { font-size: .875rem; }
  .mine-cat .ct { font-size: .75rem; }
  .mine-score { grid-template-columns: 1fr; }
}

.results-card { background: var(--bone); color: var(--ink); border-radius: 28px; padding: 48px clamp(20px, 5vw, 64px); width: min(820px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.results-card h2 { font-size: clamp(2.5rem, 1rem + 5vw, 5rem); }
.final { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.final div { background: var(--bone-2); border-radius: var(--card-r); padding: 18px 36px; font-weight: 700; font-size: 1.25rem; }
.final strong { display: block; font-family: var(--display); font-size: 2.75rem; color: var(--red); }
.game-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.game-stats div { display: flex; flex-direction: column; gap: 2px; background: var(--tc); color: var(--bone); border-radius: var(--card-r); padding: 12px 24px; font-weight: 500; }
.game-stats b { font-family: var(--display); font-size: 1.25rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -40px; font-style: normal; font-size: 26px; line-height: 1; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: translateX(40px) rotate(540deg); } }

/* ---------- Entrance for home sections ---------- */
.reveal > * { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in > * { opacity: 1; transform: none; }
.reveal.in > *:nth-child(2) { transition-delay: .08s; }
.reveal.in > *:nth-child(3) { transition-delay: .16s; }
.reveal.in > *:nth-child(4) { transition-delay: .24s; }

/* ---------- Nav user ---------- */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .who { display: flex; flex-direction: column; line-height: 1.25; font-weight: 700; color: var(--bone); text-align: start; text-decoration: none; }
@media (hover: hover) { .nav-user .who:hover { color: var(--gold-soft); } }
body[data-view="mygames"] .nav-user .who { text-decoration: underline; text-underline-offset: 4px; }
.nav-user .who small { font-weight: 400; font-size: .8125rem; color: var(--gold-soft); }
body[data-view="login"] .nav nav, body[data-view="login"] #navResume { display: none; }

/* ---------- Login ---------- */
.login-view { display: grid; place-items: center; padding: 48px var(--margin); }
.login-card {
  position: relative; width: min(460px, 100%); background: var(--bone); color: var(--ink); border-radius: 28px;
  padding: 56px clamp(20px, 5vw, 44px) 40px; display: flex; flex-direction: column; gap: 16px; text-align: center;
  animation: flipin .5s var(--ease);
}
.login-card { container-type: inline-size; }
.login-title { font-size: min(clamp(3.5rem, 2rem + 6vw, 5.5rem), 13.5cqi); white-space: nowrap; line-height: 1.1; padding-bottom: .22em; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; text-align: start; }
.login-card input, .admin-card input {
  font: inherit; font-size: 1.125rem; padding: 12px 16px; border-radius: 12px; border: 2px solid transparent;
  background: var(--bone-2); color: var(--ink);
}
.login-card input:focus, .admin-card input:focus { outline: none; border-color: var(--ink); }
.login-card .error { color: var(--red); min-height: 1.5em; margin: -4px 0; }
.login-card .btn { width: 100%; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 18px; }
.admin-card { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.admin-card h3 { font-size: 1.5rem; }
.admin-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.admin-card .inline { display: flex; gap: 8px; }
.admin-card .inline input { flex: 1; min-width: 0; }
.admin-card .btn { align-self: flex-start; }
.admin-card .msg { min-height: 1.5em; font-weight: 700; color: var(--felt); }
.admin-msg { min-height: 1.6em; font-weight: 700; color: var(--gold-soft); margin-bottom: 12px; font-size: 1.125rem; }
.admin-table-wrap { background: var(--bone); color: var(--ink); border-radius: var(--card-r); padding: 8px 16px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.admin-table th { text-align: start; padding: 12px 10px; font-weight: 800; border-bottom: 2px solid var(--bone-3); white-space: nowrap; }
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--bone-2); vertical-align: middle; }
.admin-table td b { font-size: 1.0625rem; }
.admin-table td small { margin-inline-start: 8px; background: var(--gold-soft); border-radius: 999px; padding: 1px 10px; font-size: .8125rem; font-weight: 700; }
.admin-table .num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.admin-table .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-table .acts .chip { padding: 6px 12px; font-size: .875rem; }
.admin-table .chip.danger { background: var(--red); color: var(--bone); }
.admin-table tr.off td { opacity: .55; }
.admin-table tr.off .acts { opacity: 1; }
.admin-table .msg-text { white-space: pre-line; min-width: 220px; }
.twist .tw-btns { display: flex; flex-direction: column; gap: 6px; margin-inline-start: auto; }

/* ---------- Suggestions ---------- */
.suggest-sec { background: var(--felt); padding: 160px var(--margin); }
.suggest-card { max-width: 900px; margin: 0 auto; background: var(--red); color: var(--bone); border-radius: 28px; padding: clamp(28px, 5vw, 56px); text-align: center; }
.suggest-card .lead { margin: 16px auto 28px; }
.suggest-form { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.suggest-form input { flex: 1; min-width: 0; font: inherit; font-size: 1.125rem; padding: 12px 18px; border-radius: 999px; border: 2px solid transparent; background: var(--bone); color: var(--ink); }
.suggest-form input::placeholder { color: var(--muted); }
.suggest-form input:focus { outline: none; border-color: var(--gold); }
.suggest-form .btn { background: var(--ink); color: var(--bone); }
@media (hover: hover) { .suggest-form .btn:hover { background: var(--felt-2); } }
.suggest-msg { min-height: 1.6em; margin-top: 10px; font-weight: 700; color: var(--gold-soft); }
.suggest-new { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.suggest-new:empty { display: none; }
.suggest-new b { width: 100%; }
.suggest-new span { background: var(--bone); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.suggest-new a { align-self: center; color: var(--gold-soft); font-weight: 700; padding: 6px 8px; }
.suggest-end { width: 100%; background: var(--red); color: var(--bone); border-radius: var(--card-r); padding: 22px 18px 10px; }
.suggest-end h3 { font-size: 1.375rem; margin-bottom: 12px; }
.cat-card .new, .menu-item .new { font-style: normal; font-size: .75rem; font-weight: 800; background: var(--red); color: var(--bone); border-radius: 999px; padding: 0 8px; }
.cat-card .new { position: absolute; top: -8px; inset-inline-end: 8px; }
.admin-sub { font-size: 1.75rem; margin: 40px 0 6px; }
.admin-note { color: var(--bone-2); margin-bottom: 14px; }
.admin-table .st { font-weight: 700; white-space: nowrap; }
.admin-table .st.pending { color: var(--gold); }
.admin-table .st.done { color: var(--felt); }
.admin-table .st.rejected { color: var(--red); }
.admin-table td.note { font-size: .875rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal > * { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, 1fr); }
  .slip-sec { grid-template-columns: 1fr; }
  .twist-cols { grid-template-columns: 1fr; }
  .action-head { grid-template-columns: 1fr; }
  .hand { flex-wrap: wrap; gap: 16px; }
  .ll-card { margin: 0; transform: none; }
}
@media (max-width: 640px) {
  .nav { gap: 12px; height: 64px; }
  .nav nav { display: none; }
  .wordmark { font-size: 1.625rem; flex: 1; }
  .hero { min-height: 0; padding-top: 24px; padding-bottom: 24px; }
  .hero-meta { display: grid; grid-template-columns: auto auto; gap: 8px 22px; }
  .hero-meta i { display: none; }
  .hero-card { border-radius: 22px; }
  .hero-hand { height: 190px; }
  .hero-hand div { bottom: 24px; }
  .hero-hand div { width: 92px; height: 130px; margin-left: -46px; font-size: .8125rem; }
  .hero-hand div span { font-size: 1.75rem; }
  .menu-sec, .slip-sec, .hand-sec, .action-sec, .faq-sec { padding-top: 96px; padding-bottom: 96px; }
  .menu-sec { padding-top: 8px; }
  .menu-sheet { padding: 28px 20px; }
  .slip { padding: 28px 20px 56px; }
  .slip .total { margin: 24px -20px 0; padding: 12px 20px; }
  .ll-card { width: 100%; min-height: 0; padding: 44px 18px 18px; }
  .fcard { padding: 16px 18px 18px; }
  .fcard .tab { inset-inline-start: calc(var(--t) * (100% - 92px)); padding: 4px 16px 0; font-size: .875rem; }
  .cta-row { flex-direction: column; gap: 12px; }
  .cta-row .btn { width: 100%; }
  .teams-setup { grid-template-columns: 1fr; }
  .slots { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .picker-tools { flex: 1 1 100%; }
  .board { grid-template-columns: 1fr; }
  .scorebar { grid-template-columns: 1fr 1fr; }
  .turn-mid { grid-column: 1 / -1; grid-row: 1; }
  .team-score { grid-template-columns: 1fr; padding: 10px 12px; }
  .score-row { grid-row: auto; }
  .score-row strong { font-size: 1.875rem; min-width: 64px; }
  .q-head { padding: 0 34px; }
  .choices { grid-template-columns: 1fr; }
  .f-teams { grid-template-columns: 1fr; }
  .twist { flex-wrap: wrap; }
  .twist button { margin-inline-start: 0; }
  .twist .tw-btns { flex-direction: row; flex-wrap: wrap; margin-inline-start: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .suggest-form { flex-direction: column; }
  .suggest-sec { padding-top: 96px; padding-bottom: 96px; }
  .nav-user .who small { display: none; }
  .nav-user .who { font-size: .875rem; }
  #navPlay { display: none; }
}

/* Question feedback */
.q-report { display: block; margin: 18px auto 0; background: none; color: inherit; opacity: .65; font: inherit; font-size: var(--step-small); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { .q-report:hover { opacity: 1; } }
.q-report:disabled { text-decoration: none; cursor: default; }
.fb-dialog { border: 0; border-radius: var(--card-r); padding: 28px 24px; width: min(480px, calc(100% - 32px)); background: var(--bone); color: var(--ink); }
.fb-dialog::backdrop { background: rgb(0 0 0 / .55); }
.fb-dialog h3 { font-size: 1.375rem; margin-bottom: 8px; }
.fb-q { font-size: var(--step-small); opacity: .8; margin-bottom: 16px; }
.fb-kinds { display: grid; gap: 8px; margin-bottom: 14px; }
.fb-kinds label { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bone-2); cursor: pointer; }
.fb-kinds label:has(input:checked) { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--ink); }
.fb-dialog textarea { width: 100%; font: inherit; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--bone-3); background: #fff; color: var(--ink); resize: vertical; }
.fb-btns { display: flex; gap: 10px; margin-top: 16px; }
.admin-table .st.fixed, .admin-table .st.removed { color: var(--felt); }

/* Line-up questions: a vertical pitch, attacking upwards, team's right on the right */
.q-media.xi { align-self: stretch; }
.q-media .pitch {
  position: relative; width: min(100%, 640px); height: clamp(320px, 40vh, 440px); padding: 12px 6px;
  display: flex; flex-direction: column-reverse; justify-content: space-around;
  border-radius: 16px; border: 3px solid rgb(255 255 255 / .55);
  background:
    radial-gradient(circle at 50% 0, transparent 0 17%, rgb(255 255 255 / .5) 17% calc(17% + 2px), transparent calc(17% + 2px)),
    linear-gradient(transparent calc(100% - 22%), rgb(255 255 255 / .12) 0),
    repeating-linear-gradient(#3f7d2c 0 12.5%, #377226 12.5% 25%);
}
.q-media .pitch::after { content: ""; position: absolute; inset: auto 30% 0; height: 16%; border: 2px solid rgb(255 255 255 / .5); border-bottom: 0; }
.pitch .formation { position: absolute; bottom: 8px; inset-inline-start: 12px; font-size: .8125rem; font-weight: 700; color: rgb(255 255 255 / .85); direction: ltr; }
.pitch .line { display: flex; justify-content: space-evenly; position: relative; z-index: 1; }
.pitch .pl { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; flex: 0 1 22%; }
.pitch .pl i { width: clamp(22px, 4.2vw, 34px); aspect-ratio: 1; border-radius: 50%; background: var(--kit); border: 2px solid var(--ring); box-shadow: 0 2px 6px rgb(0 0 0 / .35); font-style: normal; }
.pitch .pl b { font-size: clamp(.6875rem, 1.6vw, .9375rem); font-weight: 700; color: #fff; background: rgb(0 0 0 / .5); border-radius: 6px; padding: 1px 6px; max-width: 100%; text-align: center; line-height: 1.25; }
.pitch .pl.miss i { display: grid; place-items: center; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 1.1em; animation: pl-pulse 1.4s ease-in-out infinite; }
.pitch .pl.miss b { background: var(--gold); color: var(--ink); }
.pitch .pl.miss b:empty { display: none; }
@keyframes pl-pulse { 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .pitch .pl.miss i { animation: none; } }

/* Phones on their side (and other short screens): everything for one question fits without scrolling. */
@media (orientation: landscape) and (max-height: 520px) {
  .nav { height: 46px; gap: 12px; }
  .nav nav { display: none; }
  .wordmark { font-size: 1.375rem; flex: 1; }
  .nav .btn-small { padding: 6px 14px; font-size: .875rem; }
  .nav-sound { width: 34px; height: 34px; }
  .nav-user { font-size: .8125rem; }

  .game { padding: 8px var(--margin) 10px; }
  #view-board { height: calc(100svh - 46px); }
  #view-board .board { min-height: 0; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px 14px; }
  #view-board .col { grid-template-rows: repeat(3, 1fr); gap: 5px; min-height: 0; }
  .col-head { padding: 4px; gap: 2px; border-radius: 12px; }
  .col-head::before { top: 4px; right: 6px; font-size: .875rem; }
  .col-head .ic { font-size: 1.75rem; }
  .col-head b { font-size: .8125rem; }
  .cell { padding: 0; font-size: 1.0625rem; border-radius: 9px; }
  .scorebar { margin-top: 8px; gap: 10px; }
  .team-score { padding: 6px 12px; gap: 2px 10px; border-radius: 14px; }
  .team-score h3 { font-size: 1rem; }
  .log { display: none; }
  .score-row { gap: 6px; }
  .score-row strong { font-size: 1.5rem; min-width: 60px; }
  .score-row button { width: 28px; height: 28px; font-size: 1rem; }
  .mini-ll button { min-width: 30px; height: 30px; font-size: .9375rem; padding: 0 6px; }
  .turn-pill { font-size: 1rem; }
  .turn-mid small, .mod-pill { font-size: .75rem; }

  .q-card { padding: 10px 44px 10px; gap: 6px; border-radius: 18px; }
  .q-index b { font-size: 1.125rem; }
  .q-index span { font-size: 1.25rem; }
  .q-index-top { top: 10px; right: 12px; }
  .q-index-bottom { bottom: 10px; left: 12px; }
  .q-head span { padding: 3px 12px; font-size: .875rem; }
  .timer span { font-size: 1.375rem; }
  .timer::after { height: 6px; }
  .q-text { font-size: clamp(1.25rem, 3.6vh + .4rem, 1.875rem); line-height: 1.35; max-width: 40ch; }
  .q-answer { font-size: 1.5rem; padding: 6px 22px; }
  .twist { padding: 6px 10px; gap: 10px; }
  .twist .tw-ic { width: 34px; height: 34px; font-size: 1.25rem; }
  .twist b { font-size: 1rem; }
  .twist small { font-size: .8125rem; }
  .q-actions .btn, .q-lifelines button { padding: 7px 16px; font-size: .9375rem; }
  .q-actions, .q-lifelines { gap: 8px; }
  .q-media img { max-height: 46svh; }
  .q-media .pitch { height: max(240px, calc(100svh - 150px)); }
  .q-report { margin-top: 0; }
  .q-actions .who { font-size: 1rem; }
}

/* Random categories: which sections the dice may draw from */
.rand-secs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 14px; }
.rand-secs > span { font-weight: 700; margin-inline-end: 4px; }
.rand-secs .chip { padding: 5px 12px; font-size: .875rem; }

/* Charades: only a QR code on screen */
.host-btn { margin-top: 6px; font: inherit; font-weight: 700; font-size: var(--step-small); color: var(--bone); background: var(--felt-3); border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.host-btn.on { background: var(--gold); color: var(--ink); }
.host-dialog { text-align: center; }
.host-dialog .qr { width: min(260px, 70vw); aspect-ratio: 1; margin: 16px auto 8px; background: #fff; border-radius: 16px; padding: 8px; }
.host-dialog .qr svg { display: block; width: 100%; height: 100%; }
.host-dialog .host-link a { color: var(--muted); }
.host-dialog .fb-btns { justify-content: center; }
.q-media.act .qr { width: min(240px, 60vw); aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.q-media.act .qr svg { display: block; width: 100%; height: 100%; }
.q-media .act-note { font-size: 1rem; font-weight: 700; color: var(--ink); max-width: 36ch; }
@media (orientation: landscape) and (max-height: 520px) { .q-media.act .qr { width: min(170px, 42svh); } }

/* ---------- Secret pick ---------- */
.secret-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; color: var(--bone); }
.secret-row small { flex: 1 1 220px; color: var(--bone-3, #cfcdc6); font-size: .875rem; line-height: 1.5; }
.secret-row .chip.on { background: var(--gold); color: var(--ink); }
/* Each team's box shows its QR code until its phone has picked. */
.secret-mode .picker, .secret-mode #randomPick, .secret-mode .team-setup h4 { display: none; }
.team-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.team-qr svg { width: 180px; height: 180px; background: #fff; padding: 10px; border-radius: 14px; }
.team-qr p { font-weight: 700; line-height: 1.5; }
.team-qr a { font-size: .875rem; color: inherit; opacity: .7; }
.team-done { text-align: center; font-weight: 800; font-size: 1.125rem; padding: 18px 8px; }
.team-done small { display: block; font-weight: 400; font-size: .875rem; opacity: .7; margin-top: 4px; }
/* In the game, a secret team's unused lifelines are face down here; the team plays them from its phone. */
body.secret-game .mini-ll button[data-ll]:not(.spent) { font-size: 0; pointer-events: none; }
body.secret-game .mini-ll button[data-ll]:not(.spent)::before { content: "🤫"; font-size: 18px; }
body.secret-game #qLifelines button { display: none; }
body.secret-game #qLifelines:has(button)::before { content: "🤫 وسائل المساعدة تنلعب من جوال الفريق"; font-weight: 700; opacity: .8; }
.teams-qrs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 4px; }
.teams-qrs > div { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.teams-qrs b { color: var(--tc); font-size: 1.0625rem; }
.teams-qrs svg { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 12px; }
.teams-qrs a { font-size: .8125rem; color: inherit; opacity: .7; }
@media (max-width: 380px) { .teams-qrs { grid-template-columns: 1fr; } }

/* ---------- Today's free quick game ---------- */
.hero-daily { margin-top: 14px; font-weight: 700; color: var(--red); }
.hero-daily:empty { display: none; }

/* ---------- Ideas, rewards, swap cards ---------- */
.suggest-kind { display: flex; gap: 8px; justify-content: center; width: 100%; flex-wrap: wrap; }
.suggest-kind .chip.on { background: var(--ink); color: var(--bone); }
.fb-reward { font-size: .875rem; font-weight: 700; color: var(--red); margin: 8px 0 0; }
.gift-dialog { text-align: center; }
.gift-dialog .gift-big { font-size: 56px; line-height: 1; margin: 0; }
.gift-dialog p { line-height: 1.6; }
.gift-dialog small { color: var(--muted); }
.gift-dialog .gift-thanks { font-size: .875rem; color: var(--muted); }
.gift-dialog .fb-btns { justify-content: center; }
.suggest-form:has(.suggest-kind) { flex-wrap: wrap; }
.suggest-form .suggest-kind { flex-basis: 100%; }

/* ---------- Tournament («مود الكأس») ---------- */
.cup-page h2 { color: var(--bone); }
.cup-lead { color: var(--bone); font-size: 1.0625rem; line-height: 1.7; max-width: 60ch; margin: 8px 0 16px; }
.cup-note { color: var(--gold-soft); font-weight: 700; margin: 10px 0 16px; }
.cup-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.cup-sizes .chip.on { background: var(--gold); color: var(--ink); }
.cup-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cup-player { background: var(--bone); color: var(--ink); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cup-player input { font: inherit; font-weight: 800; font-size: 1.0625rem; border: 0; border-radius: 12px; padding: 10px 12px; background: var(--bone-2); color: var(--ink); width: 100%; }
.cup-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cup-cats .chip { font-size: .875rem; }
.cup-cats .chip.on { background: var(--ink); color: var(--bone); }
.cup-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 22px 0 8px; }
.cup-actions [disabled] { opacity: .5; }
.cup-bracket { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 12px; align-items: center; }
.cup-round { flex: 1 0 200px; display: flex; flex-direction: column; gap: 12px; justify-content: space-around; align-self: stretch; }
.cup-round h3 { color: var(--gold-soft); text-align: center; font-size: 1rem; }
.cup-match { background: var(--bone); color: var(--ink); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.cup-match > div { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; padding: 4px 2px; }
.cup-match > div + div { border-top: 1px solid rgb(0 0 0 / .08); }
.cup-match .won { color: var(--ink); }
.cup-match .won span::before { content: "🏆 "; }
.cup-match .lost { opacity: .45; text-decoration: line-through; }
.cup-match.next { box-shadow: 0 0 0 3px var(--gold); }
.cup-match .btn { margin-top: 6px; padding: 8px 12px; font-size: .9375rem; }
.cup-champ { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 18px; color: var(--bone); text-align: center; }
.cup-champ img { width: 110px; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .35)); }
.cup-champ b { color: var(--gold-soft); }
.cup-champ span { font-size: 2rem; font-weight: 800; }
.cup-result { margin: 14px 0; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.cup-result[hidden] { display: none; }
.cup-tie { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cup-pick { width: min(640px, calc(100vw - 24px)); max-height: 86svh; display: flex; flex-direction: column; gap: 10px; }
.cup-pick:not([open]) { display: none; }
.cup-pick-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cup-pick-close { border: 0; background: var(--bone-2); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; }
.cup-pick input[type=search] { font: inherit; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--bone-2); }
.cup-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; overflow-y: auto; }
.cup-pick-cat { position: relative; border: 0; border-radius: 12px; overflow: hidden; background: var(--bone-2); padding: 0 0 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.cup-pick-cat img { width: 100%; height: 82px; object-fit: cover; display: block; }  /* a fixed height: aspect-ratio collapses in WebKit scrolling grids */
.cup-pick-cat span { font-size: 28px; padding-top: 8px; }
.cup-pick-cat b { font-size: .8125rem; padding: 0 6px; }
.cup-pick-cat.on { outline: 3px solid var(--gold); outline-offset: -3px; background: var(--gold-soft); }
@media (max-width: 640px) {
  .cup-bracket { flex-direction: column; align-items: stretch; }
  .cup-round { flex: none; }
}
