
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');
:root{
  --gold:#F6A400; --blue:#0057A8; --red:#E73535; --text:#132033;
}
*{box-sizing:border-box}
body{
  margin:0;font-family:'Tajawal',Arial,sans-serif;color:var(--text);
  background:radial-gradient(circle at 20% 15%,rgba(214,179,90,.28),transparent 26%),
  radial-gradient(circle at 85% 10%,rgba(37,99,235,.24),transparent 25%),
  linear-gradient(135deg,#01264a,#003f78);min-height:100vh;
}
.app-shell{width:min(1100px,94vw);margin:auto;padding:28px 0 50px}
.hero{text-align:center;color:white;padding:30px 16px}
.brand{display:inline-block;color:var(--gold);font-weight:900;border:1px solid rgba(214,179,90,.6);padding:8px 18px;border-radius:999px;margin-bottom:12px}
.hero h1{font-size:clamp(34px,5vw,58px);margin:0;font-weight:900}
.hero p{color:rgba(255,255,255,.78);font-size:20px}
.main-nav{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  width:min(760px,100%);
  margin:20px auto 0;
  direction:rtl;
}
.main-nav .nav-btn{
  width:100%;
  margin:0;
  min-height:54px;
  padding:10px 8px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-size:16px;
  line-height:1.2;
  background:rgba(255,255,255,.12);
  color:#fff;
  border:1px solid rgba(214,179,90,.45);
  box-shadow:0 12px 28px rgba(0,0,0,.18);
  backdrop-filter:blur(8px);
}
.main-nav .nav-btn:hover{
  background:linear-gradient(135deg,var(--gold),#b98b24);
  color:#111;
  transform:translateY(-1px);
}
.main-nav .nav-icon{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  background:rgba(255,255,255,.18);
  font-size:17px;
  flex:0 0 auto;
}
@media(max-width:480px){
  .main-nav{grid-template-columns:repeat(2, minmax(0, 1fr));gap:7px;margin-top:16px}
  .main-nav .nav-btn{
    min-height:50px;
    padding:9px 4px;
    font-size:13px;
    border-radius:14px;
    gap:4px;
  }
  .main-nav .nav-icon{
    width:24px;
    height:24px;
    font-size:15px;
  }
}

.grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.card{background:rgba(255,255,255,.96);border-radius:24px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.28);margin-bottom:20px}
.full-card{margin-top:20px}
label{display:block;margin-top:14px;font-weight:800}
input{width:100%;padding:13px 14px;border:1px solid #d1d5db;border-radius:14px;font-size:18px;margin-top:7px;font-family:inherit}
button{width:100%;margin-top:18px;padding:14px 18px;border:none;border-radius:16px;font-family:inherit;font-size:18px;font-weight:900;background:linear-gradient(135deg,var(--gold),#b98b24);color:#111;cursor:pointer}
button:disabled{background:#9ca3af;color:#fff;cursor:not-allowed}
.match-card{background:#fff;border:1px solid rgba(214,179,90,.45);border-radius:20px;padding:20px;text-align:center;margin-bottom:18px}
.round{color:var(--blue);font-weight:900;font-size:18px}
.teams{font-size:30px;font-weight:900;margin:10px 0}
.teams span{color:var(--gold)}
.meta{color:#6b7280}
.timer{display:inline-block;margin-top:12px;padding:10px 16px;border-radius:999px;background:rgba(214,179,90,.18);border:1px solid rgba(214,179,90,.55);font-weight:900}
.timer.started{font-size:24px;background:#dcfce7;color:#166534;border-color:#86efac}
.timer.finished{font-size:24px;background:#fee2e2;color:#991b1b;border-color:#fca5a5;animation:none}
.result{margin-top:14px;padding:14px;border-radius:16px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-size:20px;font-weight:900}
.score-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.message,.notice{padding:14px 16px;border-radius:14px;margin-top:12px;text-align:center;font-weight:700;font-size:14px;animation:fadeInMsg .3s ease}
@keyframes fadeInMsg{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
.ok,.good{background:#f0fdf4;color:#166534;border:1.5px solid #bbf7d0}
.bad{background:#fff1f2;color:#991b1b;border:1.5px solid #fecdd3}
.notice{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}
.rank-box{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;padding:16px;border-radius:16px;line-height:2}
.table-wrap{overflow-x:auto;margin-top:12px}
table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid #e5e7eb;padding:10px;text-align:right}
.badges{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.badge-card{padding:14px;border-radius:16px;background:linear-gradient(135deg,rgba(214,179,90,.22),rgba(37,99,235,.08));border:1px solid rgba(214,179,90,.45);font-weight:900}
.badge-card span{display:block;margin-top:6px;color:#4b5563;font-size:13px}
footer{text-align:center;color:rgba(255,255,255,.78);font-weight:800;margin-top:28px;padding:18px}
@media(max-width:820px){.grid{grid-template-columns:1fr}.teams{font-size:26px}}


.team-with-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  vertical-align: middle;
}

.team-with-flag img {
  width: 32px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
}

.result .team-with-flag {
  margin: 0 6px;
}

td .team-with-flag {
  justify-content: flex-start;
}


.badge-card {
  position: relative;
  text-align: center;
  min-height: 138px;
}

.badge-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(135deg, #fff7d6, #d6b35a);
  box-shadow: 0 10px 24px rgba(214,179,90,.25);
  border: 1px solid rgba(214,179,90,.65);
}

.badge-card.locked {
  opacity: .78;
  background: #f9fafb;
  border-color: #e5e7eb;
}

.badge-card.locked .badge-icon {
  background: linear-gradient(135deg, #f3f4f6, #d1d5db);
  box-shadow: none;
}

.badge-card small {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}


/* تحسين حجم أسماء المنتخبات والأعلام للجوال والآيباد والكمبيوتر */
.teams {
  font-size: clamp(18px, 3.2vw, 26px) !important;
  line-height: 1.5;
  gap: 8px;
}

.team-with-flag {
  gap: 6px !important;
}

.team-with-flag img {
  width: clamp(24px, 4vw, 32px) !important;
  height: auto !important;
  max-height: 22px;
}

.score-row input {
  font-size: clamp(15px, 3.5vw, 18px);
}

.match-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 42px rgba(0,0,0,.16);
}

.timer.started {
  animation: kickoffPulse 1.4s ease-in-out infinite;
}

@keyframes kickoffPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 rgba(22,101,52,0); }
  50% { transform: scale(1.03); box-shadow: 0 0 22px rgba(22,101,52,.25); }
}

.progress-card {
  margin-bottom: 20px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.progress-bar {
  height: 14px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar div {
  height: 100%;
  background: linear-gradient(135deg, var(--gold), #b98b24);
  border-radius: 999px;
  transition: width .3s ease;
}

.crowd-stats {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 14px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.stat-card span {
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .match-card {
    padding: 16px;
  }

  .teams {
    font-size: 18px !important;
    flex-direction: column;
  }

  .teams > span:not(.team-with-flag) {
    font-size: 22px;
  }

  .team-with-flag img {
    width: 24px !important;
  }

  .score-row {
    gap: 10px;
  }

  .score-row input {
    padding: 12px 10px;
  }

  .crowd-stats {
    font-size: 13px;
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .teams {
    font-size: 22px !important;
  }

  .team-with-flag img {
    width: 28px !important;
  }
}


.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
}

.worldcup-logo {
  width: min(145px, 34vw);
  height: auto;
  display: block;
  border-radius: 18px;
  filter: drop-shadow(0 18px 32px rgba(0,0,0,.42));
}

@media (max-width: 820px) {
  .worldcup-logo {
    width: min(118px, 38vw);
  }
}


.crowd-title {
  font-weight: 900;
  color: #111827;
  margin-bottom: 10px;
}

.percent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
}

.percent-row strong {
  color: #1d4ed8;
  font-size: 15px;
}

.mini-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}

.mini-bar div {
  height: 100%;
  background: linear-gradient(135deg, #d6b35a, #b98b24);
  border-radius: 999px;
}

.mini-bar.draw div {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.mini-bar.team-b div {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.popular-score {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
}


/* سجل توقعاتي: بدون أعلام وبحالات ملونة */
.plain-team-name {
  font-weight: 800;
  color: #111827;
}

.status-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
}

.status-not-started {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-live {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-ended {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status-half-time {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-muted {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

@media (max-width: 820px) {
  #dashboard table {
    font-size: 12px;
  }

  #dashboard th,
  #dashboard td {
    padding: 8px 6px;
  }

  .status-pill {
    font-size: 12px;
    padding: 5px 9px;
  }

  .plain-team-name {
    font-size: 12px;
  }
}


.admin-match-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.admin-match-card strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #111827;
}

.admin-match-card small {
  display: block;
  color: #6b7280;
  margin-top: 4px;
}

.suggested-result {
  margin-top: 10px;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: #1d4ed8;
  font-weight: 800;
}


.app-toast-message {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(30px);
  z-index: 99999;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 18px;
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}

.app-toast-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast-message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.app-toast-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@media (max-width: 820px) {
  .app-toast-message {
    bottom: 22px;
    font-size: 15px;
    padding: 13px 16px;
  }
}


/* بطاقتي المطورة */
#myCard {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.mycard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(214,179,90,.22), rgba(37,99,235,.12));
  border-radius: 18px;
}

.mycard-welcome {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}

.mycard-sub {
  color: #4b5563;
  font-weight: 700;
  margin-top: 3px;
}

.mycard-rank {
  min-width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #b98b24);
  color: #111;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(214,179,90,.28);
}

.mycard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  align-items: stretch;
}

.mycard-stat-item {
  min-width: 0;
  min-height: 128px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe5f0;
  border-radius: 16px;
  padding: 14px 8px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 8px 20px rgba(15, 52, 96, .07);
}

.mycard-stat-number {
  display: block;
  width: 100%;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  color: #075ea8;
  font-weight: 900;
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
}

.mycard-stat-title {
  display: block;
  width: 100%;
  margin-top: 10px;
  color: #26364a;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.mycard-stat-description {
  display: block;
  width: 100%;
  min-height: 18px;
  margin-top: 5px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}


.mycard-movement {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 900;
}

.mycard-movement small {
  display: block;
  margin-top: 5px;
  font-weight: 800;
  opacity: .8;
}

.move-up {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.move-down {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.move-same {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.mycard-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mycard-badges span {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
}

.mycard-next {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  color: #374151;
  font-weight: 800;
}

.mycard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mycard-actions button {
  margin-top: 0;
  padding: 11px 12px;
  font-size: 14px;
}

@media (max-width: 820px) {
  .mycard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mycard-stat-item {
    min-height: 122px;
    padding: 13px 8px 11px;
  }

  .mycard-stat-number {
    font-size: 30px;
  }

  .mycard-stat-title {
    font-size: 13px;
  }

  .mycard-welcome {
    font-size: 18px;
  }

  .mycard-rank {
    min-width: 58px;
    height: 58px;
    font-size: 21px;
  }
}


.top-three-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.top-three-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
}

.top-three-card .medal {
  font-size: 30px;
}

.top-three-card strong {
  display: block;
  font-weight: 900;
}

.top-three-card span {
  color: #6b7280;
  font-weight: 800;
  font-size: 13px;
}

.top-three-card small {
  margin-inline-start: auto;
  font-weight: 900;
  color: #1d4ed8;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.report-actions button {
  margin-top: 0;
}

.certificate {
  margin-top: 16px;
  background: linear-gradient(135deg, #fff7d6, #ffffff);
  border: 3px solid #d6b35a;
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  color: #111827;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

.cert-logo {
  font-size: 54px;
}

.certificate h2 {
  color: #b98b24;
  font-size: 34px;
}

.certificate h1 {
  font-size: 42px;
  margin: 10px 0;
}

.cert-footer {
  margin-top: 22px;
  color: #6b7280;
  font-weight: 800;
}

@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { position: fixed; inset: 0; margin: auto; box-shadow: none; }
  .certificate button { display: none; }
}

@media (max-width: 820px) {
  .top-three-box {
    grid-template-columns: 1fr;
  }
}








/* FINAL CLEAN CERTIFICATE CSS */
.certificate-actions {
  margin-top: 18px;
}

.cert-bg-wrap {
  position: relative;
  width: 1120px;
  max-width: 100%;
  margin: 20px auto;
  direction: rtl;
  text-align: center;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  background: #fff;
}

.cert-bg-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* الاسم: تم إنزاله قليلًا وتصغير الخط درجتين */
.cert-name-overlay {
  position: absolute;
  top: 45.8%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  text-align: center;
  font-size: clamp(18px, 2.45vw, 34px);
  line-height: 1.1;
  font-weight: 900;
  color: #061b3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(255,255,255,.42);
  z-index: 5;
}

/* المركز: رفع كلمة الأول قليلًا لتتوسط داخل الشريط الذهبي */
.cert-rank-word-overlay {
  position: absolute;
  top: 62.90%;
  left: 42.7%;
  transform: translate(-50%, -50%);
  width: 20%;
  text-align: center;
  font-size: clamp(17px, 2.35vw, 32px);
  line-height: 1;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 3px 8px rgba(0,0,0,.32);
  z-index: 5;
}

/* إخفاء أي عناصر قديمة من الإصدارات السابقة */
.cert-rank-overlay,
.cert-phrase-overlay {
  display: none !important;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 5mm;
  }

  html, body {
    width: 297mm;
    height: 210mm;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden !important;
  }

  #winnerCertificate,
  #winnerCertificate * {
    visibility: visible !important;
  }

  #winnerCertificate {
    position: fixed !important;
    left: 5mm !important;
    top: 5mm !important;
    right: auto !important;
    bottom: auto !important;
    width: 287mm !important;
    max-width: 287mm !important;
    max-height: 200mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #winnerCertificate .cert-bg-img {
    width: 100% !important;
    height: auto !important;
    max-height: 200mm !important;
    object-fit: contain !important;
  }

  .no-print,
  .certificate-actions {
    display: none !important;
  }
}


/* Fixed date display readability */
.match-date,
.date-text,
.prediction-date {
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
}


/* Keep percentage numbers in the correct left-to-right order inside Arabic RTL text */
.percent-value{
  direction:ltr;
  unicode-bidi:isolate;
  display:inline-block;
  white-space:nowrap;
}


/* Patch: clearer prediction/result display and leaderboard badges */
.score-team-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  direction:ltr;
  min-width:220px;
}
.score-team-line strong{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:999px;
  padding:4px 10px;
  font-weight:900;
  white-space:nowrap;
}
.muted-text{color:#6b7280;font-size:13px}
.leaderboard-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  background:linear-gradient(135deg,rgba(214,179,90,.22),rgba(37,99,235,.08));
  border:1px solid rgba(214,179,90,.45);
  border-radius:999px;
  padding:5px 8px;
  font-size:12px;
  font-weight:800;
  margin:2px;
  white-space:nowrap;
}
.manual-match-info{margin:10px 0}
.manual-preview .suggested-result{line-height:1.8}
@media(max-width:600px){
  .score-team-line{min-width:180px;font-size:12px}
  .score-team-line strong{padding:3px 8px}
  .leaderboard-badge{font-size:11px;padding:4px 6px}
}


.participant-greeting{
  width:min(760px,100%);
  margin:0 auto 18px;
  padding:16px 18px;
  border-radius:22px;
  background:linear-gradient(135deg,rgba(25,113,229,.16),rgba(214,169,53,.16));
  border:1px solid rgba(214,169,53,.38);
  color:#fff;
  font-size:19px;
  font-weight:900;
  text-align:center;
  box-shadow:0 18px 45px rgba(0,0,0,.18);
}
.terms-card{
  max-width:820px;
  margin:0 auto 20px;
  text-align:right;
}
.terms-welcome{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 16px;
  border-radius:999px;
  background:#1971E5;
  color:#fff;
  border:1px solid #D6A935;
  font-weight:900;
  margin-bottom:12px;
}
.terms-card h2{
  margin-top:0;
  font-size:32px;
  color:#0f172a;
}
.terms-intro{
  margin:0 0 18px;
  font-size:18px;
  line-height:1.9;
  color:#334155;
  font-weight:700;
}
.terms-list{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin-top:14px;
}
.term-item{
  padding:15px 16px;
  border-radius:18px;
  background:#f8fafc;
  border:1px solid #dbeafe;
}
.term-item strong{
  display:block;
  color:#1971E5;
  font-size:17px;
  margin-bottom:5px;
}
.term-item span{
  display:block;
  color:#334155;
  line-height:1.8;
  font-weight:700;
}
.start-prediction-btn{
  margin-top:24px;
  min-height:62px;
  font-size:22px;
  border-radius:22px;
  background:linear-gradient(135deg,#1971E5,#0F5FA8);
  color:#fff;
  border:1px solid #D6A935;
  box-shadow:0 18px 40px rgba(25,113,229,.24);
}
@media(max-width:600px){
  .participant-greeting{font-size:16px;padding:13px 12px;border-radius:18px}
  .terms-card{padding:20px}
  .terms-card h2{font-size:26px}
  .terms-intro{font-size:16px}
  .start-prediction-btn{font-size:20px;min-height:58px}
}


/* Points badge style for home leaderboard */
.points-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:56px;
  padding:9px 16px;
  border-radius:999px;
  background:#1971E5;
  border:1px solid #D6A935;
  color:#fff;
  box-shadow:0 8px 18px rgba(25,113,229,.18);
  font-weight:900;
  line-height:1;
  white-space:nowrap;
}
.points-pill b{
  font-size:19px;
  font-weight:900;
  color:#fff;
  letter-spacing:.2px;
  text-shadow:none;
}
.top-three-card .points-pill{
  margin-top:7px;
}
.leaderboard-points{
  margin:auto 0;
}
@media(max-width:600px){
  .points-pill{min-width:50px;padding:8px 13px}
  .points-pill b{font-size:17px}
}


/* My predictions compact vertical score layout */
.my-predictions-table th,
.my-predictions-table td{
  vertical-align:middle;
}
.vertical-score-block{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:160px;
  direction:ltr;
}
.vertical-score-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:10px;
  padding:6px 8px;
}
.vertical-score-row span{
  font-weight:700;
  color:#0f172a;
  text-align:left;
}
.vertical-score-row strong{
  min-width:28px;
  text-align:center;
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:8px;
  padding:3px 8px;
  font-weight:900;
}
@media (max-width:600px){
  .my-predictions-table{font-size:12px}
  .vertical-score-block{min-width:130px}
  .vertical-score-row{gap:6px;padding:5px 6px}
  .vertical-score-row strong{min-width:24px;padding:2px 6px}
}

/* My predictions two-row table layout */
.predictions-two-row-table{
  width:100%;
  border-collapse:collapse;
}
.predictions-two-row-table th{
  text-align:center;
  white-space:nowrap;
}
.predictions-two-row-table td{
  text-align:center;
  vertical-align:middle;
}
.prediction-date-row td{
  background:#f8fafc;
  color:#475569;
  font-weight:800;
  text-align:right;
  border-top:2px solid #e2e8f0;
  padding:10px 12px;
}
.prediction-team-row td{
  padding:8px 10px;
}
.prediction-second-row td{
  border-bottom:1px solid #e2e8f0;
}
.team-name-cell{
  font-weight:900;
  color:#0f172a;
  text-align:right !important;
  min-width:150px;
}
.score-cell{
  font-weight:900;
  color:#1d4ed8;
  font-size:18px;
}
.status-cell,
.points-cell{
  border-bottom:1px solid #e2e8f0;
}
.points-cell{
  font-weight:900;
  color:#0f172a;
  font-size:18px;
}
.total-points-row td{
  background:#fff7ed;
  color:#7c2d12;
  font-weight:900;
  border-top:2px solid #f59e0b;
  padding:10px 12px;
}
.total-points-row td:last-child{
  font-size:18px;
}
@media(max-width:600px){
  .predictions-two-row-table{font-size:12px}
  .team-name-cell{min-width:105px;font-size:12px;padding-right:6px !important}
  .score-cell,.points-cell{font-size:15px}
  .prediction-date-row td{font-size:12px;padding:8px}
  .prediction-team-row td{padding:7px 5px}
  .status-pill{font-size:11px;padding:5px 7px}
}


/* تحديث سجل توقعاتي: توسيط العنوان وتلوين التوقع والنتيجة */
.my-predictions-title{
  text-align:center;
  margin:22px 0 14px;
  font-weight:900;
}
.prediction-score-cell{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:10px;
  box-shadow:inset 0 0 0 1px rgba(29,78,216,.04);
}
.result-score-cell{
  background:#ecfdf5;
  color:#047857;
  border:1px solid #a7f3d0;
  border-radius:10px;
  box-shadow:inset 0 0 0 1px rgba(4,120,87,.04);
}
.predictions-two-row-table .prediction-score-cell,
.predictions-two-row-table .result-score-cell{
  display:table-cell;
}


/* === Department PDF-style Table === */
.dept-pdf-wrap{overflow-x:auto;margin-top:12px}
.dept-pdf-table{width:100%;border-collapse:collapse;font-size:13px;direction:ltr}
.dept-pdf-table thead tr{background:#003b75;color:#fff}
.dept-pdf-table th{padding:10px 12px;text-align:center;font-weight:700;font-size:12px;white-space:nowrap}
.dept-pdf-table td{padding:9px 12px;text-align:center;border-bottom:1px solid #e2e8f0}
.dept-pdf-table td:nth-child(2){text-align:left;font-weight:600;color:#0b2345}
.dept-pdf-table td:nth-child(5) strong{color:#0057A8;font-size:15px}
.dept-pdf-table td:first-child strong{color:#475569}
.dept-pdf-row-even{background:#eef7ff}
.dept-pdf-row-odd{background:#fff}
.dept-pdf-table tbody tr:hover{background:#dbeafe}
@media(max-width:600px){
  .dept-pdf-table{font-size:11px}
  .dept-pdf-table th,.dept-pdf-table td{padding:7px 6px}
}
.yansab-logo{max-height:96px;object-fit:contain;background:#fff;border-radius:18px;padding:10px 18px;box-shadow:0 16px 38px rgba(0,0,0,.22)}
.logo-wrap{margin-bottom:12px}.worldcup-logo.yansab-logo{width:min(420px,90vw);height:auto}
.brand{background:rgba(255,255,255,.08);color:#fff;border-color:rgba(246,164,0,.75)}
.hero h1{color:#fff}.hero p{color:rgba(255,255,255,.86)}
.card{border:1px solid rgba(0,87,168,.10)}
select{width:100%;padding:13px 14px;border:1px solid #d1d5db;border-radius:14px;font-size:18px;margin-top:7px;font-family:inherit;background:#fff;color:var(--text)}
.leaderboard-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
.leaderboard-tabs button{margin:0;background:linear-gradient(135deg,#0057A8,#0072CE);color:#fff;font-size:15px;padding:12px;transition:all .2s;border:2px solid transparent}
.leaderboard-tabs button.tab-active{background:#fff;color:#003b75;font-weight:900;border:2px solid #0057A8;box-shadow:0 4px 12px rgba(0,87,168,.2),0 2px 0 #0057A8;transform:translateY(-2px)}
.leaderboard-explain{margin:12px 0;padding:12px 14px;border-radius:14px;background:#eef7ff;color:#003f78;border:1px solid #b8ddff;font-weight:800;text-align:center}
.leaders-subtitle{margin:14px 0 8px;color:#003f78;text-align:center;font-size:16px}.top-three-box{display:grid;gap:10px}
.top-three-card{border:1px solid rgba(0,87,168,.16)}
.points-pill,.leaderboard-points,.top-three-points{background:linear-gradient(135deg,#0057A8,#0b75c9)!important;color:#fff!important}
button{background:linear-gradient(135deg,#F6A400,#D48700);color:#111827}
.main-nav .nav-btn:hover{background:linear-gradient(135deg,#F6A400,#D48700)}
.rank-box,.result{background:#eef7ff;color:#0057A8;border-color:#b8ddff}.notice{background:#fff7e6;color:#9a5b00;border-color:#ffd893}
.term-item{border-color:rgba(0,87,168,.10)}
@media(max-width:700px){.leaderboard-tabs{grid-template-columns:1fr}.leaderboard-tabs button{font-size:13px}.worldcup-logo.yansab-logo{width:min(320px,90vw)}}


/* Yansab support card */
.support-card .support-box{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:16px;
  border:1px solid rgba(13,89,162,.18);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(255,246,227,.78));
  text-align:right;
}
.support-card .support-icon{
  width:52px;
  height:52px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  background:linear-gradient(135deg,#25D366,#128C7E);
  color:#fff;
  box-shadow:0 12px 28px rgba(37,211,102,.18);
}
.support-card strong{display:block;color:#0b2345;font-weight:900;margin-bottom:4px}
.support-phone{
  display:inline-block;
  direction:ltr;
  font-size:20px;
  font-weight:900;
  color:#0d59a2;
  text-decoration:none;
  margin-left:8px;
}
.support-note{display:inline-block;color:#128C7E;font-weight:900}
@media(max-width:650px){
  .support-card .support-box{align-items:flex-start;justify-content:flex-start}
  .support-phone{font-size:18px}
}

/* === Updated Yansab identity assets === */
.yansab-logo{
  max-height:82px !important;
  object-fit:contain;
  background:#fff;
  border-radius:18px;
  padding:10px 18px;
  box-shadow:0 16px 38px rgba(0,0,0,.20);
}
.worldcup-logo.yansab-logo{
  width:min(330px,86vw) !important;
  height:auto;
}
.event-logo-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  margin:10px auto 16px;
}
.yansab-event-poster{
  display:block;
  width:auto;
  max-width:min(300px,78vw);
  max-height:440px;
  object-fit:contain;
  border-radius:24px;
  background:#fff;
  padding:10px;
  box-shadow:0 20px 48px rgba(0,0,0,.22);
  border:1px solid rgba(0,87,168,.12);
}
@media(max-width:700px){
  .worldcup-logo.yansab-logo{width:min(280px,84vw) !important;max-height:72px !important;padding:8px 14px}
  .yansab-event-poster{max-width:min(240px,76vw);max-height:360px;border-radius:20px;padding:8px}
  .event-logo-wrap{margin:8px auto 12px}
}


/* === Final logo placement: remove old Yansab logo and keep only the event logo === */
.logo-wrap:has(.yansab-logo),
.yansab-logo{
  display:none !important;
}
.event-logo-wrap{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  margin:0 auto 16px !important;
}
.yansab-event-poster{
  display:block !important;
  width:auto !important;
  max-width:min(260px,72vw) !important;
  max-height:360px !important;
  object-fit:contain !important;
  border-radius:24px !important;
  background:#fff !important;
  padding:10px !important;
  box-shadow:0 20px 48px rgba(0,0,0,.20) !important;
  border:1px solid rgba(0,87,168,.12) !important;
}
.admin-event-logo-wrap{
  margin:0 auto 12px !important;
}
.admin-event-poster{
  max-width:min(180px,60vw) !important;
  max-height:260px !important;
  border-radius:20px !important;
  padding:8px !important;
}
@media(max-width:700px){
  .yansab-event-poster{
    max-width:min(220px,72vw) !important;
    max-height:310px !important;
    border-radius:20px !important;
    padding:8px !important;
  }
  .admin-event-poster{
    max-width:min(160px,62vw) !important;
    max-height:230px !important;
  }
  .event-logo-wrap{margin:0 auto 12px !important;}
}

.support-admin-link{display:inline-block;margin-top:10px;padding:9px 14px;border-radius:12px;background:linear-gradient(135deg,#0d59a2,#003b75);color:#fff!important;text-decoration:none;font-weight:900;box-shadow:0 8px 18px rgba(13,89,162,.18)}
.support-admin-link:hover{transform:translateY(-1px)}


/* === Final Yansab logo placement and support button bottom === */
.hero{
  position:relative;
  overflow:hidden;
}
.hero-logo-right{
  width:100%;
  display:flex;
  justify-content:flex-start;
  align-items:center;
  margin:0 0 14px;
  direction:rtl;
}
.header-yansab-logo{
  display:block;
  width:min(210px,46vw);
  max-height:88px;
  object-fit:contain;
  filter:drop-shadow(0 12px 18px rgba(0,0,0,.18));
}
.main-poster-wrap{
  margin:6px auto 18px !important;
}
.main-yansab-poster,
.yansab-event-poster.main-yansab-poster{
  max-width:min(300px,72vw) !important;
  max-height:455px !important;
  border-radius:26px !important;
  padding:8px !important;
  background:#fff !important;
  box-shadow:0 22px 50px rgba(0,0,0,.22) !important;
  border:1px solid rgba(0,87,168,.10) !important;
}
.support-card{
  margin-top:22px;
  margin-bottom:0;
}
.support-card .support-box{
  justify-content:center;
}
@media(max-width:700px){
  .hero-logo-right{justify-content:flex-start;margin-bottom:10px;}
  .header-yansab-logo{width:min(180px,58vw);max-height:78px;}
  .main-yansab-poster,
  .yansab-event-poster.main-yansab-poster{
    max-width:min(250px,78vw) !important;
    max-height:385px !important;
    border-radius:22px !important;
  }
}


/* WhatsApp support logo - compact mobile friendly */
.support-wa-logo-link{
  width:42px;
  height:42px;
  min-width:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#25D366;
  box-shadow:0 10px 22px rgba(37,211,102,.20);
  text-decoration:none;
  transition:transform .18s ease, box-shadow .18s ease;
}
.support-wa-logo-link:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(37,211,102,.26)}
.support-wa-logo{
  width:42px;
  height:42px;
  display:block;
  object-fit:contain;
  border-radius:50%;
}
@media(max-width:650px){
  .support-card .support-box{gap:10px;padding:13px 12px;align-items:center;}
  .support-wa-logo-link,.support-wa-logo{width:36px;height:36px;min-width:36px;}
}


/* === Clean technical support card: compact mobile-first redesign === */
.support-card-clean{
  margin-top:22px !important;
  padding:18px !important;
  background:linear-gradient(135deg,#ffffff,#f7fbff) !important;
  border:1px solid rgba(0,87,168,.16) !important;
  box-shadow:0 18px 45px rgba(0,30,70,.10) !important;
}
.support-card-clean .support-clean-content{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  direction:rtl !important;
}
.support-card-clean .support-clean-text{
  text-align:right !important;
  flex:1 1 auto !important;
}
.support-card-clean h2{
  margin:0 0 5px !important;
  color:#0b2345 !important;
  font-size:22px !important;
  font-weight:900 !important;
}
.support-card-clean p{
  margin:0 !important;
  color:#526174 !important;
  font-size:15px !important;
  line-height:1.8 !important;
  font-weight:700 !important;
}
.support-card-clean .support-clean-actions{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
}
.support-whatsapp-btn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:9px !important;
  min-height:42px !important;
  padding:10px 16px !important;
  border-radius:999px !important;
  background:#128C7E !important;
  color:#fff !important;
  text-decoration:none !important;
  font-weight:900 !important;
  box-shadow:0 10px 22px rgba(18,140,126,.18) !important;
  border:1px solid rgba(255,255,255,.22) !important;
  line-height:1 !important;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}
.support-whatsapp-btn:hover{
  transform:translateY(-1px) !important;
  filter:brightness(1.04) !important;
  box-shadow:0 14px 30px rgba(18,140,126,.24) !important;
}
.support-whatsapp-btn .wa-word{
  font-size:14px !important;
  font-weight:900 !important;
  opacity:.95 !important;
}
.support-whatsapp-btn .support-wa-number{
  direction:ltr !important;
  unicode-bidi:embed !important;
  font-size:17px !important;
  letter-spacing:.3px !important;
  color:#fff !important;
  font-weight:900 !important;
}
.support-admin-link-clean{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:40px !important;
  padding:9px 14px !important;
  border-radius:999px !important;
  background:#eef6ff !important;
  color:#0057a8 !important;
  border:1px solid rgba(0,87,168,.18) !important;
  text-decoration:none !important;
  font-weight:900 !important;
  box-shadow:none !important;
}
.support-wa-logo-link,.support-wa-logo{
  display:none !important;
}
@media(max-width:700px){
  .support-card-clean{
    padding:15px !important;
    border-radius:20px !important;
  }
  .support-card-clean .support-clean-content{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:12px !important;
  }
  .support-card-clean h2{
    font-size:20px !important;
    text-align:center !important;
  }
  .support-card-clean p{
    font-size:14px !important;
    text-align:center !important;
  }
  .support-card-clean .support-clean-actions{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:9px !important;
  }
  .support-whatsapp-btn,.support-admin-link-clean{
    width:100% !important;
    min-height:44px !important;
    box-sizing:border-box !important;
  }
  .support-whatsapp-btn .support-wa-number{
    font-size:16px !important;
  }
}

/* === Yansab hero logo: approved combined artwork, centered and responsive === */
.hero .hero-logo-center-placement{
  width:100% !important;
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  direction:rtl !important;
  box-sizing:border-box !important;
  padding-inline:clamp(0px,2.2vw,24px) !important;
  margin:0 0 14px !important;
}
.hero .hero-logo-center-placement .main-yansab-poster{
  display:block !important;
  width:clamp(145px,16vw,185px) !important;
  max-width:185px !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:18px !important;
  background:#fff !important;
  border:1px solid rgba(255,255,255,.34) !important;
  box-shadow:0 16px 38px rgba(0,0,0,.22) !important;
}
@media(max-width:700px){
  .hero .hero-logo-center-placement{
    padding-inline:2px !important;
    margin-bottom:10px !important;
  }
  .hero .hero-logo-center-placement .main-yansab-poster{
    width:clamp(118px,35vw,145px) !important;
    max-width:145px !important;
    border-radius:15px !important;
    box-shadow:0 12px 28px rgba(0,0,0,.20) !important;
  }
}

/* Participant name policy note - 2026-06-12 */
.field-note {
  display: block;
  margin: -4px 0 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  opacity: 0.78;
}

/* === FAQ: leaderboard and scoring explanation === */
.main-nav{
  grid-template-columns:repeat(5, minmax(0, 1fr));
  width:min(980px,100%);
}
.leaderboard-faq-btn{
  margin-top:10px;
  background:linear-gradient(135deg,#0057A8,#0072CE);
  color:#fff;
  border:1px solid rgba(255,255,255,.25);
}
.faq-card{max-width:900px;margin-inline:auto}
.faq-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  background:#eef7ff;
  color:#0057A8;
  border:1px solid #b8ddff;
  font-weight:900;
  margin-bottom:10px;
}
.faq-card h2{margin:0;color:#0f172a;font-size:32px}
.faq-intro{font-size:18px;line-height:1.9;color:#475569;font-weight:700;margin:10px 0 20px}
.faq-list{display:grid;gap:12px}
.faq-item{
  border:1px solid #dbeafe;
  border-radius:18px;
  background:#f8fafc;
  overflow:hidden;
}
.faq-item summary{
  list-style:none;
  cursor:pointer;
  padding:16px 52px 16px 18px;
  color:#003f78;
  font-size:18px;
  font-weight:900;
  position:relative;
}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary::before{
  content:'+';
  position:absolute;
  right:18px;
  top:50%;
  transform:translateY(-50%);
  width:26px;
  height:26px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#0057A8;
  color:#fff;
  font-size:20px;
  line-height:1;
}
.faq-item[open] summary::before{content:'−'}
.faq-item[open] summary{background:#eef7ff}
.faq-answer{
  padding:15px 18px 18px;
  color:#334155;
  font-weight:700;
  line-height:1.9;
  border-top:1px solid #dbeafe;
}
.faq-answer p{margin:5px 0}
.faq-back-btn{
  margin-top:22px;
  background:linear-gradient(135deg,#F6A400,#D48700);
  color:#111827;
}
@media(max-width:800px){
  .main-nav{grid-template-columns:repeat(3,minmax(0,1fr));width:min(720px,100%)}
}
@media(max-width:480px){
  .main-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .faq-card{padding:20px}
  .faq-card h2{font-size:27px}
  .faq-intro{font-size:16px}
  .faq-item summary{font-size:16px;padding:14px 46px 14px 14px}
  .faq-item summary::before{right:14px}
  .faq-answer{font-size:15px;padding:13px 14px 16px}
}

/* === ترتيب قسم المتصدرين في الصفحة الرئيسية === */
.top-three-box{
  display:block;
}

.leaders-group{
  position:relative;
  padding:20px 18px 18px;
  border:1px solid rgba(0,87,168,.20);
  border-radius:20px;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%);
  box-shadow:0 10px 28px rgba(0,63,120,.08), inset 0 0 0 1px rgba(255,255,255,.75);
}

.leaders-subtitle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin:0 0 20px;
  color:#003f78;
  text-align:center;
  font-size:18px;
  font-weight:900;
  line-height:1.5;
}

.leaders-subtitle::before,
.leaders-subtitle::after{
  content:"";
  flex:1 1 90px;
  max-width:180px;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(0,87,168,.48));
}

.leaders-subtitle::after{
  background:linear-gradient(90deg,rgba(0,87,168,.48),transparent);
}

.leaders-subtitle span{
  display:inline-block;
  padding:5px 16px;
  border:1px solid rgba(0,87,168,.16);
  border-radius:999px;
  background:#eef7ff;
  box-shadow:0 5px 14px rgba(0,87,168,.07);
}

.leaders-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.leaders-grid .top-three-card{
  min-width:0;
  border:1px solid rgba(0,87,168,.18);
  box-shadow:0 8px 22px rgba(0,63,120,.08);
}

.champion-card{
  max-width:360px;
  margin:0 auto 22px;
  border:2px solid #e0a400;
  border-radius:16px;
  padding:18px 20px;
  gap:16px;
}

.champion-card .champion-medal{
  font-size:48px;
}

.champion-card .champion-info{
  flex:1;
  text-align:right;
  min-width:0;
}

.champion-card .champion-label{
  display:block;
  color:#b8860b;
  font-weight:900;
  font-size:16px;
  margin-bottom:4px;
}

.champion-card strong{
  font-size:19px;
}

.champion-card .champion-rank{
  margin-inline-start:auto;
  align-self:center;
  font-weight:900;
  color:#1d4ed8;
  font-size:34px;
  line-height:1;
}

@media(max-width:820px){
  .champion-card{
    max-width:100%;
  }
}

.leaders-participants-group .leaders-grid .top-three-card,
.leaders-departments-group .leaders-grid .top-three-card,
.champion-card{
  flex-direction:row-reverse;
}

.participant-info{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
  text-align:right;
}

.champion-card .champion-info .points-pill,
.participant-info .points-pill{
  margin-top:2px;
}

.leaders-participants-group .rank-pill{
  margin-inline-start:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:26px;
  padding:0 6px;
  background:#eef4ff;
  color:#1d4ed8;
  font-weight:900;
  font-size:15px;
  border-radius:999px;
  flex-shrink:0;
}

.top-three-card .dept-medal{
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#eef4ff;
  border-radius:12px;
  flex-shrink:0;
}

.top-three-card .dept-medal .dept-ic{
  width:26px;
  height:26px;
  stroke:#1d4ed8;
  fill:none;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.dept-champion-card .champion-info{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
}

.dept-champion-card .champion-dept-medal{
  width:52px;
  height:52px;
}

.dept-champion-card .champion-dept-medal .dept-ic{
  width:30px;
  height:30px;
}

.leaders-departments-group .dept-rank-pill{
  margin-inline-start:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 8px;
  background:#eef4ff;
  color:#1d4ed8;
  font-weight:900;
  font-size:19px;
  border-radius:999px;
  flex-shrink:0;
}

.leaders-section-spacer{
  height:24px;
}

.leaders-group-note{
  margin:14px 0 0;
  padding-top:12px;
  border-top:1px dashed rgba(0,87,168,.22);
  color:#54708c;
  text-align:center;
  font-size:13px;
  font-weight:800;
}

.leaders-empty-notice{
  grid-column:1/-1;
  margin:0;
}

@media(max-width:820px){
  .leaders-group{
    padding:17px 12px 14px;
    border-radius:17px;
  }

  .leaders-subtitle{
    gap:8px;
    margin-bottom:16px;
    font-size:16px;
  }

  .leaders-subtitle span{
    padding:4px 12px;
  }

  .leaders-subtitle::before,
  .leaders-subtitle::after{
    min-width:18px;
  }

  .leaders-grid{
    grid-template-columns:1fr;
    gap:10px;
  }

  .leaders-participants-group .leaders-grid{
    gap:7px;
  }

  .leaders-participants-group .leaders-grid .top-three-card{
    padding:8px 12px;
    gap:10px;
  }

  .leaders-participants-group .leaders-grid .top-three-card .medal{
    font-size:22px;
  }

  .leaders-participants-group .leaders-grid .top-three-card strong{
    font-size:13px;
    line-height:1.3;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  .leaders-participants-group .leaders-grid .rank-pill{
    min-width:22px;
    height:22px;
    font-size:12px;
    padding:0 5px;
  }

  .leaders-section-spacer{
    height:20px;
  }
}

/* === دليل الأوسمة === */
.badge-legend{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:16px;margin-top:16px}
.badge-legend h4{margin:0 0 12px;color:#0b2345;font-size:15px;font-weight:900}
.badge-legend-grid{display:flex;flex-direction:column;gap:10px}
.badge-legend-item{display:flex;align-items:flex-start;gap:12px;background:#fff;border-radius:12px;padding:10px 14px;border:1px solid #e2e8f0}
.badge-legend-icon{font-size:24px;min-width:32px;text-align:center;line-height:1.4}
.badge-legend-item strong{display:block;font-size:14px;color:#0b2345;margin-bottom:2px}
.badge-legend-item p{margin:0;font-size:12px;color:#64748b;line-height:1.4}

/* YANSAB TEST v48 — large responsive flags and live score presentation */
.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  column-gap: clamp(10px, 2vw, 22px);
  width: min(760px, 100%);
  margin: 14px auto 10px;
}

.teams .team-with-flag {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px !important;
  color: var(--gold);
}

.teams .team-label {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.versus-mark {
  color: #334155 !important;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 900;
}

.flag-shell {
  width: clamp(46px, 5vw, 58px);
  height: clamp(30px, 3.4vw, 38px);
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .13);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .20);
}

.team-with-flag img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.flag-fallback {
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1;
}

.team-flag-missing .flag-shell {
  border-style: dashed;
}

.live-score-panel {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 17px;
  border: 1px solid #86efac;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
}

.live-score-panel.is-final {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.live-score-title {
  margin-bottom: 9px;
  color: #166534;
  font-size: 14px;
  font-weight: 900;
}

.live-score-panel.is-final .live-score-title {
  color: #1d4ed8;
}

.live-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.live-score-team .team-with-flag {
  display: flex;
  flex-direction: column;
  gap: 5px !important;
  font-size: 13px;
  font-weight: 900;
}

.live-score-team .flag-shell {
  width: 42px;
  height: 28px;
}

.live-score-numbers {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  color: #0f172a;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
}

.score-divider {
  color: #64748b;
  font-size: .72em;
}

.penalty-score-line {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed rgba(71, 85, 105, .28);
  font-size: 14px;
  font-weight: 800;
}

.live-update-warning {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 620px) {
  .match-card {
    padding: 15px 12px;
  }

  .teams {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 7px;
    font-size: clamp(15px, 4.2vw, 18px) !important;
  }

  .teams .team-with-flag {
    flex-direction: column;
    gap: 7px !important;
  }

  .teams .flag-shell {
    width: 48px;
    height: 32px;
  }

  .teams > span:not(.team-with-flag) {
    font-size: 23px;
  }

  .live-score-row {
    gap: 7px;
  }

  .live-score-team .team-with-flag {
    font-size: 11px;
  }

  .live-score-team .flag-shell {
    width: 38px;
    height: 25px;
  }

  .live-score-numbers {
    gap: 6px;
    font-size: 31px;
  }
}

@media (min-width: 621px) and (max-width: 1180px) {
  .teams .flag-shell {
    width: 52px;
    height: 34px;
  }
}

/* YANSAB TEST v49 — visual team panels with subtle animation */
.teams {
  grid-template-columns: minmax(180px, 276px) 58px minmax(180px, 276px);
  column-gap: clamp(14px, 2.4vw, 28px);
  width: min(760px, 100%);
  margin: 18px auto 14px;
}

.teams .team-with-flag {
  min-height: 164px;
  padding: 18px 16px 15px;
  flex-direction: column;
  gap: 13px !important;
  border-radius: 21px;
  border: 1px solid rgba(14, 165, 233, .22);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.98), rgba(240,249,255,.92) 62%, rgba(224,242,254,.84));
  box-shadow:
    0 18px 34px rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255,255,255,.95);
  color: #0b1f5e !important;
  position: relative;
  isolation: isolate;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.teams .team-with-flag::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.72);
  pointer-events: none;
  z-index: -1;
}

.teams .team-with-flag:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, .42);
  box-shadow:
    0 24px 42px rgba(15, 23, 42, .12),
    0 0 0 5px rgba(14, 165, 233, .06),
    inset 0 1px 0 rgba(255,255,255,.98);
}

.teams .flag-shell {
  width: clamp(118px, 12vw, 142px);
  height: clamp(76px, 7.8vw, 91px);
  border-radius: 15px;
  border: 4px solid rgba(255,255,255,.92);
  background: #fff;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, .19),
    0 0 0 2px rgba(148, 163, 184, .18);
  overflow: hidden;
}

.teams .team-label {
  color: #0b1f5e !important;
  font-size: clamp(18px, 1.8vw, 23px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -.01em;
}

.versus-mark {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  border-radius: 999px;
  color: #075985 !important;
  background: linear-gradient(145deg, #ffffff, #eff6ff);
  border: 1px solid rgba(14, 165, 233, .25);
  box-shadow:
    0 10px 22px rgba(14, 116, 144, .10),
    inset 0 1px 0 rgba(255,255,255,.95);
  font-size: 23px;
  font-weight: 900;
}

@media (prefers-reduced-motion: no-preference) {
  .teams .team-with-flag {
    animation: teamPanelFloat 4.8s ease-in-out infinite;
  }

  .teams .team-with-flag:nth-child(3) {
    animation-delay: -2.4s;
  }

  .versus-mark {
    animation: versusSoftPulse 3.4s ease-in-out infinite;
  }
}

@keyframes teamPanelFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes versusSoftPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 22px rgba(14, 116, 144, .10), inset 0 1px 0 rgba(255,255,255,.95);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 12px 26px rgba(14, 116, 144, .16), 0 0 0 5px rgba(14,165,233,.05), inset 0 1px 0 rgba(255,255,255,.98);
  }
}

@media (max-width: 620px) {
  .teams {
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    column-gap: 7px;
    width: 100%;
    margin: 15px auto 12px;
  }

  .teams .team-with-flag {
    min-height: 126px;
    padding: 12px 6px 11px;
    gap: 9px !important;
    border-radius: 16px;
  }

  .teams .team-with-flag::before {
    inset: 5px;
    border-radius: 12px;
  }

  .teams .flag-shell {
    width: clamp(78px, 25vw, 100px);
    height: clamp(51px, 16vw, 65px);
    border-width: 3px;
    border-radius: 11px;
  }

  .teams .team-label {
    font-size: clamp(13px, 3.7vw, 16px);
    line-height: 1.18;
  }

  .versus-mark {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }
}

@media (min-width: 621px) and (max-width: 900px) {
  .teams {
    grid-template-columns: minmax(160px, 240px) 50px minmax(160px, 240px);
    column-gap: 15px;
  }

  .teams .team-with-flag {
    min-height: 150px;
    padding: 16px 12px 13px;
  }

  .teams .flag-shell {
    width: 118px;
    height: 76px;
  }
}

/* YANSAB TEST v51 — remove duplicated flags from live score panel */
.live-score-team {
  min-width: 0;
  color: #0b2345;
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: center;
}

/* YANSAB TEST v52 — show live goals under the primary flags only */
.teams .team-with-flag.has-live-score {
  min-height: 202px;
  gap: 8px !important;
}

.team-live-goals {
  min-width: 58px;
  height: 58px;
  padding: 0 14px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #eff6ff);
  border: 1px solid rgba(37, 99, 235, .20);
  box-shadow:
    0 9px 20px rgba(15, 23, 42, .11),
    inset 0 1px 0 rgba(255, 255, 255, .98);
  color: #0b1f5e;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 950;
  line-height: 1;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.teams.has-live-score .versus-mark {
  font-size: 0;
}

.teams.has-live-score .versus-mark::after {
  content: "–";
  font-size: 29px;
  line-height: 1;
}

.penalty-score-standalone {
  width: fit-content;
  margin: 10px auto 0;
  padding: 8px 14px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
}

@media (prefers-reduced-motion: no-preference) {
  .team-live-goals {
    animation: liveGoalScoreIn .55s cubic-bezier(.22, 1, .36, 1) both;
  }
}

@keyframes liveGoalScoreIn {
  0% { opacity: 0; transform: scale(.72) translateY(5px); }
  70% { opacity: 1; transform: scale(1.07) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 620px) {
  .teams .team-with-flag.has-live-score {
    min-height: 164px;
    gap: 6px !important;
  }

  .team-live-goals {
    min-width: 46px;
    height: 46px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: clamp(28px, 8vw, 36px);
  }

  .teams.has-live-score .versus-mark::after {
    font-size: 23px;
  }
}

/* YANSAB: بطاقة آلية احتساب نقاط خروج المغلوب (الشروط والأحكام) */
.term-highlight{display:block;background:linear-gradient(180deg,#fff8e6,#fffdf7);border:1.5px solid #e6c35a;border-radius:14px;padding:14px 16px;line-height:1.85;font-size:13px;color:#3a3a3a}
.term-highlight .ko-title{display:block;font-size:16px;font-weight:700;color:#8a5a00;margin-bottom:8px}
.term-highlight .ko-firstline{white-space:normal;font-size:12px;color:#5a5a5a;margin-bottom:10px}
.term-highlight .ko-p{margin:0 0 10px;font-weight:400}
.term-highlight .ko-p b{font-weight:700;color:#8a5a00}
.term-highlight .ko-list{margin:0 0 10px;padding-inline-start:20px;font-weight:400}
.term-highlight .ko-list li{margin-bottom:5px}
.term-highlight .ko-ex-title{font-weight:700;color:#8a5a00;margin-bottom:8px}
.term-highlight .ko-ex{display:flex;flex-direction:column;gap:8px}
.term-highlight .ko-ex-row{display:flex;align-items:flex-start;gap:8px}
.term-highlight .ko-b{flex:0 0 auto;min-width:22px;height:22px;line-height:22px;text-align:center;border-radius:7px;font-weight:700;font-size:12px;color:#fff}
.term-highlight .ko-b3{background:#2e9e5b}
.term-highlight .ko-b1{background:#d4a017}
.term-highlight .ko-b0{background:#c2544a}
.term-highlight .ko-ex-t{font-size:12.5px;line-height:1.6;font-weight:400}
.term-highlight .ko-ex-t b{color:#1f3a5f;font-weight:700}
@media(min-width:700px){.term-highlight .ko-firstline{white-space:nowrap;font-size:11.5px}}
@keyframes yansabFlash{0%,100%{box-shadow:0 0 0 0 rgba(207,156,22,0)}30%{box-shadow:0 0 0 4px rgba(207,156,22,.6)}}
.term-highlight.flash{animation:yansabFlash 1.8s ease}


/* === توب 5 مشاركين حسب الإدارة — قسم مستقل داخل الترتيب العام === */
.dept-top5-list{display:grid;gap:10px;margin-top:12px}
.dept-top5-item{border:1px solid rgba(0,87,168,.18);border-radius:14px;background:#fff}
.dept-top5-head{display:flex;align-items:center;gap:10px;padding:12px 14px}
.dept-top5-place{flex:0 0 auto;padding:5px 12px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:900;font-size:13px;white-space:nowrap}
.dept-top5-dept{flex:1 1 auto;min-width:0;font-size:15px;color:#0f172a;overflow-wrap:anywhere}
/* width/margin يلغيان قاعدة button العامة (width:100%;margin-top:18px) حتى يبقى الزر داخل الصف */
.dept-top5-toggle{flex:0 0 auto;width:auto;margin:0;padding:9px 14px;font-size:13px;border-radius:10px;background:linear-gradient(135deg,#0057A8,#0072CE);color:#fff;border:1px solid rgba(255,255,255,.25)}
.dept-top5-details:not(:empty){padding:0 14px 14px}
.dept-top5-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-top:12px;border-top:1px dashed rgba(0,87,168,.22)}
.dept-top5-fact{padding:10px;border-radius:12px;background:#f8fafc;border:1px solid #e2e8f0;text-align:center}
.dept-top5-fact span{display:block;color:#64748b;font-size:11px;font-weight:800;margin-bottom:4px}
.dept-top5-fact strong{color:#0f172a;font-size:14px;overflow-wrap:anywhere}
.dept-top5-note{margin:12px 0 0;color:#9a5b00;font-size:12px;font-weight:800;text-align:center}
@media(max-width:600px){
  .dept-top5-head{flex-wrap:wrap;gap:8px}
  .dept-top5-place{order:1}
  .dept-top5-dept{order:2;flex:1 1 auto;font-size:14px}
  .dept-top5-toggle{order:3;width:100%}
  .dept-top5-facts{grid-template-columns:1fr;gap:8px}
}
