body {
    margin: 0;
    padding: 0;
    background-color: #87CEEB;
    /* Sky Blue */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    /* Prevent scrolling */
    touch-action: none;
    /* Prevent zoom/scroll on mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

canvas {
    background: linear-gradient(#87CEEB, #E0F7FA);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    max-width: 100%;
    max-height: 100%;
    /* Full height */
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* UI LAYER - Full Screen Overlay */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

/* ZONES */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
}

.menu-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    pointer-events: auto;
}

.center-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    width: 100%;
}



/* TEXT STYLES */
h1 {
    margin: 0;
    font-size: 2rem;
    color: #d35400;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
    display: none;
    /* Hide title during gameplay to save space, show in modal? Or keep it? Let's hide to clean up */
}

.stat-box {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

#score-display {
    color: #d35400;
}

#coin-display {
    color: #f1c40f;
    text-shadow: 1px 1px 0 #b7950b;
}



/* BUTTONS */
.game-btn {
    background-color: #FFD700;
    border: 2px solid #d35400;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 4px 0 #d35400;
    transition: all 0.1s;
    color: #333;
    min-width: 120px;
    text-align: center;
}

.game-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.game-btn:disabled {
    background-color: #ccc;
    border-color: #888;
    box-shadow: none;
    color: #666;
    cursor: not-allowed;
}

#admin-btn {
    background-color: #9b59b6;
    border-color: #8e44ad;
    color: white;
    box-shadow: 0 4px 0 #8e44ad;
    text-shadow: 1px 1px 0 #000;
}

#shop-btn {
    background-color: #FFD700;
}



#locker-btn {
    background-color: #3498db;
    border-color: #2980b9;
    color: white;
    box-shadow: 0 4px 0 #2980b9;
}

#spin-btn {
    background: linear-gradient(45deg, #ff0000, #00ff00, #ffffff, #d4af37);
    background-size: 400% 400%;
    animation: rainbow 3s ease infinite;
    color: white;
    border: 2px solid white;
    text-shadow: 1px 1px 0 black;
    display: none;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

/* OVERLAYS & MESSAGES */
#message {
    font-size: 3rem;
    color: red;
    text-shadow: 2px 2px 0 white;
    display: none;
}

#admin-overlay {
    display: none;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: bold;
    color: #9b59b6;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 20px;
    border-radius: 20px;
    border: 2px solid #9b59b6;
    text-shadow: none;
    pointer-events: none;
}

#resume-overlay {
    display: none;
    font-size: 8rem;
    font-weight: bold;
    color: #d35400;
    text-shadow: 4px 4px 0 white;
    z-index: 200;
}

#powerup-bar-container {
    display: none;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid white;
    overflow: hidden;
}

#powerup-bar {
    width: 100%;
    height: 100%;
    background: #00FF00;
    transition: width 0.1s linear;
}

#powerup-text {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
}

/* MODALS */
.modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 15px;
    border: 4px solid #d35400;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    min-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
}

#shop-modal {
    border-color: #d35400;
}



#locker-modal {
    border-color: #3498db;
    background: #eaf2f8;
}

#admin-modal {
    border-color: #9b59b6;
    background: #f3e5f5;
}

#spin-modal {
    border-color: #27ae60;
    background: #e8f8f5;
}

#wheel-canvas {
    margin: 10px auto;
    display: block;
    border-radius: 50%;
    border: 5px solid #27ae60;
}

#spin-result {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 10px;
    height: 30px;
    color: #27ae60;
}

#shop-timer {
    font-size: 0.9rem;
    color: #d35400;
    margin-bottom: 10px;
    font-weight: bold;
}

#shop-items-container {
    max-height: 250px;
    overflow-y: auto;
}

#locker-items-container {
    max-height: 250px;
    overflow-y: auto;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #eee;
    border-radius: 8px;
}

.buy-btn,
.cheat-btn,
.equip-btn {
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.buy-btn {
    background: #28a745;
}

.cheat-btn {
    background: #9b59b6;
}

.equip-btn {
    background: #3498db;
}

.buy-btn:disabled,
.cheat-btn:disabled,
.equip-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    pointer-events: none;
}

#assets {
    display: none;
}

#quest-progress {
    font-size: 0.8rem;
    color: #555;
    margin-top: 5px;
    font-style: italic;
}