/* ============================================
   TUNG TUNG TUNG SAHUR GAME - STYLES
   Italian Brainrot Aesthetic + Minimal UI
   ============================================ */

/* Italian Brainrot Colour Palette */
:root {
    --neon-pink: #ff2d6a;
    --neon-cyan: #00fff7;
    --neon-purple: #b537f2;
    --neon-gold: #ffd700;
    --neon-green: #39ff14;
    --neon-red: #ff3333;
    --dark-bg: #0a0a1a;
    --dark-secondary: #16213e;
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Body with gradient background - mobile-first design */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow: hidden;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Main game container with glowing border - fits viewport perfectly */
#game-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    position: relative;
    background: radial-gradient(circle, #0f3460 0%, #16213e 100%);
    border: 5px solid #e94560;
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.5);
    overflow: hidden;
}

/* ============================================
   SCREEN LAYOUTS
   ============================================ */

/* Start and game-over screens overlay */
#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
}

/* Start screen styles */
.start-logo {
    margin-bottom: 1.5rem;
}

.start-character {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    border: 4px solid var(--neon-pink);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.6);
    animation: characterBounce 2s infinite;
}

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

.start-title {
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink);
    margin-bottom: 1rem;
    text-align: center;
    animation: titlePulse 2s infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink); }
    50% { text-shadow: 0 0 30px var(--neon-pink), 0 0 60px var(--neon-pink), 0 0 80px var(--neon-pink); }
}

.start-subtitle {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 0.5rem;
    text-align: center;
}

.sahur-text {
    color: var(--neon-gold);
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-gold);
}

.start-hint {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
    font-style: italic;
}

@media (min-width: 480px) {
    .start-character { width: 180px; height: 180px; }
    .start-title { font-size: 2.5rem; }
}

@media (min-width: 768px) {
    .start-character { width: 200px; height: 200px; }
    .start-title { font-size: 3rem; }
}

/* Buttons styling (start and restart) - mobile-first */
#start-btn, #restart-btn, #resume-checkpoint-btn {
    font-size: 1.5rem;
    padding: 1rem 2rem;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.5);
    transition: all 0.3s;
    font-family: inherit;
    margin: 8px;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    #start-btn, #restart-btn, #resume-checkpoint-btn {
        font-size: 2rem;
        padding: 1.5rem 3rem;
        border-radius: 20px;
        margin: 10px;
    }
}

#resume-checkpoint-btn {
    background: linear-gradient(135deg, #ffd700, #ff9500);
    color: #000;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

#start-btn:hover, #restart-btn:hover, #resume-checkpoint-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(233, 69, 96, 0.7);
}

#resume-checkpoint-btn:hover {
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.8);
}

/* ============================================
   GAME SCREEN
   ============================================ */

#game-screen {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Screen fade animations for difficulty effect */
#game-screen.fade-out {
    animation: fadeOut 0.5s ease-out;
}

#game-screen.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Difficulty tier badge (now in bottom bar) */
#difficulty-tier-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    border: 3px solid;
    transition: all 0.5s ease;
    white-space: nowrap;
}

/* Difficulty tier color themes */
.difficulty-tier-gentle {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    border-color: #00ff88;
    color: #000;
}

.difficulty-tier-morning {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-color: #ffd700;
    color: #000;
}

.difficulty-tier-serious {
    background: linear-gradient(135deg, #ff9500, #ff6600);
    border-color: #ff9500;
    color: #fff;
}

.difficulty-tier-master {
    background: linear-gradient(135deg, #e94560, #c03548);
    border-color: #e94560;
    color: #fff;
}

.difficulty-tier-speed {
    background: linear-gradient(135deg, #9d4edd, #7209b7);
    border-color: #9d4edd;
    color: #fff;
}

.difficulty-tier-challenge {
    background: linear-gradient(135deg, #ff006e, #8b0049);
    border-color: #ff006e;
    color: #fff;
    animation: challengePulse 2s infinite;
}

.difficulty-tier-legendary {
    background: linear-gradient(135deg, #ffd700, #ff0000, #ffd700);
    background-size: 200% 100%;
    border-color: #ffd700;
    color: #fff;
    animation: legendaryShine 3s infinite, challengePulse 1.5s infinite;
    text-shadow: 0 0 10px #fff;
}

.difficulty-tier-godlike {
    background: linear-gradient(135deg, #00ffff, #ff00ff, #00ffff);
    background-size: 200% 100%;
    border-color: #00ffff;
    color: #fff;
    animation: godlikeShine 2s infinite, challengePulse 1s infinite;
    text-shadow: 0 0 15px #fff, 0 0 30px #00ffff;
}

.difficulty-tier-timebender {
    background: linear-gradient(135deg, #8b00ff, #00ff00, #8b00ff);
    background-size: 300% 100%;
    border-color: #8b00ff;
    color: #fff;
    animation: timebenderShine 1.5s infinite, challengePulse 0.8s infinite;
    text-shadow: 0 0 20px #fff, 0 0 40px #8b00ff;
}

.difficulty-tier-avatar {
    background: linear-gradient(135deg, #ff0000, #ffd700, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 400% 100%;
    border-color: #fff;
    color: #fff;
    animation: avatarShine 2s infinite, challengePulse 0.5s infinite;
    text-shadow: 0 0 25px #fff, 0 0 50px #ffd700;
    border-width: 4px;
}

.difficulty-tier-transcendent {
    background: linear-gradient(135deg, #fff, #ffd700, #fff);
    background-size: 200% 100%;
    border-color: #ffd700;
    color: #000;
    animation: transcendentShine 1s infinite, transcendentPulse 0.3s infinite;
    text-shadow: 0 0 10px #ffd700;
    border-width: 5px;
    box-shadow: 0 0 30px #ffd700, 0 0 60px #fff;
}

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

@keyframes timebenderShine {
    0% { background-position: 0% 50%; filter: hue-rotate(0deg); }
    50% { background-position: 100% 50%; filter: hue-rotate(180deg); }
    100% { background-position: 0% 50%; filter: hue-rotate(360deg); }
}

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

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

@keyframes transcendentPulse {
    0%, 100% { box-shadow: 0 0 30px #ffd700, 0 0 60px #fff; }
    50% { box-shadow: 0 0 50px #ffd700, 0 0 100px #fff, 0 0 150px #ffd700; }
}

/* HUD - Simplified minimalist design */
#hud {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 15px;
    z-index: 5;
}

/* Individual HUD items - larger, bolder */
.hud-item {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: bold;
    border: 3px solid var(--neon-pink);
    box-shadow: 0 0 20px rgba(255, 45, 106, 0.5);
    white-space: nowrap;
}

/* Lives item special styling */
.lives-item {
    border-color: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.5);
}

/* Score item special styling */
.score-item {
    border-color: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Responsive HUD for larger screens */
@media (min-width: 480px) {
    .hud-item {
        padding: 12px 25px;
        font-size: 1.5rem;
    }
}

/* ============================================
   TRICK INDICATOR
   ============================================ */

#trick-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.95), rgba(200, 0, 50, 0.95));
    padding: 15px 20px;
    border-bottom: 4px solid var(--neon-red);
    box-shadow: 0 5px 40px rgba(255, 51, 51, 0.9), inset 0 0 30px rgba(255, 255, 255, 0.1);
    z-index: 200;
    animation: trickFlash 0.3s ease-out, trickPulse 0.5s infinite 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
}

#trick-icon {
    font-size: 2rem;
    animation: iconShake 0.2s infinite;
}

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

#trick-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px white, 0 2px 4px rgba(0,0,0,0.5);
}

@keyframes trickFlash {
    0% { opacity: 0; transform: translateY(-100%); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes trickPulse {
    0%, 100% { box-shadow: 0 5px 40px rgba(255, 51, 51, 0.9), inset 0 0 30px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 5px 60px rgba(255, 51, 51, 1), inset 0 0 50px rgba(255, 255, 255, 0.2); }
}

/* ============================================
   BOTTOM BAR
   ============================================ */

#bottom-bar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.bottom-item {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 247, 0.4);
}

/* Hidden game state elements */
.game-state-hidden {
    display: none;
}

@media (min-width: 768px) {
    .hud-item {
        padding: 10px 20px;
        font-size: 1.3rem;
    }
}

/* Highlight effect when HUD values change */
.hud-item.highlight {
    border-color: #ffd700;
    animation: hudPulse 0.3s;
}

/* Penalty item warning styling */
.penalty-item {
    border-color: #ff9500;
}

.penalty-item.danger {
    border-color: #ff3333;
    animation: dangerPulse 0.5s infinite;
}

/* Fastest finger display styling */
.fastest-finger {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.fastest-finger.new-record {
    border-color: #ffd700;
    animation: recordPulse 0.5s;
    background: rgba(255, 215, 0, 0.2);
}

/* Checkpoint indicator styling */
.checkpoint-item {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
}

.checkpoint-item.checkpoint-pulse {
    animation: checkpointSave 2s ease-out;
}

/* Score multiplier styling */
#score-multiplier {
    color: var(--neon-gold);
    font-size: 1.1em;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    animation: multiplierPulse 0.5s infinite alternate;
    text-shadow: 0 0 5px var(--neon-gold);
}

@keyframes multiplierPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* ============================================
   TIMER BAR (Pressure Effect)
   ============================================ */

/* Timer container - positioned above tap button */
#timer-container {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 300px;
    height: 25px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid var(--neon-cyan);
    border-radius: 15px;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 0 25px rgba(0, 255, 247, 0.5);
    pointer-events: none;
}

@media (min-width: 768px) {
    #timer-container {
        bottom: 25%;
        width: 60%;
        height: 30px;
    }
}

/* The animated timer bar */
#timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00ff88 0%, #ffd700 50%, #ff4444 100%);
    transition: width linear;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Timer bar in critical state (< 30% remaining) */
#timer-bar.critical {
    background: linear-gradient(90deg, #ff0000 0%, #ff4444 100%);
    animation: timerPulse 0.2s infinite;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
}

/* Timer bar in warning state (< 60% remaining) */
#timer-bar.warning {
    background: linear-gradient(90deg, #ff9500 0%, #ffd700 50%, #ff4444 100%);
    box-shadow: 0 0 25px rgba(255, 149, 0, 0.8);
}

/* Timer text showing milliseconds - responsive */
#timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    font-family: 'Courier New', monospace;
}

#timer-text.critical {
    color: #ff0000;
    animation: textShake 0.1s infinite;
    font-size: 1rem;
}

@media (min-width: 768px) {
    #timer-text {
        font-size: 1.2rem;
    }
    
    #timer-text.critical {
        font-size: 1.4rem;
    }
}

/* ============================================
   COMBO DISPLAY (Floating)
   ============================================ */

#combo-display {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

#combo-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    margin-bottom: 5px;
}

#combo-count {
    font-size: 2.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    #combo-text {
        font-size: 2.5rem;
    }
    
    #combo-count {
        font-size: 3rem;
    }
}

/* ============================================
   CHARACTER AREA
   ============================================ */

/* Container for Tung Sahur character */
#character-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* The character sprite/image - responsive sizing */
#tung-character {
    width: 200px;
    height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: float 3s ease-in-out infinite;
    transition: background-image 0.3s ease;
    opacity: 0.85;
}

@media (min-width: 480px) {
    #tung-character {
        width: 250px;
        height: 250px;
    }
}

@media (min-width: 768px) {
    #tung-character {
        width: 300px;
        height: 300px;
    }
}

/* Loading state for character image */
#tung-character.loading {
    opacity: 0.5;
}

/* Call indicator showing "SAHUR!" - responsive sizing */
#call-indicator {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 30px #ffd700;
    opacity: 0;
    animation: callPulse 1s ease-in-out;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 15;
}

@media (min-width: 480px) {
    #call-indicator {
        font-size: 3.5rem;
    }
}

@media (min-width: 768px) {
    #call-indicator {
        font-size: 4rem;
    }
}

/* Fake button hint */
#fake-hint {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: #ff3333;
    text-shadow: 0 0 20px #ff3333;
    background: rgba(255, 51, 51, 0.2);
    padding: 10px 20px;
    border-radius: 15px;
    border: 3px solid #ff3333;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    animation: fakeHintPulse 0.5s ease-in-out;
}

/* Fake button variant of call indicator (higher levels) */
#call-indicator.fake-button {
    background: #e94560;
    border-radius: 50%;
    border: 5px solid #ffd700;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.8);
    font-size: 2.5rem;
    color: white;
    text-shadow: none;
}

/* ============================================
   TAP BUTTON
   ============================================ */

/* Main tap button - Italian Brainrot neon style */
#tap-area {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, var(--neon-pink), #ff006e);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(255, 45, 106, 0.8), 0 0 80px rgba(255, 45, 106, 0.4);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.4s ease,
                box-shadow 0.3s ease;
    border: 4px solid var(--neon-gold);
    touch-action: manipulation;
    z-index: 100;
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 480px) {
    #tap-area {
        width: 150px;
        height: 150px;
        font-size: 2.2rem;
    }
}

@media (min-width: 768px) {
    #tap-area {
        width: 170px;
        height: 170px;
        font-size: 2.5rem;
        border: 5px solid var(--neon-gold);
    }
}

/* Hidden state - button starts hidden */
#tap-area.tap-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.5);
}

/* Revealing state - button fading in */
#tap-area.tap-revealing {
    animation: tapReveal 0.5s ease-out forwards;
    pointer-events: auto !important;
}

@keyframes tapReveal {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    50% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Invisible state for button (higher levels) */
#tap-area.invisible {
    opacity: 0;
    pointer-events: none;
}

/* Disabled state for wait-to-win tricks */
#tap-area.disabled-trick {
    background: linear-gradient(135deg, #666, #444);
    border-color: #ff3333;
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.5), 0 0 80px rgba(255, 51, 51, 0.3);
    animation: disabledPulse 0.5s infinite;
}

#tap-area.disabled-trick::after {
    content: '🚫';
    position: absolute;
    font-size: 3rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes disabledPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.4; }
}

/* Active/pressed state with scale down effect */
#tap-area:active {
    transform: translateX(-50%) scale(0.9);
}

/* Larger invisible hit area for better touch detection */
#tap-area::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
}

/* Morphing button shapes */
.shape-circle {
    border-radius: 50%;
}

.shape-square {
    border-radius: 10%;
}

.shape-triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
}

.shape-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border-radius: 0;
}

/* ============================================
   CHEAT CODE CONTAINER
   ============================================ */

#cheat-container {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 25;
    animation: slideUp 0.3s ease-out;
}

#cheat-input {
    padding: 10px 15px;
    font-size: 1rem;
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-family: inherit;
    outline: none;
    width: 200px;
    text-align: center;
}

#cheat-input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

#cheat-submit {
    padding: 10px 20px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ffd700, #ff9500);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

#cheat-submit:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.7);
}

#cheat-submit:active {
    transform: scale(0.95);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Shake animation for misses */
.shake {
    animation: shake 0.5s;
}

/* Glow animation for successful taps */
.glow {
    animation: glow 0.5s;
}

/* Hidden class to hide elements */
.hidden { 
    display: none !important; 
}

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

/* Pulse animation for title */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Floating animation for character */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Call indicator pulse animation */
@keyframes callPulse {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.5); }
}

/* Shake animation for character when player misses */
@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-10deg); }
    75% { transform: translate(-50%, -50%) rotate(10deg); }
}

/* Glow animation for successful tap */
@keyframes glow {
    0%, 100% { box-shadow: 0 10px 40px rgba(233, 69, 96, 0.8); }
    50% { box-shadow: 0 10px 60px rgba(255, 215, 0, 1); }
}

/* Fade animations for screen difficulty effect */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

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

/* HUD pulse animation when values update */
@keyframes hudPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Danger pulse for penalty warnings */
@keyframes dangerPulse {
    0%, 100% { 
        border-color: #ff3333; 
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    50% { 
        border-color: #ff6666; 
        box-shadow: 0 5px 25px rgba(255, 51, 51, 0.8);
    }
}

/* Timer bar pulse for critical state */
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Text shake for critical timer */
@keyframes textShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-2deg); }
    75% { transform: translate(-50%, -50%) rotate(2deg); }
}

/* Record pulse for fastest finger */
@keyframes recordPulse {
    0%, 100% { 
        transform: scale(1); 
        border-color: #00ff88;
    }
    50% { 
        transform: scale(1.15); 
        border-color: #ffd700;
        box-shadow: 0 5px 30px rgba(255, 215, 0, 0.9);
    }
}

/* Fake hint pulse animation */
@keyframes fakeHintPulse {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.5); }
}

/* Slide up animation for cheat container */
@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

/* Level up bounce animation */
@keyframes levelBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Combo float animation */
@keyframes comboFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-40px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px) scale(0.8);
    }
}

.floating-score {
    position: fixed;
    font-size: 2rem;
    font-weight: bold;
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-gold);
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 1s ease-out forwards;
    transform: translateX(-50%);
}

.floating-score.fast-bonus {
    color: var(--neon-cyan);
    font-size: 2.5rem;
    text-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan);
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-40px) scale(1.3); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-80px) scale(0.8); }
}

.near-miss-hint {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan);
    animation: fastPop 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 50;
}

.reaction-feedback {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 50;
    animation: feedbackPop 0.6s ease-out forwards;
}

.feedback-perfect {
    color: var(--neon-purple);
    text-shadow: 0 0 20px var(--neon-purple), 0 0 40px var(--neon-purple), 0 0 60px var(--neon-purple);
    font-size: 2.5rem;
}

.feedback-great {
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green), 0 0 30px var(--neon-green);
}

.feedback-good {
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold), 0 0 20px var(--neon-gold);
}

@keyframes feedbackPop {
    0% { opacity: 0; transform: translateX(-50%) scale(0.3) translateY(20px); }
    30% { opacity: 1; transform: translateX(-50%) scale(1.2) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-30px); }
}

@keyframes fastPop {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
    25% { opacity: 1; transform: translateX(-50%) scale(1.3); }
    100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-40px); }
}

#game-container.screen-pulse {
    animation: screenGlow 0.3s ease-out;
}

@keyframes screenGlow {
    0% { box-shadow: inset 0 0 0 0 transparent; }
    50% { box-shadow: inset 0 0 50px calc(var(--pulse-intensity, 1) * 10px) var(--neon-purple); }
    100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* Checkpoint save celebration */
@keyframes checkpointSave {
    0%, 100% { 
        border-color: #ffd700;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    50% { 
        border-color: #00ff88;
        box-shadow: 0 5px 35px rgba(255, 215, 0, 1), 0 0 50px rgba(0, 255, 136, 0.8);
        transform: scale(1.1);
    }
}

/* Challenge tier pulse */
@keyframes challengePulse {
    0%, 100% { 
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    50% { 
        box-shadow: 0 5px 30px rgba(255, 0, 110, 0.8);
    }
}

/* Legendary tier shine */
@keyframes legendaryShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Size pulse for morphing button */
@keyframes sizePulse {
    0%, 100% { 
        width: var(--button-size, 180px);
        height: var(--button-size, 180px);
    }
    50% { 
        width: calc(var(--button-size, 180px) * 0.7);
        height: calc(var(--button-size, 180px) * 0.7);
    }
}

/* ============================================
   NEW UI ELEMENTS - V3.0
   ============================================ */

/* Top bar - simplified */
#top-bar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.spacer { flex: 1; }

.pause-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-cyan);
    color: white;
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pause-btn:hover {
    background: rgba(0, 255, 247, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.pause-btn:active {
    transform: scale(0.95);
}

/* Game Over Screen Styles */
.game-over-character {
    margin-bottom: 1rem;
}

.game-over-img {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    border: 3px solid var(--neon-pink);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.game-over-title {
    font-size: 1.6rem;
    color: var(--neon-pink);
    text-shadow: 0 0 15px var(--neon-pink);
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 90%;
}

.score-display {
    text-align: center;
    margin-bottom: 1rem;
}

.final-score-label {
    font-size: 0.9rem;
    color: #888;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.final-score-value {
    font-size: 4rem;
    font-weight: bold;
    color: var(--neon-gold);
    text-shadow: 0 0 20px var(--neon-gold);
}

.high-score-display {
    font-size: 1.2rem;
    color: var(--neon-gold);
    margin-bottom: 1.5rem;
}

.high-score-display .trophy {
    margin-right: 5px;
}

.checkpoint-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--neon-gold);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.checkpoint-title {
    color: var(--neon-gold);
    margin-bottom: 5px;
}

.checkpoint-tier {
    color: var(--neon-green);
    margin-bottom: 3px;
}

.checkpoint-details {
    font-size: 0.9rem;
    color: #aaa;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.btn-primary {
    background: var(--neon-pink);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.7);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--neon-gold), #ff9500);
    color: #000;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s;
}

.btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

/* Overlay for modals */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

/* Modal container */
.modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #e94560;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-height: 85%;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(233, 69, 96, 0.7);
}

.modal.wide {
    max-width: 95%;
    width: 500px;
}

.modal h2 {
    color: #e94560;
    margin-bottom: 20px;
    text-align: center;
    font-size: 2rem;
}

.modal p {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Button styles */
.btn-primary, .btn-secondary, .btn-danger {
    font-size: 1.3rem;
    padding: 12px 30px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
    transition: all 0.3s;
    font-family: inherit;
    touch-action: manipulation;
}

.btn-primary {
    background: #e94560;
    color: white;
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid #e94560;
}

.btn-danger {
    background: #ff3333;
    color: white;
    box-shadow: 0 5px 20px rgba(255, 51, 51, 0.5);
    font-size: 1rem;
}

.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
    transform: scale(1.05);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active {
    transform: scale(0.95);
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #e94560;
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #e94560;
    box-shadow: 0 3px 15px rgba(233, 69, 96, 0.5);
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.leaderboard-entry {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.leaderboard-entry.top-1 {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-entry.top-2 {
    border-color: #c0c0c0;
}

.leaderboard-entry.top-3 {
    border-color: #cd7f32;
}

.entry-rank {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
}

.entry-details {
    flex: 1;
    margin: 0 15px;
}

.entry-metric {
    font-size: 1.2rem;
    color: #ffd700;
    font-weight: bold;
}

.entry-meta {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 5px;
}

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

.stats-summary h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

/* Settings */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #ffd700;
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #e94560;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
}

.setting-group input[type="range"] {
    padding: 0;
    height: 40px;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

#volume-value {
    display: inline-block;
    margin-left: 10px;
    color: #00ff88;
    font-weight: bold;
}

/* Floating feedback button */
.floating-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff9500);
    border: 3px solid #fff;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
    transition: all 0.3s;
    z-index: 999;
    touch-action: manipulation;
}

.floating-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.8);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* Color themes */
.theme-ocean {
    --primary-color: #0077be;
    --secondary-color: #00a8e8;
    --accent-color: #00d9ff;
}

.theme-forest {
    --primary-color: #228b22;
    --secondary-color: #32cd32;
    --accent-color: #7fff00;
}

.theme-sunset {
    --primary-color: #ff6347;
    --secondary-color: #ff8c00;
    --accent-color: #ffd700;
}

.theme-midnight {
    --primary-color: #000000;
    --secondary-color: #1a1a1a;
    --accent-color: #4a4a4a;
}

/* Responsive adjustments for new elements */
@media (max-width: 480px) {
    .modal {
        padding: 20px;
    }

    .modal h2 {
        font-size: 1.5rem;
    }

    .mode-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 15px;
        right: 15px;
    }

    .leaderboard-entry {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   ENHANCED GRAPHICS - BETTER VISUALS
   ============================================ */

/* Animated starfield background */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,215,0,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(0,255,247,0.7), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,45,106,0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.5), transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
    animation: starfield 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes starfield {
    0% { transform: translateY(0); }
    100% { transform: translateY(-150px); }
}

/* Enhanced button breathing glow */
#tap-area {
    animation: buttonBreathing 2s ease-in-out infinite;
}

@keyframes buttonBreathing {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 45, 106, 0.8), 0 0 80px rgba(255, 45, 106, 0.4);
        transform: translateX(-50%) scale(1);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 45, 106, 1), 0 0 100px rgba(255, 45, 106, 0.6), 0 0 120px rgba(255, 215, 0, 0.3);
        transform: translateX(-50%) scale(1.02);
    }
}

/* Button success burst */
#tap-area.success-burst {
    animation: successBurst 0.4s ease-out;
}

@keyframes successBurst {
    0% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 40px rgba(255, 45, 106, 0.8);
    }
    50% {
        transform: translateX(-50%) scale(1.15);
        box-shadow: 0 0 80px rgba(0, 255, 136, 1), 0 0 120px rgba(255, 215, 0, 0.8);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 40px rgba(255, 45, 106, 0.8);
    }
}

/* Screen shake on miss */
#game-container.screen-shake {
    animation: screenShake 0.4s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px) rotate(-0.5deg); }
    20% { transform: translateX(8px) rotate(0.5deg); }
    30% { transform: translateX(-6px) rotate(-0.3deg); }
    40% { transform: translateX(6px) rotate(0.3deg); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    70% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* Screen flash effects */
#game-container.flash-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.4), transparent 70%);
    animation: flashFade 0.3s ease-out forwards;
    pointer-events: none;
    z-index: 500;
}

#game-container.flash-miss::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 51, 51, 0.5), transparent 70%);
    animation: flashFade 0.4s ease-out forwards;
    pointer-events: none;
    z-index: 500;
}

@keyframes flashFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Combo fire effect */
.combo-fire {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 150px;
    background: linear-gradient(to top,
        rgba(255, 100, 0, 0.6) 0%,
        rgba(255, 200, 0, 0.4) 30%,
        rgba(255, 100, 0, 0.2) 60%,
        transparent 100%);
    pointer-events: none;
    animation: fireFlicker 0.15s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes fireFlicker {
    0% { opacity: 0.7; transform: translateX(-50%) scaleY(1); }
    100% { opacity: 1; transform: translateX(-50%) scaleY(1.1); }
}

/* Lightning border for high combo */
#game-container.combo-lightning {
    animation: lightningBorder 0.1s ease-in-out infinite alternate;
}

@keyframes lightningBorder {
    0% {
        border-color: var(--neon-cyan);
        box-shadow: 0 0 50px rgba(0, 255, 247, 0.8), inset 0 0 30px rgba(0, 255, 247, 0.2);
    }
    100% {
        border-color: var(--neon-purple);
        box-shadow: 0 0 70px rgba(181, 55, 242, 1), inset 0 0 50px rgba(181, 55, 242, 0.3);
    }
}

/* Rainbow shimmer for max combo */
#game-container.combo-rainbow {
    animation: rainbowShimmer 1s linear infinite;
}

@keyframes rainbowShimmer {
    0% { border-color: #ff2d6a; box-shadow: 0 0 60px rgba(255, 45, 106, 0.9); }
    16% { border-color: #ffd700; box-shadow: 0 0 60px rgba(255, 215, 0, 0.9); }
    33% { border-color: #00ff88; box-shadow: 0 0 60px rgba(0, 255, 136, 0.9); }
    50% { border-color: #00fff7; box-shadow: 0 0 60px rgba(0, 255, 247, 0.9); }
    66% { border-color: #b537f2; box-shadow: 0 0 60px rgba(181, 55, 242, 0.9); }
    83% { border-color: #ff006e; box-shadow: 0 0 60px rgba(255, 0, 110, 0.9); }
    100% { border-color: #ff2d6a; box-shadow: 0 0 60px rgba(255, 45, 106, 0.9); }
}

/* Ripple effect on tap */
.tap-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

/* Enhanced character reactions */
#tung-character {
    transition: transform 0.2s ease, filter 0.3s ease;
}

#tung-character.happy {
    animation: characterHappy 0.5s ease-out;
    filter: brightness(1.2) saturate(1.3);
}

#tung-character.excited {
    animation: characterExcited 0.3s ease-out infinite;
    filter: brightness(1.3) saturate(1.5) drop-shadow(0 0 20px var(--neon-gold));
}

#tung-character.sad {
    animation: characterSad 0.5s ease-out;
    filter: brightness(0.7) saturate(0.8);
}

@keyframes characterHappy {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    75% { transform: translateY(-10px) rotate(-3deg); }
}

@keyframes characterExcited {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes characterSad {
    0% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(5px) rotate(-3deg); }
    60% { transform: translateY(5px) rotate(3deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Level up celebration */
#game-container.level-up-celebration {
    animation: levelUpCelebration 1s ease-out;
}

@keyframes levelUpCelebration {
    0%, 100% {
        border-color: #e94560;
    }
    25% {
        border-color: var(--neon-gold);
        box-shadow: 0 0 100px rgba(255, 215, 0, 1);
    }
    50% {
        border-color: var(--neon-green);
        box-shadow: 0 0 120px rgba(57, 255, 20, 1);
    }
    75% {
        border-color: var(--neon-cyan);
        box-shadow: 0 0 100px rgba(0, 255, 247, 1);
    }
}

/* Enhanced difficulty tier animations */
.difficulty-tier-legendary {
    position: relative;
    overflow: visible;
}

.difficulty-tier-legendary::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #ff0000, #ffd700, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: legendaryGlow 3s ease infinite;
    filter: blur(6px);
}

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

/* Fast reaction trail effect */
.speed-trail {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.5;
    animation: trailFade 0.3s ease-out forwards;
    pointer-events: none;
}

@keyframes trailFade {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Checkpoint celebration effect */
#game-container.checkpoint-celebration {
    animation: checkpointCelebration 1.5s ease-out;
}

@keyframes checkpointCelebration {
    0%, 100% { border-color: #e94560; }
    25% { border-color: var(--neon-gold); box-shadow: 0 0 80px rgba(255, 215, 0, 0.9); }
    50% { border-color: var(--neon-green); box-shadow: 0 0 100px rgba(0, 255, 136, 1); }
    75% { border-color: var(--neon-gold); box-shadow: 0 0 80px rgba(255, 215, 0, 0.9); }
}

/* Difficulty tier background tints */
#game-screen.tier-gentle { background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%); }
#game-screen.tier-morning { background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%); }
#game-screen.tier-serious { background: radial-gradient(circle, rgba(255, 149, 0, 0.1) 0%, transparent 70%); }
#game-screen.tier-master { background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, transparent 70%); }
#game-screen.tier-speed { background: radial-gradient(circle, rgba(157, 78, 221, 0.15) 0%, transparent 70%); }
#game-screen.tier-challenge { background: radial-gradient(circle, rgba(255, 0, 110, 0.15) 0%, transparent 70%); }
#game-screen.tier-legendary { background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, rgba(255, 0, 0, 0.1) 50%, transparent 70%); }

/* ============================================
   NEW TRICK ANIMATIONS - CHAOS MODE
   ============================================ */

/* Spin Cycle - Button rotates rapidly */
#tap-area.spin-cycle {
    animation: spinButton 0.5s linear infinite !important;
}

@keyframes spinButton {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* Size Chaos - Button randomly changes size */
#tap-area.size-chaos {
    animation: sizeChaosPulse 0.3s ease-in-out infinite alternate !important;
}

@keyframes sizeChaosPulse {
    0% { transform: translateX(-50%) scale(0.6); }
    50% { transform: translateX(-50%) scale(1.4); }
    100% { transform: translateX(-50%) scale(0.8); }
}

/* Gravity Drop - Button falls from top */
#tap-area.gravity-drop {
    animation: gravityFall 1.5s ease-in forwards !important;
    top: 0;
    bottom: auto;
}

@keyframes gravityFall {
    0% { top: -150px; }
    70% { top: 70%; }
    85% { top: 65%; }
    100% { top: 70%; }
}

/* Orbit Mode - Button orbits character */
#tap-area.orbit-mode {
    animation: orbitPath 4s linear infinite !important;
    bottom: auto;
    left: auto;
    right: auto;
}

@keyframes orbitPath {
    0% { top: 30%; left: 50%; transform: translateX(-50%); }
    25% { top: 50%; left: 80%; transform: translateX(-50%); }
    50% { top: 70%; left: 50%; transform: translateX(-50%); }
    75% { top: 50%; left: 20%; transform: translateX(-50%); }
    100% { top: 30%; left: 50%; transform: translateX(-50%); }
}

/* Bounce Madness - Button bounces around */
#tap-area.bounce-madness {
    animation: bounceMadness 1.5s ease-in-out infinite !important;
    bottom: auto;
}

@keyframes bounceMadness {
    0% { top: 20%; left: 20%; transform: translate(-50%, -50%); }
    25% { top: 20%; left: 80%; transform: translate(-50%, -50%); }
    50% { top: 75%; left: 80%; transform: translate(-50%, -50%); }
    75% { top: 75%; left: 20%; transform: translate(-50%, -50%); }
    100% { top: 20%; left: 20%; transform: translate(-50%, -50%); }
}

/* Corner positions for Corner Ambush */
#tap-area.corner-top-left { left: 15% !important; bottom: auto !important; top: 15% !important; }
#tap-area.corner-top-right { left: 85% !important; bottom: auto !important; top: 15% !important; }
#tap-area.corner-bottom-left { left: 15% !important; bottom: 15% !important; top: auto !important; }
#tap-area.corner-bottom-right { left: 85% !important; bottom: 15% !important; top: auto !important; }

/* Strobe Light effect */
#game-container.strobe-effect {
    animation: strobeFlash 0.15s linear infinite !important;
}

@keyframes strobeFlash {
    0%, 49% { filter: brightness(1); }
    50%, 100% { filter: brightness(0.1); }
}

#game-container.strobe-effect #tap-area {
    animation: strobeButton 0.15s linear infinite !important;
}

@keyframes strobeButton {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Screen Flip - Upside down */
#game-container.screen-flip {
    transform: rotate(180deg);
    transition: transform 0.5s ease;
}

/* Blur Vision effect */
#game-container.blur-vision {
    animation: blurClear 3s ease-out forwards;
}

@keyframes blurClear {
    0% { filter: blur(15px); }
    70% { filter: blur(8px); }
    100% { filter: blur(0px); }
}

/* Invisible Button - Fades out */
#tap-area.invisible-fade {
    animation: fadeToInvisible 0.5s ease-out forwards !important;
}

@keyframes fadeToInvisible {
    0% { opacity: 1; }
    100% { opacity: 0; pointer-events: auto; }
}

/* Clone buttons for Clone Army */
.clone-button {
    position: absolute;
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, var(--neon-pink), #ff006e);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(255, 45, 106, 0.6);
    border: 4px solid var(--neon-gold);
    touch-action: manipulation;
    z-index: 99;
    animation: clonePulse 0.8s ease-in-out infinite;
}

.clone-button.real-button {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.9), 0 0 60px rgba(255, 215, 0, 0.5);
    border-color: #fff;
}

.clone-button.fake-button {
    opacity: 0.85;
    box-shadow: 0 0 20px rgba(255, 45, 106, 0.4);
}

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

/* Countdown Bomb display */
.countdown-display {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8rem;
    font-weight: bold;
    color: var(--neon-red);
    text-shadow: 0 0 30px var(--neon-red), 0 0 60px var(--neon-red);
    z-index: 200;
    animation: countdownPulse 0.5s ease-in-out;
    pointer-events: none;
}

.countdown-display.countdown-go {
    color: var(--neon-green);
    text-shadow: 0 0 30px var(--neon-green), 0 0 60px var(--neon-green);
    font-size: 6rem;
}

@keyframes countdownPulse {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Fake Out - MISS text that fakes you out */
.fake-miss-text {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    font-weight: bold;
    color: var(--neon-red);
    text-shadow: 0 0 20px var(--neon-red);
    z-index: 200;
    animation: fakeMissPop 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes fakeMissPop {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    30% { transform: translateX(-50%) scale(1.2); opacity: 1; }
    70% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(0.8); opacity: 0; }
}

/* Chaos Storm - Combined visual chaos */
#game-container.chaos-storm {
    animation: chaosBackground 0.5s linear infinite;
}

@keyframes chaosBackground {
    0% { border-color: var(--neon-pink); }
    25% { border-color: var(--neon-cyan); }
    50% { border-color: var(--neon-purple); }
    75% { border-color: var(--neon-gold); }
    100% { border-color: var(--neon-pink); }
}
#game-screen.tier-godlike { background: radial-gradient(circle, rgba(0, 255, 255, 0.25) 0%, rgba(255, 0, 255, 0.15) 50%, transparent 70%); }
#game-screen.tier-timebender { background: radial-gradient(circle, rgba(139, 0, 255, 0.25) 0%, rgba(0, 255, 0, 0.15) 50%, transparent 70%); }
#game-screen.tier-avatar { background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 0, 0, 0.2) 30%, rgba(0, 255, 255, 0.15) 60%, transparent 80%); }
#game-screen.tier-transcendent { background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 215, 0, 0.3) 40%, transparent 70%); }

