/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0a0a14;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(0, 100, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 255, 100, 0.05) 0%, transparent 60%);
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Game Container - Arcade Cabinet Feel */
#game-container {
    position: relative;
    width: 600px;
    padding: 20px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 3px solid #333;
    border-radius: 16px;
    box-shadow:
        0 0 30px rgba(0, 255, 0, 0.15),
        0 0 60px rgba(0, 255, 0, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.9),
        0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Heads Up Display */
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 4px;
    color: #0f0;
    font-size: 13px;
    text-shadow: 0 0 8px #0f0, 0 0 2px #0f0;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#lives-display {
    font-size: 16px;
    letter-spacing: 4px;
}

#difficulty-display {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid currentColor;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-easy {
    color: #0f0;
    border-color: #0f0;
    text-shadow: 0 0 6px #0f0;
}

.difficulty-medium {
    color: #ffcc00;
    border-color: #ffcc00;
    text-shadow: 0 0 6px #ffcc00;
}

.difficulty-hard {
    color: #ff6600;
    border-color: #ff6600;
    text-shadow: 0 0 6px #ff6600;
}

.difficulty-expert {
    color: #ff003c;
    border-color: #ff003c;
    text-shadow: 0 0 6px #ff003c;
    animation: expertPulse 0.5s ease infinite;
}

@keyframes expertPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Canvas Wrapper with CRT */
.canvas-wrapper {
    position: relative;
    width: 560px;
    height: 640px;
    overflow: hidden;
    border: 2px solid #444;
    border-radius: 6px;
    background-color: #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
}

/* CRT Overlay */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.65;
    border-radius: 6px;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.overlay.hidden {
    display: none;
    opacity: 0;
}

.overlay.active {
    display: flex;
    opacity: 1;
}

.overlay h1 {
    color: #ffcc00;
    text-shadow:
        4px 4px 0 #cc0000,
        0 0 20px rgba(255, 204, 0, 0.4);
    font-size: 42px;
    margin-bottom: 24px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        text-shadow: 4px 4px 0 #cc0000, 0 0 20px rgba(255, 204, 0, 0.3);
    }

    50% {
        text-shadow: 4px 4px 0 #cc0000, 0 0 40px rgba(255, 204, 0, 0.6), 0 0 60px rgba(255, 204, 0, 0.2);
    }
}

.overlay p {
    font-size: 12px;
    line-height: 2;
    margin-bottom: 10px;
    color: #ccc;
}

/* Leaderboard */
.leaderboard {
    margin-top: 16px;
    width: 85%;
    max-width: 400px;
}

.leaderboard h2 {
    color: #ffcc00;
    font-size: 14px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.leaderboard-list {
    list-style: none;
    padding: 0;
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    padding: 4px 0;
    color: #aaa;
    border-bottom: 1px solid #222;
}

.leaderboard-list li:first-child {
    color: #ffd700;
}

.leaderboard-list li:nth-child(2) {
    color: #c0c0c0;
}

.leaderboard-list li:nth-child(3) {
    color: #cd7f32;
}

/* Initials input */
.initials-prompt {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.initials-prompt.active {
    display: flex;
}

.initials-prompt input {
    background: #111;
    border: 2px solid #ffcc00;
    color: #ffcc00;
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    width: 120px;
    text-align: center;
    padding: 8px;
    text-transform: uppercase;
    letter-spacing: 8px;
    outline: none;
}

.initials-prompt input:focus {
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.4);
}

.initials-prompt p {
    font-size: 10px;
    color: #aaa;
}

/* Utilities */
.text-red {
    color: #ff003c !important;
    text-shadow: 4px 4px 0 #880000, 0 0 10px rgba(255, 0, 60, 0.4) !important;
}

.mt-2 {
    margin-top: 16px;
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* Skyrim Easter Egg */
#skyrim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

#skyrim-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#skyrim-video {
    max-width: 55%;
    max-height: 80vh;
    border: 2px solid #333;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Credits Column (Left) */
.skyrim-credits {
    width: 200px;
    height: 80vh;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.credits-scroll {
    position: absolute;
    top: 100%;
    width: 100%;
    text-align: center;
    animation: scrollCredits 40s linear infinite;
    font-family: 'Press Start 2P', monospace;
}

#skyrim-overlay.active .credits-scroll {
    animation-play-state: running;
}

.credits-scroll h2 {
    color: #ffcc00;
    font-size: 11px;
    margin-bottom: 20px;
    line-height: 1.8;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.credits-subtitle {
    color: #888;
    font-size: 8px;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.credits-role {
    color: #666;
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 24px;
    margin-bottom: 6px;
}

.credits-name {
    color: #fff;
    font-size: 9px;
    margin-bottom: 4px;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.credits-quote {
    color: #aaa;
    font-size: 6px;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.6;
    padding: 0 8px;
}

@keyframes scrollCredits {
    0% {
        top: 100%;
    }

    100% {
        top: -250%;
    }
}

/* Dead Frog Column (Right) */
.skyrim-frog {
    width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#dead-frog-img {
    width: 160px;
    image-rendering: pixelated;
    filter: grayscale(1);
    animation: frogFloat 3s ease-in-out infinite;
}

.rip-text {
    font-family: 'Press Start 2P', monospace;
    color: #ff003c;
    font-size: 18px;
    margin-top: 16px;
    text-shadow: 0 0 15px rgba(255, 0, 60, 0.6);
    animation: blinker 1.5s ease-in-out infinite;
    letter-spacing: 8px;
}

@keyframes frogFloat {

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

    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

/* Glitch effect for returning from Skyrim */
.glitch-return {
    animation: glitchReturn 0.6s steps(4) 3;
}

@keyframes glitchReturn {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg) saturate(1);
    }

    10% {
        transform: translate(-8px, 4px) skewX(2deg);
        filter: hue-rotate(90deg) saturate(3);
    }

    20% {
        transform: translate(6px, -3px) skewX(-1deg);
        filter: hue-rotate(180deg) saturate(0.5);
    }

    30% {
        transform: translate(-4px, 6px);
        filter: hue-rotate(270deg) saturate(2);
    }

    40% {
        transform: translate(3px, -5px) skewX(3deg);
        filter: hue-rotate(45deg) saturate(4) brightness(1.5);
    }

    50% {
        transform: translate(-6px, 2px);
        filter: hue-rotate(0deg) saturate(1);
    }

    60% {
        transform: translate(5px, -4px) skewX(-2deg);
        filter: hue-rotate(120deg) saturate(2);
    }

    70% {
        transform: translate(-3px, 5px);
        filter: hue-rotate(200deg) saturate(0.3);
    }

    80% {
        transform: translate(4px, -2px) skewX(1deg);
        filter: hue-rotate(300deg) saturate(3) brightness(1.3);
    }

    90% {
        transform: translate(-2px, 3px);
        filter: hue-rotate(60deg) saturate(1.5);
    }

    100% {
        transform: translate(0);
        filter: hue-rotate(0deg) saturate(1);
    }
}