/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #ffc107;
    --bg-color: #2c1810;
    --card-bg: #3d2817;
    --text-color: #fff5e1;
    --text-secondary: #d4a574;
    --border-color: #5c4033;
    --success-color: #4caf50;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --bun-color: #daa520;
    --patty-color: #8b4513;
    --cheese-color: #ffd700;
    --lettuce-color: #90ee90;
    --tomato-color: #ff6347;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 2s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1;
    transition: background-image 1s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    transition: background 1s ease;
}

/* Background message */
.background-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    z-index: 150;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
    animation: fadeInUp 0.5s ease;
    max-width: 90%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Header Styles */
header {
    text-align: center;
    padding: 1rem 0 0.5rem 0;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 1.8rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.25rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main Content */
main {
    margin-bottom: 2rem;
}

/* Game Stats */
.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.multiplier-stat {
    background: linear-gradient(135deg, #4a2c2a, #3d2817);
    border-color: var(--accent-color);
}

.multiplier-stat .stat-value {
    color: var(--success-color);
    font-size: 1.5rem;
}

/* Burger Container */
.burger-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    margin: 1rem auto;
    transform-origin: center center;
    transition: transform 0.5s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Burger Styles */
.burger {
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transform-origin: center center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.burger:hover {
    transform: scale(1.05);
}

.burger:active {
    transform: scale(0.95);
}

.burger-layer {
    width: 300px;
    height: 45px;
    margin: -5px 0;
    border-radius: 50%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.2);
}

.bun-top {
    background: linear-gradient(to bottom, var(--bun-color), #c8960f);
    height: 60px;
    border-radius: 100px 100px 20px 20px;
    box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.2);
}

.sesame {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #f5deb3;
    border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.sesame:nth-child(1) { top: 20px; left: 60px; }
.sesame:nth-child(2) { top: 15px; left: 120px; }
.sesame:nth-child(3) { top: 18px; left: 180px; }
.sesame:nth-child(4) { top: 25px; left: 240px; }
.sesame:nth-child(5) { top: 28px; left: 150px; }

.lettuce {
    background: var(--lettuce-color);
    background: linear-gradient(to bottom, #90ee90, #7cb87c);
    width: 330px;
    height: 35px;
    border-radius: 50%;
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.2);
}

.tomato {
    background: var(--tomato-color);
    background: linear-gradient(to bottom, #ff6347, #cc4f39);
    height: 28px;
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.2);
}

.cheese {
    background: var(--cheese-color);
    background: linear-gradient(to bottom, #ffd700, #daa520);
    width: 315px;
    height: 22px;
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.2);
}

.patty {
    background: var(--patty-color);
    background: linear-gradient(to bottom, #8b4513, #5c2d0f);
    height: 50px;
    box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.3);
}

.bun-bottom {
    background: linear-gradient(to top, var(--bun-color), #c8960f);
    height: 50px;
    border-radius: 20px 20px 50px 50px;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* Click Message */
.click-message {
    position: absolute;
    bottom: -50px;
    font-size: 1.5rem;
    color: var(--accent-color);
    animation: pulse 2s infinite;
    pointer-events: none;
}

/* Celebration */
.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.celebration.show {
    opacity: 1;
    animation: celebrate 1s ease-out, rainbow 1s linear infinite, neonGlow 1s ease-in-out infinite;
}

/* Multiplier Powerups */
#multiplierContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.multiplier-powerup {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    animation: float 3s ease-in-out infinite, spawn 0.3s ease-out;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.multiplier-powerup:hover {
    transform: scale(1.2);
}

.multiplier-powerup.x2 {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.multiplier-powerup.x4 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.multiplier-timer {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 150px;
    z-index: 200;
    box-shadow: var(--shadow);
}

.multiplier-timer h4 {
    color: var(--accent-color);
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.active-multiplier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.25rem 0;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.active-multiplier .mult-label {
    font-weight: bold;
    font-size: 1rem;
}

.active-multiplier.x2 .mult-label {
    color: #4ade80;
}

.active-multiplier.x4 .mult-label {
    color: #f59e0b;
}

.active-multiplier .mult-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }

    .burger-layer {
        width: 200px;
    }

    .lettuce {
        width: 220px;
    }

    .cheese {
        width: 210px;
    }

    .game-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.4rem;
    }
    
    .stat-card h3 {
        font-size: 0.6rem;
    }

    .stat-value {
        font-size: 1rem;
    }
    
    .multiplier-stat .stat-value {
        font-size: 1.2rem;
    }
    
    .background-message {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        bottom: 10px;
    }
    
    .burger-container {
        min-height: 300px;
    }
    
    .multiplier-timer {
        top: 5px;
        right: 5px;
        min-width: 120px;
        padding: 0.4rem;
    }
    
    .multiplier-timer h4 {
        font-size: 0.65rem;
    }
    
    .active-multiplier .mult-label {
        font-size: 0.85rem;
    }
    
    .active-multiplier .mult-time {
        font-size: 0.65rem;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

@keyframes bite {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95) rotate(2deg);
    }
    100% {
        transform: scale(1);
    }
}

.burger.bite {
    animation: bite 0.2s ease;
}

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

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

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

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--vx, 0), var(--vy, 0)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes colorPulse {
    0% { 
        box-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
        border-color: #ff0000;
    }
    25% { 
        box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
        border-color: #00ff00;
    }
    50% { 
        box-shadow: 0 0 20px #0000ff, 0 0 40px #0000ff;
        border-color: #0000ff;
    }
    75% { 
        box-shadow: 0 0 20px #ffff00, 0 0 40px #ffff00;
        border-color: #ffff00;
    }
    100% { 
        box-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
        border-color: #ff0000;
    }
}

@keyframes neonGlow {
    0%, 100% {
        text-shadow: 0 0 10px #ff00de, 0 0 20px #ff00de, 0 0 30px #ff00de;
    }
    25% {
        text-shadow: 0 0 10px #00fff9, 0 0 20px #00fff9, 0 0 30px #00fff9;
    }
    50% {
        text-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14, 0 0 30px #39ff14;
    }
    75% {
        text-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00, 0 0 30px #ffff00;
    }
}

.screen-shake {
    animation: shake 0.5s ease-in-out;
}

.particle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    animation: explode 1s ease-out forwards, rainbow 0.5s linear infinite;
    z-index: 9999;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.chaos-mode {
    animation: rainbow 2s linear infinite;
}

.combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 20px #FF0000, 0 0 40px #FF00FF;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: neonGlow 1s ease-in-out infinite;
}

.combo-display.show {
    opacity: 1;
    animation: pulse 0.5s ease-in-out;
}

.speed-boost {
    position: absolute;
    padding: 10px 20px;
    background: linear-gradient(135deg, #00ff00, #00ffff);
    color: #000;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    animation: float 3s ease-in-out infinite, spawn 0.5s ease-out, colorPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    transition: transform 0.2s ease;
    z-index: 100;
    border: 3px solid #00ff00;
}

.speed-boost:hover {
    transform: scale(1.2);
}

.flying-multiplier {
    position: fixed;
    padding: 15px 25px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    pointer-events: auto;
    animation: flyAcross 4s linear forwards;
    box-shadow: 0 0 30px currentColor;
    text-shadow: 0 0 10px #fff;
    transition: transform 0.1s ease;
}

.flying-multiplier:hover {
    transform: scale(1.3) rotate(10deg);
}

.flying-multiplier.x8 {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    border: 3px solid #ff0000;
    animation: flyAcross 4s linear forwards, flash 0.5s ease-in-out infinite;
}

.flying-multiplier.x16 {
    background: linear-gradient(135deg, #ffd93d, #f7b731);
    color: #000;
    border: 3px solid #ff8c00;
    box-shadow: 0 0 30px #ffd93d;
    animation: flyAcross 4s linear forwards, flash 0.3s ease-in-out infinite;
}

.flying-multiplier.x24 {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7, #ff00ff, #00ffff);
    background-size: 200% 200%;
    color: #fff;
    border: 3px solid #5f27cd;
    box-shadow: 0 0 40px #a29bfe, 0 0 60px #ff00ff;
    animation: flyAcross 4s linear forwards, pulse 0.5s ease-in-out infinite, rainbow 2s linear infinite, flash 0.2s ease-in-out infinite;
}

@keyframes flyAcross {
    0% {
        left: var(--start-x);
        top: var(--start-y);
        opacity: 1;
    }
    100% {
        left: var(--end-x);
        top: var(--end-y);
        opacity: 1;
    }
}

.random-event {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 9999;
    animation: fadeInUp 0.5s ease-out, colorPulse 1s ease-in-out infinite, neonGlow 1s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
    border: 2px solid #ff0000;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, var(--card-bg), var(--bg-color));
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--accent-color);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.5);
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
}

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

/* Leaderboard Toggle Button */
.leaderboard-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 500;
    transition: transform 0.2s ease;
}

.leaderboard-toggle:hover {
    transform: scale(1.05);
}

/* Leaderboard Content */
.leaderboard-content {
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--accent-color);
}

.leaderboard-list {
    margin: 1.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.leaderboard-entry.top1 {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-entry.top2 {
    border-left-color: #C0C0C0;
    background: rgba(192, 192, 192, 0.1);
}

.leaderboard-entry.top3 {
    border-left-color: #CD7F32;
    background: rgba(205, 127, 50, 0.1);
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    width: 40px;
}

.leaderboard-name {
    flex: 1;
    text-align: left;
    color: var(--text-color);
    font-weight: bold;
}

.leaderboard-stats {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.leaderboard-tier {
    color: var(--accent-color);
    font-size: 0.75rem;
}
