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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #fff;
}

body.max-sass {
    background: linear-gradient(135deg, #2e0a1a 0%, #4e1b2d 50%, #2e0a1a 100%);
}

body.max-sass #header h1 {
    color: #FF6B6B;
    text-shadow: 3px 3px 0 #FFD700, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
#header {
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

#header h1 {
    font-size: clamp(12px, 2.5vw, 24px);
    color: #FFD700;
    text-shadow: 
        3px 3px 0 #FF6B00,
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff;
    animation: titlePulse 2s infinite;
    letter-spacing: 2px;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-family: 'VT323', monospace;
    font-size: clamp(12px, 2vw, 20px);
    color: #FF6B6B;
    margin-top: 10px;
    letter-spacing: 2px;
    font-style: italic;
}

/* Roast Ticker */
#roast-ticker {
    width: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    margin-top: 15px;
    border-top: 2px solid #FF6B6B;
    border-bottom: 2px solid #FF6B6B;
}

.ticker-content {
    display: flex;
    gap: 60px;
    animation: tickerScroll 30s linear infinite;
    white-space: nowrap;
}

.ticker-content span {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #FF6B6B;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.spotlight {
    position: absolute;
    width: 100px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(255, 107, 107, 0.3) 0%, transparent 70%);
    animation: spotlightMove 3s infinite ease-in-out;
}

.spotlight.left {
    left: 10%;
    top: -50px;
}

.spotlight.right {
    right: 10%;
    top: -50px;
    animation-delay: 1.5s;
}

@keyframes spotlightMove {
    0%, 100% { transform: rotate(-20deg); }
    50% { transform: rotate(20deg); }
}

/* Main Stage */
#main-stage {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Code Panel */
#code-panel {
    background: #0d0d0d;
    border: 3px solid #FF6B6B;
    border-radius: 10px;
    width: 340px;
    max-height: 700px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
}

.live-badge {
    color: #ff4444;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    animation: livePulse 1s infinite;
}

.live-badge.blink {
    opacity: 0.3;
}

@keyframes livePulse {
    0%, 100% { text-shadow: 0 0 10px #ff4444; }
    50% { text-shadow: 0 0 20px #ff4444, 0 0 30px #ff4444; }
}

.terminal-title {
    color: #FF6B6B;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    letter-spacing: 1px;
}

#code-display {
    padding: 15px;
    overflow-y: auto;
    max-height: 620px;
}

#code-content {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    line-height: 1.6;
    color: #00ff00;
    white-space: pre-wrap;
}

#code-content .tag { color: #ff6b6b; }
#code-content .attr { color: #ffd93d; }
#code-content .string { color: #6bcb77; }
#code-content .value { color: #4ecdc4; transition: all 0.2s; }
#code-content .comment { color: #666; font-style: italic; }
#code-content .roast-comment { color: #FF6B6B; font-style: italic; }
#code-content .roast-value { color: #FF6B6B; }
#code-content .highlight { background: rgba(255, 255, 0, 0.3); animation: highlightPulse 0.5s; }
#code-content .highlight-up { color: #4ecdc4; text-shadow: 0 0 10px #4ecdc4; }
#code-content .highlight-down { color: #ff6b6b; text-shadow: 0 0 10px #ff6b6b; }

@keyframes highlightPulse {
    0% { background: rgba(255, 255, 0, 0.8); }
    100% { background: rgba(255, 255, 0, 0.3); }
}

/* Game Wrapper */
#game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#roast-frame {
    border: 4px solid #FF6B6B;
    border-radius: 35px;
    padding: 5px;
    background: linear-gradient(45deg, #FF6B6B22, #FFD70022);
}

#tv-frame {
    background: #2a2a2a;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 8px #444,
        0 0 0 12px #222;
    position: relative;
}

#canvas {
    display: block;
    border-radius: 10px;
    cursor: pointer;
    image-rendering: pixelated;
}

#scanlines {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    border-radius: 10px;
}

#heckler-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 107, 107, 0.95);
    color: #fff;
    padding: 15px 25px;
    border-radius: 15px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    text-align: center;
    z-index: 50;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

#heckler-popup.show {
    opacity: 1;
    animation: hecklerBounce 0.3s ease-out;
}

@keyframes hecklerBounce {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

#score-display {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.score-label {
    font-size: 10px;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
}

#current-score {
    font-size: 48px;
    color: #fff;
    text-shadow: 
        3px 3px 0 #FFD700,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    transition: transform 0.1s;
}

#score-commentary {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #FF6B6B;
    margin-top: 5px;
}

/* Game Overlay */
#game-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#start-screen, #game-over-screen {
    text-align: center;
    pointer-events: auto;
}

.start-title {
    font-size: 20px;
    color: #fff;
    text-shadow: 3px 3px 0 #FF6B6B;
    animation: bounce 1s infinite;
}

.start-roast {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #FF6B6B;
    margin-top: 20px;
    font-style: italic;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.start-hint {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #87CEEB;
    margin-top: 20px;
}

#game-over-screen {
    background: rgba(0, 0, 0, 0.9);
    padding: 25px;
    border-radius: 20px;
    border: 4px solid #FF4444;
}

.game-over-text {
    font-size: 24px;
    color: #FF4444;
    text-shadow: 
        3px 3px 0 #000,
        0 0 20px #FF4444;
    animation: gameOverPulse 0.5s;
}

#game-over-roast {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #FF6B6B;
    margin: 15px 0;
    font-style: italic;
}

@keyframes gameOverPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    75% { transform: scale(0.95); }
}

#game-over-screen.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

#final-score-display {
    font-size: 14px;
    color: #FFD700;
    margin: 15px 0 10px;
}

#star-rating {
    font-size: 20px;
    margin: 10px 0;
}

#high-score-display {
    font-size: 10px;
    color: #87CEEB;
    margin-bottom: 10px;
}

#david-quote {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    font-style: italic;
}

#replay-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(180deg, #FF6B6B 0%, #CC4444 100%);
    border: 4px solid #fff;
    border-radius: 50px;
    padding: 15px 25px;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #992222,
        0 10px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
}

#replay-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 #992222,
        0 12px 25px rgba(0, 0, 0, 0.5);
}

#replay-button:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #992222,
        0 5px 10px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

/* Stats Bar */
#stats-bar {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid #FF6B6B;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    font-family: 'VT323', monospace;
    font-size: 16px;
}

.stat-label {
    color: #87CEEB;
}

.stat span:last-child {
    color: #FFD700;
    margin-left: 5px;
}

.roast-stat span:last-child {
    color: #FF6B6B;
}

/* Reactions */
#reactions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 100;
}

.reaction {
    position: absolute;
    bottom: -50px;
    font-size: 40px;
    animation: floatUp 1.5s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1.5);
        opacity: 0;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #666;
}

footer a {
    color: #FF6B6B;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.dedication {
    color: #FF6B6B;
    margin-top: 10px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
    #main-stage {
        flex-direction: column;
        align-items: center;
    }
    
    #code-panel {
        order: 2;
        width: 100%;
        max-width: 420px;
        max-height: 300px;
    }
    
    #game-wrapper {
        order: 1;
    }
}

@media (max-width: 500px) {
    #canvas {
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 400 / 600;
    }
    
    #tv-frame {
        padding: 12px;
        border-radius: 20px;
    }
    
    #roast-frame {
        padding: 3px;
        border-radius: 25px;
    }
    
    #score-display {
        top: 20px;
    }
    
    #current-score {
        font-size: 36px;
    }
    
    .game-over-text {
        font-size: 18px;
    }
    
    #replay-button {
        font-size: 10px;
        padding: 12px 18px;
    }
    
    #stats-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .ticker-content span {
        font-size: 12px;
    }
    
    #header h1 {
        font-size: 11px;
    }
    
    .subtitle {
        font-size: 11px;
    }
}