@font-face { font-family: "Alexandria"; src: url("../fonts/Alexandria.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bodoni"; src: url("../fonts/BodoniModa-Italic.ttf") format("truetype"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --bg: #FFFFFF;
  --surface: #F5F5F6;
  --ink: #141416;
  --muted: #74767C;
  --hair: #E7E7EA;
  --accent: #1E7A4C;
  --accent-soft: #E8F3ED;
  --warn: #B4541A;
  --warn-soft: #FBEFE6;
  --r: 18px;
  --r-sm: 12px;
  --gut: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Alexandria", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); margin: 0; }

.app { max-width: 460px; margin: 0 auto; padding: max(32px, env(safe-area-inset-top)) var(--gut) 128px; }

/* ---------- الهيدر ---------- */
.masthead { text-align: center; margin-bottom: 24px; }

/* ---------- التبويبات ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border-radius: 12px; margin-bottom: 32px; }
.tabs button { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(20,20,22,.08), 0 0 0 1px var(--hair); }
.wordmark { margin: 0; font-family: "Bodoni", Georgia, serif; font-style: italic; font-weight: 500; font-size: 30px; line-height: 1.1; direction: ltr; }
.status { margin: 12px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C6C7CC; flex: none; }
.status.live::before { background: var(--accent); }
.status.live { color: var(--ink); }

/* ---------- المسرح ---------- */
.stage { margin-bottom: 48px; }
.label { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.label.accent { color: var(--accent); font-weight: 600; }
.label-row { display: flex; justify-content: space-between; gap: 12px; }
.box { border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; }
.box.empty, .box.champ { padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.box h2 { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.4; }
.box.empty .muted { max-width: 30ch; }
.box.champ h2 { font-size: 21px; margin-top: 4px; }
.box.champ.hero { background: var(--accent-soft); border-color: transparent; padding: 32px 24px; }
.box.champ.hero h2 { font-size: 24px; }
.box.champ.hero .label { margin: 0; }
.crown-big { color: var(--accent); }
.crown-big .crown { width: 46px; height: 34px; margin: 0; }
.box.champ .btn { margin-top: 12px; }

.current .team {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px; border: 0; background: none; text-align: inherit;
  transition: background .3s, opacity .3s;
}
.current .team.tappable:hover { background: var(--surface); }
.current .team.won { background: var(--accent-soft); }
.current .team.lost { opacity: .45; }
.current .vs { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; padding: 0 16px; }
.current .vs::before, .current .vs::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.current .tn { font-size: 16px; }
.tn { font-weight: 600; font-size: 15px; line-height: 1.35; min-width: 0; }
.tn small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.and { font-weight: 400; color: var(--muted); }
.tick { margin-inline-start: auto; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: transparent; border: 1.5px solid transparent; }
.tappable .tick { border-color: var(--hair); }
.team.won .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.tick .ck { width: 18px; height: 18px; }
.progress { display: flex; gap: 4px; margin: 0 0 16px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--hair); }
.progress i.done { background: var(--ink); }
.progress i.cur { background: var(--accent); }
.pick {
  margin-inline-start: auto; flex: none;
  font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--hair); background: var(--bg);
  border-radius: 999px; padding: 6px 16px;
}
button.pick:hover { border-color: var(--accent); }
.pick.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- الصور ---------- */
.avs { display: inline-flex; flex: none; }
.avs .ph + .ph { margin-inline-start: -14px; }
.avs.sm .ph + .ph { margin-inline-start: -12px; }
.avs.lg .ph + .ph, .avs.xl .ph + .ph { margin-inline-start: -18px; }
.avs.hero .ph { border-color: var(--accent-soft); }
.ph {
  position: relative; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--surface);
  font-size: 18px;
}
.ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; border-radius: 50%; }
.ph .mono { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.ph.sm { width: 30px; height: 30px; border-width: 2px; font-size: 12px; }
.ph.md { width: 40px; height: 40px; border-width: 2px; font-size: 15px; }
.ph.lg { width: 84px; height: 84px; font-size: 28px; }
.ph.xl { width: 112px; height: 112px; border-width: 4px; font-size: 36px; }
.ph.mt { width: 56px; height: 56px; font-size: 20px; }
.ph.hero { width: 132px; height: 132px; border-width: 5px; font-size: 42px; }
.avs.mt .ph + .ph { margin-inline-start: -14px; }
.avs.hero .ph + .ph { margin-inline-start: -22px; }
.crown { display: inline-block; width: .9em; height: .68em; margin-inline-start: .25em; color: var(--accent); vertical-align: .02em; }
.ph .crown-badge {
  position: absolute; bottom: -2px; inset-inline-end: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  display: grid; place-items: center;
}
.ph .crown-badge .crown { width: 11px; height: 8px; margin: 0; color: #fff; vertical-align: 0; }
.ph.sm .crown-badge, .ph.md .crown-badge { display: none; }

/* ---------- كروت القرعة ---------- */
.draw-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 10px;
  perspective: 900px;
}
.card {
  position: relative; aspect-ratio: 4 / 5;
  border: 0; padding: 0; background: none;
  transform-style: preserve-3d;
  transition: transform .7s var(--ease);
}
.card[disabled] { cursor: default; }
.card .face, .card .back {
  position: absolute; inset: 0;
  border-radius: var(--r-sm);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.card .back {
  background: var(--surface);
  border: 1px solid var(--hair);
  display: grid; place-items: center;
  transition: visibility 0s .3s, border-color .2s;
}
.card .back .n { font-weight: 600; font-size: 22px; color: var(--muted); }
.card:not([disabled]):hover .back { border-color: var(--ink); }
.card.up .back { visibility: hidden; }
.card .face { transform: rotateY(180deg); background: var(--surface); border: 1px solid var(--hair); }
.card .face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.card .face .mono { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 700; font-size: 26px; color: var(--muted); }
.card .face .nm {
  position: absolute; inset: auto 0 0 0;
  padding: 16px 4px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2;
}
.card.up { transform: rotateY(180deg); }
.card.pending .face { border: 2px solid var(--accent); }
.card .tnum { position: absolute; top: 6px; inset-inline-start: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(20,20,22,.18); animation: fade .4s .7s both; }
.no-anim .card .tnum { animation: none; }
.no-anim .card, .no-anim .team-row { transition: none !important; animation: none !important; }

/* ---------- لحظة الكشف ---------- */
.reveal { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 40; }
.reveal .spot {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 34px;
  background: var(--bg);
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--hair), 0 24px 60px rgba(20, 20, 22, .14);
  text-align: center;
  animation: spotIn .45s var(--ease) both, spotOut .4s ease-in 1.5s both;
}
.reveal .spot.long { animation: spotIn .5s var(--ease) both, spotOut .45s ease-in 2.4s both; }
.reveal .who { font-weight: 700; font-size: 21px; line-height: 1.3; }
@keyframes spotIn { from { transform: scale(.85); opacity: 0; } }
@keyframes spotOut { to { transform: scale(.96); opacity: 0; } }

/* ---------- الأقسام ---------- */
.block { margin-bottom: 48px; }
.block h2 { font-weight: 700; font-size: 17px; margin: 0 0 12px; line-height: 1.4; }
.block .lead { color: var(--muted); font-size: 12px; margin: -6px 0 12px; }
.note { font-size: 12px; color: var(--warn); margin: 12px 0 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); animation: rowIn .5s var(--ease) both; }
.team-row .r { color: var(--muted); width: 18px; text-align: center; }
.team-row .tn { font-size: 14px; font-weight: 600; }
@keyframes rowIn { from { transform: translateY(-8px); opacity: 0; } }

/* الترتيب */
.table { width: 100%; border-collapse: collapse; }
.table th { font-weight: 400; color: var(--muted); font-size: 11px; text-align: center; padding: 8px 0; white-space: nowrap; }
.table th:nth-child(2) { text-align: right; }
.table td { padding: 14px 0; border-top: 1px solid var(--hair); text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.table td.tm { text-align: right; }
.table td.tm .in { display: flex; align-items: center; gap: 10px; }
.table .names { font-weight: 500; line-height: 1.35; }
.table .rk { color: var(--muted); width: 24px; }
.table .pts { font-weight: 700; font-size: 15px; width: 40px; }
.table td:nth-child(3), .table td:nth-child(4) { width: 36px; }
.table tr.lead .pts { color: var(--accent); }

/* الماتشات */
.matches { list-style: none; margin: 0; padding: 0; }
.match {
  display: grid; grid-template-columns: 24px 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 14px 0; border-top: 1px solid var(--hair); font-size: 13px;
}
button.match { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: inherit; }
.match .n { color: var(--muted); text-align: center; }
.match .side { line-height: 1.35; }
.match .side.b { text-align: left; }
.match .side .t { display: block; font-size: 11px; color: var(--muted); }
.match .vs { font-size: 11px; color: var(--muted); }
.match .side .ck { width: 14px; height: 14px; color: var(--accent); display: inline-block; vertical-align: -2px; margin-inline-end: 4px; }
.match.played .side { color: var(--muted); }
.match.played .side.w { color: var(--ink); font-weight: 600; }
.match.played .n { color: #B5B7BC; }
.match.next .side { color: var(--ink); }
.match.now { background: var(--surface); border-radius: var(--r-sm); border-top-color: transparent; padding-inline: 8px; }
.match.now .n { color: var(--accent); font-weight: 700; }
.match.po .n { color: var(--warn); }
.round-label { font-size: 12px; color: var(--muted); padding: 24px 0 8px; }

/* قاعة الأبطال */
.leaders { list-style: none; margin: 0; padding: 0; }
.leader { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: inherit; }
.leader .nm { font-weight: 600; }
.leader .meta { color: var(--muted); font-size: 12px; }
.leader .big { margin-inline-start: auto; font-weight: 700; font-size: 19px; color: var(--accent); line-height: 1; }
.leader .big small { font-size: 12px; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.duo { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 24px 0 48px; border: 1px solid var(--hair); border-radius: var(--r); }
.duo .pair { display: flex; }
.duo .pair .ph + .ph { margin-inline-start: -12px; }
.duo .label { font-size: 12px; color: var(--muted); margin: 0; }
.duo .nm { font-weight: 600; font-size: 15px; line-height: 1.35; }
.duo .rate { font-weight: 700; font-size: 21px; color: var(--accent); margin-inline-start: auto; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 20px 8px; }
.roster button { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
.roster .ph { width: 60px; height: 60px; }
.roster .nm { font-size: 12px; font-weight: 500; margin-top: 8px; line-height: 1.3; text-align: center; }

/* الأرشيف */
.hist { list-style: none; padding: 0; margin: 0; }
.hist details { border-top: 1px solid var(--hair); }
.hist summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.hist summary::-webkit-details-marker { display: none; }
.hist .when { color: var(--muted); font-size: 12px; }
.hist .champ { font-weight: 600; }
.hist .chev { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.hist details[open] .chev { transform: rotate(180deg); }
.hist .body { padding: 0 0 16px; }
.hist .row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--muted); }
.hist .row b { color: var(--ink); font-weight: 500; }
.empty-note { color: var(--muted); font-size: 13px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hair); background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: var(--bg); }
.btn.danger { color: var(--warn); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px; font-size: 13px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- شريط المنظم ---------- */
.adminbar { position: fixed; inset: auto 0 0 0; padding: 12px var(--gut) max(14px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--hair); z-index: 30; }
.adminbar .in { max-width: 460px; margin: 0 auto; display: flex; gap: 8px; }
.adminbar .btn { flex: 1; padding: 0 12px; }
.adminbar .btn.more { flex: none; width: 46px; padding: 0; }

/* ---------- الشيت ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 22, .32); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet { width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 24px var(--gut) max(22px, env(safe-area-inset-bottom)); animation: up .3s var(--ease) both; }
.sheet h3 { margin: 0 0 4px; font-weight: 700; font-size: 18px; line-height: 1.4; }
.sheet .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.sheet .actions { display: flex; gap: 8px; margin-top: 24px; }
.sheet .actions .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.stepper { display: flex; align-items: center; gap: 22px; justify-content: center; margin: 10px 0; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--hair); background: var(--bg); font-size: 22px; line-height: 1; }
.stepper .val { font-weight: 700; font-size: 38px; line-height: 1; min-width: 60px; text-align: center; }
.stepper-note { text-align: center; color: var(--muted); font-size: 13px; }
.stepper-note b { color: var(--ink); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 13px; color: var(--muted); }
.field input[type=text] { height: 48px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--bg); }
.field input[type=text]:focus { border-color: var(--ink); outline: none; }
.photo-pick { display: flex; align-items: center; gap: 16px; }

.plist { list-style: none; margin: 0 0 8px; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.plist .nm { font-weight: 500; flex: 1; line-height: 1.35; }
.plist .nm small { display: block; font-size: 12px; color: var(--warn); font-weight: 400; }
.plist li.is-away .ph { opacity: .4; }

.choose { display: grid; gap: 10px; }
.choose .btn { justify-content: flex-start; height: auto; min-height: 54px; padding: 10px 16px; text-align: start; white-space: normal; }
.choose .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* بطاقة اللاعب */
.pcard-top { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.pcard-top h3 { font-size: 21px; }
.pcard-top .titles { color: var(--accent); font-weight: 600; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: var(--r-sm); padding: 12px 8px; text-align: center; }
.stat .v { font-weight: 700; font-size: 19px; line-height: 1.2; }
.stat .k { font-size: 12px; color: var(--muted); }
.rel { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.rel .k { font-size: 12px; color: var(--muted); }
.rel .v { font-weight: 600; }
.rel .x { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

/* البطل */
.champ-in .crown-big { animation: crownDrop .8s .55s var(--ease) both; }
@keyframes crownDrop { from { transform: translateY(-24px) rotate(-12deg); opacity: 0; } }
.champ-in .avs { animation: champIn .9s var(--ease) both; }
.champ-in h2 { animation: champIn .7s .35s var(--ease) both; }
.champ-in .muted, .champ-in .btn { animation: fade .6s .8s both; }
@keyframes champIn { from { transform: translateY(14px) scale(.94); opacity: 0; } }

/* التوست */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 16px);
  width: max-content; max-width: calc(100% - 36px);
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
  z-index: 60;
}
.toast .and { color: inherit; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--bg); font-weight: 700; text-decoration: underline; padding: 4px; }
.toast.err { background: var(--warn); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- إضافات ---------- */
.tdate { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.tdate:empty { display: none; }
.next-up { margin: 12px 0 0; padding-inline: 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.next-up b { color: var(--ink); font-weight: 600; }
.card .face .nm .with { display: block; font-weight: 400; font-size: 10px; opacity: .9; }
.card .face .nm .with:empty { display: none; }

/* ---------- قايمة الماتشات: وش لوش ---------- */
.vsrow { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--hair); background: none; text-align: center; }
.vsrow .sd { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.vsrow .av { position: relative; display: inline-flex; }
.vsrow .ph.sm { width: 34px; height: 34px; }
.vsrow .nm { font-size: 12px; font-weight: 500; line-height: 1.35; }
.vsrow .nm small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.vsrow .sd.w .nm { font-weight: 700; }
.vsrow .sd.l { opacity: .45; }
.vsrow .sd.l img { filter: grayscale(1); }
.vsrow .badge { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 7px; border-radius: 999px; border: 2px solid var(--bg); white-space: nowrap; }
.vsrow .mid { font-size: 11px; color: var(--muted); }
.vsrow .mid .n { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.vsrow.played .mid .n { color: #B5B7BC; }
.vsrow.now { background: var(--surface); border-radius: var(--r-sm); border-top-color: transparent; }
.vsrow.now + * , li:has(> .vsrow.now) + li > .vsrow { border-top-color: transparent; }
.vsrow.now .mid, .vsrow.now .mid .n { color: var(--accent); font-weight: 700; }
.vsrow.po .mid .n { color: var(--warn); }

/* ---------- بطاقة اللاعب ---------- */
.pcard-top .titles.none { color: var(--muted); font-weight: 400; }
.pgrp { margin-bottom: 20px; }
.pgrp .k { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.prow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prow .st { background: var(--surface); border-radius: var(--r-sm); padding: 12px 8px; text-align: center; }
.prow .st .v { font-weight: 700; font-size: 19px; line-height: 1.25; }
.prow .st .l { font-size: 11px; color: var(--muted); }
.prow .st.hl { background: var(--accent-soft); }
.prow .st.hl .v { color: var(--accent); }
.pbar { height: 6px; border-radius: 3px; background: var(--hair); margin-top: 10px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- لاعب الشهر ---------- */
.month { margin-bottom: 48px; }
.potm { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; margin-bottom: 12px; border: 0; border-radius: var(--r); background: var(--accent-soft); text-align: inherit; }
.potm .ph.lg { width: 68px; height: 68px; }
.potm .l { font-size: 12px; color: var(--accent); font-weight: 600; }
.potm .n { font-size: 18px; font-weight: 700; line-height: 1.35; }
.potm .m { font-size: 12px; color: var(--muted); }
.race { border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 14px 16px 8px; }
.race .t { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.race .r { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 0; border: 0; background: none; text-align: inherit; }
.race .r .ph.md { width: 32px; height: 32px; }
.race .r .nm { font-weight: 500; font-size: 13px; width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race .r .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.race .r .bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.race .r.top .bar i { background: var(--accent); }
.race .r .v { font-weight: 700; font-size: 13px; width: 20px; text-align: left; }
.chip { display: inline-block; margin-top: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }

/* ---------- المواجهة المباشرة ---------- */
.h2h-wrap { margin-top: 24px; }
.h2h-wrap h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.h2h-wrap .k { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.h2h-pick { display: flex; gap: 12px; overflow-x: auto; padding: 3px 3px 10px; margin: 0 -3px 6px; scrollbar-width: none; }
.h2h-pick::-webkit-scrollbar { display: none; }
.h2h-pick button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font-size: 11px; color: var(--muted); }
.h2h-pick button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.h2h-pick button[aria-pressed="true"] .ph { box-shadow: 0 0 0 2px var(--accent); }
.h2h { border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 16px; }
.h2h .faces { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; margin-bottom: 12px; }
.h2h .faces > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.h2h .faces .ph.lg { width: 56px; height: 56px; }
.h2h .faces .nm { font-weight: 700; font-size: 14px; margin-top: 4px; }
.h2h .faces .big { font-weight: 700; font-size: 26px; line-height: 1.1; }
.h2h .faces .big.w { color: var(--accent); }
.h2h .faces .mid { font-size: 11px; color: var(--muted); padding: 0 10px; }
.h2h .split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.h2h .split i { background: var(--accent); }
.h2h .split b { background: #C6C7CC; }
.h2h .none { font-size: 13px; text-align: center; padding: 6px 0 2px; }
.h2h .line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); padding-top: 10px; margin-top: 12px; border-top: 1px solid var(--hair); }
.h2h .line b { color: var(--ink); font-weight: 600; }

/* ---------- كارت الأبطال: بولارويد ---------- */
.polcard { position: relative; overflow: hidden; border-radius: 22px; background: var(--accent-soft); padding: 24px 18px 22px; text-align: center; }
.polcard .k { font-family: "Bodoni", Georgia, serif; font-style: italic; font-weight: 500; font-size: 28px; line-height: 1; color: var(--accent); direction: ltr; }
.polcard .k small { display: block; direction: rtl; font-family: "Alexandria", sans-serif; font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.polcard .stamp { position: absolute; top: 16px; left: 16px; width: 60px; height: 60px; border-radius: 50%; border: 2px dashed var(--accent); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1.2; transform: rotate(-14deg); }
.polcard .pol { display: flex; justify-content: center; margin: 20px 0 8px; }
.polcard figure { position: relative; margin: 0; background: #fff; padding: 7px 7px 32px; border-radius: 6px; box-shadow: 0 12px 26px rgba(20, 20, 22, .16); }
.polcard figure:first-child { transform: rotate(5deg) translateX(-6px); }
.polcard figure:last-child { transform: rotate(-6deg) translateX(6px); z-index: 1; }
.polcard.solo figure:first-child { transform: rotate(-3deg); }
.polcard figure img, .polcard figure .mono { display: grid; place-items: center; width: 122px; height: 142px; border-radius: 3px; object-fit: cover; object-position: 50% 25%; font-weight: 700; font-size: 44px; }
.polcard figcaption { position: absolute; inset: auto 0 7px 0; font-weight: 700; font-size: 14px; }
.polcard .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 16px; }
.polcard .row div { background: #fff; border-radius: var(--r-sm); padding: 10px 4px; }
.polcard .row b { display: block; font-size: 19px; line-height: 1.25; color: var(--accent); }
.polcard .row span { font-size: 11px; color: var(--muted); }

.polcard.champ-in figure:first-child { animation: polIn1 .8s cubic-bezier(.2, .9, .3, 1.2) both; }
.polcard.champ-in figure:last-child { animation: polIn2 .8s .18s cubic-bezier(.2, .9, .3, 1.2) both; }
.polcard.champ-in.solo figure:first-child { animation-name: polIn3; }
.polcard.champ-in .stamp { animation: stampIn .45s 1s cubic-bezier(.3, 1.6, .5, 1) both; }
.polcard.champ-in .row, .polcard.champ-in .btn { animation: fade .5s 1.2s both; }
@keyframes polIn1 { from { transform: translate(-60px, -120px) rotate(-25deg); opacity: 0; } }
@keyframes polIn2 { from { transform: translate(60px, -120px) rotate(25deg); opacity: 0; } }
@keyframes polIn3 { from { transform: translateY(-120px) rotate(20deg); opacity: 0; } }
@keyframes stampIn { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } }

/* ---------- تبويب الأبطال ---------- */
.hblk { margin-bottom: 44px; }
.hblk h2, #history h2 { font-weight: 700; font-size: 17px; margin: 0 0 12px; line-height: 1.4; }
.hblk .duo { margin: 0; }
.race .r { display: grid; grid-template-columns: 16px 32px 64px 1fr 74px; gap: 8px; }
.race .r .rk { font-size: 12px; color: var(--muted); text-align: center; }
.race .r .v { width: auto; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.race .r .v b { font-size: 13px; color: var(--ink); }
.race .r.top .rk, .race .r.top .v b { color: var(--accent); font-weight: 700; }
.race .r.none { opacity: .5; }
.race .r.none .bar { background: none; }

.hist li { list-style: none; }
.hc { border: 1px solid var(--hair); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.hc summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.hc summary::-webkit-details-marker { display: none; }
.hc .date { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--surface); padding: 6px 0; line-height: 1.15; }
.hc .date b { display: block; font-size: 19px; }
.hc .date span { font-size: 10px; color: var(--muted); }
.hc .champ { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hc .champ .l { font-size: 11px; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.hc .champ .l .crown { margin: 0; width: 12px; height: 9px; }
.hc .champ .nm { font-weight: 700; font-size: 15px; line-height: 1.35; }
.hc .champ .m { font-size: 10.5px; font-weight: 300; color: var(--muted); }
.ph.hcv { width: 42px; height: 42px; border-width: 2px; font-size: 15px; }
.avs.hcv .ph + .ph { margin-inline-start: -14px; }
.hc .crown-badge { display: none; }
.hc .chev { color: var(--muted); font-size: 12px; transition: transform .2s; }
.hc[open] .chev { transform: rotate(180deg); }
.hc .body { border-top: 1px solid var(--hair); padding: 6px 16px 12px; background: #FCFCFD; }
.hrow { display: grid; grid-template-columns: 18px auto 1fr auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.hrow .rk { color: var(--muted); text-align: center; font-size: 12px; }
.ph.xs { width: 26px; height: 26px; border-width: 2px; font-size: 10px; }
.avs.xs .ph + .ph { margin-inline-start: -9px; }
.hrow .w { font-size: 12px; color: var(--muted); }
.hrow.first .rk, .hrow.first .w { color: var(--accent); font-weight: 700; }
.hrow.first .nm { font-weight: 700; }
.hfoot { font-size: 11px; color: var(--muted); text-align: center; margin: 6px 0 0; }

/* آيفونات قديمة من غير aspect-ratio */
@supports not (aspect-ratio: 1) {
  .card { height: 0; padding-bottom: 125%; }
}

/* ---------- تبديل اللاعيبة ---------- */
.team-row.swap { gap: 10px; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chips .and { font-size: 12px; color: var(--muted); }
.pchip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 4px; padding-inline: 4px 12px; border: 1px solid var(--hair); border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; }
.pchip .ph.sm { width: 28px; height: 28px; border-width: 0; }
.pchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- سحب الشيت ---------- */
.grab { width: 40px; height: 5px; border-radius: 3px; background: #D5D6DA; margin: -12px auto 16px; touch-action: none; }
.sheet { touch-action: pan-y; overscroll-behavior: contain; }

/* ---------- المزيد في البطولات ---------- */
.more-btn { width: 100%; margin-top: 4px; }

/* ---------- لاعب الشهر ---------- */
.potm-card { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 16px 18px 14px; margin-bottom: 28px; border: 1px solid var(--hair); border-radius: var(--r); background: linear-gradient(180deg, var(--accent-soft), var(--bg) 80%); text-align: center; }
.potm-card .w { font-family: "Bodoni", Georgia, serif; font-style: italic; font-weight: 500; font-size: 18px; line-height: 1; color: var(--accent); direction: ltr; margin-bottom: 12px; }
.ph.pm { width: 60px; height: 60px; border: 0; font-size: 22px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent); }
.potm-card .crown-badge { display: none; }
.potm-card .n { font-size: 16px; font-weight: 700; line-height: 1.3; margin-top: 10px; }

/* ---------- التايمر ---------- */
.timer { margin-bottom: 22px; }
.tmr { border: 1px solid var(--hair); border-radius: var(--r); padding: 12px 14px 10px; transition: background .3s, border-color .3s; }
.tmr .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tmr .k { font-size: 11px; color: var(--muted); }
.tmr .clock { font-weight: 700; font-size: 25px; line-height: 1.15; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.tmr .adds { display: flex; gap: 6px; }
.tmr .adds button { height: 28px; padding: 0 10px; border: 1px solid var(--hair); border-radius: 999px; background: var(--bg); font-size: 11px; font-weight: 600; }
.tmr .bar { height: 4px; border-radius: 2px; background: var(--hair); overflow: hidden; margin: 8px 0 6px; }
.tmr .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; margin-inline-start: auto; transition: width 1s linear; }
.tmr .info { font-size: 11px; color: var(--muted); }
.tmr .info b { color: var(--ink); font-weight: 600; }
.tmr.low { background: var(--warn-soft); border-color: #F0D5C2; }
.tmr.low .clock, .tmr.low .k { color: var(--warn); }
.tmr.low .bar i { background: var(--warn); }
.tmr.over { background: var(--warn-soft); border-color: var(--warn); }
.tmr.over .clock, .tmr.over .k { color: var(--warn); }
.tmr.over .info { margin-top: 6px; }

.rec { border-radius: var(--r); background: var(--accent-soft); padding: 14px; }
.rec h3 { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.rec p { margin: 0 0 10px; font-size: 11px; color: var(--muted); }
.rec .opts { display: grid; gap: 8px; }
.rec .o { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid transparent; }
.rec .o.best { border-color: var(--accent); }
.rec .o b { font-size: 13px; }
.rec .o .d { display: block; font-size: 10.5px; color: var(--muted); }
.rec .o .tag { font-size: 10px; color: var(--accent); font-weight: 700; margin-inline-start: 6px; }
.rec .o .go { flex: none; font-size: 12px; font-weight: 700; color: #fff; background: var(--ink); border: 0; border-radius: 10px; padding: 6px 12px; }
.rec-foot { text-align: center; font-size: 11px; color: var(--muted); margin: 10px 0 0; }

.vsrow .dur { color: var(--ink); font-weight: 600; }
.vsrow .dur small { font-weight: 400; color: var(--muted); }

.setrow { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.lbl2 { font-weight: 600; font-size: 14px; }
.stepper.sm { gap: 14px; margin: 0; }
.stepper.sm button { width: 38px; height: 38px; font-size: 20px; }
.stepper.sm .val { font-size: 24px; min-width: 64px; direction: ltr; }
.setrow + .stepper-note { text-align: start; margin: 4px 0 14px; font-size: 12px; }
