:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #f1c40f;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --bg-color: #ecf0f1;
    --text-color: #2c3e50;
    --font-family: 'Rubik', 'Assistant', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Prevent text selection during game */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 600px;
    /* Mobile-first but constrained on desktop */
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.game-header {
    height: 60px;
    background: var(--secondary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 10;
}

.lives-container {
    letter-spacing: 2px;
}

/* Conveyor Belt Area */
.conveyor-belt {
    height: 200px;
    background: #222;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 5px solid var(--accent-color);
}

/* Film Strip Effect (Optional visual decoration) */
.conveyor-belt::before,
.conveyor-belt::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 15px;
    background-image: linear-gradient(90deg, #444 50%, transparent 50%);
    background-size: 40px 100%;
    z-index: 1;
}

.conveyor-belt::before {
    top: 10px;
}

.conveyor-belt::after {
    bottom: 10px;
}

/* The Moving Item */
.moving-item {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    /* Animation is handled by JS for restart capability */
    left: -200px;
    /* Start off-screen LEFT */
    direction: rtl;
    /* For Hebrew */
}

.moving-item.animate {
    animation: moveRight 10s linear forwards;
}

@keyframes moveRight {
    from {
        left: -300px;
    }

    to {
        left: 120%;
    }

    /* Move completely off to the RIGHT */
}

/* Options Grid */
.options-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    /* 2x3 grid = 6 options */
    gap: 10px;
    padding: 15px;
    background: var(--bg-color);
}

.option-btn {
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-family: var(--font-family);
    font-weight: bold;
    color: var(--secondary-color);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
}

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

.option-btn.correct {
    background: var(--success-color);
    color: white;
    animation: pulse 0.5s;
}

.option-btn.wrong {
    background: var(--danger-color);
    color: white;
    animation: shake 0.4s;
}

/* Feedback Overlay */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    z-index: 20;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.feedback-overlay.show-correct {
    background: rgba(46, 204, 113, 0.2);
    opacity: 1;
}

.feedback-overlay.show-wrong {
    background: rgba(231, 76, 60, 0.2);
    opacity: 1;
}

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h1,
.modal-content h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 25px;
    color: #7f8c8d;
    line-height: 1.5;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
    transition: transform 0.2s;
}

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

.hidden {
    display: none !important;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive tweaks */
@media (max-height: 600px) {
    .conveyor-belt {
        height: 150px;
    }

    .moving-item {
        font-size: 1.5rem;
        padding: 15px 30px;
    }

    .options-grid {
        gap: 5px;
        padding: 10px;
    }

    .option-btn {
        font-size: 1rem;
    }
}