/* =====================================================
   NEBRASKETBALL RETRO INTRO ANIMATION
   16-bit style inspired by early 90s graphics & Pokemon
   ===================================================== */

/* CSS Custom Properties - Retro Theme */
:root {
    /* Nebraska Colors - Retro Style */
    --retro-scarlet: #d00000;
    --retro-cream: #f5e8c8;
    --retro-dark: #1a1a2e;
    --retro-light: #e8e0d0;

    /* CRT TV Colors */
    --crt-bezel: #2a2a2a;
    --crt-inner-bezel: #1a1a1a;
    --crt-screen-glow: rgba(100, 200, 100, 0.05);

    /* Pokemon Battle Colors */
    --battle-bg-grass: #90c868;
    --battle-bg-sky: #88c8e8;
    --battle-ui-dark: #303030;
    --battle-ui-light: #f8f8f8;
    --battle-hp-green: #58a858;
    --battle-hp-yellow: #f8c028;
    --battle-hp-red: #e85858;
}

/* =====================================================
   INTRO OVERLAY CONTAINER
   ===================================================== */
/* =====================================================
   INTRO OVERLAY CONTAINER
   ===================================================== */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    /* Moody basketball court background */
    background:
        /* Dark overlay */
        linear-gradient(180deg, rgba(10, 5, 5, 0.95) 0%, rgba(20, 10, 10, 0.9) 100%),
        /* Subtle court lines */
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 48%,
            rgba(208, 0, 0, 0.03) 48%,
            rgba(208, 0, 0, 0.03) 52%,
            transparent 52%),
        /* Center circle hint */
        radial-gradient(circle at 50% 60%, rgba(208, 0, 0, 0.08) 0%, transparent 25%),
        /* Court wood grain texture */
        repeating-linear-gradient(0deg,
            rgba(139, 90, 43, 0.03) 0px,
            rgba(139, 90, 43, 0.03) 2px,
            transparent 2px,
            transparent 8px),
        /* Base dark */
        #0a0505;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-overlay.instant-hide {
    display: none;
}

/* Spotlight Logo Above TV */
.intro-logo {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(24px, 6vw, 48px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow:
        0 0 40px rgba(208, 0, 0, 0.8),
        0 0 80px rgba(208, 0, 0, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.8);
    animation: logo-glow 2s ease-in-out infinite alternate;
    position: relative;
}

.intro-logo::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d00000, transparent);
}

@keyframes logo-glow {
    0% {
        text-shadow: 0 0 40px rgba(208, 0, 0, 0.8), 0 0 80px rgba(208, 0, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.8);
    }

    100% {
        text-shadow: 0 0 60px rgba(208, 0, 0, 1), 0 0 120px rgba(208, 0, 0, 0.6), 0 4px 20px rgba(0, 0, 0, 0.8);
    }
}

/* Skip Button */
.skip-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(208, 0, 0, 0.6);
    color: var(--retro-cream);
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    border-radius: 4px;
}

.skip-button:hover {
    background: #d00000;
    border-color: #d00000;
    color: white;
    transform: scale(1.05);
}

.skip-button:active {
    transform: scale(0.95);
}

/* =====================================================
   VINTAGE CRT TV FRAME
   ===================================================== */
.crt-tv-container {
    position: relative;
    width: 90vmin;
    max-width: 550px;
    aspect-ratio: 4/3;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Outer TV Cabinet - Wood Grain Look */
.crt-frame {
    position: relative;
    width: 100%;
    height: 100%;
    /* Wood grain cabinet look */
    background:
        linear-gradient(135deg, #5a3d2b 0%, #3d2817 50%, #2a1a0f 100%);
    border-radius: 12px 12px 8px 8px;
    padding: 18px 20px 28px 20px;
    box-shadow:
        /* Inner bevel */
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 8px rgba(0, 0, 0, 0.4),
        /* Outer shadows */
        0 8px 32px rgba(0, 0, 0, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Wood grain texture overlay */
.crt-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.1) 3px,
            rgba(0, 0, 0, 0.1) 4px);
    pointer-events: none;
    z-index: 0;
}

/* Control knobs/buttons area at bottom */
.crt-frame::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    width: 60px;
    height: 10px;
    background:
        radial-gradient(circle at 15px 5px, #2a2a2a 4px, transparent 4px),
        radial-gradient(circle at 35px 5px, #2a2a2a 4px, transparent 4px),
        radial-gradient(circle at 50px 5px, #22c55e 3px, transparent 3px);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Inner bezel around screen */
.crt-inner-bezel {
    position: absolute;
    inset: 14px 16px 24px 16px;
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.9),
        inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.crt-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        inset 0 0 50px rgba(0, 0, 0, 0.9),
        inset 0 0 2px rgba(255, 255, 255, 0.1);
}

/* CRT Scanlines */
.crt-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0.15) 4px);
    pointer-events: none;
    z-index: 100;
}

/* CRT Screen Curve Effect */
.crt-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            transparent 60%,
            rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 101;
}

/* Screen Content */
.screen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   ESPN ANCHOR DESK SCENE
   ===================================================== */
.espn-scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
}

.espn-scene.active {
    opacity: 1;
}

/* ESPN Studio Background */
.espn-studio {
    flex: 1;
    position: relative;
    background: linear-gradient(180deg,
            #1a1a3a 0%,
            #2a2a4a 40%,
            #3a3a5a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

/* ESPN Logo Area */
.espn-logo-area {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #cc0000;
    padding: 4px 16px;
    border-radius: 2px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: white;
    letter-spacing: 2px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Anchor Desk */
.anchor-desk {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(180deg, #4a3020 0%, #2a1810 100%);
    display: flex;
    justify-content: center;
    gap: 20%;
    padding-top: 10px;
}

.anchor-desk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b6914, #ffd700, #8b6914);
}

/* Anchors */
.anchor {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(-30%);
}

.anchor-body {
    width: 40px;
    height: 50px;
    position: relative;
}

/* Pixel Art Anchor Head */
.anchor-head {
    width: 32px;
    height: 32px;
    background: #e8c8a0;
    border-radius: 4px;
    position: relative;
    margin: 0 auto 4px;
    image-rendering: pixelated;
}

.anchor-head::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 6px;
    height: 6px;
    background: #2a2a2a;
    border-radius: 50%;
    box-shadow: 14px 0 0 #2a2a2a;
}

.anchor-head::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: #8b4040;
    border-radius: 2px;
}

/* Hair variations */
.anchor-1 .anchor-head {
    box-shadow: 0 -8px 0 #4a3020, -2px -6px 0 #4a3020, 2px -6px 0 #4a3020;
}

.anchor-2 .anchor-head {
    box-shadow: 0 -8px 0 #2a2a2a, -4px -6px 0 #2a2a2a, 4px -6px 0 #2a2a2a;
}

/* Anchor Suit */
.anchor-torso {
    width: 44px;
    height: 30px;
    background: linear-gradient(180deg, #1a1a3a 0%, #0a0a2a 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
}

.anchor-torso::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 20px;
    background: #cc0000;
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #1a1a1a;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    line-height: 1.8;
    text-align: center;
    max-width: 85%;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.speech-bubble.visible {
    opacity: 1;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: white;
}

.speech-bubble.left::after {
    left: 30%;
}

.speech-bubble.right::after {
    left: 70%;
}

/* =====================================================
   TRANSITION SCREEN
   ===================================================== */
.transition-scene {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 60;
}

.transition-scene.active {
    opacity: 1;
}

.transition-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: var(--retro-cream);
    text-align: center;
    line-height: 2;
    text-shadow: 2px 2px 0 var(--retro-scarlet);
    animation: text-flicker 0.1s infinite alternate;
}

@keyframes text-flicker {
    0% {
        opacity: 0.95;
    }

    100% {
        opacity: 1;
    }
}

/* =====================================================
   POKEMON BATTLE SCENE
   ===================================================== */
.battle-scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
    background: linear-gradient(180deg,
            var(--battle-bg-sky) 0%,
            var(--battle-bg-sky) 50%,
            var(--battle-bg-grass) 50%,
            var(--battle-bg-grass) 100%);
}

.battle-scene.active {
    opacity: 1;
}

/* Battle Arena */
.battle-arena {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 15% 10% 20%;
}

/* Score Box - Pokemon Style HP Bar Area - LARGER FOR MOBILE */
.score-box {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    background: linear-gradient(180deg, #f0e8d8 0%, #d8d0c0 100%);
    border: 3px solid #303030;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.score-teams {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.score-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #a0a0a0;
}

.team-name {
    font-weight: bold;
    color: #303030;
    font-size: 11px;
}

.team-score {
    color: #303030;
    min-width: 32px;
    text-align: right;
    font-size: 12px;
    font-weight: bold;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.score-row.neb .team-name {
    color: var(--retro-scarlet);
}

.score-row.neb .team-score {
    color: var(--retro-scarlet);
}

.score-flash {
    animation: score-flash 0.15s ease-in-out 4;
}

@keyframes score-flash {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
        color: #ffd700;
    }
}

/* Winner flash animation */
.winner-flash {
    animation: winner-flash 0.2s ease-in-out 5;
}

@keyframes winner-flash {

    0%,
    100% {
        background: linear-gradient(180deg, #f0e8d8 0%, #d8d0c0 100%);
    }

    50% {
        background: linear-gradient(180deg, #ffffa0 0%, #ffd700 100%);
    }
}

/* Record Display - LARGER */
.record-display {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--retro-scarlet);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'Press Start 2P', monospace;
    text-align: center;
    min-width: 80px;
}

.record-label {
    color: #aaa;
    font-size: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.record-value {
    color: #22c55e;
    font-weight: bold;
    font-size: 12px;
}

/* Player Sprites - LARGER */
.player-sprite {
    position: absolute;
    width: 100px;
    height: 100px;
    image-rendering: pixelated;
    transition: transform 0.3s ease-out;
}

.nebraska-player {
    left: 5%;
    bottom: 12%;
    transform: translateX(-150%);
}

.nebraska-player.slide-in {
    transform: translateX(0);
}

.opponent-player {
    right: 5%;
    bottom: 18%;
    transform: translateX(150%);
}

.opponent-player.slide-in {
    transform: translateX(0);
}

.opponent-player.defeated {
    animation: defeat-animation 0.6s ease-in forwards;
}

@keyframes defeat-animation {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    30% {
        opacity: 0.8;
        transform: translateY(-15px);
    }

    100% {
        opacity: 0;
        transform: translateY(120px);
    }
}

/* Pixel Art Player - Nebraska - SCALED UP */
.pixel-player {
    width: 100%;
    height: 100%;
    position: relative;
    transform: scale(1.25);
    transform-origin: center bottom;
}

/* Nebraska Player Body Parts - Larger */
.neb-hat {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 15px;
    background: var(--retro-scarlet);
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.neb-hat::before {
    content: 'N';
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.neb-hat::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    background: #800000;
    border-radius: 2px;
}

.neb-head {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    background: #e8c8a0;
    border-radius: 6px;
}

.neb-head::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 5px;
    width: 8px;
    height: 8px;
    background: #2a2a2a;
    border-radius: 50%;
    box-shadow: 16px 0 0 #2a2a2a;
}

.neb-head::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.neb-jersey {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 30px;
    background: var(--retro-cream);
    border: 3px solid var(--retro-scarlet);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.neb-jersey::before {
    content: '15';
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--retro-scarlet);
    font-weight: bold;
}

.neb-shorts {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 14px;
    background: var(--retro-scarlet);
    border-radius: 0 0 6px 6px;
}

.neb-legs {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 10px;
    display: flex;
    justify-content: space-between;
}

.neb-legs::before,
.neb-legs::after {
    content: '';
    width: 10px;
    height: 100%;
    background: #e8c8a0;
    border-radius: 3px;
}

/* Generic Opponent Player */
.opponent-jersey {
    background: #888888;
    border-color: #666666;
}

.opponent-jersey::before {
    color: #666666;
}

/* Opponent color variations via inline styles */

/* Battle ground indicators */
.ground-indicator {
    position: absolute;
    bottom: 18%;
    width: 60px;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.ground-indicator.left {
    left: 8%;
}

.ground-indicator.right {
    right: 8%;
}

/* =====================================================
   VICTORY / CONFETTI SCENE
   ===================================================== */
.victory-scene {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            #1a0a1a 0%,
            #2a1a2a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 70;
}

.victory-scene.active {
    opacity: 1;
}

.victory-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    color: var(--retro-cream);
    text-align: center;
    line-height: 2.5;
    text-shadow:
        2px 2px 0 var(--retro-scarlet),
        4px 4px 0 rgba(0, 0, 0, 0.3);
    animation: victory-pulse 1s ease-in-out infinite;
}

@keyframes victory-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.victory-record {
    margin-top: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    color: #22c55e;
    text-shadow: 2px 2px 0 #0a4a0a;
}

/* Retro Confetti */
.retro-confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.retro-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    image-rendering: pixelated;
}

/* =====================================================
   LOADING / INITIAL STATE
   ===================================================== */
.loading-screen {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 80;
}

.loading-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--retro-cream);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 480px) {
    .crt-tv-container {
        width: 98vw;
        max-width: none;
    }

    .crt-frame {
        padding: 12px;
        border-radius: 12px;
    }

    .speech-bubble {
        font-size: 6px;
        padding: 8px 12px;
        max-width: 90%;
    }

    .espn-logo-area {
        font-size: 6px;
        padding: 3px 10px;
    }

    .transition-text {
        font-size: 10px;
        padding: 0 10px;
    }

    .score-box {
        font-size: 6px;
        padding: 6px;
        min-width: 50%;
    }

    .record-display {
        font-size: 6px;
        padding: 4px 6px;
    }

    .player-sprite {
        width: 60px;
        height: 60px;
    }

    .victory-text {
        font-size: 12px;
    }

    .victory-record {
        font-size: 18px;
    }

    .skip-button {
        bottom: 12px;
        right: 12px;
        padding: 8px 16px;
        font-size: 10px;
    }
}

@media (min-width: 768px) {
    .crt-tv-container {
        max-width: 700px;
    }

    .speech-bubble {
        font-size: 9px;
        padding: 14px 20px;
    }

    .score-box {
        font-size: 9px;
    }

    .player-sprite {
        width: 100px;
        height: 100px;
    }

    .transition-text {
        font-size: 18px;
    }
}

/* =====================================================
   DARK/LIGHT MODE COMPATIBILITY
   ===================================================== */
[data-theme="light"] .intro-overlay {
    /* Keep dark for authentic retro feel */
    background: var(--retro-dark);
}

/* =====================================================
   PIXEL ART ANIMATIONS
   ===================================================== */
.sprite-idle {
    animation: sprite-bounce 0.6s ease-in-out infinite;
}

@keyframes sprite-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.anchor.talking .anchor-head::after {
    animation: mouth-move 0.2s infinite alternate;
}

@keyframes mouth-move {
    0% {
        height: 4px;
    }

    100% {
        height: 6px;
        border-radius: 4px;
    }
}