/* ==========================================================
   مين الفاهم؟ — ستايل برنامج مسابقات: ألوان صريحة، ملصقات بحدود سودا، وشخصية "فهّوم"
   لون الخلفية يتغير حسب تصنيف السؤال (يتحكم فيه app.js عبر --bg و --on)
   ========================================================== */
:root {
  --bg: #2B3BE8;
  --on: #FFFFFF;
  --on-soft: rgba(255, 255, 255, .78);
  --ink: #161616;
  --paper: #FFFFFF;
  --yellow: #FFD23F;
  --coral: #FF5B4A;
  --mint: #2FD69E;
  --sky: #5BB8FF;
  --pink: #FF8AC6;
  --muted: #6A6A6A;
  --soft: #F2F2EE;
  --display: 'Lalezar', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --ui: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --sh: 5px 5px 0 var(--ink);
  --sh-sm: 3px 3px 0 var(--ink);
  --outline: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 2px 2px var(--ink), -2px -2px var(--ink), 2px -2px var(--ink), -2px 2px var(--ink);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; transition: background-color .6s ease; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--on);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  transition: background-color .6s ease, color .3s;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1.6px, transparent 2.2px);
  background-size: 24px 24px;
  z-index: 0;
}
#app { position: relative; z-index: 1; }

/* ---------------- زينة الخلفية ----------------
   ملصقات بنفس ستايل اللعبة (حدود سودا وظل صلب) على أطراف الشاشة بس عشان ما تزاحم المحتوى
   الشاشات الكبيرة: عمودين على اليمين واليسار  الجوال: أربع زوايا وأصغر */
.deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.d { position: absolute; display: block; --r: 0deg; transform: rotate(var(--r)); animation: deco-bob 9s ease-in-out infinite; }
@keyframes deco-bob { 50% { transform: translateY(-9px) rotate(calc(var(--r) + 4deg)); } }
.d-q {
  font: 400 150px/1 var(--display); color: var(--yellow);
  -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 7px 7px 0 var(--ink);
}
.d-tile {
  width: 64px; height: 72px; border-radius: 14px; display: grid; place-items: center;
  font: 400 42px/1 var(--display); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.d-t1 { background: var(--coral); }
.d-t2 { background: var(--sky); }
svg.d { filter: drop-shadow(4px 4px 0 var(--ink)); overflow: visible; }
svg.d-line { filter: none; color: var(--on); opacity: .32; }
.d-star { width: 92px; } .d-bolt { width: 66px; } .d-watch { width: 92px; } .d-crown { width: 112px; }
.d-bulb { width: 74px; } .d-bubble { width: 104px; } .d-spark { width: 44px; } .d-squig { width: 120px; } .d-ring { width: 58px; }

/* الشاشات الكبيرة: الأطراف فاضية فنعبّيها */
.d-q      { left: 4.5%;  top: 15%; --r: -12deg; }
.d-squig  { left: 2%;    top: 37%; --r: -6deg; animation-delay: -2s; }
.d-bolt   { left: 10%;   top: 47%; --r: 12deg; animation-delay: -4s; }
.d-t2     { left: 3.5%;  top: 66%; --r: -9deg; animation-delay: -6s; }
.d-bulb   { left: 10.5%; top: 79%; --r: 10deg; animation-delay: -1s; }
.d-s1     { left: 14%;   top: 9%;  --r: 0deg;  animation-delay: -3s; }
.d-star   { right: 4%;   top: 13%; --r: 10deg; animation-delay: -5s; }
.d-t1     { right: 12%;  top: 34%; --r: 7deg;  animation-delay: -7s; }
.d-watch  { right: 3.5%; top: 48%; --r: -8deg; animation-delay: -2.5s; }
.d-ring   { right: 13%;  top: 66%; --r: 0deg;  animation-delay: -1.5s; }
.d-crown  { right: 4%;   top: 78%; --r: -10deg; animation-delay: -4.5s; }
.d-s2     { right: 15%;  top: 90%; --r: 0deg;  animation-delay: -6.5s; }
.d-bubble { display: none; }

/* أثناء الأسئلة تخف شوي عشان ما تشتت */
body:has(.screen.play) .deco, body:has(.screen.intro) .deco { opacity: .45; }

/* الشاشات المتوسطة والجوال: نخلي بس ملصقات في الزوايا وأصغر وتختفي وقت الأسئلة */
@media (max-width: 1180px) {
  body:has(.screen.play) .deco { display: none; }
  .d-squig, .d-bolt, .d-t2, .d-bulb, .d-t1, .d-ring, .d-watch, .d-s2 { display: none; }
  .d-q     { left: -8px; top: auto; bottom: 7%; font-size: 110px; }
  .d-star  { right: -14px; top: 26%; width: 74px; }
  .d-crown { right: -18px; top: auto; bottom: 3%; width: 92px; }
  .d-s1    { left: 4%; top: 28%; }
  .d-bubble { display: block; left: -22px; top: 52%; width: 86px; --r: 8deg; animation-delay: -3.5s; }
}
@media (max-width: 640px) {
  /* الجوال: الزوايا الفوق حول الشخصية فاضية فنحط فيها */
  .d-q { font-size: 78px; left: 5%; top: 62px; bottom: auto; -webkit-text-stroke-width: 6px; text-shadow: 5px 5px 0 var(--ink); }
  .d-star { width: 54px; right: 7%; top: 92px; }
  .d-s1 { width: 30px; left: auto; right: 24%; top: 44px; }
  .d-crown { width: 72px; }
  .d-bubble { width: 66px; }
  /* برا الرئيسية أعلى الشاشة فيه عناوين فنخلي الزينة على الأطراف بس */
  body:not(:has(.screen.home)) :is(.d-q, .d-star, .d-s1) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .d { animation: none; } }
@media print { .deco { display: none; } }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }

.screen { min-height: 100vh; min-height: 100dvh; padding: 18px 16px 28px; animation: screen-in .3s ease both; }
@keyframes screen-in { from { opacity: 0; } }
.boot { display: grid; place-items: center; }
.boot-msg { font-family: var(--display); font-size: 34px; text-shadow: var(--outline), 4px 4px 0 var(--ink); color: #fff; }

/* ---------------- ملصقات وأزرار ---------------- */
.card {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px 13px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn.yellow { background: var(--yellow); }
.btn.green { background: var(--mint); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.wa { background: #2BD46B; }
.btn.big { font-size: 28px; padding: 13px 34px 16px; border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); }
.btn.small { font-size: 17px; padding: 6px 13px 8px; border-width: 2.5px; border-radius: 11px; box-shadow: 3px 3px 0 var(--ink); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--on); border-color: var(--on); box-shadow: none; }

.sticker {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 4px 14px 5px; font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-sm);
}
.round {
  width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink);
  background: var(--paper); color: var(--ink); cursor: pointer; font-size: 19px;
  display: grid; place-items: center; box-shadow: var(--sh-sm); flex-shrink: 0;
}
.round:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.title {
  font-family: var(--display); font-weight: 400; color: #fff; margin: 0; line-height: 1.15;
  text-shadow: var(--outline), 5px 5px 0 var(--ink);
}

/* ---------------- فهّوم ---------------- */
.mascot { display: block; overflow: visible; }
.mascot .m-body { fill: var(--yellow); stroke: var(--ink); stroke-width: 5; }
.mascot .m-line { stroke: var(--ink); stroke-width: 4; }
.mascot .m-stroke { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mascot .pupil { fill: var(--ink); transition: transform .12s ease-out; }
.mascot .eye { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.mascot.idle { animation: bob 3.2s ease-in-out infinite; }
.mascot.happy { animation: hop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.mascot.sad { animation: droop .6s ease both; }
.mascot.shock { animation: shake .45s ease both; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes hop { 0% { transform: translateY(20px) scale(.6); } 60% { transform: translateY(-10px) scale(1.08) rotate(-6deg); } 100% { transform: none; } }
@keyframes droop { from { transform: translateY(-12px) scale(.8); opacity: 0; } to { transform: rotate(6deg); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px) rotate(-4deg); } 75% { transform: translateX(6px) rotate(4deg); } }

/* ---------------- الرئيسية ---------------- */
.home { display: grid; align-content: center; justify-items: center; gap: 6px; padding-top: 30px; }
.brand { position: relative; display: grid; justify-items: center; }
.brand .mascot { width: 132px; height: 132px; margin-bottom: -18px; position: relative; z-index: 2; }
.logo { font-size: clamp(64px, 13vw, 118px); }
.tag { margin: 6px 0 22px; color: var(--on-soft); font-size: 19px; text-align: center; max-width: 30ch; font-weight: 500; }
.slip { width: min(470px, 100%); padding: 22px 22px 24px; display: grid; gap: 16px; }
.slip label { font-weight: 700; font-size: 15px; display: block; margin-bottom: 6px; }
.field {
  width: 100%; padding: 12px 16px; border-radius: 14px; border: 3px solid var(--ink);
  background: #fff; color: var(--ink); font-size: 18px; font-weight: 500; outline: none;
}
.field:focus { background: #FFFBE6; }
/* minmax(0,1fr) عشان الأعمدة ما تتوسع أكثر من الشاشة في الجوالات الصغيرة */
.avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.av-btn {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 2.5px solid transparent; border-radius: 12px; background: var(--soft); cursor: pointer;
  font-size: 23px; display: grid; place-items: center; transition: transform .12s;
}
.av-btn:hover { transform: scale(1.1) rotate(-4deg); }
.av-btn.on { background: var(--yellow); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-6deg) scale(1.08); }
.or { text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.codejoin { display: flex; gap: 8px; }
.codejoin .field { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; }
.invited { background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 17px; text-align: center; font-weight: 600; transform: rotate(-1deg); }
.invited b { font-family: var(--display); letter-spacing: .12em; font-weight: 400; font-size: 21px; }
.home-foot { margin-top: 22px; color: var(--on-soft); font-size: 15px; text-align: center; font-weight: 500; }

/* ---------------- الشريط العلوي ---------------- */
.topbar { display: flex; align-items: center; gap: 10px; max-width: 1180px; margin: 0 auto 20px; }
.logo-sm { font-family: var(--display); font-size: 32px; line-height: 1; color: #fff; text-shadow: var(--outline), 3px 3px 0 var(--ink); margin-inline-end: auto; }
.code-pill { font-family: var(--display); letter-spacing: .14em; font-size: 18px; }

/* ---------------- الغرفة ---------------- */
.lobby-grid { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; grid-template-columns: minmax(320px, 410px) 1fr; align-items: start; }
.side, .main { display: grid; gap: 22px; align-content: start; }
.invite { padding: 18px 20px 20px; }
.lbl-sm { font-size: 15px; font-weight: 700; }
.room-code { display: flex; gap: 8px; justify-content: center; margin: 10px 0 18px; direction: ltr; }
.room-code b {
  width: 62px; height: 72px; border-radius: 14px; display: grid; place-items: center;
  font: 400 44px/1 var(--display); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.room-code b:nth-child(1) { background: var(--yellow); transform: rotate(-5deg); }
.room-code b:nth-child(2) { background: var(--sky); transform: rotate(3deg) translateY(4px); }
.room-code b:nth-child(3) { background: var(--coral); transform: rotate(-2deg); }
.room-code b:nth-child(4) { background: var(--mint); transform: rotate(6deg) translateY(2px); }
.link-row { display: flex; gap: 8px; }
.link-row .field { font-size: 14px; padding: 9px 12px; direction: ltr; text-align: left; border-width: 2.5px; }
.share-row { display: flex; gap: 8px; margin-top: 10px; }
.share-row .btn { flex: 1; }
.hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); line-height: 1.65; }
.hint.good { color: #0E8F5F; font-weight: 600; }

.settings { padding: 18px 20px 20px; }
.settings h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 0 10px; line-height: 1.2; }
.settings h3 small { font-family: var(--ui); font-size: 13px; color: var(--muted); font-weight: 500; margin-inline-start: 6px; }
.settings h3:not(:first-child) { margin-top: 20px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode {
  border: 2.5px solid var(--ink); cursor: pointer; text-align: center; background: #fff; border-radius: 16px;
  padding: 12px 6px 10px; display: grid; gap: 2px; justify-items: center; box-shadow: var(--sh-sm);
  transition: transform .12s;
}
.mode:hover { transform: translateY(-2px); }
.mode-ic { font-size: 28px; line-height: 1.2; }
.mode b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.25; }
.mode small { font-size: 12px; color: var(--muted); }
.mode.on { background: var(--yellow); transform: rotate(-2deg) translateY(-2px); box-shadow: var(--sh); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.lbl { font-weight: 700; font-size: 15px; }
.seg { display: flex; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: var(--sh-sm); }
.seg button { border: 0; background: #fff; cursor: pointer; padding: 7px 12px; font-weight: 700; font-size: 15px; min-width: 42px; }
.seg button + button { border-inline-start: 2px solid var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.cat {
  --c: #fff; --t: var(--ink);
  border: 2.5px solid var(--ink); cursor: pointer; border-radius: 14px; padding: 10px 8px 9px; background: #fff;
  display: grid; justify-items: center; gap: 1px; position: relative; transition: transform .12s, background .15s;
}
.cat:hover { transform: translateY(-2px) rotate(-1deg); }
.cat span { font-size: 24px; line-height: 1.25; }
.cat b { font-size: 14px; font-weight: 700; }
.cat small { font-size: 11.5px; opacity: .7; }
.cat.on { background: var(--c); color: var(--t); box-shadow: var(--sh-sm); transform: rotate(-1.5deg); }
.cat.all { grid-column: 1 / -1; grid-auto-flow: column; justify-content: center; gap: 10px; padding: 11px; }
.cat.all b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.cat.all.on { --c: var(--yellow); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tagc { border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; background: var(--c, #fff); color: var(--t, var(--ink)); }
.note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

.table-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.table-head h2 { font-size: 38px; }
.count-badge { font-family: var(--display); font-size: 22px; vertical-align: middle; margin-inline-start: 6px; text-shadow: none; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.seat { position: relative; display: grid; justify-items: center; gap: 8px; padding: 4px 4px 0; }
.seat.new { animation: pop-in .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop-in { from { transform: scale(.4) rotate(-10deg); opacity: 0; } }
.seat .nm { background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 12px 3px; font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); }
.seat.me .nm { background: var(--yellow); }
.seat.off { opacity: .45; }
.seat .crown { position: absolute; top: -14px; font-size: 28px; transform: rotate(-14deg); margin-inline-start: -46px; }
.seat .tag-off { font-size: 12px; font-weight: 600; color: var(--on-soft); }
.kick {
  position: absolute; top: 0; margin-inline-start: 58px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1; font-weight: 700;
}
.kick:hover { background: var(--coral); color: #fff; }
.lonely { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.lonely .mascot { width: 76px; height: 76px; flex-shrink: 0; }
.bubble {
  position: relative; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 16px;
  padding: 8px 14px 10px; font-weight: 700; font-size: 15px; box-shadow: var(--sh-sm);
}

/* صورة اللاعب */
.av {
  --c: var(--yellow);
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; font-size: 32px; line-height: 1;
  background: var(--c); border: 3px solid var(--ink); box-shadow: var(--sh-sm); flex-shrink: 0;
}
.av.sm { width: 34px; height: 34px; font-size: 17px; border-width: 2.5px; box-shadow: 2px 2px 0 var(--ink); }
.av.xs { width: 28px; height: 28px; font-size: 14px; border-width: 2px; box-shadow: none; }
.av.xl { width: 136px; height: 136px; font-size: 70px; border-width: 4px; box-shadow: 6px 6px 0 var(--ink); }

/* الفرق */
.teams { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.team { padding: 14px; display: grid; gap: 10px; align-content: start; border-top: 12px solid var(--tc); }
.team.t0 { --tc: var(--coral); } .team.t1 { --tc: var(--sky); } .team.t2 { --tc: var(--yellow); } .team.t3 { --tc: var(--mint); }
.team-head { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.team-head b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.team-head .n { margin-inline-start: auto; font-family: var(--display); font-size: 20px; }
.team-list { display: grid; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.team-row.off { opacity: .45; }
.team-row .kick { position: static; margin-inline-start: auto; }
.team-me { font-size: 14px; font-weight: 700; text-align: center; padding: 6px; background: var(--soft); border-radius: 10px; }
.empty { margin: 0; font-size: 14px; color: var(--muted); }

.startbar {
  position: sticky; bottom: 12px; z-index: 5;
  max-width: 1180px; margin: 24px auto 0; padding: 12px 14px 12px 18px;
  display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap;
}
.startbar .sum { font-size: 15px; font-weight: 600; }
.startbar .sum b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.startbar .warn { color: #C2261A; font-weight: 700; }
.waiting { font-family: var(--display); font-size: 21px; }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------------- المقدمة ---------------- */
.intro { display: grid; place-items: center; align-content: center; gap: 24px; text-align: center; }
.intro-title { font-size: clamp(60px, 12vw, 120px); animation: slam .55s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes slam { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } }
.vs { display: flex; align-items: center; gap: clamp(14px, 6vw, 64px); }
.vs-p { display: grid; justify-items: center; gap: 14px; animation: slide-a .55s .15s cubic-bezier(.3, 1.4, .5, 1) both; }
.vs-p.b { animation-name: slide-b; }
.vs-p .nm { font-family: var(--display); font-size: 26px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 18px 4px; box-shadow: var(--sh-sm); }
@keyframes slide-a { from { transform: translateX(160px) rotate(10deg); opacity: 0; } }
@keyframes slide-b { from { transform: translateX(-160px) rotate(-10deg); opacity: 0; } }
.burst-wrap { filter: drop-shadow(4px 4px 0 var(--ink)); animation: spin-in .6s .4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes spin-in { from { transform: scale(0) rotate(-180deg); } }
.burst {
  width: 118px; height: 118px; display: grid; place-items: center; background: var(--yellow); color: var(--ink);
  font-family: var(--display); font-size: 38px; padding-bottom: 6px;
  clip-path: polygon(50.0% 0.0%, 58.7% 12.0%, 71.7% 5.0%, 74.3% 19.5%, 89.1% 18.8%, 85.1% 33.1%, 98.7% 38.9%, 89.0% 50.0%, 98.7% 61.1%, 85.1% 66.9%, 89.1% 81.2%, 74.3% 80.5%, 71.7% 95.0%, 58.7% 88.0%, 50.0% 100.0%, 41.3% 88.0%, 28.3% 95.0%, 25.7% 80.5%, 10.9% 81.2%, 14.9% 66.9%, 1.3% 61.1%, 11.0% 50.0%, 1.3% 38.9%, 14.9% 33.1%, 10.9% 18.8%, 25.7% 19.5%, 28.3% 5.0%, 41.3% 12.0%);
}
.crowd { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 760px; }
.crowd .av { animation: pop-in .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.team-vs { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.team-vs .team { min-width: 190px; }
.team-vs .ms { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.intro-meta { font-size: 19px; font-weight: 600; margin: 0; max-width: 46ch; color: var(--on-soft); }
.count { height: 150px; display: grid; place-items: center; }
.count .num {
  width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink); border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ink);
  font: 400 96px/1 var(--display); padding-bottom: 8px;
  animation: num-pop .5s cubic-bezier(.3, 1.7, .5, 1) both;
}
.count .num.c2 { background: var(--yellow); } .count .num.c1 { background: var(--coral); color: #fff; }
@keyframes num-pop { from { transform: scale(.2) rotate(-30deg); } }

/* ---------------- السؤال ---------------- */
.play { display: flex; flex-direction: column; gap: 16px; padding-bottom: 18px; }
.hud { max-width: 1000px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.qn { font-family: var(--display); font-weight: 400; font-size: 18px; }
.qn b { font-weight: 400; font-size: 24px; }
.myscore { margin-inline-start: auto; font-family: var(--display); font-size: 21px; font-weight: 400; }
.myscore small { font-family: var(--ui); font-size: 12px; font-weight: 600; color: var(--muted); }
.hud-l { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.timer-row { max-width: 1000px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.secs {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--sh-sm);
  font: 400 30px/1 var(--display); padding-bottom: 3px; transition: background .2s;
}
.secs.hot { background: var(--coral); color: #fff; animation: thump .5s ease infinite; }
@keyframes thump { 50% { transform: scale(1.14) rotate(-6deg); } }
.bar { flex: 1; height: 26px; border: 3px solid var(--ink); border-radius: 999px; background: rgba(0, 0, 0, .22); overflow: hidden; box-shadow: var(--sh-sm); }
.bar .fill {
  height: 100%; width: 100%; background: var(--yellow); border-radius: 999px;
  background-image: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, .35) 10px 20px);
  border-inline-end: 3px solid var(--ink);
}
.bar.hot .fill { background-color: var(--coral); }
.bar.done .fill { width: 0 !important; border: 0; }

.duel { max-width: 1000px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.duel .who { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; min-width: 0; }
.duel .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12ch; }
.duel .sc { font-family: var(--display); font-weight: 400; font-size: 22px; }
.rope { flex: 1; height: 18px; border-radius: 999px; background: var(--sky); border: 3px solid var(--ink); overflow: hidden; box-shadow: var(--sh-sm); }
.rope i { display: block; height: 100%; width: 50%; background: var(--coral); border-inline-end: 3px solid var(--ink); transition: width .9s cubic-bezier(.3, 1.4, .5, 1); }

.qwrap { max-width: 1000px; width: 100%; margin: 6px auto 0; }
.qcard {
  position: relative; text-align: center; padding: 38px 28px 34px;
  min-height: 170px; display: grid; place-items: center; gap: 12px;
  animation: card-in .45s cubic-bezier(.3, 1.4, .5, 1) both;
}
@keyframes card-in { from { transform: translateY(26px) rotate(-2deg) scale(.96); opacity: 0; } }
.cat-tag {
  position: absolute; top: -20px; right: 24px; transform: rotate(-3deg);
  background: var(--bg); color: var(--on); border: 3px solid var(--ink); border-radius: 12px;
  padding: 3px 14px 5px; font-family: var(--display); font-size: 19px; box-shadow: var(--sh-sm);
}
.qtext { margin: 0; font-size: clamp(22px, 3.3vw, 34px); line-height: 1.45; font-weight: 700; max-width: 30ch; text-wrap: balance; }
.qcard .big { font-size: clamp(50px, 9vw, 80px); line-height: 1.15; letter-spacing: .05em; }
.qcard .kind { font-family: var(--display); font-size: 22px; }
.qcard .flag { max-height: 150px; max-width: 250px; border-radius: 8px; border: 3px solid var(--ink); box-shadow: var(--sh-sm); }
.flag-miss { font-size: 14px; color: #C2261A; font-weight: 600; }

.verdict { position: absolute; top: -34px; left: 14px; display: flex; align-items: flex-end; gap: 0; z-index: 3; pointer-events: none; }
.verdict .mascot { width: 88px; height: 88px; }
.verdict .bubble { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; margin-bottom: 40px; margin-inline-end: -6px; transform: rotate(-4deg); animation: pop-in .4s .1s cubic-bezier(.3, 1.6, .5, 1) both; }
.verdict .bubble small { display: block; font-family: var(--ui); font-size: 13px; font-weight: 600; }
.verdict.ok .bubble { background: var(--mint); }
.verdict.bad .bubble { background: var(--coral); color: #fff; }
.verdict.miss .bubble { background: #fff; }

.answers { max-width: 1000px; width: 100%; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ans {
  --lc: var(--yellow);
  position: relative; display: flex; align-items: center; gap: 14px; text-align: start;
  min-height: 84px; padding: 14px 16px; cursor: pointer;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh);
  font-weight: 700; font-size: clamp(17px, 2vw, 21px); line-height: 1.35;
  transition: transform .14s ease, box-shadow .14s ease, background .2s, opacity .25s;
  animation: ans-in .45s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: var(--d, 0ms);
}
@keyframes ans-in { from { opacity: 0; transform: translateY(24px) scale(.9) rotate(var(--r0, -3deg)); } }
.ans.s0 { --lc: var(--yellow); --r0: -4deg; } .ans.s1 { --lc: var(--sky); --r0: 3deg; }
.ans.s2 { --lc: var(--coral); --r0: -2deg; } .ans.s3 { --lc: var(--mint); --r0: 4deg; }
.ans .lt {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center;
  background: var(--lc); border: 3px solid var(--ink); font: 400 28px/1 var(--display); padding-bottom: 4px;
}
.ans .lt { color: var(--ink); }
.ans .txt { flex: 1; }
.ans:hover:not(:disabled) { transform: translate(-2px, -3px) rotate(-.6deg); box-shadow: 7px 8px 0 var(--ink); }
.ans:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.ans:disabled { cursor: default; }
.ans.picked { background: var(--yellow); transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.ans.picked .lt { background: #fff; }
.ans.dim { opacity: .5; }
.ans.gone { opacity: .14; transform: scale(.94); pointer-events: none; }
.ans.right { background: var(--mint); opacity: 1; transform: scale(1.03) rotate(-1deg); box-shadow: 7px 7px 0 var(--ink); z-index: 2; }
.ans.right .lt { background: #fff; }
.ans.right::after { content: '✓'; position: absolute; top: -14px; left: -10px; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.ans.wrong { opacity: .5; transform: scale(.97); box-shadow: 2px 2px 0 var(--ink); }
.ans.wrong:not(.picked) .lt { background: var(--soft); }
.ans.wrong.picked { opacity: 1; background: var(--coral); color: #fff; }
.ans.wrong.picked::after { content: '✗'; position: absolute; top: -14px; left: -10px; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--ink); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.pickers { display: flex; margin-inline-start: auto; }
.pickers .av { margin-inline-start: -8px; animation: pop-in .35s both; }
.pickers .more { --c: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }

.dock { max-width: 1000px; width: 100%; margin: 6px auto 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.powers { display: flex; gap: 8px; }
.pw {
  border: 2.5px solid var(--ink); cursor: pointer; border-radius: 12px; padding: 5px 12px 7px; background: #fff; color: var(--ink);
  box-shadow: var(--sh-sm); display: inline-flex; gap: 6px; align-items: baseline; font-family: var(--display); font-size: 18px;
}
.pw small { font-family: var(--ui); font-size: 12px; font-weight: 600; color: var(--muted); }
.pw:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pw:disabled { opacity: .45; cursor: default; }
.pw.on { background: var(--pink); opacity: 1; }
.answered { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.answered .av { opacity: .35; transition: all .25s; position: relative; }
.answered .av.done { opacity: 1; transform: translateY(-4px) rotate(-6deg); }
.answered .cnt { font-weight: 700; font-size: 14px; margin-inline-start: 6px; color: var(--on); }
.reacts { display: flex; gap: 5px; }
.reacts button { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; cursor: pointer; font-size: 18px; transition: transform .1s; box-shadow: 2px 2px 0 var(--ink); }
.reacts button:active { transform: scale(.82); }
.watch { text-align: center; font-family: var(--display); font-size: 20px; }

/* لوحة النقاط */
.sheet { max-width: 1000px; width: 100%; margin: 8px auto 0; padding: 12px; animation: card-in .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ranks li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; font-weight: 700; font-size: 16px; min-height: 48px; }
.ranks li.me { background: var(--yellow); box-shadow: inset 0 0 0 2.5px var(--ink); }
.ranks .rk { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; font: 400 19px/1 var(--display); padding-bottom: 2px; background: #fff; flex-shrink: 0; }
.ranks .rk.r1 { background: var(--yellow); } .ranks .rk.r2 { background: #D9DFE8; } .ranks .rk.r3 { background: #F2A86C; }
.ranks .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .mv { font-size: 12px; font-weight: 800; }
.ranks .mv.up { color: #0E8F5F; } .ranks .mv.down { color: #C2261A; }
.ranks .fire { font-size: 13px; }
.ranks .gain { margin-inline-start: auto; font-size: 13px; padding: 1px 9px 2px; border-radius: 999px; border: 2px solid var(--ink); background: var(--soft); white-space: nowrap; }
.ranks .gain.ok { background: var(--mint); }
.ranks .sc { font: 400 25px/1 var(--display); min-width: 66px; text-align: left; }
.next { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 4px 10px 2px; font-size: 14px; font-weight: 600; color: var(--muted); }
.next-bar { flex: 1; height: 10px; border-radius: 9px; border: 2px solid var(--ink); overflow: hidden; }
.next-bar i { display: block; height: 100%; background: var(--ink); width: 100%; animation: drain var(--ms) linear forwards; transform-origin: right; }
@keyframes drain { to { transform: scaleX(0); } }
.tbars { display: grid; gap: 8px; margin: 4px 0 12px; }
.tbar { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 10px; font-weight: 700; }
.tbar .track { height: 22px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--soft); }
.tbar .fill { height: 100%; background: var(--tc); border-inline-end: 2.5px solid var(--ink); transition: width .9s; min-width: 6px; }
.tbar.t0 { --tc: var(--coral); } .tbar.t1 { --tc: var(--sky); } .tbar.t2 { --tc: var(--yellow); } .tbar.t3 { --tc: var(--mint); }
.tbar .v { font: 400 24px/1 var(--display); text-align: left; }

/* ---------------- النهاية ---------------- */
.end { padding-bottom: 40px; }
.end-wrap { max-width: 1000px; margin: 0 auto; display: grid; gap: 24px; justify-items: center; }
.winner { display: grid; justify-items: center; gap: 12px; text-align: center; }
.winner h1 { font-size: clamp(56px, 11vw, 104px); animation: slam .55s .15s cubic-bezier(.3, 1.5, .5, 1) both; }
.winner .who { font-family: var(--display); font-size: 30px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 22px 6px; box-shadow: var(--sh); transform: rotate(-2deg); }
.winner .pts { font-weight: 700; font-size: 17px; }
.crown-wrap { position: relative; display: flex; align-items: flex-end; gap: 0; }
.crown-wrap .crown { position: absolute; top: -50px; right: 50%; transform: translateX(50%) rotate(-10deg); font-size: 54px; animation: slam .5s .4s both; }
.crown-wrap .mascot { width: 92px; height: 92px; margin-inline-start: -26px; margin-bottom: -6px; }
.podium { display: flex; align-items: flex-end; gap: 12px; justify-content: center; }
.step { display: grid; justify-items: center; gap: 8px; width: 124px; }
.step .blk { width: 100%; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 16px 16px 6px 6px; font: 400 52px/1 var(--display); color: var(--ink); box-shadow: var(--sh); padding-bottom: 6px; }
.step.r1 .blk { height: 128px; background: var(--coral); color: #fff; }
.step.r2 .blk { height: 94px; background: #D9DFE8; }
.step.r3 .blk { height: 70px; background: #F2A86C; }
.step .nm { font-weight: 700; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .sc { font-family: var(--display); font-size: 19px; }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; width: 100%; }
.award { padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-radius: 18px; }
.award:nth-child(1) { transform: rotate(-1deg); } .award:nth-child(3) { transform: rotate(1deg); }
.award .ic { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--soft); flex-shrink: 0; }
.award b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.2; }
.award span { font-size: 14px; color: var(--muted); font-weight: 600; }
.end-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------------- طبقات ---------------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.float { position: absolute; bottom: 70px; display: grid; justify-items: center; gap: 2px; animation: float-up 2.6s ease-out forwards; }
.float .e { font-size: 42px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.float .n { font-size: 12px; font-weight: 700; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; }
@keyframes float-up { 0% { transform: translateY(0) scale(.5); opacity: 0; } 12% { opacity: 1; transform: translateY(-20px) scale(1.15); } 100% { transform: translateY(-62vh) translateX(var(--dx)) rotate(var(--rot)); opacity: 0; } }
.confetti { position: absolute; top: -40px; border: 2px solid var(--ink); animation: fall var(--t) linear forwards; }
.confetti.q { border: 0; font: 400 30px/1 var(--display); text-shadow: var(--outline); color: #fff; }
@keyframes fall { to { transform: translateY(112vh) translateX(var(--dx)) rotate(var(--rot)); } }

#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; justify-items: center; width: min(92vw, 520px); pointer-events: none; }
.toast { background: #fff; color: var(--ink); border: 3px solid var(--ink); padding: 8px 18px 10px; border-radius: 14px; font-weight: 700; font-size: 15px; box-shadow: var(--sh-sm); animation: toast-in .35s cubic-bezier(.3, 1.6, .5, 1) both; text-align: center; }
.toast.bad { background: var(--coral); color: #fff; }
.toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { transform: translateY(-24px) rotate(-4deg); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-16px); opacity: 0; } }
.net { position: fixed; top: 0; inset-inline: 0; z-index: 50; background: var(--coral); color: #fff; text-align: center; padding: 8px; font-weight: 700; font-size: 14px; border-bottom: 3px solid var(--ink); }

.center-msg { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; }
.center-msg .mascot { width: 110px; height: 110px; }
.center-msg h2 { font-size: 46px; }
.center-msg p { margin: 0; max-width: 40ch; font-weight: 500; }

/* بلاغ عن سؤال */
.report { display: flex; justify-content: center; margin-top: 12px; }
.report-btn { border: 0; background: transparent; color: var(--on-soft); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.report-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; box-shadow: var(--sh-sm); }
.report-pick span { font-weight: 700; font-size: 14px; margin-inline-end: 4px; }
.report-pick button { border: 2px solid var(--ink); background: var(--soft); border-radius: 999px; padding: 3px 11px 4px; font-weight: 600; font-size: 13px; cursor: pointer; }
.report-pick button:hover { background: var(--yellow); }
.report-done { font-weight: 700; font-size: 14px; color: var(--on); }
.announce { background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 16px 10px; font-weight: 700; box-shadow: var(--sh-sm); margin-bottom: 18px; max-width: 470px; text-align: center; transform: rotate(-1deg); }

/* ---------------- الجوال ---------------- */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .main { display: contents; }
  .table { order: 1; }
  .side { order: 2; }
  .cats-panel { order: 3; }
}
@media (max-width: 620px) {
  .screen { padding: 12px 12px 22px; }
  .answers { grid-template-columns: 1fr; gap: 12px; }
  .ans { min-height: 64px; padding: 10px 12px; font-size: 17px; }
  .ans .lt { width: 40px; height: 40px; font-size: 23px; border-radius: 12px; }
  .qcard { padding: 34px 16px 26px; min-height: 130px; }
  .cat-tag { right: 14px; font-size: 17px; }
  .verdict { top: -42px; left: 2px; }
  .verdict .mascot { width: 60px; height: 60px; }
  .verdict .bubble { font-size: 20px; margin-bottom: 24px; }
  .dock { grid-template-columns: 1fr; justify-items: center; gap: 12px; }
  .dock .answered { order: -1; }
  .room-code b { width: 54px; height: 64px; font-size: 38px; }
  .modes { grid-template-columns: 1fr; }
  .mode { grid-template-columns: auto 1fr; text-align: right; justify-items: start; column-gap: 12px; padding: 8px 14px; }
  .mode-ic { grid-row: span 2; }
  .mode.on { transform: rotate(-1deg); }
  .ranks .sc { min-width: 50px; font-size: 21px; }
  .ranks li { gap: 8px; padding: 6px 8px; font-size: 15px; }
  .tbar { grid-template-columns: 96px 1fr 54px; }
  .step { width: 98px; }
  .avatars { gap: 4px; }
  .av-btn { font-size: 20px; border-radius: 10px; }
  .logo-sm { font-size: 26px; }
  .hud .qn { font-size: 16px; }
  .sticker { padding: 3px 10px 4px; font-size: 13px; }
  .startbar { bottom: 8px; }
  .startbar .btn.big { width: 100%; }
}

/* ---------------- الحساب والتحدي المصنّف ---------------- */
.home { position: relative; }
.acct { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 5; }
.acct-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; cursor: pointer;
  background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: var(--sh-sm); font: inherit;
}
.acct-chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.acct-n { display: grid; line-height: 1.15; text-align: start; }
.acct-n b { font-size: 14px; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-n small { font-size: 11px; color: var(--muted); }
.acct-r { font-family: var(--display); font-size: 17px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 0 9px 2px; }
.av.has-img { overflow: hidden; padding: 0; background: #fff; }
.av.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.playas { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 8px 12px; font-weight: 600; }
.playas > span:not(.av) { flex: 1; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish.danger { color: #C62828; }
.announce.warn { background: var(--yellow); }

.ranked { margin-top: 18px; gap: 14px; background: var(--ink); color: #fff; transform: rotate(-.6deg); }
.ranked-head { display: flex; gap: 14px; align-items: flex-start; }
.ranked-ic { font-size: 38px; line-height: 1; background: #E2359E; border: 3px solid #fff; border-radius: 16px; padding: 6px 8px 10px; transform: rotate(6deg); flex-shrink: 0; }
.ranked h2 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.1; }
.ranked p { margin: 4px 0 0; color: rgba(255,255,255,.78); font-size: 15px; }
.ranked-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.ranked-actions .btn { box-shadow: 4px 4px 0 #fff; border-color: #fff; }
.ranked-actions .btn:not(.yellow) { background: transparent; color: #fff; }

.queue .center-msg { min-height: 70vh; }
.q-faces { display: flex; align-items: center; gap: 18px; }
.q-vs { font-family: var(--display); font-size: 40px; color: var(--yellow); text-shadow: var(--outline), 4px 4px 0 var(--ink); transform: rotate(-8deg); }
.q-mystery { background: #fff; font-family: var(--display); color: var(--ink); animation: q-pulse 1.1s ease-in-out infinite; }
@keyframes q-pulse { 50% { transform: scale(1.06) rotate(4deg); background: var(--yellow); } }
.q-timer { font-family: var(--display); font-size: 26px; padding: 2px 18px 6px; letter-spacing: .06em; }
.q-n { min-height: 1.5em; font-weight: 600; }

.board-wrap { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }
.board-title { font-size: clamp(46px, 9vw, 72px); text-align: center; }
.board-sub { margin: -6px 0 4px; text-align: center; font-weight: 600; }
.boot-msg.sm { font-size: 24px; text-align: center; }
.lb-me { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; }
.lb-me .lb-who small { color: rgba(255,255,255,.75); }
.lb { list-style: none; margin: 0; padding: 6px; display: grid; }
.lb li + li { border-top: 2px dashed #E3E3DC; }
.lb-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; background: none; border: 0; border-radius: 14px; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.lb-row:hover { background: var(--soft); }
.lb-row.me { background: #FFF4C4; }
.lb-rank { width: 36px; text-align: center; font-family: var(--display); font-size: 22px; flex-shrink: 0; }
.lb-rank.r1, .lb-rank.r2, .lb-rank.r3 { font-size: 28px; }
.lb-who { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.lb-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who small { color: var(--muted); font-size: 12px; text-align: right; }
.acct-n small { text-align: right; }
.lb-wl { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.lb-pts { font-family: var(--display); font-size: 22px; background: var(--yellow); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 12px; padding: 0 10px 3px; min-width: 64px; text-align: center; }
.lb-empty { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; font-weight: 600; }
.lb-empty .mascot { width: 90px; height: 90px; }

.prof-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: minmax(300px, 1.1fr) 1fr; gap: 22px; align-items: start; }
.prof-card { padding: 20px; display: grid; gap: 18px; }
.prof-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.prof-pic { display: grid; gap: 8px; }
.prof-form { display: grid; gap: 14px; }
.prof-form label { font-weight: 700; font-size: 15px; display: block; margin-bottom: 6px; }
.prof-form label small { color: var(--muted); font-weight: 500; }
.help { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.at-field { display: flex; align-items: center; border: 3px solid var(--ink); border-radius: 14px; background: #fff; overflow: hidden; direction: ltr; }
.at-field span { padding: 0 4px 0 14px; font-weight: 700; color: var(--muted); }
.at-field .field { border: 0; border-radius: 0; padding-left: 2px; }
.prof-side { display: grid; gap: 22px; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; }
.prof-stats > div { display: grid; justify-items: center; padding: 10px 4px; }
.prof-stats b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.prof-stats span { font-size: 13px; color: var(--muted); font-weight: 600; }
.prof-recent, .prof-sec { padding: 16px 18px 18px; }
.prof-recent h3, .prof-sec h3, .sheet h3 { margin: 0 0 10px; font-size: 17px; }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--soft); }
.recent li span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent li small { font-weight: 700; direction: ltr; min-width: 3ch; text-align: center; }
.recent .r-w b { color: #12895E; } .recent .r-l b { color: #C62828; }
.prof-out { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed #E3E3DC; }

.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(22,22,22,.55); display: grid; place-items: center; padding: 16px; animation: screen-in .2s ease both; }
.sheet { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px 22px 20px; display: grid; gap: 12px; animation: sheet-in .28s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes sheet-in { from { transform: translateY(24px) rotate(-2deg); opacity: 0; } }
.sheet .note { margin: 0; }
.sheet-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 38px; height: 38px; font-size: 15px; }
.sheet-title { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0; line-height: 1.1; }
.sheet-switch { margin: 2px 0 0; text-align: center; font-weight: 600; }
.gbtn { gap: 10px; font-family: var(--ui); font-weight: 700; font-size: 17px; text-decoration: none; }
/* الدخول برمز الإيميل */
.mail-step { gap: 12px; }
.form-msg { margin: 0; font-size: 14px; font-weight: 700; color: #1B7A4B; }
.form-msg.bad { color: #C62828; }
.code-in { text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .45em; padding-inline-start: calc(16px + .45em); }
.mail-more { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 14px; }
.mail-more .linkish:disabled { opacity: .55; cursor: default; text-decoration: none; }
.mail-sec { display: grid; gap: 8px; justify-items: start; margin-bottom: 14px; }
.mail-sec .prof-out { margin: 0; padding: 0; border: 0; justify-content: flex-start; gap: 14px; }
/* الخروج من المباراة */
.exit-btn { font-size: 15px; padding: 5px 11px 7px; white-space: nowrap; }
.exit-btn .x-short { display: none; }
.exit-q { margin: 0; font-size: 18px; font-weight: 700; }
.exit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.exit-actions .btn { font-size: 19px; }
.left-note { margin-top: 4px; }
@media (max-width: 640px) {
  .exit-btn .x-long { display: none; }
  .exit-btn .x-short { display: inline; }
  .exit-actions { grid-template-columns: 1fr; }
}
.pu-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.pu .prof-stats { border: 2.5px solid var(--ink); border-radius: 16px; }

.rk-res { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rk-delta { font-family: var(--display); font-size: 22px; padding: 0 14px 4px; }
.rk-delta.up { background: var(--mint); }
.rk-delta.down { background: #FFB3AA; }
.rk-pill { letter-spacing: 0; font-size: 16px; background: #E2359E; color: #fff; }

@media (max-width: 760px) {
  .prof-grid { grid-template-columns: 1fr; }
  .acct { position: static; justify-self: end; margin-bottom: -6px; }
  .ranked-actions { grid-template-columns: 1fr; }
}


/* ---------------- صفحات الموقع ---------------- */
.site-foot {
  width: 100%; max-width: 760px; margin: 34px auto 6px; padding-top: 22px; border-top: 3px dashed rgba(255,255,255,.35);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; color: var(--on, #fff); text-align: start;
}
.site-foot h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.2; }
.site-foot nav { display: grid; gap: 6px; align-content: start; }
.site-foot a { color: inherit; font-weight: 600; font-size: 15px; text-decoration: none; opacity: .88; width: fit-content; }
.site-foot a:hover, .site-foot a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.foot-line { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13.5px; opacity: .75; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.foot-social { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.foot-support { grid-column: 1 / -1; margin: 0; }
.site-foot .foot-support a.btn { color: var(--ink); opacity: 1; font-size: 17px; text-decoration: none; }
.home .site-foot { margin-top: 26px; }

.page-wrap { max-width: 800px; margin: 0 auto; display: grid; gap: 14px; }
.page-title { font-size: clamp(40px, 8vw, 64px); text-align: center; margin: 4px 0 0; line-height: 1.15; }
.page-date { margin: -6px 0 2px; text-align: center; font-weight: 600; font-size: 14px; color: var(--on, #fff); opacity: .85; }
.page-card { padding: clamp(20px, 4vw, 38px); }
.md { font-size: 17px; line-height: 1.85; color: var(--ink); }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 14px; max-width: 68ch; }
.md h2 { font-family: var(--display); font-weight: 400; font-size: 29px; line-height: 1.25; margin: 30px 0 10px; }
.md h3 { font-size: 18.5px; margin: 22px 0 6px; }
.md ul, .md ol { margin: 0 0 16px; padding-inline-start: 24px; max-width: 68ch; }
.md li { margin: 4px 0; }
.md li > ul { margin: 4px 0 0; }
.md ol li::marker { font-weight: 700; }
.md a { color: inherit; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: #E2359E; }
.md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--soft); border-radius: 6px; padding: 1px 6px; direction: ltr; unicode-bidi: isolate; }
.md-note { margin: 4px 0 18px; padding: 12px 16px; background: #FFF4C4; border: 2.5px solid var(--ink); border-radius: 14px; font-size: 16px; max-width: 68ch; }
.md-table { overflow-x: auto; margin: 4px 0 20px; border: 2.5px solid var(--ink); border-radius: 14px; }
.md table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.6; }
.md th { background: var(--ink); color: #fff; text-align: start; padding: 10px 14px; font-weight: 700; }
.md td { padding: 10px 14px; border-top: 2px solid #E8E8E1; vertical-align: top; }
.md td:first-child { font-weight: 600; white-space: nowrap; }
.md-faq { border-bottom: 2px dashed #E3E3DC; }
.md-faq summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 17.5px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.md-faq summary::-webkit-details-marker { display: none; }
.md-faq summary::after { content: '+'; flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 50%; font-size: 20px; line-height: 1; background: var(--yellow); transition: transform .2s; }
.md-faq[open] summary::after { transform: rotate(45deg); }
.md-faq > div { padding: 0 0 14px; }
.md-faq > div > :last-child { margin-bottom: 0; }

.contact-ways { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.msg-form { display: grid; gap: 14px; margin-top: 8px; padding-top: 22px; border-top: 3px dashed #E3E3DC; }
.msg-form label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.msg-form label small { font-weight: 500; color: var(--muted); }
.msg-form textarea.field { resize: vertical; min-height: 140px; line-height: 1.7; font: inherit; }
.msg-form select.field { cursor: pointer; }
.msg-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.msg-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.msg-form .check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); flex-shrink: 0; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sent { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 0 4px; margin-top: 8px; border-top: 3px dashed #E3E3DC; }
.sent .mascot { width: 96px; height: 96px; }
.sent h2 { margin: 6px 0 0; }

@media (max-width: 760px) {
  .site-foot { grid-template-columns: 1fr 1fr; }
  .site-foot nav:first-child { grid-column: 1 / -1; }
  .msg-form .two { grid-template-columns: 1fr; }
  .md { font-size: 16.5px; }
  .md td:first-child { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .q-mystery, .ranked { animation: none; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti, .float { display: none; }
}

/* البلاغ عن لاعب */
.rep-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.rep-reasons legend { font-weight: 700; margin-bottom: 6px; }
.rep-pick { display: grid; gap: 8px; }
.rep-pick .btn { justify-content: flex-start; gap: 10px; }

/* الموافقة على الشروط عند إنشاء حساب */
.terms-ok { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; cursor: pointer; margin: 2px 0 10px; }
.terms-ok input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }
.terms-ok a { color: inherit; text-decoration: underline; }

/* التصنيفات للي داخلين الغرفة (يشوفونها والمضيف يختار) */
.cat.view { cursor: default; }
.cat.view:hover { transform: none; }
.cat.view.on:hover { transform: rotate(-1.5deg); }
