/* ==========================================================
   الدوري اليمني للمحترفين - التصميم العام
   نظام الألوان: ليلة الملعب (Pitch Night)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Changa:wght@500;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    /* الألوان */
    --color-bg: #0B1F1A;
    --color-bg-2: #0E251F;
    --color-surface: #15322A;
    --color-surface-2: #1D3F35;
    --color-red: #D7263D;
    --color-red-soft: rgba(215, 38, 61, 0.16);
    --color-gold: #F4B73F;
    --color-gold-soft: rgba(244, 183, 63, 0.14);
    --color-text: #F4F1EA;
    --color-muted: #92ACA4;
    --color-line: rgba(244, 241, 234, 0.10);

    /* الخطوط */
    --font-display: 'Changa', 'Tajawal', sans-serif;
    --font-body: 'Tajawal', sans-serif;

    /* مقاسات */
    --radius: 14px;
    --radius-sm: 8px;
    --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(244,183,63,0.06), transparent 40%),
        radial-gradient(circle at 85% 10%, rgba(215,38,61,0.07), transparent 35%);
    background-attachment: fixed;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================
   الهيدر
   ========================================================== */
.site-header {
    background: linear-gradient(180deg, var(--color-bg-2), var(--color-bg));
    border-bottom: 1px solid var(--color-line);
    padding: 18px 0;
    position: relative;
}

.site-header::after {
    content: "";
    position: absolute;
    bottom: -3px; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-red), var(--color-gold));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-surface);
}

.brand-text .brand-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
}

.brand-text .brand-sub {
    font-size: 0.78rem;
    color: var(--color-muted);
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    gap: 22px;
    font-size: 0.95rem;
    font-weight: 500;
}

.main-nav a {
    color: var(--color-muted);
    transition: color 0.2s;
    padding: 6px 2px;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-text);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -6px; right: 0; left: 0;
    height: 2px;
    background: var(--color-gold);
    border-radius: 2px;
}

/* ==========================================================
   شريط المباشر (Live Ticker)
   ========================================================== */
.live-ticker {
    background: var(--color-red);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.live-ticker .ticker-track {
    display: flex;
    gap: 48px;
    white-space: nowrap;
    padding: 9px 0;
    animation: ticker-scroll 28s linear infinite;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
}

.live-ticker .ticker-track span.dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    margin-inline-end: 8px;
    animation: pulse-dot 1.4s infinite;
    vertical-align: middle;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
}

@media (prefers-reduced-motion: reduce) {
    .live-ticker .ticker-track { animation: none; overflow-x: auto; }
    .live-ticker .ticker-track span.dot { animation: none; }
}

/* ==========================================================
   عناوين الأقسام
   ========================================================== */
.section {
    padding: 38px 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.section-head .eyebrow {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: var(--color-gold);
    margin-bottom: 6px;
    font-weight: 600;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
}

.section-head .section-note {
    color: var(--color-muted);
    font-size: 0.88rem;
}

/* ==========================================================
   كروت المباريات - بتصميم "تذكرة المباراة" (Match Ticket)
   ========================================================== */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.match-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.match-card:hover {
    transform: translateY(-3px);
    border-color: rgba(244, 183, 63, 0.35);
}

.match-card a.card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.match-card__main {
    flex: 1;
    padding: 18px 16px;
    min-width: 0;
}

.match-card__competition {
    font-size: 0.74rem;
    color: var(--color-muted);
    text-align: center;
    margin-bottom: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-card__teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.match-card .team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 0;
}

.match-card .team__logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
}

.match-card .team__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.match-card__score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 4px;
}

.match-card__score .vs {
    font-size: 0.95rem;
    color: var(--color-muted);
    font-weight: 500;
}

.match-card__date {
    margin-top: 14px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* الجزء الجانبي من "التذكرة" */
.match-card__stub {
    width: 96px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--color-surface-2);
    position: relative;
    padding: 12px 8px;
    text-align: center;
    border-inline-start: 2px dashed rgba(244,241,234,0.18);
}

.punch {
    position: absolute;
    inset-inline-start: -8px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--color-bg);
    z-index: 1;
}

.punch.top { top: -8px; }
.punch.bottom { bottom: -8px; }

.match-card__stub .stub-icon {
    font-size: 1.4rem;
}

.match-card__stub .stub-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
}

/* شارات الحالة */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: var(--font-display);
}

.badge-live {
    background: var(--color-red-soft);
    color: #ff8a96;
    border: 1px solid rgba(215,38,61,0.4);
}

.badge-live .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-red);
    animation: pulse-dot 1.4s infinite;
}

.badge-finished {
    background: rgba(146, 172, 164, 0.12);
    color: var(--color-muted);
    border: 1px solid var(--color-line);
}

.badge-upcoming {
    background: var(--color-gold-soft);
    color: var(--color-gold);
    border: 1px solid rgba(244,183,63,0.35);
}

/* ==========================================================
   حالة عدم وجود مباريات
   ========================================================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: var(--color-surface);
    border: 1px dashed var(--color-line);
    border-radius: var(--radius);
    color: var(--color-muted);
}

.empty-state .emoji { font-size: 2.2rem; margin-bottom: 10px; }

/* ==========================================================
   أزرار
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-primary {
    background: var(--color-gold);
    color: #18260f;
}
.btn-primary:hover { background: #ffc861; }

.btn-outline {
    background: transparent;
    border-color: var(--color-line);
    color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-gold); color: var(--color-gold); }

/* ==========================================================
   قسم كأس العالم 2026
   ========================================================== */
.wc-section {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 22px;
}

.wc-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--color-line);
    flex-wrap: wrap;
}

.wc-tab {
    background: none;
    border: none;
    color: var(--color-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 10px 6px;
    cursor: pointer;
    position: relative;
    transition: color 0.18s;
}

.wc-tab.active { color: var(--color-gold); }

.wc-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px; right: 0; left: 0;
    height: 2px;
    background: var(--color-gold);
}

.wc-panel { display: none; }
.wc-panel.active { display: block; }

.wc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.wc-table th, .wc-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--color-line);
}

.wc-table th {
    color: var(--color-muted);
    font-weight: 500;
    font-size: 0.78rem;
}

.wc-table td.team-cell, .wc-table th.team-cell {
    text-align: right;
}

.wc-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-team img {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.wc-group-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-gold);
    margin: 18px 0 8px;
    font-size: 0.95rem;
}

.wc-group-title:first-child { margin-top: 0; }

.wc-empty {
    text-align: center;
    color: var(--color-muted);
    padding: 30px 0;
    font-size: 0.9rem;
}

.wc-fixture-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.88rem;
    gap: 10px;
}

.wc-fixture-row:last-child { border-bottom: none; }

.wc-fixture-row .fx-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.wc-fixture-row .fx-team.away { justify-content: flex-end; }

.wc-fixture-row img { width: 20px; height: 20px; border-radius: 50%; }

.wc-fixture-row .fx-score {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-gold);
    flex-shrink: 0;
    min-width: 70px;
    text-align: center;
}

/* ==========================================================
   صفحة البث المباشر
   ========================================================== */
.watch-hero {
    text-align: center;
    margin-bottom: 24px;
}

.watch-hero .vs-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}

.watch-hero .team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.watch-hero .team img {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
}

.watch-hero .team-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.watch-hero .score-box {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-gold);
}

.watch-hero .competition-name {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: 10px;
}

.player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-line);
}

.player-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* رسالة عدم توفر البث */
.stream-pending {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.stream-pending .box {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 34px 26px;
    text-align: center;
    max-width: 420px;
}

.stream-pending .box .icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.stream-pending .box h3 {
    font-family: var(--font-display);
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.stream-pending .box p {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================================
   صفحة التواصل / التراخيص
   ========================================================== */
.contact-card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 30px;
}

.contact-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-top: 0;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}

/* ==========================================================
   مساحات الإعلانات
   ========================================================== */
.ad-slot {
    margin: 26px 0;
    text-align: center;
}

.ad-slot .ad-label {
    font-size: 0.7rem;
    color: var(--color-muted);
    letter-spacing: 1px;
    margin-bottom: 6px;
    opacity: 0.6;
}

/* ==========================================================
   الفوتر
   ========================================================== */
.site-footer {
    border-top: 1px solid var(--color-line);
    padding: 28px 0;
    margin-top: 30px;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--color-gold); }

/* ==========================================================
   الاستجابة للشاشات الصغيرة
   ========================================================== */
@media (max-width: 720px) {
    .matches-grid { grid-template-columns: 1fr; }
    .section-head h2 { font-size: 1.3rem; }
    .main-nav { gap: 14px; font-size: 0.85rem; }
    .watch-hero .vs-line { gap: 12px; }
    .watch-hero .team img { width: 50px; height: 50px; }
    .watch-hero .score-box { font-size: 1.6rem; }
    .match-card__stub { width: 78px; }
}
