:root {
    --bg: #0b0f18;
    --panel: rgba(10, 14, 24, 0.92);
    --text: #e8eefc;
    --muted: rgba(232, 238, 252, 0.75);
    --line: rgba(232, 238, 252, 0.15);
    --btn: rgba(255, 255, 255, 0.08);
    --btnHover: rgba(255, 255, 255, 0.12);
    --btnPrimary: rgba(90, 160, 255, 0.9);
    --btnPrimaryHover: rgba(90, 160, 255, 1);
    --fuel: rgba(80, 210, 120, 0.95);
    --fuelLow: rgba(255, 90, 90, 0.95);
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    height: 100%;
    overflow: hidden;
}

#game-wrap {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hidden { display: none !important; }

/* HUD */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 20;
    pointer-events: none;
}

.hud-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.hud-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    backdrop-filter: blur(6px);
    font-size: 14px;
}

.label {
    color: var(--muted);
    margin-right: 6px;
}

.fuel-wrap {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fuel-bar {
    width: min(52vw, 260px);
    height: 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

.fuel-fill {
    height: 100%;
    width: 100%;
    background: var(--fuel);
    transition: width 80ms linear;
}

.fuel-text {
    width: 54px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: var(--muted);
}

/* Overlays */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    padding: 18px;
}

.panel {
    width: min(520px, 92vw);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

.title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 14px;
}

.controls {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    margin: 12px 0;
}

.controls-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.controls ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.5;
}

.stats {
    display: grid;
    gap: 6px;
    color: var(--muted);
    margin-bottom: 14px;
}

.tip {
    margin: 10px 0 14px 0;
    color: var(--muted);
    font-size: 14px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px 14px;
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--btn);
    color: var(--text);
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
}

.btn:hover {
    background: var(--btnHover);
}

.btn.primary {
    background: var(--btnPrimary);
    border-color: rgba(90,160,255,0.35);
    color: #07101f;
}

.btn.primary:hover {
    background: var(--btnPrimaryHover);
}

/* Touch zones (invisible, but could be helpful to debug) */
.touch-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
    pointer-events: auto;
    background: rgba(255,255,255,0);
}
#touch-left { left: 0; }
#touch-right { right: 0; }
