html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Loading screen - Dark theme (default) */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020617; /* slate-950 - matches DartsColors.Background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 32px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(248, 250, 252, 0.1); /* slate-50 with opacity */
    border-top-color: #F8FAFC; /* slate-50 - matches OnBackground */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: #F8FAFC; /* slate-50 - matches OnBackground */
    font-weight: 500;
}

/* Loading screen - Light theme (system preference) */
@media (prefers-color-scheme: light) {
    #loading-screen {
        background: #E2E8F0; /* slate-200 - matches DartsColorsLight.Background */
    }

    .loading-spinner {
        border-color: rgba(15, 23, 42, 0.1); /* slate-900 with opacity */
        border-top-color: #0F172A; /* slate-900 - matches OnBackground light */
    }

    .loading-text {
        color: #0F172A; /* slate-900 - matches OnBackground light */
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Canvas container - will be resized when banner is shown */
#canvas-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#canvas-container.with-banner {
    height: calc(100% - 66px) !important;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   Static Content (SEO / AdSense crawler page)
   ============================================ */

#static-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    z-index: 1; /* below loading screen (9999), above nothing */
    background: #020617;
    color: #F8FAFC;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Hero */
.sc-hero {
    text-align: center;
    padding: 64px 24px 48px;
    max-width: 720px;
    margin: 0 auto;
}

.sc-hero img {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.sc-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #F8FAFC;
}

.sc-hero .sc-tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: #94A3B8;
    margin: 0 0 16px;
}

.sc-hero .sc-description {
    font-size: 1rem;
    color: #CBD5E1;
    margin: 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* Section headings */
.sc-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

.sc-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #F8FAFC;
    margin: 0 0 32px;
}

/* Games grid */
.sc-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sc-game-card {
    background: #0F172A;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 20px;
}

.sc-game-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #F8FAFC;
    margin: 0 0 8px;
}

.sc-game-card p {
    font-size: 0.875rem;
    color: #94A3B8;
    margin: 0;
}

/* Features grid */
.sc-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sc-feature {
    background: #0F172A;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 20px;
}

.sc-feature h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #F8FAFC;
    margin: 0 0 6px;
}

.sc-feature p {
    font-size: 0.875rem;
    color: #94A3B8;
    margin: 0;
}

/* How to play steps */
.sc-steps {
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    counter-reset: steps;
}

.sc-steps li {
    counter-increment: steps;
    position: relative;
    padding: 0 0 24px 56px;
    font-size: 1rem;
    color: #CBD5E1;
}

.sc-steps li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: #1E293B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #F8FAFC;
}

.sc-steps li strong {
    color: #F8FAFC;
}

/* CTA section */
.sc-cta {
    text-align: center;
    padding: 48px 24px;
    max-width: 560px;
    margin: 0 auto;
}

.sc-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #F8FAFC;
    margin: 0 0 12px;
}

.sc-cta p {
    font-size: 0.9375rem;
    color: #94A3B8;
    margin: 0;
}

/* Footer */
.sc-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.8125rem;
    color: #64748B;
    border-top: 1px solid #1E293B;
}

/* Light theme overrides */
@media (prefers-color-scheme: light) {
    #static-content {
        background: #E2E8F0;
        color: #0F172A;
    }

    .sc-hero h1 { color: #0F172A; }
    .sc-hero .sc-tagline { color: #475569; }
    .sc-hero .sc-description { color: #334155; }

    .sc-section h2 { color: #0F172A; }

    .sc-game-card,
    .sc-feature {
        background: #F8FAFC;
        border-color: #CBD5E1;
    }

    .sc-game-card h3,
    .sc-feature h3 { color: #0F172A; }

    .sc-game-card p,
    .sc-feature p { color: #475569; }

    .sc-steps li { color: #334155; }
    .sc-steps li::before {
        background: #CBD5E1;
        color: #0F172A;
    }
    .sc-steps li strong { color: #0F172A; }

    .sc-cta h2 { color: #0F172A; }
    .sc-cta p { color: #475569; }

    .sc-footer {
        color: #64748B;
        border-top-color: #CBD5E1;
    }
}

/* Responsive: small screens */
@media (max-width: 480px) {
    .sc-hero { padding: 40px 16px 32px; }
    .sc-hero h1 { font-size: 2rem; }
    .sc-hero .sc-tagline { font-size: 1.1rem; }
    .sc-section { padding: 0 16px 36px; }
    .sc-section h2 { font-size: 1.4rem; }
    .sc-games-grid,
    .sc-features-grid {
        grid-template-columns: 1fr;
    }
}

/* Ad banner at bottom */
#ad-banner-frame {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 66px;
    border: none;
    display: none;
}
