/* RevizTV design system — Moroccan night arcade. RTL-first, mobile-first. */
:root {
  --bg: #0f0d24;
  --bg-2: #161338;
  --card: #1d1946;
  --card-2: #262058;
  --card-3: #2f2869;
  --line: #3a3280;
  --ink: #f7f4ff;
  --muted: #b3acdf;
  --dim: #8079b8;
  --majorelle: #6150ff;
  --majorelle-2: #8577ff;
  --mint: #2fe39c;
  --mint-dark: #17a873;
  --saffron: #ffc83a;
  --saffron-dark: #d99a00;
  --tomato: #ff5263;
  --tomato-dark: #c42a3b;
  --teal: #1ccad8;
  --pink: #ff7ac6;
  --felt: #0f6b47;
  --felt-2: #0b5538;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(5, 3, 20, .45);
  --font: "Rubik", "Segoe UI", Tahoma, sans-serif;
  --display: "Lalezar", "Rubik", sans-serif;
  --tabbar-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(97, 80, 255, .28), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(28, 202, 216, .12), transparent 60%),
    url("/assets/img/zellige.svg");
  background-size: auto, auto, 120px 120px;
  background-attachment: fixed;
}
a { color: var(--majorelle-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.25; margin: 0 0 .4em; letter-spacing: 0; }
h1 { font-size: clamp(30px, 7vw, 54px); }
h2 { font-size: clamp(24px, 4.5vw, 34px); }
h3 { font-size: 22px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
.page { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 24px 0 calc(var(--tabbar-h) + 32px); flex: 1; }
.page.wide { width: min(1320px, 100% - 24px); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.spacer { flex: 1; }
@media (min-width: 900px) { .page { padding-bottom: 48px; } }

/* ---------- top bar & tab bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(15, 13, 36, .82);
  border-bottom: 1px solid rgba(97, 80, 255, .25);
}
.topbar-in { width: min(1320px, 100% - 24px); margin: 0 auto; display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-size: 24px; text-decoration: none !important; white-space: nowrap; }
.brand .logo { width: 40px; height: 40px; }
.brand b { color: var(--saffron); font-weight: 400; }
.nav { display: none; gap: 6px; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--card); }
.nav a.nav-admin { color: var(--saffron); border: 1px solid rgba(255, 200, 58, .4); }
.nav a.nav-admin.active { background: rgba(255, 200, 58, .15); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 600; max-width: 190px; text-decoration: none !important; }
.me-chip span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .nav { display: flex; } }

/* "🎓 تعلّم اللعبة" button: soft pulsing glow + a shine sweep (no flashing; off in calm / reduced motion) */
.btn-learn { position: relative; z-index: 2; overflow: hidden; align-self: flex-start; margin-top: 12px;
  --b: linear-gradient(135deg, #ff7ac6, #6150ff); --b-shadow: #3b2aa8; color: #fff;
  background: linear-gradient(135deg, #ff7ac6, #6150ff); border: 2px solid rgba(255, 255, 255, .5);
  animation: learn-pulse 1.8s ease-in-out infinite; }
.btn-learn .learn-shine { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-120%); animation: learn-shine 2.6s ease-in-out infinite; }
@keyframes learn-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 122, 198, .55), 0 6px 0 #3b2aa8; }
  50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(255, 122, 198, 0), 0 6px 0 #3b2aa8; }
}
@keyframes learn-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
body.rv-calm .btn-learn, body.rv-calm .btn-learn .learn-shine { animation: none; }
@media (prefers-reduced-motion: reduce) { .btn-learn, .btn-learn .learn-shine { animation: none; } }

/* Explainer video popup (same page, closes itself at the end) */
body.vp-open { overflow: hidden; }
.vp-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(5, 3, 20, .88); display: grid; place-items: center; padding: 16px; animation: pop .2s ease; }
.vp-box { position: relative; }
.vp-video { display: block; background: #000; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.vp-video.pc { width: min(1100px, 92vw, (100vh - 90px) * 16 / 9); aspect-ratio: 16 / 9; height: auto; }
.vp-video.phone { height: min(86vh, 100vw * 16 / 9 - 40px); aspect-ratio: 9 / 16; width: auto; max-width: 92vw; }
.vp-close { position: absolute; top: -18px; inset-inline-start: -18px; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .6); background: var(--tomato); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
@media (max-width: 600px) { .vp-close { top: 6px; inset-inline-start: 6px; } }

/* /me: Osoul Nature coupons */
.coupon-row { padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--mint); }
.coupon-row.expired { opacity: .55; border-color: var(--line); }
.coupon-code { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--mint); }
.points-row .points-ico { font-size: 22px; }
.points-row .small { direction: rtl; }
.points-row.refunded .title, .points-row.revoked .title { color: var(--muted); }

/* "My parties" bar: open rooms the player can go back to */
.myrooms { background: rgba(255, 200, 58, .08); border-bottom: 1px solid rgba(255, 200, 58, .35); }
.myrooms-in { width: min(1320px, 100% - 24px); margin: 0 auto; padding: 8px 0; display: grid; gap: 6px; }
.myrooms-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.myrooms-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.myrooms-text strong { overflow-wrap: anywhere; }
.myrooms-x { width: 36px; height: 36px; font-size: 14px; }

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(22, 19, 56, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: 11px; font-weight: 600; text-decoration: none; min-height: 48px; }
.tabbar a .ico { font-size: 22px; line-height: 1; filter: grayscale(.6); }
.tabbar a.active { color: var(--ink); }
.tabbar a.active .ico { filter: none; transform: translateY(-2px) scale(1.08); }
@media (min-width: 900px) { .tabbar { display: none; } }
body.in-game .tabbar { display: none; }
body.in-game .page { padding-bottom: 24px; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--card-3); --b-shadow: #1a1546; --b-ink: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 14px; border: 0;
  background: var(--b); color: var(--b-ink); font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 4px 0 var(--b-shadow); transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  text-decoration: none !important; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--b-shadow); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--b-shadow); filter: grayscale(.4); }
.btn-primary { --b: var(--mint); --b-shadow: var(--mint-dark); --b-ink: #08261a; }
.btn-gold { --b: var(--saffron); --b-shadow: var(--saffron-dark); --b-ink: #2b1d00; }
.btn-blue { --b: var(--majorelle); --b-shadow: #3d2fc0; --b-ink: #fff; }
.btn-danger { --b: var(--tomato); --b-shadow: var(--tomato-dark); --b-ink: #fff; }
.btn-ghost { --b: transparent; --b-shadow: transparent; border: 2px solid var(--line); box-shadow: none; }
.btn-ghost:active { transform: translateY(1px); box-shadow: none; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 58px; padding: 14px 28px; font-size: 19px; border-radius: 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--card-2); }

/* ---------- cards & surfaces ---------- */
.card { background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.pad-lg { padding: 28px; }
.card h3 { margin-bottom: 8px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--muted); margin-bottom: 10px; text-transform: none; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-3); color: var(--muted); white-space: nowrap; }
.badge.mint { background: rgba(47, 227, 156, .15); color: var(--mint); }
.badge.gold { background: rgba(255, 200, 58, .15); color: var(--saffron); }
.badge.red { background: rgba(255, 82, 99, .15); color: var(--tomato); }
.badge.blue { background: rgba(97, 80, 255, .2); color: var(--majorelle-2); }
.sticker { display: inline-block; font-family: var(--display); font-size: 18px; padding: 4px 14px; border-radius: 10px; background: var(--saffron); color: #2b1d00; transform: rotate(-4deg); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.sticker.pink { background: var(--pink); color: #3a0024; transform: rotate(3deg); }
.sticker.mint { background: var(--mint); color: #08261a; transform: rotate(2deg); }

/* ---------- avatars ---------- */
.av { --s: 40px; width: var(--s); height: var(--s); flex: 0 0 var(--s); border-radius: 30%; display: inline-grid; place-items: center; background: var(--card-3); font-size: calc(var(--s) * .58); line-height: 1; position: relative; overflow: hidden; border: 2px solid rgba(255, 255, 255, .08); }
.av svg { width: 92%; height: 92%; }
.av.sm { --s: 30px; }
.av.lg { --s: 64px; }
.av.xl { --s: 96px; }
.av .dot { position: absolute; bottom: 2px; inset-inline-start: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); border: 2px solid var(--card); }
.av .dot.on { background: var(--mint); }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.avatar-picker button { border: 2px solid transparent; background: var(--card-2); border-radius: 16px; padding: 6px; cursor: pointer; display: grid; place-items: center; min-height: 56px; }
.avatar-picker button[aria-pressed="true"] { border-color: var(--saffron); background: var(--card-3); transform: scale(1.05); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: #120f2e; color: var(--ink); outline: none; }
.input:focus { border-color: var(--majorelle-2); }
textarea.input { min-height: 90px; resize: vertical; }
.code-input { text-transform: uppercase; letter-spacing: 6px; font-weight: 800; text-align: center; font-size: 22px; direction: ltr; }
.form-error { color: var(--tomato); font-weight: 600; font-size: 14px; min-height: 1.2em; }
.seg { display: inline-flex; background: #120f2e; border: 2px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--majorelle); color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--mint); }

/* ---------- feedback: toasts, banners, modal, states ---------- */
.toasts { position: fixed; z-index: 100; inset-inline: 0; top: 70px; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; max-width: 520px; background: var(--card-3); border: 1px solid var(--line); border-inline-start: 5px solid var(--majorelle); color: var(--ink); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; animation: pop .25s ease; }
.toast.error { border-inline-start-color: var(--tomato); }
.toast.ok { border-inline-start-color: var(--mint); }
.net-banner { position: fixed; z-index: 90; inset-inline: 0; top: 0; padding: 8px 16px; text-align: center; font-weight: 700; background: var(--tomato); color: #fff; transform: translateY(-100%); transition: transform .25s; }
.net-banner.show { transform: none; }
.net-banner.reconnecting { background: var(--saffron); color: #2b1d00; }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(5, 3, 20, .72); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: pop .22s ease; }
.modal h2 { margin-top: 0; }
.state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 16px; color: var(--muted); }
.state .mascot { width: 120px; height: 120px; }
.state h3 { color: var(--ink); }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; min-height: 20px; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; color: var(--muted); }
.boot-donkey { font-size: 64px; animation: wobble 1s infinite; }
.noscript { text-align: center; padding: 40px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid var(--card-3); border-top-color: var(--saffron); animation: spin .8s linear infinite; display: inline-block; }

/* ---------- home ---------- */
.hero { display: grid; gap: 24px; align-items: center; padding: 18px 0 8px; }
.hero h1 .accent { color: var(--saffron); display: inline-block; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 240px; }
.hero-art .mascot { width: min(300px, 70vw); filter: drop-shadow(0 20px 40px rgba(97, 80, 255, .35)); animation: float 4s ease-in-out infinite; }
.hero-art .sticker { position: absolute; }
.hero-art .s1 { top: 6%; inset-inline-start: 4%; }
.hero-art .s2 { bottom: 10%; inset-inline-end: 2%; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.15fr .85fr; padding-top: 40px; } }
.join-box { display: flex; gap: 8px; flex-wrap: wrap; }
.join-box .input { flex: 1 1 160px; }

.game-card { position: relative; overflow: hidden; border-radius: 22px; padding: 22px; min-height: 230px; display: flex; flex-direction: column; gap: 10px; border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; transition: transform .2s; }
.game-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.game-card .art { position: absolute; inset-inline-end: 4px; top: 8px; width: 118px; height: 118px; opacity: .95; pointer-events: none; }
.game-card h3, .game-card h1 { font-size: 28px; margin: 0; max-width: calc(100% - 120px); }
.game-card p { color: rgba(255, 255, 255, .85); max-width: calc(100% - 120px); margin: 0; }
.game-card .meta { position: relative; z-index: 1; }
.game-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.game-card .meta .badge { background: rgba(0, 0, 0, .28); color: #fff; }
.g-hmar { background: linear-gradient(135deg, #6150ff 0%, #3a2bb8 60%, #241a7a 100%); }
.game-card.disabled { filter: grayscale(.8); opacity: .6; }

.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--card-3); flex: 0 0 34px; }
.rank-n.r1 { background: var(--saffron); color: #2b1d00; }
.rank-n.r2 { background: #cfd3e6; color: #1b1d2a; }
.rank-n.r3 { background: #e39a5c; color: #2b1300; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs button, .tabs a { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; text-decoration: none; }
.tabs .active { background: var(--majorelle); color: #fff; border-color: transparent; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }

/* ---------- room ---------- */
.room-layout { display: grid; gap: 16px; }
.room-layout > *, .side > *, .chat, .reactions, .grid > * { min-width: 0; }
@media (min-width: 1000px) { .room-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.room-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.room-code { font-family: var(--display); font-size: 26px; letter-spacing: 4px; direction: ltr; background: #120f2e; border: 2px dashed var(--saffron); color: var(--saffron); padding: 2px 14px; border-radius: 12px; }
.side { display: grid; gap: 16px; }
@media (min-width: 1000px) { .side { position: sticky; top: 78px; } }
.members .m { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.members .m + .m { border-top: 1px solid rgba(255, 255, 255, .05); }
.members .m .name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members .m .name { display: flex; align-items: center; gap: 2px; }
.members .m .name .nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: min(9ch, 100%); }
.members .m { flex-wrap: wrap; row-gap: 4px; }
.members .m .name { flex: 1 1 8rem; }
.members .m .name .name-tag { flex: none; }
.members .m.me .name::after { content: " (نتا)"; color: var(--dim); font-weight: 500; flex: none; white-space: nowrap; }
.ready-pill { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--card-3); color: var(--dim); }
.ready-pill.on { background: rgba(47, 227, 156, .16); color: var(--mint); }
.crown { color: var(--saffron); }
.lobby-hero { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 10px 0; }
.lobby-hero .mascot { width: 140px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.slot { width: 18px; height: 18px; border-radius: 6px; background: var(--card-3); border: 2px dashed var(--line); }
.slot.full { background: var(--mint); border: 0; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 420px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; scrollbar-width: thin; }
.msg { max-width: 92%; align-self: flex-start; background: var(--card-2); border-radius: 14px; padding: 6px 12px; position: relative; overflow-wrap: anywhere; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--majorelle-2); display: flex; gap: 6px; align-items: center; }
.msg.mine { align-self: flex-end; background: #2b3f8f; }
.msg .body { unicode-bidi: plaintext; text-align: start; } /* Latin and Arabic messages each keep their natural direction */
.msg.system { align-self: center; background: transparent; color: var(--dim); font-size: 13px; text-align: center; padding: 2px 8px; }
.msg.hidden-msg { font-style: italic; color: var(--dim); }
.msg.reaction { background: transparent; font-size: 30px; padding: 0 6px; }
.msg.reaction .who { font-size: 11px; }
.msg .msg-actions { display: none; gap: 4px; margin-top: 2px; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.msg-actions button { background: none; border: 0; color: var(--dim); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; position: relative; align-items: center; }
.chat-form .emoji-toggle { flex: 0 0 44px; font-size: 22px; }
.chat-form .emoji-toggle[aria-expanded="true"] { background: var(--card-3); border-color: var(--saffron); }
.emoji-panel { position: absolute; inset-inline: 0; bottom: calc(100% + 8px); z-index: 20; max-height: min(280px, 45vh); overflow-y: auto; overscroll-behavior: contain; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); animation: pop .15s ease; }
.emoji-group + .emoji-group { margin-top: 8px; }
.emoji-title { font-size: 12px; font-weight: 800; color: var(--muted); margin: 0 4px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emoji-btn { height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--card-3); }
.name-tag { display: inline-block; direction: ltr; unicode-bidi: isolate; font-size: 11px; font-weight: 700; color: var(--saffron); background: rgba(255, 200, 58, .12); border-radius: 6px; padding: 0 5px; margin-inline-start: 4px; }
.room-code.masked { letter-spacing: 6px; color: var(--dim); border-color: var(--line); }
.code-note { margin: -4px 0 12px; }
.members-list { max-height: 360px; overflow-y: auto; }
.fill-meter { width: min(320px, 100%); display: grid; gap: 6px; justify-items: center; }
.fill-meter .timer-bar { width: 100%; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--mint); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: pulse 1.6s infinite; }
.live-dot.off { color: var(--dim); }
.live-dot.off::before { background: var(--dim); animation: none; }
.room-row.flash { box-shadow: 0 0 0 2px rgba(47, 227, 156, .45); transition: box-shadow .6s; }
.chat-form .input { min-height: 44px; }
.reactions { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.reactions button { flex: 0 0 auto; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; font-size: 20px; width: 44px; height: 40px; cursor: pointer; }
.reactions button:active { transform: scale(.9); }
.chat-fab { position: fixed; inset-inline-start: 14px; bottom: 18px; z-index: 50; width: 58px; height: 58px; border-radius: 50%; background: var(--majorelle); border: 0; color: #fff; font-size: 26px; box-shadow: var(--shadow); cursor: pointer; }
.chat-fab .count { position: absolute; top: -4px; inset-inline-end: -4px; background: var(--tomato); color: #fff; font-size: 12px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 5px; }
@media (min-width: 1000px) { .chat-fab, .chat-close { display: none; } }
@media (max-width: 999px) {
  .side .chat-card { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s ease; max-height: 75vh; }
  .side .chat-card.open { transform: none; }
  .side .chat-card .chat { height: 55vh; }
}
.float-reactions { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.float-reactions span { position: absolute; bottom: -60px; font-size: 44px; animation: rise 2.4s ease-out forwards; }

/* ---------- timers ---------- */
.timer-bar { height: 10px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.timer-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--saffron)); border-radius: inherit; transform-origin: right; transition: width .25s linear; }
.timer-bar.low > i { background: var(--tomato); }
.timer-num { font-family: var(--display); font-size: 26px; min-width: 2.2em; text-align: center; }
.timer-num.low { color: var(--tomato); animation: pulse .6s infinite; }

/* ---------- hmar ---------- */
.hmar { display: grid; gap: 16px; }
.round-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.round-chip { font-family: var(--display); font-size: 20px; background: var(--card-3); padding: 2px 14px; border-radius: 12px; }
.type-chip { font-weight: 800; padding: 4px 12px; border-radius: 999px; font-size: 14px; }
.type-quiz { background: rgba(28, 202, 216, .18); color: var(--teal); }
.type-vote { background: rgba(255, 122, 198, .18); color: var(--pink); }
.type-challenge { background: rgba(255, 200, 58, .2); color: var(--saffron); }
.announce { display: grid; place-items: center; text-align: center; gap: 12px; min-height: 320px; padding: 24px; }
.announce .big { font-family: var(--display); font-size: clamp(40px, 9vw, 76px); line-height: 1.1; animation: slam .5s cubic-bezier(.2, 1.6, .4, 1); }
.announce .mascot { width: 130px; animation: wobble 1.2s infinite; }
.question { font-size: clamp(20px, 4vw, 28px); font-weight: 800; line-height: 1.45; }
.choices { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { --c: var(--majorelle); position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: 16px; border: 0; background: var(--c); color: #fff; font-weight: 800; font-size: 18px; text-align: start; cursor: pointer; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); transition: transform .08s, opacity .2s, filter .2s; }
.choice:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.choice .k { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(0, 0, 0, .25); font-family: var(--display); font-size: 18px; }
.choice .cnt { margin-inline-start: auto; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 0 10px; font-size: 14px; }
.choice.c0 { --c: #6150ff; } .choice.c1 { --c: #e0478f; } .choice.c2 { --c: #0f9e8a; } .choice.c3 { --c: #d97706; }
.choice.picked { outline: 4px solid #fff; outline-offset: 2px; }
.choice.locked { cursor: default; }
.choice.dim { opacity: .35; filter: grayscale(.7); }
.choice.right { box-shadow: 0 0 0 4px var(--mint), 0 5px 0 rgba(0, 0, 0, .35); animation: bounce .5s; }
.choice.wrong { animation: shake .4s; }
.explain { background: rgba(47, 227, 156, .1); border: 1px solid rgba(47, 227, 156, .35); border-radius: 14px; padding: 12px 14px; }
.result-flash { font-family: var(--display); font-size: 34px; text-align: center; }
.result-flash.good { color: var(--mint); animation: slam .45s; }
.result-flash.bad { color: var(--tomato); animation: shake .45s; }
.vote-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.vote-btn { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; background: var(--card-2); border: 2px solid var(--line); cursor: pointer; font-weight: 700; color: var(--ink); min-height: 120px; }
.vote-btn:hover { border-color: var(--pink); }
.vote-btn[aria-pressed="true"] { border-color: var(--pink); background: rgba(255, 122, 198, .15); }
.vote-btn:disabled { cursor: default; }
.vote-grid.compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.vote-grid.compact .vote-btn { min-height: 64px; padding: 8px 6px; font-size: 14px; gap: 4px; }
.board-rows.scroll, .bars.scroll { max-height: 420px; overflow-y: auto; padding-inline-end: 4px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bar { height: 30px; background: var(--card-3); border-radius: 10px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, var(--pink), var(--majorelle)); border-radius: 10px; animation: grow .6s ease-out; }
.bar > span { position: relative; z-index: 1; padding-inline: 10px; line-height: 30px; font-weight: 700; white-space: nowrap; }
.board-rows { display: grid; gap: 6px; }
.board-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--card-2); animation: slidein .35s both; }
.board-row.me { outline: 2px solid var(--majorelle-2); }
.board-row.left { opacity: .5; }
.board-row .pts { font-family: var(--display); font-size: 22px; }
.delta { font-weight: 800; color: var(--mint); font-size: 14px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 10px 0; }
.podium .p { display: grid; justify-items: center; gap: 6px; text-align: center; width: 110px; }
.podium .block { width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center; font-family: var(--display); font-size: 30px; color: #2b1d00; }
.podium .p1 .block { height: 120px; background: var(--saffron); }
.podium .p2 .block { height: 90px; background: #cfd3e6; }
.podium .p3 .block { height: 66px; background: #e39a5c; }
.awards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.award { background: var(--card-2); border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
.award .t { font-family: var(--display); font-size: 20px; color: var(--saffron); }
.answered-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.answered-dots i { width: 12px; height: 12px; border-radius: 4px; background: var(--card-3); }
.answered-dots i.on { background: var(--mint); }

/* ---------- admin ---------- */
.admin-layout { display: grid; gap: 16px; }
@media (min-width: 1000px) { .admin-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.admin-nav { display: flex; gap: 6px; overflow-x: auto; }
@media (min-width: 1000px) { .admin-nav { flex-direction: column; } }
.admin-nav button { text-align: start; border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: 10px 14px; border-radius: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.admin-nav button.active { background: var(--majorelle); color: #fff; }
.stat-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.tile .v { font-family: var(--display); font-size: 32px; line-height: 1.1; }
.tile .k { color: var(--muted); font-size: 13px; font-weight: 600; }
pre.json { white-space: pre-wrap; word-break: break-word; background: #0b0920; border-radius: 12px; padding: 10px; font-size: 12px; max-height: 300px; overflow: auto; direction: ltr; text-align: left; }

/* ---------- admin analytics ---------- */
.admin-layout > * { min-width: 0; }
.an-filters { min-width: 0; }
.an-filters .input, .an-filters select.input { width: auto; max-width: 100%; min-width: 0; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.an-filters .an-cc { width: 110px; text-transform: uppercase; }
.an-dims { gap: 8px; }
.an-meta { margin: 0; }
.an-notes { gap: 8px; }
.an-notes .badge { white-space: normal; text-align: start; line-height: 1.5; padding: 6px 12px; }
.an-card { min-width: 0; }
.an-card .stat-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.an-card .tile .v { font-size: 26px; }
.an-tbl td, .an-tbl th { white-space: nowrap; }
.an-tbl tr.clickable { cursor: pointer; }
.an-tbl tr.clickable:hover td { background: var(--card-2); }
.th-sort { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.th-sort.on { color: var(--ink); }
.an-defs dl { display: grid; gap: 4px 0; margin: 10px 0 0; }
.an-defs dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.an-defs dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.chart { margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--dim); font-size: 11px; font-family: var(--font); }
.chart-svg .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 42%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: #120f2e; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--majorelle), var(--majorelle-2)); border-radius: 99px; }
.bar-val { font-weight: 700; white-space: nowrap; }
.funnel { display: grid; gap: 8px; }
.funnel-step { position: relative; background: #120f2e; border-radius: 10px; min-height: 40px; overflow: hidden; }
.funnel-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, rgba(97, 80, 255, .55), rgba(47, 227, 156, .45)); border-radius: 10px; }
.funnel-text { position: relative; padding: 9px 12px; font-size: 14px; }
.heat { display: grid; grid-template-columns: 64px repeat(24, minmax(10px, 1fr)); gap: 2px; font-size: 10px; color: var(--dim); overflow-x: auto; min-width: 0; }
.heat-h { text-align: center; }
.heat-d { white-space: nowrap; padding-inline-end: 4px; font-size: 11px; }
.heat-c { aspect-ratio: 1; min-height: 10px; border-radius: 3px; background: var(--mint); }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 18px; }
.col { flex: 1 1 0; min-width: 8px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.col-bar { width: 100%; background: linear-gradient(180deg, var(--majorelle-2), var(--majorelle)); border-radius: 4px 4px 0 0; min-height: 1px; }
.col-v { font-size: 10px; color: var(--muted); }
.col-l { font-size: 10px; color: var(--dim); margin-top: 3px; }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: minmax(70px, 40%) 1fr auto; font-size: 13px; }
  .heat { grid-template-columns: 52px repeat(24, 12px); }
  .an-filters .row > * { flex: 1 1 140px; }
  .an-custom { width: 100%; }
}

/* ---------- analytics consent banner ---------- */
.consent { position: fixed; z-index: 90; inset-inline: 12px; bottom: calc(var(--tabbar-h) + 10px); max-width: 640px; margin-inline: auto;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; line-height: 1.7; }
.consent p { margin: 0; }
.consent a { color: var(--majorelle-2); }
.consent-actions .btn { flex: 1 1 140px; }
@media (min-width: 900px) { .consent { bottom: 18px; } }
body.in-game .consent { bottom: 10px; }

/* ---------- footer ---------- */
.footer { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 24px 0 calc(var(--tabbar-h) + 24px); color: var(--dim); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--muted); }
@media (min-width: 900px) { .footer { padding-bottom: 28px; } }
body.in-game .footer { display: none; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 75; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 2.8s linear forwards; }

/* ---------- animations ---------- */
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes slam { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; } 60% { transform: scale(.92) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-2deg); } 40% { transform: translateX(10px) rotate(2deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px var(--saffron); } 50% { box-shadow: 0 0 0 6px rgba(255, 200, 58, .45); } }
@keyframes grow { from { width: 0; } }
@keyframes slidein { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-75vh) scale(1.3) rotate(20deg); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- شكون القتال؟ (dark purple, black and gold: a Moroccan derb at night) ---------- */
.g-qattal { background: linear-gradient(135deg, #2a1747 0%, #140b26 65%, #070410 100%); border-color: #5a3d1a; }
.g-qattal h3, .g-qattal h1 { color: #ffd970; }
.qattal { --q-gold: #ffc83a; --q-night: #0b0716; --q-purple: #2a1747; display: grid; gap: 14px; }
/* derb scene (games/qattal-scene.js): public phases only; transforms/opacity/fill transitions, no flashing */
.qs { position: relative; overflow: hidden; border-radius: var(--radius); height: clamp(190px, 30vw, 290px); border: 1px solid #4a2f6e; background: #1b0f33; }
.qs-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.qs-svg * { transition: fill 2.6s ease, opacity 2.6s ease, transform 2.6s ease, stroke 2.6s ease; }
.qs.instant .qs-svg * { transition: none !important; }
.qs .sky-dusk, .qs .sky-night { opacity: 0; }
.qs.mode-dusk .sky-dusk, .qs.mode-dawn .sky-dusk { opacity: 1; }
.qs.mode-dawn .sky-day { opacity: .55; }
.qs.mode-dusk .sky-day { opacity: 0; }
.qs.mode-night .sky-night { opacity: 1; }
.qs .sun { transform: translate(240px, 0); }
.qs.mode-dawn .sun { transform: translate(240px, 55px); }
.qs.mode-dusk .sun { transform: translate(-260px, 95px); opacity: .7; }
.qs.mode-night .sun { transform: translate(240px, 190px); opacity: 0; }
.qs .moon { transform: translate(110px, 58px); opacity: 0; }
.qs.mode-night .moon { opacity: 1; }
.qs.mode-dusk .moon { opacity: .35; }
.qs .stars { fill: #fff; opacity: 0; }
.qs.mode-night .stars { opacity: 1; }
.qs.mode-night .stars circle { animation: twinkle 3.6s ease-in-out infinite; }
.qs.mode-night .stars circle:nth-child(3n) { animation-delay: -1.2s; }
.qs.mode-night .stars circle:nth-child(3n+1) { animation-delay: -2.4s; }
.qs .clouds { animation: cloudDrift 60s linear infinite alternate; }
.qs.mode-night .clouds, .qs.mode-dusk .clouds { opacity: 0; }
.qs .far { fill: #b9825c; }
.qs.mode-dusk .far { fill: #4a2a4a; }
.qs.mode-night .far { fill: #120a22; }
.qs .city { fill: #ffd970; opacity: 0; }
.qs.mode-night .city, .qs.mode-dusk .city { opacity: 1; }
.qs .wall.left { fill: #d9915a; } .qs .wall.right { fill: #c47b45; } .qs .wall.back { fill: #e7ab72; }
.qs.mode-dusk .wall.left, .qs.mode-night .wall.left { fill: #2b1f45; }
.qs.mode-dusk .wall.right, .qs.mode-night .wall.right { fill: #23183b; }
.qs.mode-dusk .wall.back, .qs.mode-night .wall.back { fill: #33244f; }
.qs .gate { fill: #7a3e1d; } .qs.mode-night .gate { fill: #0e0819; }
.qs .ground { fill: #b98a5e; } .qs.mode-night .ground, .qs.mode-dusk .ground { fill: #1d1530; }
.qs .stones { stroke: rgba(0, 0, 0, .18); stroke-width: 2; }
.qs .doors { fill: #1f5fbf; } .qs.mode-night .doors { fill: #1a2c5e; }
.qs .studs { fill: #ffd970; }
.qs .wins path { fill: #6b3a1c; }
.qs.mode-night .wins path, .qs.mode-dusk .wins path { fill: #ffc83a; }
.qs .wins path.off { fill: #1b1328 !important; transition: fill .7s ease; }
.qs .balcony > path:first-child { fill: #8b4a24; } .qs.mode-night .balcony > path:first-child { fill: #2a1a33; }
.qs .lattice { stroke: #e0ac68; stroke-width: 2; } .qs.mode-night .lattice { stroke: #6b4a22; }
.qs .shop-in { fill: #3a2412; } .qs.mode-night .shop-in, .qs.mode-dusk .shop-in { fill: #ffb84d; }
.qs .awning.a1 { fill: #e23d4f; } .qs .awning.a2 { fill: #fff3e0; }
.qs .crate { fill: #a46b34; } .qs .fruit { fill: #ff8a3a; }
.qs .sign { fill: #fff; font: 800 15px var(--display); }
.qs .rope { stroke: #5a4636; stroke-width: 1.5; }
.qs .cloth { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite; }
.qs .c1 path { fill: #ff7ac6; } .qs .c2 path { fill: #2fe39c; } .qs .c3 path { fill: #ffc83a; } .qs .c4 path { fill: #8a7bff; }
.qs .c2 { animation-delay: -1.5s; } .qs .c3 { animation-delay: -3s; } .qs .c4 { animation-delay: -.7s; }
.qs.mode-night .cloth path { fill: #3a2c58; }
.qs .lamp { fill: #3a2a1a; }
.qs .glow { opacity: 0; }
.qs.mode-night .glow, .qs.mode-dusk .glow { opacity: .95; }
.qs.mode-night .glow.g1 { animation: flicker 3.2s infinite; }
.qs.mode-night .glow.g2 { animation: flicker 4.1s infinite -1s; }
.qs .cat { fill: #07040d; opacity: 0; transform: translate(-30px, 29px); }
.qs.mode-night .cat { opacity: 1; animation: catWalk 26s linear infinite; transition: opacity 2.6s ease; }
.qs .vignette { opacity: 0; transition: opacity 1.2s ease; }
.qs.mode-night .vignette { opacity: .45; }
.qs.dim .vignette { opacity: .92; }
.qs.pulse-suspense { animation: qsZoom 1.5s ease-in-out; }
.qs.pulse-tie { animation: qsTie 1.5s ease-in-out; }
.qs-copy { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 34px 16px 14px; text-align: center; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5, 3, 14, .78)); }
.qs-title { font-family: var(--display); font-size: clamp(22px, 4.4vw, 36px); line-height: 1.2; color: #ffe9a8; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.qs-sub { margin: 4px auto 0; max-width: 620px; color: #f1eaff; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); min-height: 1.2em; }
.qs-copy.enter .qs-title, .qs-copy.enter .qs-sub { animation: qsIn .7s ease both; }
.qs-copy.enter .qs-sub { animation-delay: .15s; }
.qs-copy.tone-suspense .qs-title { color: #cfc2ff; letter-spacing: 2px; }
.qs-copy.tone-loss .qs-title { color: #ffb3bb; }
.qs-copy.tone-saved .qs-title { color: #a6f7d6; }
/* players, votes, results */
.q-tile .av { animation: qsIdle 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.5s); }
.q-tile.dead .av, .q-tile.dead .portrait { animation: none; }
.q-tile { transition: transform .4s ease, box-shadow .4s ease, opacity .4s ease, border-color .4s ease; }
.q-tile.cand { border-color: var(--saffron); box-shadow: 0 0 0 2px rgba(255, 200, 58, .22); }
.q-tile.nocand { opacity: .55; }
.q-tile.myvote { outline: 3px solid var(--pink); outline-offset: 2px; }
.q-tile.spot { transform: scale(1.06); border-color: #ffd970; box-shadow: 0 0 0 4px rgba(255, 217, 112, .9), 0 0 32px rgba(255, 217, 112, .55); }
.q-tile.fading { animation: qsFade 1.4s ease both; }
.q-tile.winner { border-color: var(--mint); animation: qsCheer 1.1s ease-in-out 3; }
.badge.pop { animation: qsPop .35s ease; }
.pick-btn.chosen { border-color: var(--pink); background: rgba(255, 122, 198, .16); }
.q-vote.enter, .q-result-box:not(.hidden) { animation: qsIn .5s ease both; }
.timer-num.urgent { color: var(--tomato); animation: qsBeat 1s ease-in-out infinite; }
.q-bars { display: grid; gap: 8px; }
.q-bar { display: grid; grid-template-columns: minmax(70px, 150px) 1fr auto; gap: 8px; align-items: center; }
.q-bar .nick { font-weight: 800; overflow-wrap: anywhere; }
.q-bar .track { height: 14px; border-radius: 7px; background: #120c24; overflow: hidden; }
.q-bar .track i { display: block; height: 100%; width: var(--w); background: var(--majorelle); border-radius: 7px; }
.q-bar.top .track i { background: linear-gradient(90deg, var(--saffron), var(--tomato)); }
.q-bars.grow .track i { animation: qsGrow 1.1s cubic-bezier(.2, .9, .3, 1) both; }
.q-verdict { margin: 10px 0 0; text-align: center; font-weight: 800; font-size: 18px; }
.q-last-event { margin: 0; padding: 10px 14px; border-radius: 12px; background: #120c24; border: 1px solid var(--line); font-weight: 700; }
.signal-feed .fresh { animation: freshSignal 2.4s ease both; border-radius: 6px; }
/* sound & motion settings */
.audio-wrap { position: relative; display: inline-flex; }
.audio-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; width: min(300px, 86vw); display: grid; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); text-align: start; }
.audio-row { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.audio-row input { width: 100%; accent-color: var(--saffron); min-height: 28px; }
body.rv-calm .qattal *, body.rv-calm .qs *, body.rv-calm .q-result * { animation: none !important; }
body.rv-calm .qs-svg * { transition-duration: .3s !important; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes cloudDrift { from { transform: translateX(-30px); } to { transform: translateX(60px); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes catWalk { 0% { transform: translate(-30px, 28px); } 100% { transform: translate(290px, 145px); } }
@keyframes qsIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes qsZoom { 0%, 100% { transform: none; } 50% { transform: scale(1.015); } }
@keyframes qsTie { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px rgba(255, 200, 58, .6); } }
@keyframes qsIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes qsFade { 0% { opacity: 1; filter: none; transform: scale(1.04); } 100% { opacity: .55; filter: grayscale(.7); transform: translateY(3px); } }
@keyframes qsCheer { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px) rotate(-2deg); } 70% { transform: translateY(0) rotate(2deg); } }
@keyframes qsPop { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes qsBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes qsGrow { from { width: 0; } }
@keyframes freshSignal { from { background: rgba(255, 200, 58, .35); } to { background: transparent; } }
@media (max-width: 560px) {
  .qs { height: 150px; }
  .qs-copy { padding: 26px 10px 10px; }
  .qs-title { font-size: 18px; }
  .qs-sub { font-size: 13px; }
}
.q-stream .obs-tip { margin: 0; }

/* ---------- شكون القتال؟ compact layout (fits without scrolling on PC; important parts first on phones) ---------- */
.q-cols, .q-col-a, .q-col-b { display: contents; }               /* phones: one column, ordered below */
.qattal .qs { order: 1; } .qattal .q-result-box { order: 2; } .qattal .q-skip { order: 3; } .qattal .q-vote { order: 4; }
.qattal .q-hidden-role { order: 5; } .qattal .q-role { order: 6; } .qattal .q-players { order: 7; }
.qattal .q-log { order: 8; } .qattal .q-stream { order: 9; }
.qattal .card { padding: 14px; }
.qattal .q-skip, .qattal .q-stream { padding: 8px 14px; }
.q-stream-off .small { color: var(--muted); }
.q-log .q-log-list { max-height: 150px; overflow-y: auto; }
/* During the vote the vote panel already lists every candidate (with counts): no second copy of the players. */
.qattal[data-phase="vote"] .q-players, .qattal[data-phase="runoff"] .q-players { display: none; }
/* Night with an action: the pick list replaces the players grid; compact role header and signals. */
.qattal.acting .q-players { display: none; }
.qattal .mchat.card { order: 6; border-top: 1px solid #5a3d1a; background: linear-gradient(180deg, #1d1236, #0e0820); }
.qattal.acting .role-head .goal { display: none; }
.qattal.acting .role-head .portrait.lg { width: 64px; height: 64px; border-radius: 16px; }
.qattal.acting .role-name { font-size: 24px; }
.qattal.acting .signal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.qattal.acting .signal-grid .btn { min-height: 40px; padding: 6px 8px; }
.qattal.acting .pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.qattal.acting .pick-btn { min-height: 76px; padding: 8px 4px; }
.qattal .q-skip .row { flex-wrap: nowrap; gap: 10px; }
.qattal .q-skip .small { font-size: 13px; }
.qattal .q-tile { padding: 8px 6px; }
body.in-game .code-note { display: none; }                         /* host's long "code hidden" note: lobby only */
/* The game shows every player itself: the room's 👥 list goes away while شكون القتال؟ is running. */
body.in-game .room-layout:has(.qattal) .side .members { display: none; }
@media (min-width: 1000px) {
  body.in-game .room-layout:has(.qattal) .side .chat { height: calc(100vh - 270px); min-height: 340px; }
}
@media (min-width: 1100px) {
  .q-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .q-col-a, .q-col-b { display: grid; gap: 14px; min-width: 0; }
  .qattal .qs { height: clamp(170px, 15vw, 230px); }
  .qattal .q-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .qattal .q-tile .av.lg { --s: 52px; }
}
.q-hidden-role .big-ico, .big-ico { font-size: 36px; }
.q-role { background: linear-gradient(180deg, #1d1236, #0e0820); border-color: #5a3d1a; }
.role-panel { display: grid; gap: 12px; }
.role-head { display: flex; gap: 14px; align-items: center; }
.role-text { min-width: 0; }
.role-name { font-family: var(--display); font-size: 30px; color: var(--saffron); line-height: 1.2; }
.role-name.r-qattal { color: #ff6b6b; }
.role-name.r-ashab { color: var(--mint); }
.role-name.r-moqaddem { color: #ffb36b; }
.role-head .goal { margin: 4px 0 0; }
.portrait { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.portrait.lg { width: 96px; height: 96px; border-radius: 22px; }
.portrait.sm { width: 48px; height: 48px; border-radius: 12px; }
.portrait.xs { width: 34px; height: 34px; border-radius: 9px; box-shadow: none; }
.mates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pick-btn { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; min-height: 92px; border-radius: 16px; background: var(--card-2); border: 2px solid var(--line); color: var(--ink); font-weight: 700; cursor: pointer; }
.pick-btn .nick { max-width: 100%; overflow-wrap: anywhere; text-align: center; font-size: 14px; }
.pick-btn:hover:not(:disabled) { border-color: var(--saffron); }
.pick-btn[aria-pressed="true"] { border-color: var(--saffron); background: rgba(255, 200, 58, .14); box-shadow: 0 0 0 3px rgba(255, 200, 58, .2); }
.pick-btn:disabled { opacity: .65; cursor: default; }
.team-picks { display: grid; gap: 6px; }
.tp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #120c24; border: 1px solid var(--line); }
.tp.ok { border-color: var(--mint-dark); }
.tp .who { font-weight: 800; }
.tp .arrow { color: var(--dim); }
.team-target { margin: 0; font-weight: 800; color: var(--saffron); }
.team-target.tie { color: var(--tomato); }
.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.signal-grid .btn { min-height: 48px; }
.signal-feed { display: grid; gap: 2px; font-size: 13px; color: var(--muted); max-height: 140px; overflow-y: auto; }
.seer-results { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.seer-results .bad { color: #ff8a8a; font-weight: 800; }
.seer-results .good { color: var(--mint); }
.dead-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 82, 99, .12); color: #ffb3bb; font-weight: 700; }
.mchat { border-top: 1px dashed #5a3d1a; padding-top: 10px; }
.mchat-log { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.mchat .msg { background: #2a1236; }
.mchat .msg.mine { background: #4a1d3a; }
.q-vote .panel-title { justify-content: space-between; flex-wrap: wrap; }
.vote-feed { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--card-3); font-size: 13px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.q-tile { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); text-align: center; min-width: 0; }
.q-tile .nick { font-weight: 800; max-width: 100%; overflow-wrap: anywhere; }
.q-tile.me { border-color: var(--saffron); }
.q-tile.dead { opacity: .55; filter: grayscale(.7); }
.q-log-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.dist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dist.invalid .dist-item { border-color: var(--tomato); opacity: .75; }
/* big rooms (up to 50 players): denser grids, name search above the buttons */
.pick-grid.compact { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.pick-grid.compact .pick-btn { min-height: 64px; padding: 6px 4px; }
.pick-grid.compact .pick-btn .nick { font-size: 12px; }
.q-grid.compact { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.q-grid.compact .q-tile { padding: 6px 4px; gap: 2px; }
.q-grid.compact .q-tile .av.lg { --s: 40px; }
.q-grid.compact .q-tile .portrait.sm { width: 40px; height: 40px; }
.q-grid.compact .q-tile .nick { font-size: 12px; }
.q-grid.compact .q-tile .badge { font-size: 10px; padding: 2px 6px; }
img.portrait { object-fit: cover; display: block; }
@media (max-width: 560px) {
  /* 50 players on a phone: 5 small tiles per row, list scrolls inside its card */
  .q-grid.compact { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); max-height: 62vh; overflow-y: auto; }
  .q-grid.compact .q-tile .av.lg, .q-grid.compact .q-tile .portrait.sm { --s: 30px; width: 30px; height: 30px; }
  .q-grid.compact .q-tile .nick { font-size: 11px; }
  .q-grid.compact .q-tile .small { display: none; }
  .pick-grid.compact { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .pick-grid.compact .pick-btn { min-height: 56px; }
}
.dist-item { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: #120c24; border: 1px solid var(--line); text-align: center; }
.dist-item b { font-size: 20px; color: var(--saffron); }
.q-settings-sum { margin: 0; padding-inline-start: 18px; }
.q-timers select { min-height: 44px; }
.q-win { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius); }
.q-win.derb { background: linear-gradient(135deg, rgba(47, 227, 156, .18), rgba(28, 202, 216, .1)); }
.q-win.qattala { background: linear-gradient(135deg, rgba(255, 82, 99, .2), rgba(42, 23, 71, .6)); }
.chat.locked .chat-form { opacity: .6; }
/* secret control window */
body.secret-window { background: #0b0716; }
.secret-main { max-width: 640px; margin: 0 auto; padding: 12px 16px 40px; }
.secret-warn { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: repeating-linear-gradient(-45deg, #3a0d16, #3a0d16 12px, #2a0a12 12px, #2a0a12 24px); border: 2px solid var(--tomato); color: #ffd7dc; position: sticky; top: 8px; z-index: 5; }
.secret-reveal .row { flex-wrap: wrap; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .75; } 50% { opacity: .5; } 55% { opacity: .85; } }
@media (max-width: 560px) {
  .dist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portrait.lg { width: 76px; height: 76px; }
  .role-name { font-size: 24px; }
  .pick-grid, .q-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---------- شكون فينا الحمار؟ final donkey reveal (games/hmar.js renderResult) ---------- */
.donkey-stage { position: relative; overflow: hidden; display: grid; gap: 14px; justify-items: center; text-align: center; padding: 22px 16px 18px;
  border-radius: var(--radius); border: 2px solid #5a3d1a; background: radial-gradient(circle at 50% 30%, rgba(255, 200, 58, .18), transparent 60%), linear-gradient(160deg, #2b1f63, #140f33); }
.donkey-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; flex-wrap: wrap; min-height: 170px; }
.donkey-victims { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.donkey-victim { display: grid; justify-items: center; gap: 4px; max-width: 140px; }
.donkey-victim b { overflow-wrap: anywhere; }
.dv-av { position: relative; padding-top: 34px; }
.dv-av .av { transition: transform .5s ease, box-shadow .5s ease; }
.donkey-ears { position: absolute; top: -6px; left: 50%; width: 110px; transform: translateX(-50%) translateY(18px) scale(.3); opacity: 0; transition: transform .6s cubic-bezier(.2, 1.6, .4, 1), opacity .4s ease; pointer-events: none; }
.donkey-mascot { width: 120px; transition: transform 1.1s cubic-bezier(.25, .9, .3, 1), opacity .5s ease; }
.donkey-mascot .mascot { width: 100%; height: auto; }
.donkey-headline { font-family: var(--display); font-size: clamp(24px, 5.5vw, 44px); line-height: 1.2; color: var(--saffron); text-shadow: 0 4px 0 rgba(0, 0, 0, .3); min-height: 1.2em; }
.donkey-actions { gap: 10px; flex-wrap: wrap; }
/* animated run: hidden first, then each step class reveals the next element */
.donkey-stage.play .donkey-mascot { transform: translateX(-340px) rotate(-6deg); opacity: 0; }
.donkey-stage.play .donkey-victim { opacity: .55; transition: opacity .5s ease; }
.donkey-stage.play.s-spot .donkey-victim { opacity: 1; }
.donkey-stage.s-spot .dv-av .av, .donkey-stage.done .dv-av .av { transform: scale(1.06); box-shadow: 0 0 0 4px #ffd970, 0 0 34px rgba(255, 217, 112, .6); }
.donkey-stage.play.s-walk .donkey-mascot { transform: none; opacity: 1; }
.donkey-stage.play.s-walk .donkey-mascot .mascot { animation: donkeyTrot .35s ease-in-out 3; }
.donkey-stage.s-costume .donkey-ears, .donkey-stage.done .donkey-ears { transform: translateX(-50%); opacity: 1; }
.donkey-headline.bounce { animation: donkeyBounce 1s cubic-bezier(.2, 1.6, .4, 1) both, donkeyWobble 1.8s ease-in-out 1s 2; }
.donkey-stage.s-party .donkey-mascot .mascot { animation: donkeyHop .6s ease-in-out 4; }
.donkey-stage.s-party .donkey-victim { animation: donkeyDance .8s ease-in-out 3; }
.final-board .is-donkey { background: linear-gradient(90deg, rgba(255, 200, 58, .16), var(--card-2)); }
.final-board.s-spot .is-donkey { box-shadow: 0 0 0 2px var(--saffron); }
body.rv-calm .donkey-stage * { animation: none !important; transition-duration: .2s !important; }
@keyframes donkeyTrot { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes donkeyHop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px) rotate(-4deg); } }
@keyframes donkeyDance { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-5deg) translateY(-4px); } 70% { transform: rotate(5deg); } }
@keyframes donkeyBounce { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes donkeyWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@media (max-width: 560px) {
  .donkey-mascot { width: 88px; }
  .donkey-row { min-height: 140px; gap: 10px; }
  .dv-av .av.xl { --s: 76px; }
  .donkey-ears { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .hero-art .mascot, .boot-donkey { animation: none; }
}

/* ---------------------------------------------------------------- official site (2026-10-14) */
.rv-hero h1 { font-size: clamp(44px, 9vw, 84px); line-height: 1; margin: 0; }
.rv-hero .hero-sub { font-family: var(--font); font-size: clamp(18px, 3.4vw, 26px); font-weight: 700; color: var(--muted); }
.hero-logo { width: min(320px, 72vw); height: auto; border-radius: 50%; filter: drop-shadow(0 20px 50px rgba(176, 38, 255, .45)); animation: float 4s ease-in-out infinite; }
.live-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 34px; }
.live-info { font-weight: 600; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; background: var(--card-3); color: var(--muted); }
.live-badge.on { background: #e5132c; color: #fff; box-shadow: 0 0 0 4px rgba(229, 19, 44, .25); }
.live-badge.on .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: livePulse 1.4s ease-in-out infinite; }
.live-badge.off { background: rgba(255, 255, 255, .08); }
@keyframes livePulse { 50% { opacity: .25; } }
.embed-16x9 { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); overflow: hidden; border: 2px solid #53fc18; background: #000; box-shadow: 0 0 40px rgba(83, 252, 24, .2); }
.embed-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.btn-kick { background: #53fc18; color: #0b0b0b; }
.btn-kick:hover { background: #6bff38; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #6d78f5; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--ink); background: var(--card-3); border: 1px solid var(--line); }
.social.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.social:hover { border-color: var(--saffron); }
.social-kick:hover { border-color: #53fc18; }
.social-discord:hover { border-color: #5865f2; }
.social-instagram:hover { border-color: #e1306c; }
.social-youtube:hover { border-color: #ff0033; }
.community-teaser, .community-head { background: radial-gradient(circle at 15% 0%, rgba(176, 38, 255, .25), transparent 55%), linear-gradient(180deg, var(--card), var(--bg-2)); }
.loyalty-ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.loyalty-step { padding: 12px; border-radius: var(--radius-sm); background: var(--card-3); border: 1px solid var(--line); opacity: .75; }
.loyalty-step.has { opacity: 1; border-color: var(--saffron); }
.footer .socials { justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  .hero-logo, .live-badge.on .dot { animation: none; }
}.brand-word { display: inline-block; direction: ltr; unicode-bidi: isolate; }
.rv-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 20px; background: radial-gradient(circle at 100% 0%, rgba(176, 38, 255, .22), transparent 60%), linear-gradient(180deg, var(--card), var(--bg-2)); }
.rv-banner-main { display: grid; gap: 6px; min-width: 0; flex: 1 1 320px; }
.rv-banner-side { display: grid; gap: 8px; justify-items: start; }
.rv-title { margin: 0; font-size: clamp(28px, 5vw, 38px); line-height: 1.1; }
.rv-tagline { margin: 0; font-size: 15px; }
.rv-banner .live-status { min-height: 28px; font-size: 14px; }
.live-player .embed-16x9 { max-width: 960px; }/* live / offline pill (eye-catching, no flashing; static with reduced motion) */
.live-pill { position: relative; display: inline-flex; align-items: center; gap: 12px; max-width: 100%; padding: 8px 10px 8px 16px; border-radius: 16px; text-decoration: none; color: #fff; font-size: 14px; isolation: isolate; transition: transform .15s ease; }
.live-pill:hover { transform: translateY(-2px); }
.live-pill:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }
.live-pill .live-text { display: grid; min-width: 0; line-height: 1.25; }
.live-pill .live-text strong { font-size: 16px; }
.live-pill .live-sub { font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
.live-pill .live-tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 10px; font-weight: 900; letter-spacing: .06em; font-size: 13px; direction: ltr; white-space: nowrap; }
.live-pill .live-go { font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.live-pill .live-viewers { font-weight: 800; font-size: 13px; padding: 5px 9px; border-radius: 10px; background: rgba(0, 0, 0, .3); white-space: nowrap; }
.live-pill.on { background: linear-gradient(120deg, #ff1f3d, #b3002d 60%, #7a0aa8); box-shadow: 0 0 0 2px rgba(255, 70, 90, .9), 0 8px 30px rgba(255, 31, 61, .45); animation: liveGlow 2.4s ease-in-out infinite; }
.live-pill.on .live-tag { background: #fff; color: #e5132c; }
.live-pill.on .live-tag .dot { width: 9px; height: 9px; border-radius: 50%; background: #e5132c; animation: livePulse 1.4s ease-in-out infinite; }
.live-pill.on .live-go { background: #fff; color: #b3002d; }
.live-pill.off { background: linear-gradient(120deg, #141318, #1d1a2e); box-shadow: 0 0 0 2px #53fc18, 0 0 22px rgba(83, 252, 24, .28); animation: offGlow 3.2s ease-in-out infinite; }
.live-pill.off .live-tag { background: rgba(83, 252, 24, .14); color: #53fc18; }
.live-pill.off .live-go { background: #53fc18; color: #0b0b0b; }
.live-pill.unknown { background: var(--card-3); box-shadow: 0 0 0 1px var(--line); font-weight: 700; }
@keyframes liveGlow { 50% { box-shadow: 0 0 0 2px rgba(255, 70, 90, .9), 0 8px 44px rgba(255, 31, 61, .75); } }
@keyframes offGlow { 50% { box-shadow: 0 0 0 2px #53fc18, 0 0 34px rgba(83, 252, 24, .45); } }
@media (max-width: 520px) { .live-pill { width: 100%; } .live-pill .live-go { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-pill, .live-pill.on, .live-pill.off, .live-pill.on .live-tag .dot { animation: none; transition: none; } }/* colour swap (owner request): ONLINE = Kick green, OFFLINE = red */
.live-pill.on { background: linear-gradient(120deg, #0f1a0b, #16241a); box-shadow: 0 0 0 2px #53fc18, 0 0 26px rgba(83, 252, 24, .4); animation: onGlowGreen 2.4s ease-in-out infinite; }
.live-pill.on .live-tag { background: #53fc18; color: #0b0b0b; }
.live-pill.on .live-tag .dot { background: #0b0b0b; }
.live-pill.on .live-go { background: #53fc18; color: #0b0b0b; }
.live-pill.on .live-viewers { background: rgba(83, 252, 24, .14); color: #53fc18; }
.live-pill.off { background: linear-gradient(120deg, #1c0b10, #241018); box-shadow: 0 0 0 2px #ff2e4d, 0 0 22px rgba(255, 46, 77, .32); animation: offGlowRed 3.2s ease-in-out infinite; }
.live-pill.off .live-tag { background: rgba(255, 46, 77, .16); color: #ff4d66; }
.live-pill.off .live-go { background: #ff2e4d; color: #fff; }
@keyframes onGlowGreen { 50% { box-shadow: 0 0 0 2px #53fc18, 0 0 44px rgba(83, 252, 24, .65); } }
@keyframes offGlowRed { 50% { box-shadow: 0 0 0 2px #ff2e4d, 0 0 34px rgba(255, 46, 77, .5); } }
@media (prefers-reduced-motion: reduce) { .live-pill.on, .live-pill.off { animation: none; } }
/* ---------------------------------------------------------------- هل تعرفني؟ (tarafni) */
.g-tarafni { background: linear-gradient(135deg, #ff5c8a 0%, #b8306a 55%, #5b1440 100%); }
.tarafni .tk-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--card-2, #1c1840); border: 2px solid var(--line); border-radius: 18px; padding: 10px; }
.tk-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-side:last-child { flex-direction: row-reverse; text-align: end; }
.tk-side.me { color: #fff; }
.tk-side.left { opacity: .5; }
.tk-who { display: grid; min-width: 0; }
.tk-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-pts { position: relative; font-family: var(--display); font-size: 30px; line-height: 1; margin-inline-start: auto; }
.tk-side:last-child .tk-pts { margin-inline-start: 0; margin-inline-end: auto; }
.tk-delta { position: absolute; top: -14px; inset-inline-end: -6px; font-size: 14px; font-family: inherit; color: var(--mint); animation: tkUp .9s ease-out; }
.tk-delta.neg { color: var(--tomato); }
.tk-mid { display: grid; justify-items: center; gap: 2px; }
.tk-vs { font-size: 26px; }
.tk-qcard { display: grid; gap: 10px; background: linear-gradient(160deg, rgba(255, 92, 138, .14), rgba(97, 80, 255, .12)); border: 2px solid rgba(255, 92, 138, .35); border-radius: 18px; padding: 16px; }
.tk-wait { font-weight: 800; color: var(--saffron); }
.tk-roles { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.tk-role { display: grid; justify-items: center; gap: 4px; }
.tk-arrow { font-size: 30px; color: var(--pink, #ff5c8a); }
.tk-special .big { color: var(--saffron); }
.tk-bets button { flex: 1 1 auto; }
.tk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.tk-custom .input { width: 100%; }
.tk-pop { animation: slam .45s; }
.tk-shake { animation: shake .45s; }
.tk-flip { animation: tkFlip .45s both; }
.tk-final { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-final-col { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--card-2, #1c1840); text-align: center; }
.tk-final-col.win { border-color: var(--saffron); box-shadow: 0 0 0 2px rgba(255, 200, 58, .25); }
.tk-final-col.me b::after { content: ' (نتا)'; font-weight: 400; color: var(--muted); }
.tk-final-pts { font-family: var(--display); font-size: 44px; line-height: 1; }
.tk-stats { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 3px; text-align: start; }
@keyframes tkUp { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 1; } }
@keyframes tkFlip { 0% { transform: rotateX(80deg); opacity: 0; } 100% { transform: rotateX(0); opacity: 1; } }
@media (max-width: 560px) {
  .tarafni .tk-score { grid-template-columns: 1fr auto 1fr; padding: 8px; gap: 6px; }
  .tk-side { flex-direction: column; text-align: center; }
  .tk-side:last-child { flex-direction: column; text-align: center; }
  .tk-pts, .tk-side:last-child .tk-pts { margin: 0; font-size: 26px; }
  .tk-final { grid-template-columns: 1fr; }
}
body.rv-calm .tarafni *, body.rv-calm .tarafni-result * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .tarafni *, .tarafni-result * { animation: none !important; } }

/* هل تعرفني؟ typed flow (2026-11-17): write → guess → both answers → the author judges */
.tarafni .tk-input { font-size: 18px; }
.tarafni .tk-sugg { display: grid; gap: 8px; }
.tarafni .tk-sugg-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 2px dashed var(--line); background: var(--card-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.tarafni .tk-sugg-item:hover { border-color: var(--pink); }
.tarafni .tk-sugg-item.picked { border-style: solid; border-color: var(--mint); background: rgba(47, 227, 156, .12); }
.tarafni .tk-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tarafni .tk-answer { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--card-2); border: 2px solid var(--line); animation: tkUp .35s ease both; }
.tarafni .tk-answer.real { border-color: var(--pink); }
.tarafni .tk-answer.guess { animation-delay: .15s; }
.tarafni .tk-answer-text { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.tarafni .tk-answer.guess.v-yes { border-color: var(--mint); background: rgba(47, 227, 156, .12); }
.tarafni .tk-answer.guess.v-no { border-color: #ff5c6c; background: rgba(255, 92, 108, .12); }
.tarafni .tk-judge { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tarafni .tk-yes { --b: var(--mint); --b-shadow: var(--mint-dark); --b-ink: #08261a; min-height: 60px; font-size: 20px; }
.tarafni .tk-no { --b: #ff5c6c; --b-shadow: #b8323f; --b-ink: #fff; min-height: 60px; font-size: 20px; }
@media (max-width: 560px) { .tarafni .tk-answers { grid-template-columns: 1fr; } }
.rv-calm .tarafni .tk-answer { animation: none; }
@media (prefers-reduced-motion: reduce) { .tarafni .tk-answer { animation: none; } }
