/* ===== CSS Variables ===== */
:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #ffd700;
    --bg-gradient-start: #1a0f0a;
    --bg-gradient-end: #2d1a14;
    --text-color: #ffffff;
    --text-secondary: #ffccaa;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --success-color: #4caf50;
    --burger-red: #d32f2f;
    --burger-orange: #ff6b35;
    --burger-yellow: #ffd700;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', 'Arial Bold', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-color);
    overflow-y: auto;
    min-height: 100vh;
    position: relative;
}

/* ===== Header ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 3px solid var(--burger-orange);
}

.back-btn {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 2px solid var(--burger-orange);
    transition: all 0.3s ease;
    font-weight: bold;
}

.back-btn:hover {
    background: var(--burger-orange);
    transform: translateX(-5px);
}

.game-title {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--burger-yellow), var(--burger-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.score-display {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--burger-yellow);
    min-width: 100px;
    text-align: right;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ===== Game Container ===== */
#game-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-gradient-start);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* ===== Instructions Panel (Left Side) ===== */
#instructions-panel {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 260px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(211, 47, 47, 0.15));
    backdrop-filter: blur(20px);
    border-right: 3px solid var(--burger-orange);
    z-index: 40;
    overflow-y: auto;
    animation: slideInLeft 0.5s ease;
}

.panel-content {
    padding: 30px 20px;
}

.panel-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--burger-yellow), var(--burger-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.panel-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}

.instructions-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--burger-orange);
}

.instructions-section h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--burger-yellow);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
    font-weight: 900;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(255, 215, 0, 0.15);
    transform: translateX(5px);
}

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

.instruction-text {
    flex: 1;
}

.instruction-text strong {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: bold;
}

.instruction-text small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tips-section {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(76, 175, 80, 0.5);
    margin-bottom: 20px;
}

.tips-section h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--success-color);
    font-weight: 900;
}

.tips-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 8px 0;
    padding-left: 5px;
}

.ingredients-section {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(247, 147, 30, 0.15));
    border-radius: 15px;
    padding: 20px;
    border: 2px solid var(--burger-orange);
}

.ingredients-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--burger-orange);
    font-weight: 900;
}

.ingredient-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ingredient-list span {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid var(--card-border);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Overlay Screens ===== */
.overlay-screen {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.5s ease;
}

.overlay-screen.hidden {
    display: none;
}

.screen-content {
    text-align: center;
    padding: 40px;
    max-width: 600px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(211, 47, 47, 0.2));
    border-radius: 20px;
    border: 3px solid var(--burger-orange);
    box-shadow: 0 20px 60px rgba(255, 107, 53, 0.4);
}

.title-main {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--burger-yellow), var(--burger-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.title-sub {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: bold;
}

/* ===== Buttons ===== */
.game-btn {
    font-size: 1.2rem;
    padding: 15px 40px;
    margin: 10px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.game-btn:hover::before {
    width: 300px;
    height: 300px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--burger-orange), var(--burger-red));
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.7);
}

.secondary-btn {
    background: linear-gradient(135deg, #555, #333);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.secondary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* ===== Stats Display ===== */
.final-stats {
    margin: 30px 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px 30px;
    margin: 10px;
    border: 3px solid var(--burger-orange);
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--burger-yellow);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ===== Game HUD ===== */
#game-hud {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    gap: 20px;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 3px solid var(--burger-orange);
}

#game-hud.hidden {
    display: none;
}

.hud-top {
    display: flex;
    gap: 30px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hud-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.hud-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--burger-yellow);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ===== Perfect Notification ===== */
#perfect-notification {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    background: linear-gradient(135deg, var(--burger-yellow), var(--burger-orange));
    padding: 20px 40px;
    border-radius: 20px;
    border: 3px solid white;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6);
    animation: perfectPop 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#perfect-notification.hidden {
    display: none;
}

.perfect-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.perfect-bonus {
    font-size: 2rem;
    font-weight: 900;
    color: var(--success-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes perfectPop {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateX(-50%) scale(1.2);
    }

    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* ===== Particle Container ===== */
#particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    #instructions-panel {
        width: 280px;
    }

    .panel-content {
        padding: 20px 15px;
    }

    .panel-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    #instructions-panel {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #instructions-panel.show {
        transform: translateX(0);
    }

    #game-canvas {
        width: 100%;
    }

    #game-container {
        flex-direction: column;
    }

    .title-main {
        font-size: 2rem;
    }

    .title-sub {
        font-size: 1rem;
    }

    .game-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }

    .screen-content {
        padding: 20px;
        margin: 20px;
    }

    #game-hud {
        top: 65px;
        padding: 10px 20px;
        gap: 15px;
    }

    .hud-top {
        gap: 15px;
    }

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

    .stat-item {
        min-width: 120px;
        padding: 15px 20px;
    }

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

@media (max-width: 480px) {
    header {
        height: 50px;
        padding: 0 10px;
    }

    .game-title {
        font-size: 1.2rem;
    }

    .back-btn {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .score-display {
        font-size: 1.4rem;
        min-width: 80px;
    }

    #instructions-panel {
        width: 100%;
        max-width: 300px;
    }

    .ingredient-list {
        grid-template-columns: 1fr;
    }
}

/* ===== Bottom Ad ===== */
#bottom-ad {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 50px;
    z-index: 9999;
    display: block;
}

/* Adsterra Banner - Right Side Center (Desktop Only) */
/* Adsterra Banner - Right Side Bottom (Desktop Only) */
#adsterra-banner {
    position: fixed;
    top: auto;
    bottom: 5px;
    right: 10px;
    transform: none;
    z-index: 9000;
    display: none;
    width: 160px;
    height: 600px;
}

@media (min-width: 1024px) {
    #adsterra-banner {
        display: block;
    }
}