:root {
    --primary: #4cc9f0;
    --bg-dark: #0a0a12;
    --glass: rgba(10, 20, 40, 0.85);
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    z-index: 9999;
    transition: opacity 0.5s;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(76, 201, 240, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#ui-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

/* === AUDIO BUTTON STYLE === */
.ui-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    pointer-events: auto;
    background: var(--glass);
    border: 1px solid #ff3333; /* Start red for muted */
    color: #ff3333;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s ease;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.ui-btn:hover {
    background: #0a0a12;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
}

#info-panel {
    position: absolute;
    top: 20px; left: 20px;
    background: var(--glass);
    padding: 15px;
    border-left: 4px solid var(--primary);
    color: #fff;
    backdrop-filter: blur(4px);
    transition: transform 0.1s, border-color 0.3s;
    pointer-events: auto;
}

#info-panel h1 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
}

#current-location {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

#coordinates {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 5px;
}

#clock-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(76, 201, 240, 0.3);
}

#game-clock {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

#gauge-container {
    position: absolute;
    bottom: 30px; right: 30px;
    width: 120px; height: 120px;
}

.gauge-rim {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.8) 100%);
    border: 2px solid #333;
    position: relative;
}

.gauge-ticks {
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

#needle {
    position: absolute;
    top: 50%; left: 50%;
    width: 45%; height: 2px;
    background: #ff3333;
    transform-origin: 0% 50%;
    transform: translateX(-50%) rotate(-120deg);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

#gauge-center {
    position: absolute;
    top: 60%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#gauge-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

#gauge-unit {
    font-size: 0.6rem;
    color: #888;
}

#minimap-container {
    position: absolute;
    bottom: 30px; left: 30px;
    width: 150px; height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #444;
    background: #000;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#controls-hint {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
}

.key {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #666;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    font-size: 0.7rem;
    margin: 0 2px;
}

#touch-controls {
    display: none; /* Hidden on desktop */
    position: absolute;
    bottom: 20px; right: 20px;
    display: grid;
    grid-template-columns: repeat(3, 50px);
    gap: 10px;
    pointer-events: auto;
}

@media (pointer: coarse) {
    #touch-controls { display: grid; }
    #controls-hint { display: none; }
}

.touch-btn {
    width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 10px;
    font-size: 1.2rem;
    touch-action: manipulation;
}