/* ====================================================
   Matka Results — Frontend Styles
   Dark Theme + Glassmorphism + Premium Design
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* === Core Colors === */
    --bg-primary: #0a0a14;
    --bg-secondary: #0f0f1f;
    --bg-card: rgba(20, 20, 40, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* === Accent === */
    --gold: #e2b714;
    --gold-light: #f5d44a;
    --gold-glow: rgba(226, 183, 20, 0.15);
    --gold-glow-strong: rgba(226, 183, 20, 0.35);

    /* === Text === */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;

    /* === Status === */
    --green: #00e676;
    --red: #ff1744;
    --blue: #2979ff;
    --orange: #ff6d00;

    /* === Borders === */
    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(226, 183, 20, 0.2);

    /* === Sizing === */
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Animated Background === */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(226, 183, 20, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(41, 121, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(255, 23, 68, 0.03) 0%, transparent 50%);
    animation: meshFloat 20s ease-in-out infinite alternate;
}
@keyframes meshFloat {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* === Header === */
.site-header {
    position: relative;
    z-index: 10;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 20, 0.8);
}
.site-header .logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), var(--gold-light), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.site-header .live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--green);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* === Main Container === */
.main-container {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* === Date Strip === */
.date-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}
.date-strip .date-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
}

/* === Result Cards Grid === */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* === Result Card === */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(20px);
}
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), #ff6b35, var(--blue));
    opacity: 0.8;
}
.result-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-accent);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--gold-glow);
}

.result-card .card-header {
    padding: 16px 20px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.result-card .game-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.result-card .game-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.result-card .card-body {
    padding: 12px 20px 20px;
    text-align: center;
}
.result-card .result-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 4px;
    text-shadow: 0 0 20px var(--gold-glow-strong);
    padding: 16px 0;
    animation: resultGlow 3s ease-in-out infinite alternate;
}
@keyframes resultGlow {
    0% { text-shadow: 0 0 10px var(--gold-glow); }
    100% { text-shadow: 0 0 30px var(--gold-glow-strong), 0 0 60px rgba(226, 183, 20, 0.1); }
}

.result-card .result-waiting {
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 20px 0;
}
.result-card .result-waiting .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-card .card-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.result-card .source-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.source-verified {
    background: rgba(0, 230, 118, 0.1);
    color: var(--green);
    border: 1px solid rgba(0, 230, 118, 0.2);
}
.source-unverified {
    background: rgba(255, 109, 0, 0.1);
    color: var(--orange);
    border: 1px solid rgba(255, 109, 0, 0.2);
}

/* === Controls === */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.control-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Inter', sans-serif;
}
.control-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-glow);
}
.control-btn.active {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-glow);
}

/* === Anti-gravity Canvas === */
#antigravity-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

/* === Refresh indicator === */
.refresh-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1000;
    background: transparent;
}
.refresh-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--blue));
    width: 0%;
    transition: width 30s linear;
    border-radius: 0;
}
.refresh-bar.active .progress {
    width: 100%;
}

/* === Footer === */
.site-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 40px;
}

/* === Loading Skeleton === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Last updated === */
.last-updated {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .result-card .result-value {
        font-size: 1.8rem;
        letter-spacing: 3px;
    }
    .site-header .logo {
        font-size: 1.4rem;
    }
    .controls-bar {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    .result-card .result-value {
        font-size: 1.5rem;
    }
    .main-container {
        padding: 16px 10px;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 3px;
}
