@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Base Styles */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a1a;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    touch-action: manipulation; /* Changed from 'none' - was blocking all touch events! */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Safe area insets for notched devices */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Game Container - Subtle Italian restaurant tablecloth style */
#game-container {
    position: relative;
    width: min(600px, 95vw);
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    background-color: #fef7f3;
    background-image: 
        repeating-linear-gradient(
            0deg,
            #fef7f3 0px,
            #fef7f3 40px,
            #fce8e0 40px,
            #fce8e0 80px
        ),
        repeating-linear-gradient(
            90deg,
            #fef7f3 0px,
            #fef7f3 40px,
            #fce8e0 40px,
            #fce8e0 80px
        );
    background-blend-mode: multiply;
    border: 4px solid #d4a574;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Right Sidebar Container (Desktop) */
.right-sidebar {
    position: fixed;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 320px;
    background: linear-gradient(180deg, #fef7f3 0%, #fce8e0 100%);
    border: 4px solid #d4a574;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.25);
    font-family: Arial, sans-serif;
    display: none;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.right-sidebar.visible {
    display: flex;
}

/* Leaderboard Section */
.live-leaderboard-sidebar {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.live-leaderboard-header {
    font-size: 18px;
    font-weight: bold;
    color: #8b4513;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.live-leaderboard-content {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
}

.live-leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid #d4a574;
    color: #5a3a1a;
    font-size: 11px;
}

.live-leaderboard-entry.highlight {
    background: rgba(212, 165, 116, 0.3);
    color: #8b4513;
    font-weight: bold;
    border-radius: 4px;
}

.live-leaderboard-rank {
    flex: 0 0 40px;
}

.live-leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-leaderboard-score {
    flex: 0 0 50px;
    text-align: right;
    font-weight: bold;
}

.live-leaderboard-refresh {
    margin-top: 10px;
    text-align: center;
    font-size: 10px;
    color: #8b7355;
}

.mobile-leaderboard-panel .live-leaderboard-refresh {
    color: #8b7355;
}

/* Sidebar CTA Section */
.sidebar-cta {
    padding-top: 16px;
    border-top: 2px solid #d4a574;
}

.sidebar-cta h3 {
    font-size: 14px;
    font-weight: bold;
    color: #8b4513;
    margin: 0 0 10px 0;
    text-align: center;
}

.sidebar-cta input[type="email"] {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #d4a574;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    background: white;
    color: #5a3a1a;
    box-sizing: border-box;
}

.sidebar-cta input[type="email"]:focus {
    outline: none;
    border-color: #8b4513;
}

.sidebar-cta button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-cta button:hover {
    background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(185, 28, 28, 0.3);
}

/* Turnstile widget styling */
.sidebar-cta .cf-turnstile,
.mobile-newsletter-cta .cf-turnstile {
    margin: 8px 0;
    display: flex;
    justify-content: center;
    max-height: 65px;
    overflow: hidden;
}

/* Always visible attribution */
.sidebar-attribution {
    padding: 12px 0;
    border-top: 2px solid #d4a574;
}

/* Sidebar Share Section */
.sidebar-share {
    padding-top: 16px;
    border-top: 2px solid #d4a574;
    text-align: center;
    position: relative;
}

.sidebar-share button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.6);
    color: #8b4513;
    border: 2px solid #d4a574;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-share button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #8b4513;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

/* Legal Links Section */
.sidebar-legal {
    padding-top: 12px;
    text-align: center;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.4);
}

.sidebar-legal a {
    color: #8b4513;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-legal a:hover {
    color: #5a3a1a;
    text-decoration: underline;
}

.sidebar-legal span {
    margin: 0 8px;
    color: rgba(0, 0, 0, 0.3);
}

/* Hide CTA until game is over */
.sidebar-cta.hidden-until-gameplay,
.mobile-newsletter-cta.hidden-until-gameplay {
    display: none !important;
}

body.game-over-active .sidebar-cta.hidden-until-gameplay,
body.game-over-active .mobile-newsletter-cta.hidden-until-gameplay {
    display: block !important;
}

/* Share Widget (Desktop Sidebar) */
.sidebar-share-widget {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 10px;
    z-index: 1000;
}

/* The actual popup created by JS */
.sidebar-share-widget-popup {
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom right, #fef7f3, #fce8e0);
    border: 2px solid #d4a574;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
    position: relative;
}

.sidebar-share-widget-title {
    font-weight: bold;
    font-size: 14px;
    margin: 0 0 12px 0;
    text-align: center;
    color: #1f2937;
}

.sidebar-share-widget-popup .sidebar-share-widget-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent !important;
    border: none !important;
    color: #6b7280;
    font-size: 24px;
    font-weight: normal;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-share-widget-popup .sidebar-share-widget-close:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.1) !important;
}

.sidebar-share-widget-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-share-widget-options button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 2px solid #d4a574;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-share-widget-options button:hover {
    background: #fef7f3;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-share-widget-options button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Mobile Nav Header */
.mobile-nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, #fef7f3 0%, #fce8e0 100%);
    border-bottom: 4px solid #d4a574;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    padding-top: env(safe-area-inset-top);
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
    pointer-events: auto;
}

.mobile-nav-score {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #8b4513;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Hamburger Menu (Mobile) */
.hamburger-menu {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px; /* Ensure minimum touch target */
    min-height: 44px;
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid #d4a574;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    z-index: 10001;
    touch-action: manipulation;
    transition: all 0.2s;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-menu:active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0.95);
}

.hamburger-menu span {
    width: 22px;
    height: 3px;
    background: #8b4513;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Leaderboard Slide-out */
.mobile-leaderboard-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: linear-gradient(180deg, #fef7f3 0%, #fce8e0 100%);
    border-left: 4px solid #d4a574;
    padding: 70px 20px 20px;
    padding-top: calc(70px + env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: -5px 0 20px rgba(139, 69, 19, 0.3);
    font-family: Arial, sans-serif;
    z-index: 1000;
    transition: right 0.3s ease-out;
    overflow-y: auto;
    box-sizing: border-box;
}

.mobile-leaderboard-panel.open {
    right: 0;
}

/* Play Again button in mobile menu (hidden by default) */
.mobile-play-again-btn {
    display: none;
    width: 100%;
    padding: 16px 24px;
    margin: 20px 0;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.mobile-play-again-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-leaderboard-header {
    font-size: 20px;
    font-weight: bold;
    color: #8b4513;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.mobile-leaderboard-content {
    font-size: 13px;
}

.mobile-leaderboard-content .live-leaderboard-entry {
    border-bottom: 1px solid #d4a574;
    color: #5a3a1a;
}

.mobile-leaderboard-content .live-leaderboard-entry.highlight {
    background: rgba(212, 165, 116, 0.3);
    color: #8b4513;
    font-weight: bold;
}

/* Mobile & Tablet: Use hamburger menu */
@media (max-width: 1024px) {
    #score {
        display: none !important;
    }
    
    .mobile-nav-header {
        display: flex;
    }
    
    .right-sidebar {
        display: none !important;
    }
}

/* Mobile only: Full screen game */
@media (max-width: 640px) {
    body {
        display: block;
        padding: 0; /* Reset safe-area padding for full-screen mobile */
    }

    #game-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        max-height: 100dvh; /* Override base max-height */
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Desktop only: Show right sidebar */
@media (min-width: 1025px) {
    .right-sidebar.visible {
        display: flex;
    }
    
    .mobile-nav-header {
        display: none !important;
    }
    
    .hamburger-menu {
        display: none !important;
    }
    
    .mobile-leaderboard-panel {
        display: none !important;
    }
}

/* Game Elements */
.pizza {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: pointer;
    text-align: center;
    line-height: 60px;
    user-select: none;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
}

.pizza:active::before,
.pizza:active::after,
.pizza:focus::before,
.pizza:focus::after {
    content: none;
}

.emoji {
    font-size: 2.5rem;
    opacity: 0.8;
}

#score {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    font-family: Arial, sans-serif;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mute-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mute-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

.mute-toggle:active {
    transform: scale(0.95);
}

.floating-score {
    position: absolute;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 24px;
    pointer-events: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 1000;
}

/* Game Over Styles */
.game-over {
    position: fixed;
    top: 23%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 38px;
    color: #ff0000;
    text-shadow: 4px 4px 0 #000;
    animation: gameOverPulse 2s infinite;
    text-align: center;
    z-index: 11000;
}

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1999;
    animation: fadeIn 0.5s ease-in;
}

.restart-button {
    position: fixed;
    bottom: 33%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    padding: 8px 16px;
    background: #ff0000;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    cursor: pointer;
    z-index: 11001;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Arcade Form Styles */
.arcade-form {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
    border: 4px solid #FFD700;
    border-radius: 12px;
    padding: 20px 30px;
    text-align: center;
    z-index: 11001;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    width: 350px;
    font-family: 'Courier New', monospace;
}

.arcade-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 2px;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
}

.arcade-title.mobile {
    font-size: 18px;
}

.arcade-score {
    font-size: 48px;
    font-weight: bold;
    color: #FF4444;
    text-shadow: 0 0 10px #FF4444, 2px 2px 0px #000;
    margin-bottom: 20px;
}

.arcade-score.mobile {
    font-size: 36px;
}

.arcade-label {
    font-size: 14px;
    margin-bottom: 15px;
    color: #FFFFFF;
}

.arcade-label.mobile {
    font-size: 12px;
}

.arcade-input {
    width: 100%;
    padding: 12px;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    background: #000;
    color: #00FF00;
    border: 3px solid #00FF00;
    border-radius: 6px;
    outline: none;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3), 0 0 10px rgba(0, 255, 0, 0.5);
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.arcade-input.mobile {
    font-size: 16px;
}

.arcade-error {
    min-height: 18px;
    font-size: 12px;
    color: #FF9B9B;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.arcade-button {
    flex: 1;
    padding: 12px 24px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: linear-gradient(180deg, #FF4444 0%, #CC0000 100%);
    color: #FFFFFF;
    border: 3px solid #FFFFFF;
    border-radius: 6px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 4px 0 #990000, 0 6px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
    letter-spacing: 2px;
}

.arcade-button.mobile {
    padding: 12px 20px;
    font-size: 14px;
}

.arcade-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #990000, 0 2px 5px rgba(0, 0, 0, 0.5);
}

.arcade-button-skip {
    flex: 1;
    padding: 12px 24px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: #444;
    color: #AAA;
    border: 2px solid #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.arcade-button-skip.mobile {
    padding: 12px 20px;
    font-size: 12px;
}

.arcade-button-skip:hover {
    background: #555;
    color: #CCC;
}

.arcade-hint {
    font-size: 10px;
    margin-top: 12px;
    color: #888;
    font-style: italic;
}

/* Leaderboard Styles (Game Over screen) */
.leaderboard {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
    border: 4px solid #FFD700;
    padding: 20px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 350px;
    overflow-y: auto;
    z-index: 11001;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: none;
    font-family: 'Courier New', monospace;
}

.leaderboard.mobile {
    padding: 12px;
    max-height: 250px;
    max-width: 95%;
}

.leaderboard-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #FFD700;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #FFD700;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #444;
    color: #FFFFFF;
}

.leaderboard-entry.current {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    font-weight: bold;
}

.leaderboard-rank {
    flex: 0 0 50px;
}

.leaderboard-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-score {
    flex: 0 0 80px;
    text-align: right;
}

.leaderboard-status {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
}

.leaderboard-status.success {
    color: #00FF00;
}

.leaderboard-status.flagged {
    padding: 8px;
    background: rgba(255, 68, 68, 0.2);
    border: 2px solid #FF4444;
    border-radius: 6px;
    font-size: 11px;
    color: #FF4444;
}

/* Particle effects */
.particle {
    position: absolute;
    pointer-events: none;
    user-select: none;
    font-size: 20px;
    z-index: 999;
}

/* Animations */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

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

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

@keyframes buttonPulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

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

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shareSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-share-slide-in {
    animation: shareSlideIn 0.3s ease-out;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

/* Miss Feedback - Screen Shake */
@keyframes gameShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.game-shake {
    animation: gameShake 0.3s ease-out;
}

/* Miss Feedback - Red Flash Overlay */
.miss-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center bottom, rgba(220, 38, 38, 0.4) 0%, transparent 70%);
    pointer-events: none;
    animation: missFlash 0.3s ease-out forwards;
    z-index: 100;
}

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

/* Rotten Topping Styles */
.rotten-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.4) 0%, transparent 70%);
    pointer-events: none;
    animation: rottenFlash 0.3s ease-out forwards;
    z-index: 100;
}

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

.stink-line {
    position: absolute;
    bottom: 60%;
    width: 3px;
    height: 20px;
    background: linear-gradient(to top, rgba(34, 197, 94, 0.8), transparent);
    border-radius: 2px;
    animation: stinkRise 0.8s ease-out infinite;
    pointer-events: none;
}

@keyframes stinkRise {
    0% {
        opacity: 0.8;
        transform: translateY(0) scaleY(1) rotate(-5deg);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-10px) scaleY(1.2) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-25px) scaleY(0.8) rotate(-5deg);
    }
}

.rotten-score {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    cursor: pointer;
    animation: fadeIn 0.3s ease-out;
}

.tutorial-card {
    position: relative;
    background: linear-gradient(180deg, #fef7f3 0%, #fce8e0 100%);
    border: 4px solid #d4a574;
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 320px;
    width: 85%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(139, 69, 19, 0.4),
                0 0 0 8px rgba(255, 215, 0, 0.2);
    user-select: none;
}

.tutorial-skip {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #8b7355;
    font-family: Arial, sans-serif;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tutorial-skip:hover {
    opacity: 1;
}

.tutorial-card.tutorial-animate {
    animation: tutorialSlideIn 0.3s ease-out;
}

.tutorial-emoji {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.tutorial-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: #8b4513;
    margin-bottom: 12px;
    text-shadow: 1px 1px 0 #fff;
}

.tutorial-text {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #5a3a1a;
    line-height: 1.5;
    margin-bottom: 20px;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d4a574;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: #8b4513;
    transform: scale(1.3);
}

.tutorial-tap-hint {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #8b7355;
    animation: tutorialPulse 1.5s ease-in-out infinite;
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes tutorialPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Mobile adjustments for tutorial */
@media (max-width: 640px) {
    .tutorial-card {
        padding: 24px 28px;
        max-width: 280px;
    }

    .tutorial-emoji {
        font-size: 40px;
    }

    .tutorial-title {
        font-size: 14px;
    }

    .tutorial-text {
        font-size: 14px;
    }
}
