/* ============================================================
   نجوم السهرة — نظام التصميم (v0.14)
   ليلة سهرة: خلفية فحمية دافية فيها نقشة بلاط شامي خفيفة، خط عريض للعناوين،
   وأزرار ثلاثية الأبعاد بتنكبس. لون واحد مميّز (الأصفر) للأزرار والأشياء المهمة،
   والأخضر/الأحمر للحالة بس (صح/غلط) — طلب صاحب المشروع: "كثير ألوان مش مناسب".
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #15131b;
  --bg-2: #1d1a25;
  --panel: #24202e;
  --panel-2: #2e2939;
  --panel-3: #3a3447;
  --edge: #09080c;
  --line: #3d3649;
  --text: #f7f1e6;
  --muted: #aaa2b8;
  --faint: #7c748b;

  --accent: #ffc53d;
  --accent-ink: #2a1d00;
  --accent-edge: #b98407;
  --accent-soft: #ffc53d1a;
  --accent-line: #ffc53d66;
  --gold: var(--accent);
  --gold-ink: var(--accent-ink);

  --mafia: #ff5a6e;
  --town: #4db3ff;
  --jester: #c98bff;
  --ok: #3ddc97;
  --warn: #ff9f43;
  --team-a: #ff6b7f;
  --team-b: #4dabff;

  --radius: 22px;
  --shadow: 0 14px 40px #0009;
  --font-display: 'Lalezar', 'Baloo Bhaijaan 2', 'Segoe UI', Tahoma, sans-serif;
  --font-body: 'Baloo Bhaijaan 2', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.2s ease;
}

/* نقشة البلاط (نجمة ثمانية) + وهج أصفر خفيف فوق */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 55% at 50% -12%, var(--accent-soft), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.035' stroke-width='1.3'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 13 13 0M59 0 72 13M72 59 59 72M13 72 0 59'/%3E%3C/g%3E%3C/svg%3E");
  transition: background 1.2s ease;
}

body[data-phase='night'], body[data-phase='reveal'] {
  background-color: #0b0a1a;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, #2a3a8a44, transparent),
    radial-gradient(900px 500px at 10% 110%, #4a1d6a44, transparent);
}

body[data-phase='morning'], body[data-phase='discussion'], body[data-phase='voting'], body[data-phase='verdict'] {
  background-image: radial-gradient(1000px 500px at 50% -20%, #ffb34722, transparent);
}

body[data-phase='ended'] {
  background-image: radial-gradient(900px 500px at 50% 0%, #ffd23f26, transparent);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  width: 100%;
  min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%23b8a8d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2 { margin: 0 0 .35em; line-height: 1.2; font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
h3 { margin: 0 0 .4em; line-height: 1.3; font-weight: 800; font-size: 1.05rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- الأزرار: بتنكبس لتحت ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 0;
  box-shadow: 0 4px 0 var(--edge);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease, filter .15s ease;
}

a.btn { color: inherit; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--panel-3); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 var(--accent-edge), 0 10px 26px -12px var(--accent);
}
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.07); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--accent-edge); }
.btn.primary:disabled { background: var(--panel-2); color: var(--faint); box-shadow: 0 4px 0 var(--edge); opacity: 1; }
.btn.danger { background: #ff4d6d1f; color: #ffb7c4; box-shadow: 0 4px 0 #4d0d20, inset 0 0 0 2px #ff4d6d55; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: #ffffff0f; color: var(--text); }
.btn.ghost:active:not(:disabled) { transform: none; box-shadow: none; background: #ffffff14; }
.btn.big { font-size: 1.2rem; min-height: 60px; padding: 14px 26px; border-radius: 20px; }
.btn.block { width: 100%; }
.btn.gold { background: var(--accent-soft); color: var(--accent); box-shadow: 0 4px 0 var(--edge), inset 0 0 0 2px var(--accent-line); }

.card {
  background: var(--panel);
  border: 2px solid #ffffff08;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 5px 0 var(--edge);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: 3px 12px;
  border-radius: 999px;
  background: #ffffff12;
  border: 1.5px solid transparent;
  font-size: .88em;
  font-weight: 700;
  white-space: nowrap;
}

.team-mafia { color: var(--mafia); }
.team-town { color: var(--town); }
.team-jester { color: var(--jester); }

.toast-wrap {
  position: fixed;
  inset: auto 0 calc(var(--bottom-h, 0px) + 18px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 50;
  padding: 0 16px;
}

.toast {
  background: var(--panel-3);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--edge), var(--shadow);
  font-weight: 700;
  animation: toastIn .3s cubic-bezier(.2, 1.4, .4, 1);
  max-width: 100%;
}

.toast.error { background: #5a1328; color: #ffd0d9; }

.offline-bar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  background: var(--mafia);
  color: #fff;
  text-align: center;
  padding: 6px;
  font-weight: 800;
  z-index: 60;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: var(--panel-3);
  box-shadow: inset 0 -3px 0 #0000002e;
  font-size: 1.1em;
  flex: none;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 2px solid transparent;
  min-width: 0;
  box-shadow: 0 3px 0 var(--edge);
}

.player .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.player .sub { font-size: .8em; color: var(--muted); }
.player.dead { opacity: .45; filter: grayscale(.8); }
.player.dead .name { text-decoration: line-through; }
.player.offline .avatar { outline: 2px dashed var(--mafia); }
.player.done { border-color: var(--ok); background: #3ee08f14; }
.player .badge { position: absolute; top: -9px; inset-inline-start: -6px; font-size: 1.1em; }
.player .kick {
  margin-inline-start: auto;
  background: transparent;
  color: var(--faint);
  font-size: 1.1em;
  padding: 2px 6px;
  border-radius: 8px;
}
.player .kick:hover { color: var(--text); background: #ffffff12; }

.meter { direction: ltr; }
.meter-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mafia), #5b4f7c 35%, #5b4f7c 65%, var(--town));
}
.meter-zone {
  position: absolute;
  top: -3px;
  bottom: -3px;
  border: 2px solid var(--ok);
  border-radius: 999px;
}
.meter-dot {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bg);
  transform: translate(-50%, -50%);
  transition: left .3s ease;
  box-shadow: 0 0 0 2px #fff4;
}
.meter-labels { display: flex; justify-content: space-between; font-size: .85em; margin-top: 6px; }

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 1px;
}

.fade-in { animation: fadeUp .45s cubic-bezier(.2, .9, .3, 1) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: none; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.9); }
  to { opacity: 1; transform: none; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-line); }
  50% { box-shadow: 0 0 0 10px transparent; }
}

@keyframes wobble {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* ---------- اللوبي: مشترك بين شاشة العرض وجوال المضيف 👑 ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.setup h3 { margin-top: 20px; }
.setup > h3:first-child, .setup > :first-child h3 { margin-top: 0; }
.btn.step { width: 44px; min-height: 44px; height: 44px; padding: 0; font-size: 1.4rem; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 46px; min-height: 0; height: 28px; padding: 0; margin: 0;
  border-radius: 999px; border: 0; background: var(--panel-3);
  position: relative; cursor: pointer; transition: background .2s;
  box-shadow: inset 0 2px 0 #0003;
}
.switch input::after {
  content: ''; position: absolute; top: 4px; inset-inline-start: 4px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--text);
  box-shadow: 0 2px 0 #0004; transition: inset-inline-start .2s cubic-bezier(.3, 1.4, .5, 1);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { inset-inline-start: 22px; background: var(--accent-ink); }
.switch input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }

/* كروت الألعاب: كرت غامق، والإيموجي بشارة مايلة، والأصفر مع اللمس بس */
.game-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 12px; }
.game-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 2px;
  width: 100%;
  min-height: 150px;
  padding: 16px 18px;
  text-align: start;
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  border: 2px solid transparent;
  box-shadow: 0 5px 0 var(--edge);
  transition: transform .12s ease, box-shadow .12s ease, border-color .15s;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 16%, var(--accent-soft), transparent 45%),
    repeating-linear-gradient(-45deg, transparent 0 16px, #ffffff05 16px 32px);
}
.game-card:hover:not(:disabled), .game-card:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 0 var(--edge); }
.game-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.game-emoji { font-size: 3rem; line-height: 1; }
.game-card .game-emoji {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--panel-3);
  box-shadow: 0 4px 0 var(--edge);
  font-size: 2.3rem;
  transform: rotate(-8deg);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background .15s;
}
.game-card:hover .game-emoji { transform: rotate(4deg) scale(1.06); background: var(--accent-soft); }
.game-info { display: flex; flex-direction: column; gap: 0; min-width: 0; max-width: 100%; }
.game-info b { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.2; }
.game-card:hover .game-info b { color: var(--accent); }
.game-info .muted { color: var(--muted); font-size: .92rem; line-height: 1.4; }
.game-info small { color: var(--faint); font-weight: 800; font-size: .82rem; }
.game-go { display: none; }

/* صفحة اللعبة: راس غامق، واسم اللعبة بالأصفر */
.step-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
.step-no { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; flex: none; transform: rotate(-6deg); box-shadow: 0 3px 0 var(--accent-edge); }
.back-btn { justify-self: start; align-self: flex-start; min-height: 40px; padding: 6px 12px; color: var(--muted); }
.back-btn:hover { color: var(--text); }
.game-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 10px;
}
.game-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 12% 0%, var(--accent-soft), transparent 50%);
}
.game-intro h1 { color: var(--accent); }
.intro-title { display: flex; align-items: center; gap: 14px; }
.intro-title h1 { margin: 0; font-size: 2.1rem; }
.intro-title p { margin: 0; }
.game-intro .game-emoji { display: grid; place-items: center; width: 72px; height: 72px; flex: none; border-radius: 22px; background: var(--panel-3); box-shadow: 0 4px 0 var(--edge); font-size: 2.6rem; transform: rotate(-8deg); }
.intro-meta { margin: 0; font-weight: 800; font-size: .92rem; color: var(--faint); }
.intro-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.how-to { background: var(--bg-2); border-radius: 16px; padding: 4px 14px; text-align: start; }
.how-to summary { cursor: pointer; font-weight: 800; padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to summary::after { content: '+'; margin-inline-start: auto; font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.how-to[open] summary::after { transform: rotate(45deg); }
.how-to ol { margin: 4px 0 10px; padding-inline-start: 1.3em; display: grid; gap: 6px; }
.how-to li::marker { font-weight: 800; }
.start-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: grid; gap: 8px;
  padding: 24px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 24px);
}
.start-reason { margin: 0; text-align: center; color: var(--warn); font-weight: 800; }

/* خيارات بتنختار (باقات، طرق لعب، صعوبة) */
.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 12px 0; }
.pkg {
  position: relative;
  text-align: start; padding: 14px 16px; border-radius: 18px;
  background: var(--bg-2); border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, background .15s, transform .12s;
}
.pkg:hover { background: var(--panel-2); }
.pkg:active { transform: scale(.98); }
.pkg.selected { border-color: var(--accent); background: var(--accent-soft); }
.pkg.selected::after, .style-card.selected::after {
  content: '✓'; position: absolute; top: 10px; inset-inline-end: 12px;
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .85rem;
}
.pkg-head { display: flex; align-items: center; gap: 8px; padding-inline-end: 28px; }
.pkg-head b { font-size: 1.1rem; }
.pkg-head .chip { margin-inline-start: auto; }
.pkg p { margin: 0; font-size: .9rem; line-height: 1.45; }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chips .chip { font-size: .82rem; }
.pkg-foot { display: flex; justify-content: space-between; font-size: .88rem; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); }
.bal.ok { color: var(--ok); }
.bal.mafia { color: var(--mafia); }
.bal.town { color: var(--town); }

/* التصنيفات: حبّات صغيرة بدل مربعات كبيرة */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cat {
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 6px 12px; border-radius: 14px; text-align: start;
  background: var(--bg-2); border: 2px solid transparent; color: var(--muted);
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.cat b { font-weight: 700; line-height: 1.25; }
.cat:active { transform: scale(.96); }
.cat.selected { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.cat-emoji { font-size: 1.35rem; flex: none; filter: grayscale(.6); opacity: .7; transition: filter .15s, opacity .15s; }
.cat.selected .cat-emoji { filter: none; opacity: 1; }
.cat small { display: none; }

/* تصنيفات سين جيم: مجموعات بتنفتح، وفوقها اللي انختار */
.cat-head { margin-top: 20px; }
.cat-head h3 { margin: 0; }
.cat-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; min-height: 32px; }
.chip.chosen { border-color: var(--accent); background: var(--accent-soft); font-weight: 800; cursor: pointer; }
.cat-group { border-radius: 16px; margin: 8px 0; background: var(--bg-2); }
.cat-group summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 800; list-style: none; }
.cat-group summary::-webkit-details-marker { display: none; }
.cat-group summary::after { content: '▾'; margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.cat-group[open] summary::after { transform: rotate(180deg); }
.cat-group .group-name { flex: none; }
.cat-group .picked { border-color: var(--accent); color: var(--accent); }
.cat-group .cat-grid { padding: 0 10px 10px; }
.cat-group .cat { background: var(--panel); }

/* شريط الصعوبة بإيدين */
.level-range { margin: 20px 0 6px; }
.range-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.range-head h3 { margin: 0; }
.range-text { color: var(--accent); font-size: 1.1rem; }
.range-track { position: relative; height: 48px; direction: ltr; margin: 6px 4px 0; }
.range-rail { position: absolute; inset-inline: 14px; top: 50%; height: 12px; transform: translateY(-50%); border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 2px 0 #0004; }
.range-fill { position: absolute; top: 0; bottom: 0; left: var(--from); right: var(--to); border-radius: inherit; background: linear-gradient(90deg, var(--ok), var(--accent), var(--mafia)); }
.range-track input[type='range'] {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0;
  background: none; border: 0; outline: none; pointer-events: none; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
.range-track input[type='range']::-webkit-slider-runnable-track { background: none; border: 0; }
.range-track input[type='range']::-moz-range-track { background: none; border: 0; }
.range-track input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: 32px; height: 32px; border-radius: 50%; background: var(--text);
  border: 4px solid var(--accent); box-shadow: 0 4px 0 var(--edge);
}
.range-track input[type='range']::-moz-range-thumb {
  pointer-events: auto; cursor: grab;
  width: 24px; height: 24px; border-radius: 50%; background: var(--text);
  border: 4px solid var(--accent); box-shadow: 0 4px 0 var(--edge);
}
.range-track input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px #fff; }
.range-track input[data-range-role='max'] { z-index: 2; }
.level-range.min-top input[data-range-role='min'] { z-index: 3; }
.range-ticks { display: flex; justify-content: space-between; direction: ltr; padding: 0 8px; font-size: .72rem; color: var(--faint); }
.preset-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.preset { display: grid; gap: 0; padding: 8px 4px; border-radius: 14px; background: var(--bg-2); border: 2px solid transparent; font-weight: 800; line-height: 1.3; }
.preset small { color: var(--muted); font-weight: 400; font-size: .72rem; direction: ltr; }
.preset.selected { border-color: var(--accent); background: var(--accent-soft); }

.editor { background: var(--bg-2); border-radius: 18px; padding: 12px 16px; }
.editor summary { cursor: pointer; font-weight: 800; }
.how ol { margin: 10px 0; padding-inline-start: 1.3em; }
.how li { margin: 4px 0; }

/* "إعدادات أكثر": الأشياء اللي نادراً بتتغيّر */
.more-settings { margin-top: 16px; border-radius: 18px; background: var(--bg-2); }
.more-settings > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 800; color: var(--muted);
}
.more-settings > summary::-webkit-details-marker { display: none; }
.more-settings > summary::after { content: '▾'; margin-inline-start: auto; transition: transform .2s; }
.more-settings[open] > summary { color: var(--text); }
.more-settings[open] > summary::after { transform: rotate(180deg); }
.more-settings > .settings, .more-settings > .more-body { margin: 0; padding: 4px 16px 16px; }
.more-settings .settings select { background-color: var(--panel); }
.more-settings > summary { white-space: nowrap; }
.more-settings .summary-text { flex: 1; font-weight: 400; font-size: .85rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.settings { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin: 16px 0; }
.settings label:not(.switch) { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.settings select { width: auto; }
.start-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.hint { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.crown-btn { background: transparent; font-size: 1.05em; padding: 2px 6px; opacity: .35; margin-inline-start: auto; border-radius: 8px; }
.crown-btn:hover { opacity: 1; }
.crown-btn + .kick { margin-inline-start: 0; }

/* ---------- سين جيم: مشترك بين الشاشة والجوال ---------- */
.team-A { color: var(--team-a); }
.team-B { color: var(--team-b); }

.team-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.team-card { padding: 12px 16px; border-radius: var(--radius); background: var(--panel); border: 2px solid transparent; text-align: center; transition: box-shadow .3s, transform .3s; box-shadow: 0 4px 0 var(--edge); }
.team-card.A { border-color: #ff6b8b55; }
.team-card.B { border-color: #4dabff55; }
.team-card.active.A { box-shadow: 0 4px 0 var(--edge), 0 0 0 4px #ff6b8b44; border-color: var(--team-a); transform: scale(1.02); }
.team-card.active.B { box-shadow: 0 4px 0 var(--edge), 0 0 0 4px #4dabff44; border-color: var(--team-b); transform: scale(1.02); }
.team-card { position: relative; }
.team-head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.team-head b { line-height: 1.3; }
.team-card .lifeline { position: absolute; top: 6px; inset-inline-end: 8px; font-size: .8rem; }
.team-card .team-head { padding-inline: 14px; }
.team-score { font-family: var(--font-display); font-size: 2.4rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.team-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 1.3rem; }
.team-cards.compact .team-card { padding: 8px 10px; }
.team-cards.compact .team-score { font-size: 1.7rem; }
.lifeline.spent { opacity: .25; filter: grayscale(1); }

.quiz-board { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }
.quiz-col { display: grid; gap: 8px; align-content: start; }
.quiz-cat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 6px 4px; border-radius: 14px; background: var(--bg-2); border: 2px solid transparent; font-weight: 800; font-size: .95rem; text-align: center; line-height: 1.3; }
.quiz-cell {
  display: grid; place-items: center; min-height: 56px; padding: 6px 2px;
  border-radius: 14px; font-family: var(--font-display); font-size: 1.45rem; font-variant-numeric: tabular-nums;
  background: var(--panel-2); border: 2px solid transparent; color: var(--accent);
  box-shadow: 0 4px 0 var(--edge);
  transition: transform .12s ease, box-shadow .12s ease;
}
button.quiz-cell:hover { transform: translateY(-2px); border-color: var(--accent); }
button.quiz-cell:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.quiz-cell.used { background: var(--bg-2); color: var(--faint); font-size: 1.1rem; opacity: .55; box-shadow: none; }
.quiz-cell.won-A { opacity: 1; color: var(--team-a); border-color: var(--team-a); }
.quiz-cell.won-B { opacity: 1; color: var(--team-b); border-color: var(--team-b); }

.q-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 10px 0; }
.q-value { font-family: var(--font-display); font-size: 1.8rem; color: var(--accent); line-height: 1.1; }
.q-bonus { padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); border: 2px solid var(--accent); font-weight: 800; animation: glow 1.4s infinite; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--panel); border: 2px solid transparent; text-align: start; font-weight: 700; font-size: 1.1rem; transition: opacity .3s, transform .1s; box-shadow: 0 4px 0 var(--edge); }
button.quiz-option:hover { border-color: var(--accent); }
button.quiz-option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.quiz-option .letter { width: 2em; height: 2em; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; font-weight: 800; transform: rotate(-4deg); }
.quiz-option.removed { opacity: .25; text-decoration: line-through; }
.quiz-option.correct { border-color: var(--ok); background: #3ee08f24; }
.quiz-option.correct .letter { background: var(--ok); color: #00321a; }
.quiz-option.wrong { border-color: var(--mafia); background: #ff4d6d22; }
.quiz-option.wrong .letter { background: var(--mafia); color: #2e0010; }

/* سين جيم 2.0: الولعة، الخانات الخاصة، الميزان، الكروت، والقرارات */
.team-card.on-fire { border-color: var(--warn); box-shadow: 0 4px 0 var(--edge), 0 0 22px #ffb03b44; }
.streak { font-size: 1.05rem; letter-spacing: -2px; }
.streak small { letter-spacing: 0; color: var(--muted); margin-inline-start: 6px; }
.team-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }
.mini { padding: 1px 8px; border-radius: 999px; background: #ffffff12; font-size: .78rem; white-space: nowrap; }

.quiz-cat { position: relative; }
.quiz-cat.lead-A { border-color: #ff6b8b66; }
.quiz-cat.lead-B { border-color: #4dabff66; }
.quiz-cat .crown { position: absolute; top: -8px; inset-inline-end: -4px; font-size: 1.1rem; }
.quiz-cell .cell-mark { font-size: .7em; }
.quiz-cell s { opacity: .5; font-size: .7em; margin-inline-end: 3px; }
.quiz-cell.in-line { box-shadow: 0 4px 0 var(--edge), inset 0 0 0 2px var(--accent); }
.quiz-cell.locked { color: var(--faint); background: var(--bg-2); }
.quiz-cell.locked::after { content: '🔒'; font-size: .8rem; }
.quiz-cell.forced-A { border-color: var(--team-a); border-style: dashed; }
.quiz-cell.forced-B { border-color: var(--team-b); border-style: dashed; }
.quiz-cell.dim { opacity: .4; }
.quiz-board.quarter .quiz-cell:not(.used) { border-color: var(--accent-line); }

.quiz-option { position: relative; }
.quiz-option .opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.quiz-option.mine { box-shadow: 0 4px 0 var(--edge), inset 0 0 0 2px #4dabff88; }
.opt-badges { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.opt-badge { padding: 1px 8px; border-radius: 999px; background: var(--bg-2); font-size: .75rem; font-weight: 800; }
.opt-badge.count { color: var(--accent); }
.opt-badge.me { color: var(--town); }

.chip.note, .chip.special { border-color: var(--accent); color: var(--accent); }
.chip.warn { border-color: #ffb03b66; color: var(--warn); }
.chip.gold { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.chip-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gold-text { color: var(--accent); }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }

.thermo { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: .95rem; }
.thermo-bar { display: flex; width: min(220px, 50vw); height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.thermo-bar .up { background: var(--ok); }
.thermo-bar .down { background: var(--mafia); }
.thermo-count { color: var(--muted); }

.effect-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.volcano-banner { margin: 10px auto; padding: 10px 18px; border-radius: var(--radius); background: #ff4d6d1a; border: 2px solid #ff4d6d66; text-align: center; font-weight: 800; }
.quarter-banner { margin: 10px auto; padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent); text-align: center; font-weight: 800; }

.moments { display: grid; gap: 6px; margin: 10px 0; }
.moment { padding: 8px 14px; border-radius: 14px; background: var(--panel); font-weight: 700; animation: fadeUp .4s ease both; border-inline-start: 4px solid var(--line); }
.moment.kind-title, .moment.kind-crowns { border-inline-start-color: var(--accent); }

.decision-panel { margin: 12px auto; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 2px solid var(--warn); text-align: center; box-shadow: 0 5px 0 var(--edge); }
.decision-panel.mine { border-color: var(--accent); animation: glow 1.8s infinite; }
.decision-title { font-weight: 800; margin-bottom: 8px; }
.decision-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.decision-meta { margin-top: 8px; color: var(--muted); }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }

.power-hand { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.power-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--bg-2); border: 2px solid transparent; text-align: start; }
button.power-card { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 4px 0 var(--edge); }
button.power-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
button.power-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.power-card:disabled, .power-card.off { opacity: .6; }
.power-when { margin-inline-start: auto; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.power-emoji { font-size: 1.6rem; flex: none; }
.power-text { display: grid; min-width: 0; }
.power-text small { color: var(--muted); font-weight: 400; }
.hand-panel { margin-top: 12px; }
.aim-panel { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.lock-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.lock-btn { display: grid; gap: 2px; padding: 10px 8px; line-height: 1.25; }
.lock-btn small { font-size: .7rem; opacity: .8; font-weight: 400; }
.lock-emoji { font-size: 1.5rem; }

.style-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.style-card { position: relative; display: grid; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--bg-2); border: 2px solid transparent; text-align: start; }
.style-card b { padding-inline-end: 28px; }
.style-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.style-card small { color: var(--muted); font-weight: 400; line-height: 1.4; }

.crowns-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.story ul { margin: 8px 0 0; padding-inline-start: 1.2em; text-align: start; }
.story li { margin: 4px 0; }
.finale-cats { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.finale-cat { text-align: center; min-width: 140px; }

/* ---------- تحدي الثلاثين: مشترك بين الشاشة والجوال ---------- */
.duel-score { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0; }
.duel-player { flex: 1 1 0; min-width: 0; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 2px solid transparent; text-align: center; transition: border-color .3s, transform .3s; box-shadow: 0 4px 0 var(--edge); }
.duel-player.active { border-color: var(--accent); transform: scale(1.03); box-shadow: 0 4px 0 var(--edge), 0 0 0 4px var(--accent-soft); }
.duel-name { display: block; overflow-wrap: anywhere; font-weight: 800; }
.duel-points { font-family: var(--font-display); font-size: 2.4rem; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.15; }
.duel-vs { font-family: var(--font-display); color: var(--muted); font-size: 1.4rem; flex: none; transform: rotate(-8deg); }
.judge-line { margin: 0 0 8px; }
.seg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 14px; }
.seg-dot { font-size: 1.2rem; opacity: .35; filter: grayscale(1); transition: transform .3s; }
.seg-dot.now { opacity: 1; filter: none; transform: scale(1.3); }
.seg-dot.done { opacity: .7; filter: none; }
.seg-intro { text-align: center; margin: 10px auto; max-width: 720px; }
.seg-rules { display: grid; gap: 6px; margin: 10px auto; padding: 0; list-style: none; max-width: 520px; text-align: start; }
.seg-rules li { padding: 8px 14px; border-radius: 14px; background: var(--panel); }
.duel-turn { text-align: center; font-size: 1.15rem; font-weight: 800; margin: 10px 0; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.duel-turn.buzzed { color: var(--accent); animation: glow 1.2s infinite; border-radius: 14px; padding: 6px 12px; }
.strikes { font-size: 1.1rem; letter-spacing: 2px; }
.strike-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 700px; margin: 12px auto; }
.strike-card { text-align: center; display: grid; gap: 6px; padding: 12px; }
.strike-card.now { border-color: var(--accent); }
.strike-card.out { opacity: .5; }
.said-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.bad { border-color: var(--mafia); color: var(--mafia); }
.center-chip { display: block; width: fit-content; margin: 0 auto 10px; }
.bid-run { display: grid; gap: 8px; justify-items: center; margin: 14px 0; }
.bid-counter { font-family: var(--font-display); font-size: 3.6rem; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bid-counter.done { color: var(--ok); }
.bid-counter small { font-size: 1.2rem; color: var(--muted); }
.clue-list { display: grid; gap: 10px; max-width: 760px; margin: 12px auto; }
.clue { text-align: start; opacity: .6; }
.clue.now { opacity: 1; border-color: var(--accent); }
.clue.next { opacity: .35; border-style: dashed; }
.clue-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arming { text-align: center; }
.written { font-weight: 800; overflow-wrap: anywhere; }
.duel-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.duel-role { display: grid; gap: 8px; }
.role-head { display: flex; align-items: center; gap: 8px; }
.role-emoji { font-size: 1.5rem; }
.role-player { font-size: 1.1rem; }
.role-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pick .chip { cursor: pointer; }
.duel-segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.duel-seg { display: grid; gap: 6px; }
.duel-seg.off { opacity: .5; }
.seg-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.seg-emoji { font-size: 1.4rem; }
.seg-count { display: flex; align-items: center; gap: 10px; }
.seg-count .count { font-size: 1.4rem; min-width: 1.5ch; text-align: center; }
.count-box { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0; }
.count-value { font-family: var(--font-display); font-size: 2.8rem; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.count-value.done { color: var(--ok); }
.count-value small { font-size: 1.1rem; color: var(--muted); }
.role-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.role-btn { display: grid; gap: 2px; padding: 10px 6px; text-align: center; }
.role-btn small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-btn.primary small { color: inherit; opacity: .75; }

.match-chip { font-weight: 800; color: var(--accent); border-color: var(--accent); font-size: .95rem; }
.team-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.team-col { display: flex; flex-direction: column; gap: 6px; text-align: start; min-width: 0; }
.team-col > b { overflow-wrap: anywhere; }
.team-member { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--bg-2); border: 0; text-align: start; }
.team-member .member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.team-member .swap { margin-inline-start: auto; color: var(--muted); flex: none; }

/* ---------- ارسم وخمّن: مشترك بين الشاشة والجوال ---------- */
.sketch-host { width: 100%; aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 6px 0 var(--edge), 0 0 0 4px var(--accent); }
.sketch-canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; background: #fff; }

.hint-boxes { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; direction: rtl; margin: 6px 0 2px; }
.hint-box {
  width: 34px; height: 42px; display: grid; place-items: center;
  border-bottom: 3px solid var(--accent); font-size: 1.5rem; font-weight: 800;
  background: var(--bg-2); border-radius: 8px 8px 0 0;
}
.hint-box.shown { color: var(--accent); }
.hint-gap { width: 16px; }

.feed { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; text-align: start; }
.feed.small { max-height: 150px; }
.feed-item { padding: 5px 12px; border-radius: 12px; background: var(--bg-2); font-size: .95rem; overflow-wrap: anywhere; }
.feed-item.correct { background: #3ee08f22; color: #a8f5cf; font-weight: 700; }

.guessed-line { display: grid; gap: 6px; text-align: start; }
.guessed-line .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plus { color: var(--ok); font-weight: 800; }

.mark-box { display: grid; gap: 8px; padding: 10px; border-radius: 16px; border: 2px dashed var(--accent-line); text-align: start; }
.mark-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 12px 0; }
.gallery-item { margin: 0; background: var(--panel); border-radius: 18px; overflow: hidden; box-shadow: 0 4px 0 var(--edge); }
.gallery-item:nth-child(odd) { transform: rotate(-1.2deg); }
.gallery-item:nth-child(even) { transform: rotate(1deg); }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1 / 1; background: #fff; }
.gallery-item figcaption { display: grid; gap: 2px; padding: 8px 12px; font-size: .9rem; text-align: start; }

/* لما ملفات اللعبة ما تنحمّل (بدل شاشة فاضية) */
.load-error { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 64px 16px; }
.load-emoji { font-size: 64px; line-height: 1; }

/* الإعلان: بس بين الألعاب، تحت المحتوى، وبينسكّر */
.ad-break { width: calc(100% - 32px); max-width: 970px; margin: 0 auto 32px; padding: 8px 12px 12px; background: var(--bg-2); border-radius: 16px; }
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .75rem; color: var(--muted); }
.ad-close { background: none; border: 0; color: var(--muted); font: inherit; font-size: 1rem; line-height: 1; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.ad-close:hover, .ad-close:focus-visible { background: var(--panel); color: var(--text); }
.ad-body { min-height: 90px; }
.ad-preview { display: grid; place-items: center; min-height: 90px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; padding: 12px; }
.ad-interstitial { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: #000c; backdrop-filter: blur(6px); animation: fadeIn .2s ease both; }
.ad-interstitial-card { width: min(100%, 560px); padding: 10px 14px 16px; background: var(--bg-2); border-radius: 22px; box-shadow: var(--shadow); }
.ad-close.wide { font-size: 1rem; font-weight: 800; padding: 8px 14px; background: var(--panel); color: var(--text); }
.ad-preview.tall { min-height: min(60vh, 420px); font-size: 1.1rem; line-height: 1.8; }
@media print { .ad-break, .ad-interstitial { display: none; } }

/* ---------- السهرة (مشتركة بين الشاشة والجوال) ---------- */
textarea { resize: vertical; min-height: 0; }
.lv { display: inline-block; margin-inline-start: 6px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72em; font-weight: 800; vertical-align: middle; line-height: 1.6; }
.announcements { display: grid; gap: 8px; margin-bottom: 14px; }
.announcement { background: #45b4ff1a; border: 2px solid #45b4ff44; color: #d3ecff; border-radius: 16px; padding: 10px 14px; font-weight: 700; text-align: start; }
.game-card.off { opacity: .5; filter: grayscale(1); cursor: not-allowed; }
.ready-chip { border-color: var(--ok); color: #a8f5cf; }
.ready-mark { flex: none; }
.ready-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip.is-ready { border-color: var(--ok); background: #3ee08f18; }
.chip.not-ready { opacity: .7; }

.party-card { display: grid; gap: 10px; text-align: start; }
.party-history summary { cursor: pointer; color: var(--muted); font-weight: 800; }
.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.standing { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 14px; background: var(--bg-2); min-width: 0; }
.standing:first-child { background: var(--accent-soft); }
.standing.me { box-shadow: inset 0 0 0 2px var(--accent); }
.standing-rank { width: 1.8em; text-align: center; font-weight: 800; flex: none; }
.standing-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standing-meta { flex: none; font-size: .85em; }
.standing-points { flex: none; font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); min-width: 3ch; text-align: end; }
.match-history { display: grid; gap: 4px; margin-top: 8px; }
.history-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .92rem; }
.history-name { font-weight: 800; }
.history-win { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.next-wrap { max-width: 760px; margin: 18px auto 0; width: 100%; }
.next-panel { display: grid; gap: 12px; text-align: center; animation: fadeUp .35s ease both; }
.next-panel h2 { margin: 0; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.next-board { display: grid; gap: 6px; text-align: start; }

.rewards { display: grid; gap: 8px; text-align: start; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--bg-2); box-shadow: none; }
.reward-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.05rem; }
.reward-line b { color: var(--accent); font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; direction: ltr; unicode-bidi: isolate; }
.achievement-pop .plus, .score-row .plus, .list-row .plus { direction: ltr; unicode-bidi: isolate; }
.xp-bar { height: 12px; border-radius: 999px; background: var(--edge); overflow: hidden; }
.xp-bar > div { height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--accent), #fff6); border-radius: inherit; animation: grow 1s ease both; }
.xp-text { font-size: .85rem; }
.level-up { text-align: center; font-family: var(--font-display); color: var(--accent); font-size: 1.4rem; animation: pop .5s ease both; }
.achievement-pop { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #3ee08f14; border: 2px solid #3ee08f44; animation: pop .45s ease both; }
.achievement-pop .plus { margin-inline-start: auto; color: var(--ok); font-weight: 800; }
.achievement-emoji { font-size: 1.8rem; line-height: 1; flex: none; }
.rivals { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.party-end { display: grid; gap: 16px; max-width: 900px; margin: 0 auto; text-align: center; }
.party-end-hero { position: relative; padding: 20px 8px 4px; overflow: hidden; }
.party-end-hero h1 { font-size: clamp(28px, 6vw, 52px); }
.confetti { position: absolute; inset: 0; z-index: 0; font-size: 1.6rem; letter-spacing: 1.2em; line-height: 2.4; opacity: .14; pointer-events: none; word-break: break-all; animation: fadeUp 1.2s ease both; }
.party-end-hero > :not(.confetti) { position: relative; z-index: 1; }
.mvp-avatar { font-size: 96px; line-height: 1; animation: pop .6s cubic-bezier(.2, 1.5, .4, 1) both; filter: drop-shadow(0 8px 0 #0005); }
.party-awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.party-awards .award { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.party-awards .award-emoji { font-size: 2.4rem; }

/* ---------- القوائم المنبثقة بالجوال (القائمة، الملف، التبليغ) ---------- */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; background: #07030dcc; z-index: 40; animation: fadeIn .2s ease both; }
.sheet-panel {
  position: fixed; inset: auto 0 0 0; z-index: 41; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px #000b;
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1) both; max-width: 560px; margin: 0 auto;
}
.sheet-panel::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 10px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px; }
.sheet-head b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }
.sheet-close { min-height: 40px; padding: 4px 12px; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sheet-body h3 { margin: 6px 0 0; font-size: 1.05rem; }
.menu-list { display: grid; gap: 10px; }
.menu-list .btn { justify-content: flex-start; }
.menu-list a.btn { text-decoration: none; }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head h2 { margin: 0; }
.big-avatar { width: 64px; height: 64px; font-size: 2.2rem; }
.title-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.title-pick select { width: auto; max-width: 60%; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stat { display: grid; justify-items: center; padding: 8px 4px; border-radius: 14px; background: var(--panel); text-align: center; }
.stat span { font-size: .75rem; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.2; }
.game-stat { flex-wrap: wrap; }
.game-stat small { flex-basis: 100%; }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.achievement { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--panel); border: 2px solid transparent; text-align: center; }
.achievement.got { border-color: var(--accent-line); }
.achievement.locked { opacity: .45; }
.achievement small { font-size: .72rem; line-height: 1.35; }
.report-form { display: grid; gap: 12px; }
.report-form label { display: grid; gap: 6px; font-weight: 800; }
.report-form fieldset { border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; display: grid; gap: 6px; margin: 0; }
.report-form legend { font-weight: 800; padding: 0 4px; }
.report-form .radio { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.report-form .radio input { width: auto; min-height: 0; accent-color: var(--accent); }

@keyframes grow { from { width: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@keyframes twinkle {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.announcement.warn { background: #ffb03b1f; border-color: #ffb03b55; color: #ffdcaa; margin: 0; }
.announcements .announcement { margin: 0; }

.pulse { animation: glow 1.6s ease-in-out infinite; }

/* ---------- سؤال التأكيد (ask) ---------- */
.ask { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.ask-backdrop { position: absolute; inset: 0; background: #07060bcc; animation: fadeIn .15s ease both; }
.ask-panel {
  position: relative; width: min(100%, 440px); display: grid; gap: 16px;
  padding: 22px 18px 16px; border-radius: 26px; background: var(--panel-2);
  box-shadow: 0 6px 0 var(--edge), 0 24px 60px #000c; text-align: center;
  animation: sheetUp .25s cubic-bezier(.2, 1.2, .4, 1) both;
}
.ask-text { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.6; }
.ask-actions { display: grid; gap: 8px; }
.ask-actions .btn.primary { min-height: 54px; font-size: 1.1rem; }
@media (min-width: 700px) { .ask { place-items: center; } }

/* لما في شريط "عم نرجعك" (net-banner) ما في داعي لشريط الانقطاع الثاني */
body:has(.net-banner) .offline-bar { display: none; }

/* تحدي التخمين: تصنيف الشي (خيار "بيّن التصنيف للاعبين") */
.cat-chip { align-self: center; background: var(--accent-soft); color: var(--text); border-color: var(--accent-line); }
.setting-line { margin-top: 12px; align-items: flex-start; }
.setting-line small { display: block; font-weight: 400; }
