*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #0d1117;
    color: #fff;
    font-family: system-ui, sans-serif;
    height: 100dvh;
    overflow: hidden;
}

/* ── Settings screen ─────────────────────────────────────────────────────── */

#settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 100dvh;
    padding: 40px;
}

#settings h1 {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 48px;
    letter-spacing: -0.5px;
}

.control-group {
    width: 100%;
    max-width: 420px;
    margin-bottom: 28px;
}

.control-group label {
    display: block;
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 8px;
}

input[type=range] {
    width: 100%;
    accent-color: #4fc3f7;
    height: 4px;
    cursor: pointer;
}

/* Mode radio buttons */
.radio-row {
    display: flex;
    gap: 32px;
    margin-top: 4px;
}
.radio-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
}
input[type=radio] { accent-color: #4fc3f7; width: 18px; height: 18px; cursor: pointer; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
    margin-bottom: 0;
}
input[type=checkbox] { accent-color: #4fc3f7; width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }

#startBtn {
    margin-top: 48px;
    width: 220px;
    height: 52px;
    background: #4fc3f7;
    color: #0d1117;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: opacity 0.15s;
}
#startBtn:hover { opacity: 0.85; }

/* ── Simulation screen ───────────────────────────────────────────────────── */

#canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

#backBtn {
    position: fixed;
    top: 14px;
    left: 14px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 10;
    transition: background 0.15s;
}
#backBtn:hover { background: rgba(255,255,255,0.22); }

#fps {
    position: fixed;
    top: 14px;
    right: 14px;
    color: #fff;
    font-size: 0.9rem;
    font-family: monospace;
    z-index: 10;
    pointer-events: none;
}

#fpsCapBtn, #gravBtn {
    position: fixed;
    top: 40px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 10;
    transition: background 0.15s;
}
#fpsCapBtn { top: 40px; right: 14px; }
#gravBtn   { top: 68px; right: 14px; }
#fpsCapBtn:hover, #gravBtn:hover { background: rgba(255,255,255,0.22); }
#gravBtn.disabled { color: rgba(255,255,255,0.4); }

#desktop-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
