/* ==========================================================================
   RAISE THE VIBE - ULTIMATE CHAOS EDITION 2.0
   Complete CSS with all 15 sections
   ========================================================================== */

/* --- RESET & GLOBAL --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Courier New', Courier, monospace;
    color: white;
    background: #111;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    margin: 0;
}

/* --- SECTION BASE --- */
.section {
    min-height: 100vh;
    padding: 100px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   THEME BACKGROUNDS
   ========================================================================== */

/* Hero - Rainbow Explosion */
.theme-hero {
    background: linear-gradient(135deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #8f00ff, #ff0000);
    background-size: 400% 400%;
    animation: rainbowShift 8s ease infinite;
}

.hero-bg-chaos {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,0,255,0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0,255,255,0.3) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(255,255,0,0.2) 0%, transparent 70%);
    animation: psychedelicPulse 4s ease-in-out infinite;
}

/* Meme Flood */
.theme-meme-flood {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-top: 5px solid #e94560;
}

/* Neon Vibe */
.theme-neon {
    background: #0a0a0a;
    border-top: 3px solid #00ff00;
    border-bottom: 3px solid #ff00ff;
}

/* The Void - Space */
.theme-void {
    background: #000;
    min-height: 120vh;
}

#star-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

/* Arcade */
.theme-arcade {
    background: radial-gradient(circle, #2b1055, #7597de);
    border-top: 5px solid #00ffff;
}

/* Paper/Drawing */
.theme-paper {
    background: linear-gradient(135deg, #fdf5e6, #ffe4c4);
    color: #333;
}

/* Math Zone */
.theme-math {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-top: 5px solid #ffd700;
}

.math-symbols-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.1;
    font-size: 4rem;
    overflow: hidden;
    z-index: 1;
}

/* Matrix */
.theme-matrix {
    background: #0d0d0d;
    border-top: 3px solid #00ff00;
    background-image: 
        linear-gradient(rgba(0,255,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Fidget */
.theme-fidget {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Disco */
.theme-disco {
    background: #1a1a1a;
    overflow: hidden;
}

.disco-lights {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    pointer-events: none;
}

/* Stars */
.theme-stars {
    background: linear-gradient(180deg, #0c0c1e 0%, #1a1a3e 100%);
}

#constellation-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

/* Disco Floor */
.theme-disco-floor {
    background: #111;
}

.disco-floor-tiles {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) perspective(500px) rotateX(60deg);
    width: 600px; height: 600px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    z-index: 1;
}

/* Puzzle */
.theme-puzzle {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Surprise */
.theme-surprise {
    background: repeating-linear-gradient(
        45deg,
        #ff6b6b,
        #ff6b6b 10px,
        #feca57 10px,
        #feca57 20px
    );
}

/* Danger */
.theme-danger {
    background: repeating-linear-gradient(45deg, #222, #222 10px, #333 10px, #333 20px);
    border-top: 10px solid yellow;
    border-bottom: 10px solid yellow;
}

/* Lava */
.theme-lava {
    background: linear-gradient(45deg, #ff3300, #ff6600, #990000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* Blueprint */
.theme-blueprint {
    background-color: #0055aa;
    background-image: 
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border-top: 4px solid white;
}

/* Earth */
.theme-earth {
    background: #2d462f;
    border-top: 5px solid #8fbc8f;
    border-bottom: 5px solid #8fbc8f;
}

/* Dad */
.theme-dad {
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 100%);
    border-top: 5px dashed #deb887;
}

/* Paper Alt */
.theme-paper-alt {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes psychedelicPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

@keyframes neonPulse {
    0%, 100% { text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 40px #00ff00; }
    50% { text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff, 0 0 80px #ff00ff; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes disco {
    0% { background-color: #ff0000; }
    16% { background-color: #ff7f00; }
    33% { background-color: #ffff00; }
    50% { background-color: #00ff00; }
    66% { background-color: #0000ff; }
    83% { background-color: #8b00ff; }
    100% { background-color: #ff0000; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

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

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.retro-title {
    font-size: 4rem;
    color: #ffd700;
    text-shadow: 4px 4px 0px #ff1493;
    transform: rotate(-2deg);
    margin-bottom: 20px;
}

.glitch-text {
    position: relative;
    animation: glitch 0.5s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.glitch-text::before {
    color: #ff0000;
    animation: glitch 0.3s infinite;
    clip-path: inset(0 0 50% 0);
    left: 2px;
}

.glitch-text::after {
    color: #00ffff;
    animation: glitch 0.3s infinite reverse;
    clip-path: inset(50% 0 0 0);
    left: -2px;
}

.wavy-text {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.danger-text {
    font-size: 5rem;
    color: red;
    animation: shake 0.5s infinite;
    text-shadow: 2px 2px 0 yellow;
}

.neon-text {
    font-size: 3rem;
    color: #00ff00;
    animation: neonPulse 2s infinite;
}

.void-title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 20px #00ffff;
    z-index: 10;
    position: relative;
}

.void-subtitle {
    color: rgba(255,255,255,0.7);
    z-index: 10;
    position: relative;
}

.result-text {
    font-size: 1.5rem;
    color: #ffd700;
    min-height: 60px;
    margin: 20px 0;
    font-weight: bold;
    white-space: pre-line;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.fade-in-delay {
    animation: fadeIn 1s ease-in 0.5s both;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.groovy-btn {
    padding: 20px 50px;
    border: 4px solid white;
    border-radius: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    background: #ff1493;
    color: white;
    transition: transform 0.2s, background 0.2s;
    font-weight: bold;
    margin: 10px;
}

.groovy-btn:hover {
    transform: scale(1.1);
    background: #ff8c00;
}

.pulse-btn {
    animation: pulse 2s infinite;
}

.chaos-start-btn {
    padding: 25px 60px;
    border: 5px solid #ffd700;
    border-radius: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    background: linear-gradient(135deg, #ff0000, #ff7f00);
    color: white;
    font-weight: bold;
    margin-bottom: 20px;
    transition: all 0.3s;
    animation: pulse 1.5s infinite;
}

.chaos-start-btn:hover {
    transform: scale(1.15) rotate(2deg);
    box-shadow: 0 0 30px rgba(255,215,0,0.8);
}

.action-btn {
    padding: 12px 25px;
    border-radius: 8px;
    border: 2px solid white;
    background: rgba(0,0,0,0.3);
    color: inherit;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: all 0.2s;
    font-size: 1rem;
}

.action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.big-red-button {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000);
    border-radius: 50%;
    border: 8px solid #8b0000;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.big-red-button:hover {
    transform: scale(1.05);
}

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

.macho-btn {
    padding: 25px 50px;
    background: linear-gradient(135deg, #333, #555);
    border: 5px solid white;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transform: skew(-10deg);
    font-weight: bold;
    transition: all 0.2s;
}

.macho-btn:hover {
    background: linear-gradient(135deg, #555, #777);
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.bubbly-btn {
    padding: 15px 25px;
    margin: 5px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #00ffff, #00cccc);
    color: #000;
    transition: all 0.2s;
    font-size: 1rem;
}

.bubbly-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,255,255,0.4);
}

.bubbly-btn:active {
    transform: translateY(1px);
}

.mystery-sound-btn {
    margin-top: 30px;
    padding: 20px 40px;
    background: linear-gradient(135deg, #8b00ff, #ff00ff);
    border: 3px solid #ffd700;
    border-radius: 30px;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    animation: bounce 1s infinite;
}

.mystery-sound-btn:hover {
    transform: scale(1.1);
}

.mega-vibe-button {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff00, #00cc00);
    border: 10px solid #ffd700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 0 50px rgba(0,255,0,0.5);
}

.mega-vibe-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 80px rgba(0,255,0,0.8);
}

.mega-vibe-button:disabled {
    background: linear-gradient(135deg, #666, #444);
    cursor: not-allowed;
    box-shadow: none;
}

.vibe-btn-text {
    font-size: 1.5rem;
    color: #000;
}

.vibe-btn-plus {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

.brain-boost-btn {
    margin-top: 20px;
    padding: 20px 40px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border: 3px solid #fff;
    border-radius: 30px;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    animation: bounce 2s infinite;
}

.spin-btn {
    padding: 20px 40px;
    font-size: 1.3rem;
}

.disco-btn, .party-btn, .puzzle-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
}

.surprise-btn {
    padding: 30px 60px;
    font-size: 2rem;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border: 5px solid #fff;
    border-radius: 30px;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    animation: bounce 1s infinite, disco 3s infinite;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.retro-card {
    background: rgba(0,0,0,0.4);
    padding: 30px;
    border-radius: 20px;
    border: 3px solid #fff;
    max-width: 600px;
    width: 100%;
    backdrop-filter: blur(5px);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.retro-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid #ff1493;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}

.highlight {
    color: #ff1493;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
    padding: 5px 10px;
    border-radius: 5px;
}

.nav-menu a:hover {
    color: #00ffff;
    background: rgba(0,255,255,0.2);
}

/* ==========================================================================
   TABS
   ========================================================================== */

.tab-container {
    width: 100%;
    max-width: 700px;
    background: rgba(0,0,0,0.4);
    border-radius: 15px;
    border: 2px solid #fff;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.tabs {
    display: flex;
    background: rgba(0,0,0,0.3);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.1);
}

.tab-btn.active {
    background: rgba(255,255,255,0.2);
    border-bottom: 3px solid #00ffff;
}

.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* ==========================================================================
   VIBE METER
   ========================================================================== */

#vibe-meter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 220px;
    background: rgba(0,0,0,0.9);
    border: 3px solid #32CD32;
    border-radius: 15px;
    padding: 15px;
    z-index: 999;
    box-shadow: 0 0 20px rgba(50,205,50,0.3);
}

.vibe-text {
    color: #32CD32;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
    font-size: 1.1rem;
}

.vibe-track {
    height: 15px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #444;
}

.vibe-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #32CD32, #00ff00);
    transition: width 0.3s;
    border-radius: 10px;
}

.vibe-cooldown {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #ff6600;
}

/* ==========================================================================
   SOUND BAR (Section 12)
   ========================================================================== */

#sound-bar {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0,0,0,0.9);
    border: 2px solid #ff00ff;
    border-radius: 10px;
    padding: 15px;
    z-index: 998;
    width: 180px;
}

.sound-label {
    color: #ff00ff;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

#chaos-slider {
    width: 100%;
    cursor: pointer;
}

.sound-level {
    color: #00ffff;
    font-weight: bold;
    text-align: center;
    margin-top: 5px;
}

/* ==========================================================================
   SANITY PANEL
   ========================================================================== */

#sanity-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    gap: 10px;
}

.sanity-btn {
    font-size: 1.5rem;
    background: rgba(0,0,0,0.8);
    border: 2px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.sanity-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.sanity-btn.muted {
    opacity: 0.4;
    border-color: #ff0000;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #fff, #f0f0f0);
    color: black;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    max-width: 500px;
    border: 8px solid #ff1493;
    box-shadow: 0 0 50px rgba(255,20,147,0.5);
}

.timer-bar {
    width: 100%;
    height: 15px;
    background: #ddd;
    margin-top: 25px;
    border-radius: 10px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff1493);
    width: 0%;
    transition: width 3s linear;
}

/* ==========================================================================
   CONFETTI CANVAS
   ========================================================================== */

#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* ==========================================================================
   MEME FLOOD (Section 2)
   ========================================================================== */

.meme-rain-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.meme-wall {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 800px;
    margin-top: 30px;
}

.meme-item {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid rgba(255,255,255,0.3);
}

.meme-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meme-item:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: #ff00ff;
    box-shadow: 0 0 20px rgba(255,0,255,0.5);
}

/* ==========================================================================
   THE VOID (Section 4)
   ========================================================================== */

.void-cats {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

.void-cat {
    position: absolute;
    width: 80px;
    animation: float 5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0,255,255,0.5));
}

/* ==========================================================================
   DRAWING SECTION (Section 6)
   ========================================================================== */

.crayon-title {
    color: #333;
}

.crayon-palette {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.crayon {
    width: 40px;
    height: 60px;
    border-radius: 5px 5px 20px 20px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid rgba(0,0,0,0.3);
}

.crayon:hover {
    transform: translateY(-10px);
}

.crayon.active {
    transform: translateY(-15px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.drawing-canvas {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: white;
    border: 5px solid #333;
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
}

.drawing-controls {
    margin-top: 20px;
}

/* ==========================================================================
   MATH ZONE (Section 7)
   ========================================================================== */

.math-title {
    color: #ffd700;
    font-size: 3rem;
    z-index: 10;
    position: relative;
}

.math-card {
    background: rgba(0,0,0,0.5);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #ffd700;
    max-width: 500px;
    z-index: 10;
    position: relative;
}

.math-problem {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
}

.math-input-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.math-input {
    width: 120px;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
}

.math-result {
    margin-top: 20px;
    font-size: 1.5rem;
    min-height: 30px;
}

.math-score {
    margin-top: 15px;
    font-size: 1.3rem;
    color: #00ff00;
}

.math-link {
    margin-top: 20px;
    z-index: 10;
    position: relative;
}

.math-link a {
    color: #ffd700;
    text-decoration: underline;
}

/* ==========================================================================
   MEME MATRIX (Section 8)
   ========================================================================== */

.matrix-title {
    color: #00ff00;
    font-size: 3rem;
}

.meme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 500px;
    margin-top: 30px;
}

.matrix-meme {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #00ff00;
}

.matrix-meme img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.matrix-meme:hover {
    transform: scale(1.2);
    z-index: 10;
}

/* ==========================================================================
   FIDGET SPINNER (Section 9)
   ========================================================================== */

.spinner-container {
    margin: 40px 0;
}

.fidget-spinner {
    width: 200px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease-out;
}

.spinner-arm {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 50%;
    border: 3px solid #fff;
}

.spinner-arm:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.spinner-arm:nth-child(2) { bottom: 20px; left: 20px; }
.spinner-arm:nth-child(3) { bottom: 20px; right: 20px; }

.spinner-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #333, #666);
    border-radius: 50%;
    border: 3px solid #fff;
}

.spin-counter {
    font-size: 1.5rem;
    margin: 20px 0;
}

/* ==========================================================================
   ALIEN PARTY (Section 10)
   ========================================================================== */

.disco-title {
    color: #00ffff;
    font-size: 3rem;
    text-shadow: 0 0 20px #ff00ff;
}

.alien-dance-floor {
    display: flex;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.alien {
    font-size: 4rem;
    cursor: pointer;
    animation: bounce 0.5s infinite;
    transition: transform 0.2s;
}

.alien:hover {
    transform: scale(1.3);
}

/* ==========================================================================
   STAR CHART (Section 11)
   ========================================================================== */

.star-title {
    color: #ffd700;
    z-index: 10;
    position: relative;
}

.constellation-fact {
    color: #00ffff;
    font-size: 1.3rem;
    z-index: 10;
    position: relative;
    margin: 20px 0;
}

/* ==========================================================================
   DISCO FLOOR (Section 13)
   ========================================================================== */

.disco-floor-title {
    color: #ff00ff;
    z-index: 10;
    position: relative;
}

.disco-tile {
    background: #333;
    animation: disco 2s infinite;
    animation-delay: var(--delay);
}

.dancing-animals {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    z-index: 10;
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
}

.disco-dancer {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    animation: danceBounce 0.5s ease-in-out infinite;
    transition: transform 0.2s;
}

.disco-dancer:nth-child(2) { animation-delay: 0.1s; }
.disco-dancer:nth-child(3) { animation-delay: 0.2s; }
.disco-dancer:nth-child(4) { animation-delay: 0.3s; }
.disco-dancer:nth-child(5) { animation-delay: 0.4s; }
.disco-dancer:nth-child(6) { animation-delay: 0.5s; }

.disco-dancer:hover {
    transform: scale(1.1);
}

.dancer-head {
    font-size: 3rem;
    animation: headBop 0.25s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.dancer-body {
    margin-top: -10px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

/* Arm animations */
.dancer-body .arm-left {
    animation: armWaveLeft 0.5s ease-in-out infinite;
    transform-origin: 30px 25px;
}

.dancer-body .arm-right {
    animation: armWaveRight 0.5s ease-in-out infinite;
    transform-origin: 30px 25px;
}

/* Leg animations */
.dancer-body .leg-left {
    animation: legKickLeft 0.5s ease-in-out infinite;
    transform-origin: 30px 55px;
}

.dancer-body .leg-right {
    animation: legKickRight 0.5s ease-in-out infinite;
    transform-origin: 30px 55px;
}

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

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

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

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

@keyframes legKickLeft {
    0%, 100% { transform: rotate(10deg); }
    50% { transform: rotate(-15deg); }
}

@keyframes legKickRight {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(15deg); }
}

.disco-dancer.spin-dance {
    animation: spinCrazy 0.5s ease-in-out !important;
}

@keyframes spinCrazy {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Continuous dancing when music plays */
.disco-dancer.dancing-active {
    animation: danceBounce 0.3s ease-in-out infinite !important;
}

.disco-dancer.dancing-active .dancer-head {
    animation: headBop 0.15s ease-in-out infinite !important;
}

.disco-dancer.dancing-active .arm-left {
    animation: armWaveLeft 0.3s ease-in-out infinite !important;
}

.disco-dancer.dancing-active .arm-right {
    animation: armWaveRight 0.3s ease-in-out infinite !important;
}

.disco-dancer.dancing-active .leg-left {
    animation: legKickLeft 0.3s ease-in-out infinite !important;
}

.disco-dancer.dancing-active .leg-right {
    animation: legKickRight 0.3s ease-in-out infinite !important;
}

/* ==========================================================================
   BAMBOOZLE (Section 14)
   ========================================================================== */

.puzzle-title {
    color: #fff;
}

.puzzle-card {
    background: rgba(0,0,0,0.5);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #fff;
    max-width: 600px;
}

.puzzle-question {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.puzzle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.puzzle-option {
    padding: 15px 30px;
    background: rgba(255,255,255,0.2);
    border: 2px solid #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.puzzle-option:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.05);
}

.puzzle-option.correct {
    background: #00ff00;
    color: #000;
}

.puzzle-option.wrong {
    background: #ff0000;
}

.puzzle-result {
    font-size: 1.5rem;
    margin-top: 20px;
}

/* ==========================================================================
   SURPRISE (Section 15)
   ========================================================================== */

.surprise-title {
    color: #333;
}

.surprise-display {
    background: rgba(255,255,255,0.9);
    padding: 40px;
    border-radius: 20px;
    border: 5px solid #333;
    max-width: 500px;
    margin: 30px 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.surprise-display img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
}

/* ==========================================================================
   GAMES
   ========================================================================== */

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 20px auto;
}

.bubble {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(200,200,255,0.3));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: inset 2px 2px 10px rgba(255,255,255,0.8),
                inset -2px -2px 10px rgba(0,0,0,0.1);
    transition: all 0.1s;
}

.bubble:hover {
    transform: scale(1.1);
}

.bubble.popped {
    background: rgba(0,0,0,0.2);
    transform: scale(0.8);
    box-shadow: none;
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 300px;
    margin: 20px auto;
    background: #333;
    padding: 5px;
    border-radius: 10px;
}

.cell {
    width: 100%;
    height: 90px;
    background: #fdf5e6;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    border-radius: 5px;
}

.cell:hover {
    background: #ffe4c4;
}

/* ==========================================================================
   FLOATING MEMES (Chaos)
   ========================================================================== */

.floating-meme {
    position: fixed;
    width: 200px;
    z-index: 9997;
    pointer-events: none;
    will-change: transform, left, top;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

/* ==========================================================================
   RIDDLE ANSWER
   ========================================================================== */

.riddle-answer {
    display: none;
    color: #76ff03;
    margin-top: 15px;
    font-size: 1.3rem;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.retro-footer {
    padding: 50px 0;
    text-align: center;
    background: linear-gradient(180deg, #111, #000);
    border-top: 4px solid #32CD32;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: #00ffff;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ff00ff;
}

/* ==========================================================================
   FLYING MEME ZONE
   ========================================================================== */

#flying-memes {
    position: relative;
}

#flying-meme-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 5;
    min-height: 500px;
}

.flying-meme-item {
    position: absolute;
    z-index: 6;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    will-change: transform, left, top;
    cursor: pointer;
    transition: filter 0.1s;
}

.flying-meme-item:hover {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)) brightness(1.2);
}

.meme-score-display {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 15px;
    border: 3px solid #ffd700;
    margin: 20px 0;
    font-size: 1.5rem;
}

.score-number {
    color: #ffd700;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px #ffd700;
}

@keyframes scorePopup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

.scroll-spawn-meme {
    position: absolute;
    z-index: 9990;
    pointer-events: none;
    animation: scrollMemeAppear 3s ease-out forwards;
    filter: drop-shadow(0 0 15px rgba(255, 0, 255, 0.6));
}

@keyframes scrollMemeAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.2) rotate(10deg);
    }
    40% {
        transform: scale(1) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(360deg) translateY(-100px);
    }
}

.meme-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-top: 20px;
}

/* ==========================================================================
   MOBILE TOUCH IMPROVEMENTS
   ========================================================================== */

/* Larger touch targets */
@media (pointer: coarse) {
    .action-btn, .bubbly-btn, .tab-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 14px 24px;
    }
    
    .bubble {
        width: 60px;
        height: 60px;
    }
    
    .cell {
        height: 100px;
    }
    
    .crayon {
        width: 50px;
        height: 70px;
    }
    
    .puzzle-option {
        padding: 18px 24px;
        font-size: 1.1rem;
    }
    
    .sanity-btn {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px;
    }
    
    /* Better spacing for mobile */
    .section {
        padding: 80px 10px;
    }
    
    .tab-container {
        width: 95%;
    }
}

/* Touch feedback */
.action-btn:active,
.bubbly-btn:active,
.groovy-btn:active,
.puzzle-option:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Remove hover effects on touch devices (they can be sticky) */
@media (hover: none) {
    .action-btn:hover,
    .bubbly-btn:hover,
    .groovy-btn:hover {
        transform: none;
        background: inherit;
    }
}

/* ==========================================================================
   LAZY LOADING PLACEHOLDER
   ========================================================================== */

img[loading="lazy"] {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

img[loading="lazy"].loaded {
    animation: none;
    background: none;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU acceleration for animations */
.floating-meme,
.flying-meme-item,
.scroll-spawn-meme,
.fidget-spinner,
.alien,
.dancing-animal {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-meme,
    .flying-meme-item,
    .scroll-spawn-meme {
        display: none !important;
    }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .retro-title { font-size: 2.5rem; }
    .wavy-text, .neon-text, .void-title { font-size: 2rem; }
    .danger-text { font-size: 3rem; }
    .nav-menu { display: none; }
    .meme-wall { grid-template-columns: repeat(2, 1fr); }
    .meme-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-vibe-button { width: 180px; height: 180px; }
    .big-red-button { width: 150px; height: 150px; font-size: 1.8rem; }
    #vibe-meter { width: 180px; bottom: 10px; right: 10px; }
    #sound-bar { width: 150px; top: 70px; right: 10px; }
    .groovy-btn { padding: 15px 30px; font-size: 1.2rem; }
    .chaos-start-btn { padding: 20px 40px; font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .retro-title { font-size: 2rem; }
    .section { padding: 80px 0; }
    .container { padding: 0 15px; }
}

/* Alien Fact Display */
.alien-fact-display {
    background: rgba(0, 0, 0, 0.7);
    color: #00ffff;
    padding: 20px 30px;
    border-radius: 15px;
    border: 2px solid #ff00ff;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 20px auto;
    text-shadow: 0 0 10px #00ffff;
    transition: all 0.3s;
}

.alien {
    transition: transform 0.3s ease-out;
}

/* Ghost Facts Popup */
.ghost-fact-popup {
    position: fixed;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 20px 25px;
    border-radius: 15px;
    max-width: 350px;
    font-size: 1.1rem;
    border: 2px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: ghostFadeIn 0.5s ease-out;
    transition: opacity 0.5s;
}

@keyframes ghostFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.ghost-pos-top-left { top: 100px; left: 20px; }
.ghost-pos-top-right { top: 100px; right: 20px; }
.ghost-pos-bottom-left { bottom: 100px; left: 20px; }
.ghost-pos-bottom-right { bottom: 100px; right: 20px; }
.ghost-pos-top-center { top: 100px; left: 50%; transform: translateX(-50%); }
.ghost-pos-bottom-center { bottom: 100px; left: 50%; transform: translateX(-50%); }

.ghost-fact-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.ghost-fact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ghost-fact-text {
    margin: 0;
    line-height: 1.5;
}

/* 100% Vibe Reward Modal */
.vibe-reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rewardFadeIn 0.5s ease-out;
    transition: opacity 0.5s;
}

@keyframes rewardFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vibe-reward-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 4px solid #ffd700;
    border-radius: 25px;
    padding: 40px 50px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    animation: rewardPulse 2s infinite;
}

@keyframes rewardPulse {
    0%, 100% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 80px rgba(255, 215, 0, 0.8); }
}

.vibe-reward-content h2 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ffd700;
}

.reward-prize {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.prize-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.prize-joke {
    font-style: italic;
    color: #aaa;
    margin-top: 15px;
}

.reward-close-btn {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reward-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

/* Mission Statement Section */
.theme-mission {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: auto;
    padding: 80px 20px;
}

.mission-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 50px;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.mission-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.mission-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #ddd;
}

.mission-highlight {
    font-size: 1.4rem !important;
    color: #fff !important;
    text-align: center;
    padding: 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border-left: 4px solid #ffd700;
}

.mission-signature {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mission-signature p {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 10px;
}

.signature-name {
    font-size: 1.3rem !important;
    font-style: italic;
    color: #ffd700 !important;
}

/* Enhanced Footer */
.footer-sponsor {
    font-size: 1.1rem;
    margin: 15px 0;
}

.footer-sponsor a {
    color: #ffd700;
    font-weight: bold;
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 15px;
}
