/* Touchdowns.Live Critical CSS - CLS Optimization */

/* Override font-display for CLS optimization on this page only */
@font-face {
    font-family: 'Anton';
    src: url('/static/fonts/anton-regular.woff2') format('woff2'),
         url('/static/fonts/Anton-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: optional;
    size-adjust: 115%;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-var.woff2') format('woff2'),
         url('/static/fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: optional;
}

/* Reserve space for hero section to prevent CLS */
.controls-hero {
    min-height: 420px;
}

.hero-area {
    min-height: 380px;
}

/* Reserve space for week content to prevent shift when loading */
.week-content {
    min-height: 500px;
}

/* Skeleton loader for smooth transitions - only for loading placeholders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* Prevent skeleton class from affecting actual content */
.skeleton button,
.skeleton a,
.skeleton .tweet-button,
.skeleton .bluesky-button {
    height: auto !important;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Size-adjust for heading to match fallback fonts */
h1, .h1 {
    font-size-adjust: 0.5;
}

/* Reserve space for loading spinner areas */
#current-week-container,
[id^="week-"][id$="-container"] {
    min-height: 300px;
}

/* Prevent layout shift from dynamic TOC */
.toc-container {
    min-height: 150px;
}

/* Reserve fixed dimensions for game cards */
[data-game] {
    min-height: 120px;
}

/* Ensure buttons inside cards don't inherit skeleton heights */
[data-game] .tweet-button,
[data-game] .bluesky-button,
[data-touchdown-id] .tweet-button,
[data-touchdown-id] .bluesky-button {
    height: 36px !important;
    max-height: 36px !important;
}

/* Stable button dimensions */
.tweet-button,
.bluesky-button {
    width: 110px !important;
    height: 36px !important;
    flex-shrink: 0;
    min-height: 36px !important;
    max-height: 36px !important;
}

/* Feature grid stable dimensions */
.grid-cols-2 > div,
.md\:grid-cols-3 > div {
    min-height: 100px;
}

/* Week tabs stable height */
.week-tab {
    min-height: 48px;
}

/* Prevent shifts during image load */
img {
    display: block;
}

/* Stable status indicator */
#live-updates-indicator {
    min-width: 150px;
    height: 24px;
}

/* Prevent shift from controls */
.flex.items-center.gap-6 {
    min-height: 60px;
}

/* Stable game header */
.game-header {
    min-height: 80px;
}

/* Loading state improvements */
.animate-spin {
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: #e0e0e0;
    }
    
    .dark .skeleton {
        background: #4b5563;
    }
}

