:root {
    --primary-color: #ff9e7d;
    --accent-color: #6c5ce7;
    --bg-gradient: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --font-main: 'Outfit', 'Zen Maru Gothic', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-gradient);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#game-container.playing {
    cursor: none;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #f0f0f0;
}

/* UI Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    pointer-events: none;
    z-index: 10;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timer-container,
.stock-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.progress-bg {
    width: 150px;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    transition: width 0.3s;
}

.progress-bar-container {
    width: 60%;
    margin: 0 auto;
}

.progress-bar-container .progress-bg {
    width: 100%;
    height: 12px;
    position: relative;
    overflow: visible;
}

.progress-cat-icon {
    position: absolute;
    top: -15px;
    transform: translateX(-50%);
    font-size: 24px;
    transition: left 0.3s;
    left: 0%;
}

/* Overlay & Screens */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.hidden {
    display: none !important;
}

.screen {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.rules {
    text-align: left;
    margin: 20px 0;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 10px 20px rgba(255, 158, 125, 0.3);
}

button:hover {
    transform: translateY(-3px);
    background: #ff8b61;
}

button:active {
    transform: translateY(0);
}

.stats {
    margin: 20px 0;
    font-size: 1.2rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .progress-bg {
        width: 80px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .screen {
        padding: 25px;
    }

    #game-container {
        cursor: auto;
    }
}