:root {
    --bg-color: #f8f0d6;
    --container-bg: #ffeaa7;
    --ui-text: #5d4037;
    --accent-color: #ffab91;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#main-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
}

#game-container {
    position: relative;
    width: 100vw;
    /* Responsive width */
    max-width: 500px;
    height: 80vh;
    /* Responsive height */
    max-height: 800px;
    background-color: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

#evolution-guide {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
    height: 360px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#evolution-guide h3 {
    margin: 0 0 20px 0;
    color: var(--ui-text);
    font-size: 1.2rem;
}

#wheel-container {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 20px solid rgba(255, 255, 255, 0.4);
    box-sizing: content-box;
    /* Ensure border adds to size */
}

.wheel-fruit {
    position: absolute;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.wheel-fruit:hover {
    transform: scale(1.2);
    z-index: 10;
}

.wheel-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: rgba(93, 64, 55, 0.2);
    font-weight: bold;
    pointer-events: none;
}

@media (max-width: 900px) {
    #main-wrapper {
        flex-direction: column;
    }

    #evolution-guide {
        display: none;
        /* Hide on small screens for now to avoid clutter */
    }
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    display: flex;
    justify-content: space-between;
}

#score-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--ui-text);
    font-weight: bold;
}

.score-item .label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.score-item .value {
    font-size: 1.2rem;
}

#next-fruit-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    height: 90px;
}

#next-fruit-display {
    margin-top: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    /* Placeholder */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Game Over Modal */
#game-over-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

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

h2 {
    margin-top: 0;
    color: var(--ui-text);
}

button {
    background-color: var(--accent-color);
    border: none;
    padding: 10px 20px;
    color: white;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.1s;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}