:root {
    --glass: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --neon-green: #39ff14;
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

#hud {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
}

.stat-box {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 12px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    min-width: 200px;
}

.label {
    font-size: 0.8rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
    color: var(--neon-blue);
}

#fitness-stat {
    font-size: 1.2rem;
    font-weight: bold;
}

#power-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}

#power-bar {
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    transition: width 0.5s ease;
}

#quiz-container,
#game-over,
#victory {
    position: absolute;
    /* Centered relative to screen, ignoring flex layout */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    z-index: 50;
    /* Above HUD if needed, or overlaying it */
}

#start-screen {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('LQSintro.png') no-repeat center center;
    background-size: 100% 100%;
    background-color: #000;
    pointer-events: auto;
    z-index: 100;
    /* Ensure it stays on top */
}

#start-screen button {
    display: block;
    margin: 15px auto;
    width: 240px;
}

#start-screen .btn-secondary {
    width: 160px;
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.8;
}

#start-screen .btn-secondary:hover {
    opacity: 1;
    transform: scale(1.05);
}

.tiny-note {
    font-size: 0.65rem;
    color: #888;
    margin-top: 10px;
    font-style: italic;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
}

#controls-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    z-index: 150;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.rebind-btn {
    background: #444;
    color: white;
    padding: 5px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #666;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.rebind-btn:hover {
    background: #555;
    border-color: var(--neon-blue);
}

.rebinding {
    animation: pulse-blue 1s infinite alternate;
    background: var(--neon-blue);
    color: black;
}

@keyframes pulse-blue {
    from {
        box-shadow: 0 0 5px var(--neon-blue);
    }

    to {
        box-shadow: 0 0 15px var(--neon-blue);
    }
}

.hidden {
    display: none !important;
}

.glass-card {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    color: white;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

#quiz-container .glass-card {
    background: url('LQSquiz.png') no-repeat center center;
    background-size: 100% 100%;
    aspect-ratio: 1 / 1;
    width: min(425px, 51vmin);
    /* Reduced by ~15% (was 500px/60vmin) */
    /* Ensure it fits screen while staying square */
    height: auto;
    /* Let aspect ratio handle height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#question-text {
    background: rgb(245, 245, 220);
    /* Opaque Beige */
    color: black;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: 92%;
    /* 8% smaller width */
    margin: 0 auto;
    /* Center it */
}

#options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    /* Tighter spacing for better fit */
    margin-top: 40px;
    width: 92%;
    /* Increased width (tincy bit bigger) */
    margin-left: auto;
    margin-right: auto;
}

.option-btn {
    background: rgb(245, 245, 220);
    /* Opaque Beige */
    border: 2px solid #333;
    padding: 18px;
    /* Increased padding for bigger buttons */
    border-radius: 12px;
    color: rgb(0, 56, 168);
    /* Updated to specific blue */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    position: relative;
    /* Removed negative margin */
}

.option-btn:hover {
    background: rgb(230, 230, 200);
    /* Slightly darker/different beige, NOT white */
    border-color: var(--neon-green);
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.opt-num {
    font-weight: 900;
    margin-right: 10px;
    /* Move to left */
    position: absolute;
    left: 15px;
    color: black;
    /* Force numbers to be black */
}

.opt-text {
    flex-grow: 1;
    text-align: center;
}

button {
    background: var(--neon-green);
    color: black;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--neon-green);
}

.back-link {
    display: block;
    margin-top: 20px;
    color: var(--neon-blue);
    text-decoration: none;
}