/* ═══════════════════════════════════════════
   atyarisisonuclari.com — Shared Styles
   ═══════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --white: #FFFFFF;
    --bg: #F5F6FA;
    --bg-warm: #FFFBF0;

    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-light: #D1FAE5;
    --emerald-50: #ECFDF5;

    --gold: #D97706;
    --gold-med: #F59E0B;
    --gold-light: #FEF3C7;
    --gold-50: #FFFBEB;

    --silver: #64748B;
    --silver-light: #F1F5F9;
    --bronze: #EA580C;

    --text: #0F172A;
    --text-2: #334155;
    --text-3: #64748B;
    --text-4: #94A3B8;
    --text-5: #CBD5E1;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-full: 999px;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Figtree', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 76px;
}

/* ═══════ TOPBAR ═══════ */
.topbar {
    background: var(--text);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 500;
    z-index: 200;
}

.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.topbar-text a {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.topbar-text a:hover { text-decoration: underline; }

.topbar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    flex-shrink: 0;
}

.topbar-close:hover { color: white; }

/* ═══════ HEADER ═══════ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-inner .logo { flex: 1; min-width: 0; }
.header-inner .header-nav { flex-shrink: 0; }
.header-inner .icon-btn { flex-shrink: 0; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.logo-text span {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: 0;
}

/* Header Desktop Nav */
.header-nav {
    display: none;
    gap: 4px;
}

.header-nav-link {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-3);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--r-full);
    transition: all 0.15s;
}

.header-nav-link:hover {
    color: var(--text);
    background: var(--bg);
}

.header-nav-link.active {
    color: var(--emerald);
    background: var(--emerald-50);
}

/* Header Dropdown */
.header-dropdown {
    position: relative;
}

.header-dropdown > button {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 6px;
    min-width: 200px;
    z-index: 200;
}

.header-dropdown:hover .header-dropdown-menu,
.header-dropdown:focus-within .header-dropdown-menu {
    display: block;
}

.header-dropdown-menu a {
    display: block;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-sm);
    transition: all 0.1s;
}

.header-dropdown-menu a:hover {
    background: var(--bg);
    color: var(--emerald);
}

/* Mobile / Desktop visibility */
.mobile-only { display: flex; }
.desktop-only { display: none; }

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.icon-btn:hover { border-color: var(--text-4); color: var(--text); }

/* ═══════ BOTTOM NAVIGATION ═══════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
}

.bnav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-4);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--r-sm);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.bnav.active { color: var(--emerald); }
.bnav:hover { color: var(--text-2); }
.bnav.active:hover { color: var(--emerald); }
.bnav svg { width: 22px; height: 22px; }

/* ═══════ CONTAINER ═══════ */
.container,
.content {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════ PAGE TITLE ═══════ */
.page-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: 20px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-3);
    margin-top: 4px;
}

/* ═══════ DATE NAVIGATION ═══════ */
.date-nav { padding-top: 16px; }

.date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.date-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.date-arrow:hover { box-shadow: var(--shadow-md); color: var(--text); }
.date-arrow:disabled, .date-arrow.disabled { opacity: 0.3; cursor: default; box-shadow: var(--shadow-xs); pointer-events: none; }

.date-center { text-align: center; flex: 1; }

.date-main {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.date-sub {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 2px;
}

.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    margin-right: 4px;
    position: relative;
    top: -1px;
}

/* ═══════ ALTILI GANYAN HERO ═══════ */
.altili-section { margin-top: 16px; }

.altili-card {
    background: linear-gradient(145deg, #FFFDF5, #FEF3C7, #FDE68A);
    border: 1px solid #FCD34D;
    border-radius: var(--r-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.altili-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(251,191,36,0.25), transparent 70%);
    pointer-events: none;
}

.altili-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #92400E;
    background: rgba(146,64,14,0.1);
    padding: 4px 10px;
    border-radius: var(--r-full);
}

.altili-track-info {
    font-size: 13px;
    color: #78350F;
    margin-top: 10px;
    font-weight: 500;
}

.altili-grid {
    margin-top: 16px;
    background: var(--white);
    border-radius: var(--r-md);
    border: 1px solid rgba(252,211,77,0.5);
    overflow: hidden;
}

.altili-row {
    display: grid;
    grid-template-columns: 72px repeat(6, 1fr);
    align-items: center;
}

.altili-row + .altili-row { border-top: 1px solid rgba(252,211,77,0.3); }

.altili-row-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #92400E;
    opacity: 0.6;
    padding: 0 12px;
}

.altili-cell { text-align: center; padding: 8px 4px; }

.altili-row-races .altili-cell {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: #92400E;
    opacity: 0.6;
}

.altili-row-winners .altili-cell {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: #78350F;
    padding: 10px 4px;
}

.altili-payout {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.altili-amount {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: #78350F;
    letter-spacing: -1px;
}

.altili-winners {
    font-size: 13px;
    font-weight: 600;
    color: #065F46;
    background: rgba(6,95,70,0.1);
    padding: 4px 10px;
    border-radius: var(--r-full);
}

.altili-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 18px;
    background: #78350F;
    color: #FEF3C7;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--r-full);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.altili-cta:hover { background: #92400E; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(120,53,15,0.2); }

/* ═══════ CITY TABS ═══════ */
.tabs-section { margin-top: 18px; }

.tabs-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}

.tabs-row::-webkit-scrollbar { display: none; }

.tab {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: var(--r-full);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text-3);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.tab:hover { border-color: var(--text-4); color: var(--text-2); }

.tab.active { background: var(--text); border-color: var(--text); color: var(--white); }

.tab .cnt {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    background: var(--border-light);
    padding: 1px 6px;
    border-radius: var(--r-full);
    color: var(--text-4);
}

.tab.active .cnt { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }

/* ═══════ TRACK SECTION ═══════ */
.track { margin-top: 20px; }
.track.hidden { display: none; }

.track-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.track-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-dot { width: 8px; height: 8px; border-radius: 50%; }
.track-dot.green { background: var(--emerald); }
.track-dot.blue { background: #3B82F6; }

.track-info {
    font-size: 12px;
    color: var(--text-4);
    display: flex;
    gap: 8px;
}

.done-badge {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--emerald);
    background: var(--emerald-50);
    padding: 3px 8px;
    border-radius: var(--r-full);
}

/* ═══════ RACE CARDS ═══════ */
.race {
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.race:hover { box-shadow: var(--shadow-md); }

.race-head {
    padding: 16px 18px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.race-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.race-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-2);
}

.race-meta { flex: 1; min-width: 0; }

.race-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.race-time {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.race-type {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-3);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--r-full);
}

.leg-pill {
    font-size: 10px;
    font-weight: 700;
    color: #92400E;
    background: var(--gold-light);
    padding: 2px 8px;
    border-radius: var(--r-full);
}

.race-specs { font-size: 12px; color: var(--text-4); margin-top: 2px; }

.chevron-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    color: var(--text-4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

.race.open .chevron-btn { transform: rotate(180deg); background: var(--text); color: var(--white); }

/* ─── Top 3 ─── */
.top3 {
    margin-top: 12px;
    background: var(--bg);
    border-radius: var(--r-md);
    overflow: hidden;
}

.top3-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
}

.top3-row + .top3-row { border-top: 1px solid var(--border-light); }

.pos-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.pos-circle.g { background: linear-gradient(135deg, #FBBF24, #D97706); color: white; }
.pos-circle.s { background: #94A3B8; color: white; }
.pos-circle.b { background: #EA580C; color: white; }
.pos-circle.x { background: var(--border-light); color: var(--text-4); }

.top3-horse { flex: 1; min-width: 0; }

.top3-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top3-no { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); margin-right: 3px; }
.top3-jockey { font-size: 11px; color: var(--text-4); margin-top: 1px; }

.top3-odds {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-2);
    flex-shrink: 0;
}

.top3-row:first-child .top3-odds { color: var(--gold); }

/* ─── Expand trigger ─── */
.expand-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-4);
    cursor: pointer;
    transition: color 0.15s;
    border-top: 1px solid var(--border-light);
    -webkit-tap-highlight-color: transparent;
}

.expand-trigger:hover { color: var(--text-2); }
.race.open .expand-trigger .show-text { display: none; }
.race:not(.open) .expand-trigger .hide-text { display: none; }

/* ─── Expanded details ─── */
.race-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.race.open .race-detail { max-height: 1000px; }

.detail-inner { padding: 0 18px 18px; }

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Visible thin scrollbar */
.table-scroll::-webkit-scrollbar { height: 4px; }
.table-scroll::-webkit-scrollbar-track { background: var(--border-light); border-radius: 4px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--emerald); border-radius: 4px; }
.table-scroll { scrollbar-width: thin; scrollbar-color: var(--emerald) var(--border-light); }

/* Right fade gradient hint */
.table-scroll-wrap {
    position: relative;
}

.table-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--white));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 2;
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
}

.table-scroll-wrap.scrolled::after { opacity: 0; }

/* First-time nudge animation */
@keyframes scrollHint {
    0% { transform: translateX(0); }
    30% { transform: translateX(-24px); }
    60% { transform: translateX(0); }
    100% { transform: translateX(0); }
}

.table-scroll.hint-active table {
    animation: scrollHint 1s ease 0.5s 1;
}

.full-table { width: 100%; border-collapse: collapse; min-width: 500px; }

.full-table th {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-4);
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1.5px solid var(--border);
}

.full-table th:last-child, .full-table td:last-child { text-align: right; }

.full-table td {
    padding: 9px 6px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.full-table tr:last-child td { border-bottom: none; }
.td-horse { font-weight: 600; }
.td-no { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); }
.td-jockey { color: var(--text-3); font-size: 12px; }
.td-kg { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); }
.td-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.td-odds { font-family: var(--font-mono); font-weight: 600; }
.td-odds.winner { color: var(--gold); }

/* ─── Payouts ─── */
.payouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.pay {
    background: var(--bg);
    border-radius: var(--r-md);
    padding: 12px;
}

.pay-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-4);
}

.pay-val {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}

.pay-combo { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); margin-top: 2px; }

/* ═══════ CTA BANNER ═══════ */
.cta-section { margin-top: 24px; }

.cta-card {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    border-radius: var(--r-lg);
    padding: 28px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
    pointer-events: none;
}

.cta-eyebrow {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    position: relative;
}

.cta-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: white;
    margin-top: 6px;
    letter-spacing: -0.3px;
    position: relative;
}

.cta-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    position: relative;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 24px;
    background: white;
    color: var(--emerald-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--r-full);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

/* ═══════ SEO + FOOTER ═══════ */
.seo-section { margin-top: 24px; }

.seo-box {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
}

.seo-box h2 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.seo-box p { font-size: 13px; color: var(--text-3); line-height: 1.7; }
.seo-box a { color: var(--emerald); text-decoration: none; font-weight: 600; }

.footer {
    max-width: 560px;
    margin: 24px auto 0;
    padding: 20px 20px 32px;
    text-align: center;
}

.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { font-size: 13px; color: var(--text-4); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--emerald); }
.footer-copy { font-size: 12px; color: var(--text-5); }
.footer-copy a { color: var(--emerald); text-decoration: none; font-weight: 600; }

/* ═══════ CALENDAR (Archive) ═══════ */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.cal-nav-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
}

.cal-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.cal-arrow:hover { border-color: var(--text-4); color: var(--text); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 14px;
}

.cal-head {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    text-align: center;
    padding: 8px 0;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--white);
    cursor: default;
    position: relative;
    gap: 3px;
    text-decoration: none;
}

.cal-day.empty { background: transparent; }

.cal-day.has-race {
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.15s;
}

.cal-day.has-race:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.cal-day.today {
    background: var(--emerald);
    color: white;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

.cal-day.today .cal-dots .dot { background: rgba(255,255,255,0.6); }

.cal-day.no-race { color: var(--text-5); background: var(--border-light); }

.cal-dots {
    display: flex;
    gap: 3px;
}

.cal-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--emerald);
}

.cal-dots .dot.blue { background: #3B82F6; }
.cal-dots .dot.orange { background: #F59E0B; }
.cal-dots .dot.purple { background: #8B5CF6; }
.cal-dots .dot.red { background: #EF4444; }
.cal-dots .dot.teal { background: #14B8A6; }
.cal-dots .dot.pink { background: #EC4899; }
.cal-dots .dot.yellow { background: #EAB308; }
.cal-dots .dot.brown { background: #A16207; }

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.green { background: var(--emerald); }
.legend-dot.blue { background: #3B82F6; }
.legend-dot.orange { background: #F59E0B; }
.legend-dot.purple { background: #8B5CF6; }
.legend-dot.red { background: #EF4444; }
.legend-dot.teal { background: #14B8A6; }
.legend-dot.pink { background: #EC4899; }
.legend-dot.yellow { background: #EAB308; }
.legend-dot.brown { background: #A16207; }

/* ═══════ HISTORY TABLE (Altili) ═══════ */
.history-card {
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 16px;
}

.history-card-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    padding: 16px 18px 0;
    color: var(--text-2);
}

.history-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.history-row + .history-row { border-top: 1px solid var(--border-light); }
.history-row:hover { background: var(--bg); }

.history-date {
    flex-shrink: 0;
    text-align: center;
    width: 44px;
}

.history-date .d {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.history-date .m {
    font-size: 10px;
    color: var(--text-4);
    font-weight: 600;
    text-transform: uppercase;
}

.history-info { flex: 1; min-width: 0; }

.history-track {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}

.history-combo {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-top: 2px;
}

.history-amount {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--gold);
    flex-shrink: 0;
}

.history-amount.devir {
    font-size: 12px;
    color: var(--text-4);
    font-weight: 600;
}

/* ═══════ STAT CARDS ═══════ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow-xs);
}

.stat-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-4);
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    margin-top: 6px;
    color: var(--text);
}

.stat-note { font-size: 11px; color: var(--text-4); margin-top: 2px; }

/* ═══════ INFO CARD ═══════ */
.info-card {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.info-item-label {
    font-size: 11px;
    color: var(--text-4);
    font-weight: 600;
}

.info-item-val {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

/* ═══════ PROGRAM CARDS ═══════ */
.prog-card {
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 12px;
    overflow: hidden;
}

.prog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
}

.prog-track {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prog-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-4);
}

.prog-race {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    gap: 10px;
    font-size: 13px;
}

.prog-race + .prog-race { border-top: 1px solid var(--border-light); }

.prog-race-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    flex-shrink: 0;
}

.prog-race-time {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    width: 40px;
    flex-shrink: 0;
}

.prog-race-type { color: var(--text-3); font-size: 12px; }
.prog-race-dist { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); margin-left: auto; flex-shrink: 0; }

/* ═══════ SECTION LABEL ═══════ */
.section-label {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-2);
    margin-top: 24px;
    margin-bottom: 10px;
}

/* ═══════ RESPONSIVE ═══════ */
@media (min-width: 640px) {
    .container, .content, .footer { max-width: 640px; }
    .altili-amount { font-size: 32px; }
}

@media (min-width: 768px) {
    /* Show desktop header nav */
    .header-nav { display: flex; }
    .header-inner { max-width: 960px; }

    /* Hide mobile-only elements */
    .mobile-only { display: none !important; }
    .desktop-only { display: flex; }

    /* Hide bottom nav on desktop */
    .bottom-nav { display: none; }

    /* No bottom padding needed on desktop */
    body { padding-bottom: 0; }

    /* Wider containers on desktop */
    .container, .content, .footer { max-width: 800px; }

    /* No table scroll needed on desktop — fits naturally */
    .full-table { min-width: auto; }
    .table-scroll-wrap::after { display: none; }
    .table-scroll.hint-active table { animation: none; }
}

/* ═══════ ANIMATIONS ═══════ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.race { animation: slideUp 0.35s ease both; }
.track:first-of-type .race:nth-child(1) { animation-delay: 0.04s; }
.track:first-of-type .race:nth-child(2) { animation-delay: 0.08s; }
.track:first-of-type .race:nth-child(3) { animation-delay: 0.12s; }
.track:first-of-type .race:nth-child(4) { animation-delay: 0.16s; }
.track:first-of-type .race:nth-child(5) { animation-delay: 0.20s; }
.track:first-of-type .race:nth-child(6) { animation-delay: 0.24s; }
.track:first-of-type .race:nth-child(7) { animation-delay: 0.28s; }
.altili-card { animation: slideUp 0.4s ease both; }
.history-card { animation: slideUp 0.3s ease both; }
.stat-card { animation: slideUp 0.3s ease both; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
