/* ============================================================
   Olympiad — online competition UI (hub card + event page)
   Builds on the site design tokens in css/style.css.
   ============================================================ */

/* ---------- Live competition hero card (olympiads.html) ---------- */

.oly-live-wrap {
    max-width: 1100px;
    margin: 0 auto 4.5rem auto;
}

.oly-live-card {
    position: relative;
    background: var(--bg-surface);
    border-radius: 24px;
    padding: 2.75rem 2.5rem;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 20px 60px rgba(5, 120, 70, 0.12);
    overflow: hidden;
}

.oly-live-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 220px at 85% -10%, rgba(16, 185, 129, 0.14), transparent 70%),
        radial-gradient(420px 200px at 0% 110%, rgba(52, 211, 153, 0.10), transparent 70%);
    pointer-events: none;
}

.oly-live-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.oly-live-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.oly-live-badges {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.oly-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-family: var(--font-body);
}

.oly-badge-online {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .oly-badge-online { color: #34D399; }

.oly-badge-live {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.oly-badge-stage {
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .oly-badge-stage { color: #fbbf24; }

.oly-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: olyPulse 1.6s ease-out infinite;
}

@keyframes olyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    100% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
}

.oly-live-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.oly-live-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    max-width: 48ch;
}

.oly-live-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.oly-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
}

.oly-meta-chip i { color: #10b981; font-size: 1.05rem; }

.oly-meta-chip.oly-prize-chip {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(52, 211, 153, 0.12));
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--text-primary);
    font-weight: 700;
}

.oly-live-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.oly-registered-note {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #059669;
    font-weight: 600;
    font-size: 0.92rem;
}

[data-theme="dark"] .oly-registered-note { color: #34D399; }

/* Countdown */
.oly-countdown {
    text-align: center;
}

.oly-countdown-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.oly-countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    max-width: 340px;
    margin: 0 auto;
}

.oly-count-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.85rem 0.4rem 0.7rem;
}

.oly-count-num {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.oly-count-unit {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.oly-live-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}

/* Sub-heading between live card and reference cards */
.oly-subsection-title {
    text-align: center;
    margin: 0 0 2.5rem 0;
}

.oly-subsection-title h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.oly-subsection-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Event page (olympiad-event.html) ---------- */

.olyev-section {
    padding-top: 140px;
    padding-bottom: 90px;
    position: relative;
    min-height: 80vh;
}

.olyev-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/world-map.svg');
    background-repeat: no-repeat;
    background-position: center 12%;
    background-size: cover;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

.olyev-breadcrumbs {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.olyev-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.olyev-breadcrumbs a:hover { color: #10b981; }

.olyev-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2.5rem;
    align-items: start;
}

.olyev-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.9rem;
}

.olyev-hero .oly-live-badges { margin-bottom: 1rem; }

.olyev-hero p.olyev-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 62ch;
}

/* Prize tiers */
.olyev-prizes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.75rem 0 0.5rem;
}

.olyev-prize-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.4rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.olyev-prize-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.olyev-prize-card.rank-1::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.olyev-prize-card.rank-2::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.olyev-prize-card.rank-3::before { background: linear-gradient(90deg, #b45309, #d97706); }

.olyev-prize-medal { font-size: 1.9rem; line-height: 1; margin-bottom: 0.5rem; }

.olyev-prize-rank {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.olyev-prize-amount {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
}

/* Content cards */
.olyev-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 1.9rem 2rem;
    margin-top: 1.75rem;
}

.olyev-card h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
}

.olyev-card h3 i { color: #10b981; font-size: 1.4rem; }

.olyev-card p, .olyev-card li {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.97rem;
}

.olyev-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.olyev-card ul li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.olyev-card ul li > i {
    color: #10b981;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.olyev-card ul.olyev-warn-list li > i { color: #f59e0b; }

/* Format rows */
.olyev-format-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--bg-glass);
}

.olyev-format-row + .olyev-format-row { margin-top: 0.7rem; }

.olyev-format-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.olyev-format-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.98rem;
}

.olyev-format-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sticky registration sidebar */
.olyev-side {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.olyev-register-card {
    background: var(--bg-surface);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 12px 40px rgba(5, 120, 70, 0.10);
}

.olyev-register-card .oly-countdown { margin-bottom: 1.4rem; }

.olyev-register-card .oly-countdown-grid { max-width: none; }

.olyev-status-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.olyev-status-line.ok {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .olyev-status-line.ok { color: #34D399; }

.olyev-status-line.warn {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .olyev-status-line.warn { color: #fbbf24; }

.olyev-status-line.info {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.olyev-side .btn { width: 100%; justify-content: center; }

.olyev-side .btn + .btn { margin-top: 0.7rem; }

.olyev-side-facts {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.olyev-fact {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.olyev-fact b { color: var(--text-primary); font-weight: 700; }

/* Consent + system check modal */
.olyev-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.olyev-modal-overlay.active { display: flex; }

.olyev-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 2rem;
    animation: olyevSlideUp 0.3s ease;
}

@keyframes olyevSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.olyev-modal h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.olyev-modal .olyev-modal-sub {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.4rem;
}

.olyev-consent-item {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 0.7rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.olyev-consent-item:hover { border-color: rgba(16, 185, 129, 0.45); }

.olyev-consent-item input[type="checkbox"] {
    width: 18px; height: 18px;
    margin-top: 0.2rem;
    accent-color: #10b981;
    flex-shrink: 0;
}

.olyev-consent-item .c-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.94rem;
}

.olyev-consent-item .c-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 0.15rem;
}

.olyev-modal-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.olyev-modal-actions .btn { flex: 1; justify-content: center; }

/* System check rows */
.olyev-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    margin-bottom: 0.55rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.olyev-check-row .check-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    color: var(--text-primary);
}

.olyev-check-row .check-result { font-weight: 700; }
.olyev-check-row .check-result.pass { color: #059669; }
[data-theme="dark"] .olyev-check-row .check-result.pass { color: #34D399; }
.olyev-check-row .check-result.fail { color: #ef4444; }
.olyev-check-row .check-result.pending { color: var(--text-muted); }

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
    .oly-live-inner { grid-template-columns: 1fr; gap: 2rem; }
    .oly-countdown-grid { max-width: 380px; }
    .olyev-layout { grid-template-columns: 1fr; }
    .olyev-side { position: static; }
}

@media (max-width: 640px) {
    .oly-live-card { padding: 1.75rem 1.25rem; }
    .oly-live-title { font-size: 1.6rem; }
    .olyev-hero h1 { font-size: 1.8rem; }
    .olyev-prizes { grid-template-columns: 1fr; }
    .olyev-card { padding: 1.4rem 1.2rem; }
    .oly-count-num { font-size: 1.35rem; }
}
