:root {
    --bg-color: #0f172a;
    --text-color: #ffffff;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    font-family: 'Outfit', sans-serif;
    touch-action: none;
    overflow-x: hidden;
}

#game-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

@media (min-width: 1024px) {
    #game-wrapper {
        width: calc(100% - 160px);
    }
}

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

#ui-overlay {
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

#score-board {
    display: flex;
    flex-wrap: nowrap; /* Forced 1 row */
    justify-content: center;
    align-items: center;
    gap: 8px; /* Tighter gap for mobile */
    background: rgba(0,0,0,0.6);
    padding: 8px 15px; /* Compact padding */
    border-radius: 40px;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    max-width: 95vw;
}

@media (min-width: 768px) {
    #score-board {
        gap: 20px;
        padding: 10px 30px;
        font-size: 1rem;
    }
}

.hud-item {
    white-space: nowrap;
}

.highlight-pill {
    padding: 2px 8px; /* Tighter padding for mobile */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem; /* Smaller font on mobile base */
}

@media (min-width: 768px) {
    .highlight-pill {
        padding: 4px 12px;
        font-size: 0.9rem;
    }
}

.yellow span, .blue span, .green span { 
    font-size: 1.1rem; 
    font-weight: 800; 
}

.yellow span { color: #ffeb3b; }
.blue span { color: #00e5ff; }
.red span { color: #ff3366; font-size: 1.6rem; font-weight: 950; }
.green span { color: #4ade80; }

.highlight-pill.red {
    background: rgba(255, 51, 102, 0.1);
    border-color: rgba(255, 51, 102, 0.4);
}

#timer-container.urgent {
    background: rgba(255, 51, 102, 0.4);
    border-color: #ff3366;
    animation: pmg-pulse-red 0.5s infinite alternate;
}

@keyframes pmg-pulse-red {
    from { transform: scale(1); box-shadow: 0 0 5px #ff3366; }
    to { transform: scale(1.05); box-shadow: 0 0 15px #ff3366; }
}



.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s;
}

.overlay-box {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(0, 229, 255, 0.1);
    color: white;
    max-width: 90%;
    width: 450px;
}

.pmg-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #00e5ff, #0088cc);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    width: 100%;
}
.pmg-btn:active { transform: scale(0.95); }
.pmg-btn:hover { box-shadow: 0 5px 15px rgba(0, 229, 255, 0.4); }

.pmg-btn-outline {
    color: white; 
    text-decoration: none; 
    border: 2px solid rgba(255,255,255,0.3); 
    padding: 12px 20px; 
    border-radius: 30px; 
    display: inline-block;
    transition: background 0.2s;
}
.pmg-btn-outline:hover { background: rgba(255,255,255,0.1); }

.hidden { display: none !important; opacity: 0; pointer-events: none; }
