:root {
    --primary-color: #f39c12;
    /* Orange boxes */
    --bg-color: #5d9b84;

    /* Win Modal Styling */
    .win-content {
        background: linear-gradient(135deg, #f1c40f, #e67e22);
        color: white;
        padding: 50px;
        border-radius: 20px;
        text-align: center;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        border: 5px solid white;
        animation: popIn 0.5s ease;
        max-width: 500px;
    }

    .win-content h1 {
        font-size: 3rem;
        margin-bottom: 20px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .win-content p {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    @keyframes popIn {
        0% {
            transform: scale(0.8);
            opacity: 0;
        }

        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    /* Confetti Particle */
    .confetti {
        position: fixed;
        width: 10px;
        height: 10px;
        background-color: #f00;
        top: -10px;
        /* Start above screen */
        z-index: 9999;
        opacity: 0.8;
    }

    @keyframes fall {
        0% {
            transform: translateY(0) rotate(0deg);
        }

        100% {
            transform: translateY(100vh) rotate(720deg);
        }
    }

    .progress-container {
        width: 100%;
        height: 10px;
        background-color: #ddd;
        border-radius: 5px;
        margin-bottom: 15px;
        overflow: hidden;
        position: relative;
        cursor: default;
        /* Not clickable by user until valid, or never? User said "bar sona gelince seçim yapabilsin". Didn't say bar is clickable. */
    }

    .progress-bar {
        width: 0%;
        height: 100%;
        background-color: #e67e22;
        /* Orange */
        transition: width 0.1s linear;
    }

    .image-option {
        /* Existing styles... */
        transition: all 0.3s;
    }

    .image-option.locked {
        opacity: 0.5;
        pointer-events: none;
        filter: grayscale(100%);
    }

    --dice-color: #e74c3c;
    /* Red dice */
    --text-dark: #2c3e50;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: #f0f4f8;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    /* Background Image with Overlay (Faded) */
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('background.png');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 12px solid #3498db;
    /* Thicker Blue Border */
    padding: 20px;
    position: relative;
}

/* --- GAME BOARD --- */
.board {
    display: grid;
    /* Responsive Grid: 10 cols, 5 rows */
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(5, 1fr);

    /* Keep aspect ratio 2:1 (10 cols / 5 rows) for square boxes */
    aspect-ratio: 2 / 1;

    width: 100%;
    /* Remove fixed height, use max to fit container */
    height: auto;
    max-height: 100%;

    gap: 10px;
    justify-content: center;
    align-content: center;
    margin: auto;
    /* Center in container */

    position: relative;
    /* overflow: auto; - Removed to prevent scroll bars, let it scale */
}

/* Box Style */
/* Box Style */
.box {
    background-color: var(--primary-color);
    border: 3px solid #000;
    /* Black Border */
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    /* Crucial for highlighter */
    /* Strict sizing */
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    /* Includes border/padding in size */
}

.number-box {
    font-size: clamp(2rem, 5vw, 4rem);
    /* Responsive font size */
}

/* Special box style */
.box.special {
    font-size: 13px;
    /* Slightly smaller to fit more text */
    line-height: 1.2;
    text-align: center;
    background-color: #f1c40f;
    color: #333;
    padding: 5px;
    /* Padding for text */
    flex-direction: column;
    overflow: hidden;
    /* Hide overflow if text is too long */
}

/* Center Area for Dice & Status */
.center-controls {
    grid-column: 1 / 10;
    /* Span empty space left of col 10 */
    grid-row: 2 / 5;
    /* Rows 2, 3, 4 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    /* White transparent background */
    border-radius: 15px;
    padding: 20px;
    gap: 20px;
    width: 100%;
    height: 100%;
}

/* Title removed */
.center-controls h1 {
    display: none;
}

#status-message {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: white;
    background-color: rgba(44, 62, 80, 0.9);
    /* Dark background */
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    min-height: 40px;
    margin-top: 80px;
    /* Increased spacing */
    z-index: 10;
    line-height: 1.2;
}

/* Removed separate controls referencing sidebar */
.logo-area h1 {
    text-align: center;
    line-height: 1.2;
}

/* --- 3D DICE --- */
/* --- 3D DICE (Cube) --- */
.dice-container {
    perspective: 1000px;
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}



.dice-container:active {
    transform: scale(0.9);
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

.face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--dice-color);
    border: 3px solid white;
    border-radius: 12px;
    color: white;
    font-size: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Faces positions */
.front {
    transform: translateZ(50px);
}

.back {
    transform: rotateY(180deg) translateZ(50px);
}

.right {
    transform: rotateY(90deg) translateZ(50px);
}

.left {
    transform: rotateY(-90deg) translateZ(50px);
}

.top {
    transform: rotateX(90deg) translateZ(50px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(50px);
}

/* Movement Highlighter */
.highlighter {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: rgba(231, 76, 60, 0.7);
    /* Red 70% opacity */
    border: 3px solid rgba(231, 76, 60, 0.9);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.7);
    z-index: 50;
    transition: all 0.3s ease;
    border-radius: 10px;
    pointer-events: none;
}

/* --- MODAL (QUESTION WINDOW) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    /* Dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    color: white;
    text-align: center;
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    color: #333;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.overlay h1 {
    color: #e67e22;
    margin-bottom: 20px;
}

#loading-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#start-game-btn {
    padding: 15px 30px;
    font-size: 1.5rem;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
    transition: all 0.3s;
}

#start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.6);
}

.hidden {
    display: none !important;
}

.modal-content.quiz-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    /* Larger to fit images */
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.audio-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.audio-controls {
    display: flex;
    gap: 15px;
}

.ctrl-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    transition: transform 0.2s, background-color 0.2s;
}

#play-btn {
    background-color: #27ae60;
}

#pause-btn {
    background-color: #f39c12;
}

#replay-btn {
    background-color: #2980b9;
}

.ctrl-btn:active {
    transform: scale(0.95);
}

.image-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    flex-wrap: wrap;
    /* Handle small screens */
}

.image-option {
    width: 45%;
    max-width: 300px;
    cursor: pointer;
    border: 5px solid transparent;
    /* Border for feedback */
    border-radius: 15px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-option:hover {
    transform: scale(1.05);
    border-color: #bdc3c7;
}

.image-option img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.feedback {
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 1.5em;
    margin-top: 10px;
    color: #2c3e50;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-btn {
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.option-btn:hover {
    background: #2980b9;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border: none;
        border-radius: 0;
    }

    .board-wrapper {
        flex: 2;
        padding: 5px;
        overflow-x: auto;
    }

    .board {
        gap: 3px;
        min-width: 600px;
    }

    .box {
        height: 40px;
        font-size: 14px;
        border-width: 2px;
    }

    .player {
        width: 40px;
        height: 40px;
    }

    .controls {
        flex: 1;
        flex-direction: row;
        gap: 15px;
        padding: 10px;
    }

    .dice-container {
        width: 60px;
        height: 60px;
    }

    .face {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .front {
        transform: translateZ(30px);
    }

    .back {
        transform: rotateY(180deg) translateZ(30px);
    }

    .right {
        transform: rotateY(90deg) translateZ(30px);
    }

    .left {
        transform: rotateY(-90deg) translateZ(30px);
    }

    .top {
        transform: rotateX(90deg) translateZ(30px);
    }

    .bottom {
        transform: rotateX(-90deg) translateZ(30px);
    }
}