:root {
    --blue: #2196F3;
    --orange: #FF9800;
    --dark: #111;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--dark);
    font-family: 'Segoe UI', system-ui, sans-serif;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Layer */
#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;
}

#scoreboard {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.score-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 25px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 4px solid #fff;
    min-width: 80px;
}

.score-box.blue { border-color: var(--blue); color: var(--blue); }
.score-box.orange { border-color: var(--orange); color: var(--orange); }

.score-box .label { font-size: 0.8rem; font-weight: bold; letter-spacing: 1px; }
.score-box span[id^="score"] { font-size: 3rem; font-weight: 900; line-height: 1; }

.timer-box {
    background: #222;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.5rem;
    border: 1px solid #444;
    margin-top: 10px;
}

#game-message {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 5;
}
#game-message.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

#controls-hint {
    align-self: center;
    background: rgba(0,0,0,0.7);
    padding: 15px 30px;
    border-radius: 30px;
    color: #ccc;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.key {
    display: inline-block;
    background: #eee;
    color: #111;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 0 #999;
    font-size: 0.8rem;
    margin: 0 2px;
}

/* Menus */
#main-menu, #settings-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(30,30,40,0.95), #000);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
    pointer-events: auto;
}

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

.menu-content {
    text-align: center;
    border: 1px solid #333;
    padding: 40px;
    background: rgba(255,255,255,0.02);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 10px;
    min-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Scroll Area for Settings */
.scroll-area {
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 20px;
    text-align: left;
    flex: 1;
}
.scroll-area::-webkit-scrollbar { width: 8px; }
.scroll-area::-webkit-scrollbar-track { background: #222; }
.scroll-area::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

h1, h2 {
    margin: 0;
    font-style: italic;
    text-transform: uppercase;
    background: linear-gradient(to right, var(--blue), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}
h1 { font-size: 3.5rem; }
p { color: #888; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 40px; }

.button-stack { display: flex; flex-direction: column; gap: 15px; width: 300px; margin: 0 auto; }

button {
    background: transparent;
    border: 2px solid #444;
    color: #fff;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

button:hover { background: #fff; color: #000; border-color: #fff; transform: scale(1.05); }
button.secondary { font-size: 0.9rem; padding: 10px; opacity: 0.8; }
button.restart-btn { 
    border-color: #f44336; color: #ffcdd2; 
    margin-bottom: 15px; width: 100%;
    font-size: 0.9rem; padding: 10px;
}
button.restart-btn:hover { background: #f44336; color: #fff; }

.specs { margin-top: 30px; font-size: 0.7rem; color: #444; }

.section-title {
    font-size: 0.9rem;
    color: #fff;
    border-bottom: 2px solid #555;
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.sub-header {
    font-size: 0.75rem;
    color: #888;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.option-row, .config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    color: #fff;
    font-size: 0.9rem;
}

.config-row { flex-direction: column; align-items: flex-start; gap: 5px; margin-bottom: 10px; }
.config-row label { display: flex; justify-content: space-between; width: 100%; color: #ccc;}
.config-row span { color: var(--blue); font-family: monospace; font-weight: bold; }
.config-row input[type="range"] { width: 100%; cursor: pointer; accent-color: var(--blue); }

select {
    background: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    max-width: 150px;
}
select:hover { border-color: var(--blue); }
