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

body {
    background: #0a0a0f;
    color: white;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s;
}

body.opus-flash {
    background: #2d1b4e;
}

#app {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
    position: relative;
}

.title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00, #00ffff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 5s linear infinite;
}

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

.tagline {
    color: #888;
    margin-top: 10px;
    font-size: 1.1rem;
}

.strawberry {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.strawberry:hover {
    transform: scale(1.2);
}

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

/* Vibe Input Zone */
.vibe-input-zone {
    position: relative;
    margin: 30px 0;
}

#vibeInput {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 20px;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    resize: none;
    outline: none;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
    transition: box-shadow 0.3s;
}

#vibeInput:focus {
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5), inset 0 0 30px rgba(0, 255, 255, 0.2);
}

#vibeInput::placeholder {
    color: #666;
}

.char-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #00ffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Vibe Meter */
.vibe-meter-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.vibe-meter {
    position: relative;
    width: 250px;
    height: 150px;
    --glow-intensity: 0;
}

.meter-arc {
    position: absolute;
    width: 200px;
    height: 100px;
    bottom: 20px;
    left: 25px;
    border: 8px solid transparent;
    border-top: 8px solid;
    border-left: 8px solid;
    border-right: 8px solid;
    border-image: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00) 1;
    border-radius: 100px 100px 0 0;
    box-shadow: 0 0 calc(20px + var(--glow-intensity) * 30px) rgba(255, 0, 255, calc(0.3 + var(--glow-intensity) * 0.4));
}

.meter-needle {
    position: absolute;
    width: 4px;
    height: 80px;
    background: linear-gradient(to top, #ff00ff, #00ffff);
    bottom: 20px;
    left: 123px;
    transform-origin: bottom center;
    transform: rotate(-60deg);
    transition: transform 0.1s ease-out;
    border-radius: 2px;
    box-shadow: 0 0 10px #00ffff;
}

.meter-center {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ff00ff, #8b5cf6);
    border-radius: 50%;
    bottom: 10px;
    left: 115px;
    box-shadow: 0 0 15px #ff00ff;
}

.meter-labels {
    position: absolute;
    width: 100%;
    height: 100%;
}

.meter-labels span {
    position: absolute;
    font-size: 0.65rem;
    color: #888;
    white-space: nowrap;
}

.meter-labels span:nth-child(1) { bottom: 70px; left: -10px; }
.meter-labels span:nth-child(2) { top: 20px; left: 20px; }
.meter-labels span:nth-child(3) { top: 0; left: 50%; transform: translateX(-50%); }
.meter-labels span:nth-child(4) { top: 20px; right: 10px; }
.meter-labels span:nth-child(5) { bottom: 70px; right: -20px; color: #ff00ff; font-weight: bold; }

.vibe-level {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    border-radius: 10px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: #666;
    color: white;
}

.mode-btn.active {
    border-color: #ff00ff;
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

.mode-btn[data-mode="chill"].active {
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.mode-btn[data-mode="hyper"].active {
    border-image: linear-gradient(90deg, #ff0000, #ff7700, #ffff00, #00ff00, #00ffff, #ff00ff) 1;
    animation: rainbow-border 2s linear infinite;
}

/* Canvas */
#codeCanvas {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin: 20px 0;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat:hover {
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ffff;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px;
    border-top: 1px solid #222;
    margin-top: 40px;
}

footer p {
    color: #888;
}

footer a {
    color: #ff00ff;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

footer small {
    display: block;
    margin-top: 10px;
    color: #555;
    font-size: 0.8rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(139, 92, 246, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #app {
        padding: 15px;
    }

    .title {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .strawberry {
        position: static;
        display: block;
        margin-top: 10px;
    }

    .vibe-meter {
        transform: scale(0.8);
    }

    .mode-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    #codeCanvas {
        height: 200px;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}