/* =============================================================
   أوسكار الشركة
   أسلوب "كرّاس حفل": مسطّح بلا ظلال، خطوط فاصلة رفيعة،
   أرقام ضخمة، والأحمر #BA1723 يُستخدم كحبر لا كزينة.
   ============================================================= */

/* الخطوط نفسها المستخدمة في موقع الشركة ffc.iq */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Somar Sans';
  src: url('/fonts/SomarSans-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Somar Sans';
  src: url('/fonts/SomarSans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Somar Sans';
  src: url('/fonts/SomarSans-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Somar Sans';
  src: url('/fonts/SomarSans-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --brand:      #ba1723;
  --brand-dark: #8f1019;
  --brand-tint: #fdf1f2;
  --brand-line: rgba(186, 23, 35, 0.3);

  --ink:        #141418;
  --paper:      #ffffff;
  --wash:       #f4f3f1;
  --wash-2:     #ebeae7;
  --rule:       #dedcd8;
  --rule-soft:  #e9e7e4;

  --text:       #141418;
  --muted:      #55555f;
  --faint:      #8a8a93;

  --font-ui:      'IBM Plex Sans Arabic', -apple-system, 'SF Arabic', system-ui, 'Segoe UI', sans-serif;
  --font-display: 'Somar Sans', 'IBM Plex Sans Arabic', 'SF Arabic', system-ui, sans-serif;

  --ease:       cubic-bezier(0.2, 0.9, 0.3, 1);
  --gut:        clamp(18px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* شريط التقدّم الثابت في أعلى الشاشة ------------------------------------ */
.rail {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}
.rail span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.5s var(--ease);
}

/* الهيكل ---------------------------------------------------------------- */
.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: var(--gut); }

.testbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--wash);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 13px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
  margin-inline-end: auto;
}
.brand-mark { width: 30px; height: 30px; border-radius: 4px; display: block; }
.brand small {
  display: block;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--faint);
}

.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav a {
  position: relative;
  padding: 6px 2px;
  margin-inline: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s;
}
.nav a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: right center; /* البداية من جهة القراءة في RTL */
  transition: transform 0.22s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after, .nav a[aria-current='page']::after { transform: scaleX(1); }
.nav a[aria-current='page'] { color: var(--brand); }

main { padding-block: clamp(34px, 7vw, 72px) 110px; }

/* العنوان الرئيسي ------------------------------------------------------- */
.hero { margin-bottom: clamp(32px, 6vw, 60px); }
.hero-grid {
  display: grid;
  gap: clamp(18px, 4vw, 40px);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 2.4s ease-in-out infinite;
}
.eyebrow.is-closed .dot { animation: none; background: var(--faint); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 7.5vw, 4.6rem);
  /* العربية بالتشكيل تحتاج ارتفاع سطر أوسع، وإلا اصطدمت الشدّة
     والفتحة بالسطر الذي تحتها. */
  line-height: 1.42;
  letter-spacing: -0.01em;
  margin: 12px 0 0;
}
h1 em { font-style: normal; color: var(--brand); }

.lede {
  max-width: 50ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.hero-aside {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  white-space: nowrap;
}
.hero-aside small {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;   /* الأب ارتفاع سطره 1 للأرقام، والعربية تُقصّ عنده */
  color: var(--faint);
  letter-spacing: 0.06em;
  margin-top: 6px;
  direction: rtl;
  text-align: start;
}

/* الشريط المتحرّك ------------------------------------------------------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--rule);
  padding-block: 11px;
  margin-bottom: clamp(26px, 5vw, 44px);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 34px;
  width: max-content;
  animation: slide 48s linear infinite;
  font-size: 13.5px;
  color: var(--faint);
  white-space: nowrap;
}
.marquee-track b { color: var(--brand); font-weight: 600; }
@keyframes slide { to { transform: translateX(50%); } }

/* الأزرار --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1.5px solid var(--brand);
  border-radius: 2px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost { background: none; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--ink); color: #fff; }

.btn-quiet {
  background: none;
  color: var(--muted);
  border-color: transparent;
  padding-inline: 10px;
  font-weight: 500;
}
.btn-quiet:hover:not(:disabled) { color: var(--brand); background: none; border-color: transparent; }

.btn-danger { background: none; color: var(--brand); border-color: var(--brand-line); }
.btn-danger:hover:not(:disabled) { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-block { width: 100%; }

:where(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* الحقول ---------------------------------------------------------------- */
label.field { display: block; }
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}
.input, .select {
  width: 100%;
  padding: 12px 2px;
  border: none;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.18s;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-bottom-color: var(--brand); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23ba1723' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 4px center;
  padding-left: 28px;
  cursor: pointer;
}
.input-boxed {
  padding: 11px 13px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  font-size: 14.5px;
}
.input-boxed:focus { border-color: var(--brand); border-bottom-color: var(--brand); }

/* لوح ورقي -------------------------------------------------------------- */
.sheet-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(22px, 4vw, 34px);
}

/* تخطيط صفحة الدخول: البطاقة على جهة القراءة والشرح بجانبها */
.signin-grid {
  display: grid;
  gap: clamp(22px, 4vw, 48px);
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: start;
}
.howto { padding-top: 6px; }
.howto h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.howto ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.howto li {
  position: relative;
  counter-increment: step;
  padding: 12px 42px 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}
.howto li:last-child { border-bottom: none; }
.howto li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--brand);
  direction: ltr;
  unicode-bidi: isolate;
}
.howto b { color: var(--text); font-weight: 600; }

@media (max-width: 860px) {
  .signin-grid { grid-template-columns: 1fr; }
}

/* قائمة الأوسكارات ------------------------------------------------------ */
.list {
  border-top: 1px solid var(--rule);
  margin-top: 4px;
  direction: rtl;
}

.item {
  position: relative;
  isolation: isolate; /* يُبقي طبقة التمرير خلف المحتوى لا خلف الصفحة */
  direction: rtl;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 16px;
  width: 100%;
  padding: 17px 4px;
  border: none;
  border-bottom: 1px solid var(--rule-soft);
  background: none;
  font: inherit;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  opacity: 0;
  animation: item-in 0.5s var(--ease) forwards;
}
@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.item::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: var(--brand-tint);
  transition: width 0.3s var(--ease);
  z-index: -1;
}
.item:hover::before { width: 100%; }
.item > * { position: relative; }

.item-idx {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--rule);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate; /* الرقم لا يزحزح ترتيب بقية الصف */
  transition: color 0.2s;
  min-width: 2.2ch;
}
.item:hover .item-idx { color: var(--brand); }
.item.is-picked .item-idx { color: var(--brand); }

.item-emo { font-size: 21px; line-height: 1; }

.item-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.4;
}

.item-choice {
  font-size: 14px;
  font-weight: 500;
  color: var(--faint);
  white-space: nowrap;
  max-width: 34vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.is-picked .item-choice { color: var(--brand); font-weight: 600; }

.item-go {
  font-size: 15px;
  color: var(--rule);
  transition: transform 0.25s var(--ease), color 0.2s;
}
.item:hover .item-go { color: var(--brand); transform: translateX(-5px); } /* اتجاه التقدّم في RTL */

/* لافتة الورقة المقفلة --------------------------------------------------- */
.lockbar {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-inline-start-width: 3px;
}
.lockbar-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.lockbar b { display: block; font-size: 15px; line-height: 1.5; }
.lockbar span { font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* الصفوف بعد القفل: ظاهرة لكن غير قابلة للتعديل */
.item.is-locked { cursor: default; }
.item.is-locked:hover { transform: none; }
.item.is-locked:hover::before { width: 0; }
.item.is-locked:hover .item-go,
.item.is-locked .item-go { color: var(--rule); transform: none; }

/* الدرج الجانبي --------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 20, 24, 0.4);
  animation: fade 0.2s var(--ease);
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 61;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-inline-end: 2px solid var(--ink);
  animation: drawer-in 0.32s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(-100%); } }
[dir='rtl'] .drawer { animation-name: drawer-in-rtl; }
@keyframes drawer-in-rtl { from { transform: translateX(100%); } }

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 22px 22px 16px;
  border-bottom: 2px solid var(--ink);
}
.drawer-emo { font-size: 28px; line-height: 1.2; }
.drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
}
.drawer-sub { font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.drawer-search { padding: 14px 22px 6px; }
.drawer-body { overflow-y: auto; flex: 1; padding: 6px 12px 16px; }
.drawer-foot {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  border: none;
  border-bottom: 1px solid var(--rule-soft);
  background: none;
  font: inherit;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: background 0.14s, padding-inline-start 0.18s var(--ease);
}
.option:last-child { border-bottom: none; }
.option:hover { background: var(--wash); padding-inline-start: 16px; }
.option.is-active { background: var(--brand-tint); }
.option.is-active::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--brand);
}
.option-label { font-weight: 500; font-size: 15px; }
.option-tick { margin-inline-start: auto; color: var(--brand); opacity: 0; flex: none; }
.option.is-active .option-tick { opacity: 1; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--wash-2);
}
.option.is-active .avatar { background: var(--brand); color: #fff; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* الإحصاءات ------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-block: 1px solid var(--rule);
  margin-bottom: 30px;
}
.stat { padding: 18px 20px; border-inline-start: 1px solid var(--rule); }
.stat:first-child { border-inline-start: none; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: start;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-top: 1px;
}

/* لوحات الفائزين -------------------------------------------------------- */
.awards { border-top: 2px solid var(--ink); }

.plate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 20px;
  align-items: center;
  padding: clamp(20px, 3.4vw, 32px) 4px;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  animation: plate-in 0.65s var(--ease) forwards;
}
@keyframes plate-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.plate-idx {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 4vw, 38px);
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  align-self: start;
  padding-top: 4px;
}
.plate-oscar {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: clamp(13.5px, 2vw, 15px);
  font-weight: 500;
  color: var(--muted);
}
.plate-winner {
  grid-column: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.4vw, 3rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.plate-tie {
  grid-column: 2;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--brand);
}

/* النتائج التفصيلية (للمسؤول) ------------------------------------------- */
.result { padding: 18px 4px; border-bottom: 1px solid var(--rule-soft); }
.result-head { display: flex; align-items: center; gap: 11px; }
.result-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.35; }
.crown { font-size: 13.5px; color: var(--brand); font-weight: 600; line-height: 1.5; }
.result-total { margin-inline-start: auto; font-size: 12.5px; color: var(--faint); white-space: nowrap; }

.bars { display: grid; gap: 7px; margin-top: 13px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.bar-name { font-size: 13.5px; color: var(--muted); }
.bar-row.is-top .bar-name { color: var(--text); font-weight: 600; }
.bar-votes { font-size: 12px; color: var(--faint); white-space: nowrap; }
.bar-track { grid-column: 1 / -1; height: 4px; background: var(--wash-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--rule); transition: width 0.5s var(--ease); }
.bar-row.is-top .bar-fill { background: var(--brand); }

/* الجداول --------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border-top: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 540px; }
th, td { padding: 11px 12px; text-align: start; border-bottom: 1px solid var(--rule-soft); }
th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--wash);
  position: sticky;
  top: 0;
}
tbody tr:hover td { background: var(--brand-tint); }
td.nowrap { white-space: nowrap; color: var(--muted); }
td.ltr { direction: ltr; text-align: start; }

/* تفاصيل ---------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--paper);
}
.pill.brand { border-color: var(--brand-line); color: var(--brand); background: var(--brand-tint); }
.pill.test { border-color: var(--ink); color: #fff; background: var(--ink); }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: clamp(32px, 5vw, 52px) 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.section-title h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.5;
  margin: 0;
}
.section-title p { margin: 0; font-size: 13px; color: var(--faint); }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--faint);
  border: 1px dashed var(--rule);
  font-size: 14px;
}

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 80;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin-inline: auto;
  transform: translateY(100%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s var(--ease);
}
.toast.is-on { transform: translateY(0); }
.toast.is-error { background: var(--brand); }

.foot {
  margin-top: 54px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--faint);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.foot a { color: var(--brand); text-decoration: none; font-weight: 500; }
.foot a:hover { text-decoration: underline; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
[hidden] { display: none !important; }

@keyframes fade { from { opacity: 0; } }

/* قصاصات الاحتفال ------------------------------------------------------- */
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 6px;
  height: 14px;
  animation: drop linear forwards;
}
@keyframes drop { to { transform: translateY(105vh) rotate(720deg); opacity: 0.1; } }

/* صندوق الانتظار -------------------------------------------------------- */
.waiting {
  display: grid;
  gap: 4px;
  padding: clamp(30px, 6vw, 56px) 0;
  border-block: 2px solid var(--ink);
  text-align: center;
}
.waiting-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 15vw, 7rem);
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.waiting-label { font-size: 13.5px; color: var(--muted); }

/* حملة في لوحة المسؤول -------------------------------------------------- */
.campaign {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 16px 4px;
  border-bottom: 1px solid var(--rule-soft);
  border-inline-start: 3px solid transparent;
  padding-inline-start: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.campaign.is-viewing { border-inline-start-color: var(--brand); background: var(--brand-tint); }
.campaign-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }


/* سجلّات وأرقام (لوحة المسؤول) ------------------------------------------ */
.rec-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  border-top: 1px solid var(--rule);
}
.rec {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--rule-soft);
  border-inline-start: 1px solid var(--rule-soft);
}
.rec:nth-child(odd) { border-inline-start: none; }

.rec-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.4;
}
.rec-note-top {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--faint);
}
.rec-rows { margin-top: 12px; }
.rec-row {
  display: grid;
  grid-template-columns: 2.6ch minmax(0, 1fr);
  gap: 1px 11px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.rec-row:last-child { border-bottom: none; }
.rec-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--brand);
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}
.rec-name { font-size: 14px; font-weight: 500; line-height: 1.45; }
.rec-note {
  grid-column: 2;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.45;
}
.rec-empty {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--faint);
}

@media (max-width: 680px) {
  .rec-grid { grid-template-columns: 1fr; }
  .rec { border-inline-start: none; padding-inline: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .confetti { display: none; }
  .item, .plate { opacity: 1; }
  .marquee-track { animation: none; }
}

/* ===========================================================
   الشاشات المتوسطة
   =========================================================== */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
  }
  .hero-aside {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
  .hero-aside small { margin-top: 0; }
}

/* ===========================================================
   الهواتف: رأس صفحة من سطر واحد، والتنقّل شريط سفلي
   =========================================================== */
@media (max-width: 680px) {
  :root { --gut: 16px; }

  /* الرأس: سطر واحد لا يلتفّ، بارتفاع ثابت صغير */
  .topbar-inner {
    flex-wrap: nowrap;
    gap: 10px;
    padding-block: 9px;
    min-height: 48px;
  }
  .brand { gap: 8px; font-size: 14.5px; min-width: 0; }
  .brand-mark { width: 26px; height: 26px; }
  .brand > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand small { display: none; } /* السطر الثانوي يُخفى لتوفير المساحة */

  /* التنقّل ينتقل إلى أسفل الشاشة كشريط تبويبات */
  .nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .nav a {
    margin: 0;
    padding: 13px 4px;
    text-align: center;
    font-size: 13px;
    border-inline-start: 1px solid var(--rule-soft);
  }
  .nav a:first-child { border-inline-start: none; }
  .nav a::after { inset-block-start: 0; bottom: auto; height: 3px; }

  /* بطاقة "تصوّت باسم" تبقى في الرأس لكن بالاسم الأول فقط */
  #whoami { gap: 2px; flex-wrap: nowrap; margin-inline-start: auto; }
  #whoami .pill {
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: none;
    background: none;
    padding-inline: 0;
    color: var(--muted);
    font-size: 12.5px;
  }
  #signout, #logout { font-size: 12.5px; padding-inline: 6px; }

  /* مساحة أسفل الصفحة حتى لا يغطّي الشريط السفلي المحتوى */
  main { padding-block: 20px calc(76px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  .testbar { padding: 6px 14px; font-size: 12px; line-height: 1.45; }

  /* عنوان أصغر حتى تظهر القائمة بسرعة */
  .hero { margin-bottom: 22px; }
  .hero-grid { padding-bottom: 16px; }
  h1 { font-size: clamp(1.75rem, 8.4vw, 2.3rem); margin-top: 9px; }
  .lede { font-size: 14.5px; margin-top: 9px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.05em; }
  .section-title { margin-top: 30px; }

  .marquee { margin-bottom: 22px; padding-block: 9px; }
  .marquee-track { font-size: 12.5px; gap: 24px; }

  /* صفوف الأوسكارات: سطران مريحان للّمس */
  .item {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 2px 11px;
    padding: 13px 2px;
    min-height: 60px;
  }
  .item-idx   { grid-column: 1; grid-row: 1; font-size: 13px; }
  .item-emo   { grid-column: 2; grid-row: 1; font-size: 19px; }
  .item-title { grid-column: 3; grid-row: 1; font-size: 15px; }
  .item-go    { grid-column: 4; grid-row: 1 / span 2; align-self: center; }
  .item-choice {
    grid-column: 3;
    grid-row: 2;
    max-width: none;
    font-size: 13px;
  }
  /* السهم لا يتحرّك باللمس، فنُبقيه ثابتًا */
  .item:hover .item-go { transform: none; }

  /* الدرج يصبح لوحًا يصعد من الأسفل */
  .drawer {
    inset: auto 0 0 0;
    width: 100%;
    height: min(86vh, 100% - 40px);
    border-inline-end: none;
    border-top: 2px solid var(--ink);
    animation-name: sheet-up;
  }
  [dir='rtl'] .drawer { animation-name: sheet-up; }
  .drawer::before {
    content: '';
    position: absolute;
    inset-block-start: 8px;
    inset-inline: 0;
    width: 38px;
    height: 4px;
    margin: 0 auto;
    border-radius: 99px;
    background: var(--rule);
  }
  .drawer-head { padding: 22px 18px 14px; }
  .drawer-title { font-size: 17px; }
  .drawer-search { padding-inline: 18px; }
  .drawer-body { padding-inline: 8px; }
  .drawer-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .option { padding-block: 13px; min-height: 52px; }

  /* الإحصاءات مربّعان في كل سطر بدل أربعة أسطر */
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px 14px; border-top: 1px solid var(--rule-soft); }
  .stat:nth-child(-n + 2) { border-top: none; }
  .stat:nth-child(odd) { border-inline-start: none; }
  .stat-value { font-size: 27px; }
  .stat-label { font-size: 11px; }

  /* لوحات الفائزين */
  .plate { gap: 4px 14px; padding-block: 20px; }
  .plate-idx { font-size: 20px; padding-top: 2px; }
  .plate-oscar { font-size: 13px; }
  .plate-winner { font-size: clamp(1.45rem, 7.4vw, 2.1rem); }

  .waiting-count { font-size: clamp(3rem, 20vw, 5rem); }

  /* الأزرار والحقول أكبر قليلًا للّمس */
  .btn { padding: 12px 20px; min-height: 46px; }
  .btn-sm { min-height: 40px; }
  .input, .select { font-size: 16px; } /* 16px يمنع تكبير iOS التلقائي */

  .sheet-panel { padding: 20px 18px; }
  .foot { margin-top: 36px; font-size: 12.5px; }
  .campaign { padding-inline-start: 11px; }
}

@keyframes sheet-up { from { transform: translateY(100%); } }

@media (max-width: 380px) {
  .nav a { font-size: 12px; padding-inline: 2px; }
  .item-title { font-size: 14.5px; }
  h1 { font-size: 1.65rem; }
}

/* الشاشات القصيرة أفقيًا: لا داعي لرأس لاصق يأكل الارتفاع */
@media (max-height: 460px) and (orientation: landscape) {
  .topbar { position: static; }
}
