/* ============================================
   RELATIVISTIC ROCKET SIMULATOR - Styles
   ============================================ */

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ---- Top HUD ---- */
#top-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 15px 20px 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: 10;
    pointer-events: none;
}

.hud-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.hud-subtitle {
    font-size: 13px;
    color: #888;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ---- Time Display ---- */
#time-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.time-panel {
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px 25px;
    width: 260px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.ship-time-panel {
    border-color: rgba(0, 200, 255, 0.3);
}

.earth-time-panel {
    border-color: rgba(0, 255, 100, 0.3);
}

.time-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 6px;
}

.ship-time-panel .time-value {
    color: #00d4ff;
}

.earth-time-panel .time-value {
    color: #00ff88;
}

.time-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.time-sub {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.time-date {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

.ship-time-panel .time-date { color: rgba(0, 212, 255, 0.7); }
.earth-time-panel .time-date { color: rgba(0, 255, 136, 0.7); }

/* ---- Velocity Display ---- */
#velocity-display {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.vel-ring {
    width: 180px;
    height: 180px;
    position: relative;
}

.vel-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.vel-track {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 6;
}

.vel-progress {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.1s ease, stroke 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5));
}

.vel-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.vel-percent {
    font-size: 28px;
    font-weight: 700;
    color: #00d4ff;
    font-variant-numeric: tabular-nums;
}

.vel-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Details Panel ---- */
#details-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

#details-panel h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #aaa;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}

.detail-label {
    color: #888;
}

.detail-explainer {
    font-size: 12px;
    line-height: 1.6;
    color: #aab;
    padding: 4px 0;
}

.detail-explainer .fuel-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-explainer .fuel-value {
    color: #00d4ff;
    font-weight: 600;
}

.detail-explainer .fuel-highlight {
    color: #ffaa00;
    font-weight: 600;
}

.detail-value {
    color: #e0e0e0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Info icons */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0, 200, 255, 0.15);
    border: 1px solid rgba(0, 200, 255, 0.3);
    color: #00d4ff;
    font-size: 9px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    transition: all 0.2s;
    flex-shrink: 0;
}

.info-icon:hover {
    background: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.6);
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.4);
}

/* Info Popover */
.info-popover {
    position: fixed;
    z-index: 1000;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(12, 18, 35, 0.97);
    border: 1px solid rgba(0, 200, 255, 0.25);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 200, 255, 0.08);
    backdrop-filter: blur(20px);
    animation: popover-in 0.2s ease-out;
}

@keyframes popover-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.info-popover-title {
    font-size: 15px;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
    letter-spacing: 0.5px;
}

.info-popover-body {
    font-size: 12.5px;
    line-height: 1.7;
    color: #bbc8d8;
}

.info-popover-body p {
    margin: 0 0 10px 0;
}

.info-popover-body .info-formula {
    display: block;
    background: rgba(0, 200, 255, 0.06);
    border: 1px solid rgba(0, 200, 255, 0.12);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #00d4ff;
    text-align: center;
    letter-spacing: 0.5px;
}

.info-popover-body .info-example {
    display: block;
    background: rgba(255, 200, 0, 0.06);
    border-left: 3px solid rgba(255, 200, 0, 0.3);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #ddc;
}

.info-popover-body .info-highlight {
    color: #ffcc44;
    font-weight: 600;
}

.info-popover-body .info-key {
    color: #00d4ff;
    font-weight: 600;
}

.info-popover-close {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #556;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.info-popover-close:hover {
    color: #aaa;
}

/* ---- Controls Panel ---- */
#controls-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

#controls-panel h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #aaa;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.control-group {
    margin-bottom: 16px;
}

.control-group label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select, input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input[type="number"]:focus {
    border-color: rgba(0, 200, 255, 0.5);
}

select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

select optgroup {
    background: #12122a;
    color: #00d4ff;
    font-style: normal;
    font-weight: bold;
    padding: 4px 0;
}

select optgroup option {
    font-weight: normal;
    color: #e0e0e0;
    padding-left: 8px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-wrap: wrap;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00d4ff;
    cursor: pointer;
}

.expansion-warning {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
}

.expansion-warning.warn-reachable {
    background: rgba(0, 200, 255, 0.1);
    border: 1px solid rgba(0, 200, 255, 0.2);
    color: #88ccdd;
}

.expansion-warning.warn-unreachable {
    background: rgba(255, 80, 40, 0.12);
    border: 1px solid rgba(255, 80, 40, 0.3);
    color: #ff8866;
}

/* Toggle buttons */
.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.toggle-btn:hover {
    border-color: rgba(0, 200, 255, 0.3);
}

.toggle-btn.active {
    background: rgba(0, 200, 255, 0.15);
    border-color: rgba(0, 200, 255, 0.5);
    color: #00d4ff;
}

.toggle-sub {
    display: block;
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.toggle-btn.active .toggle-sub {
    color: rgba(0, 200, 255, 0.6);
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #00d4ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00d4ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #555;
}

/* Acceleration slider zones & floor marker */
.accel-slider-wrap {
    position: relative;
}
.accel-slider-wrap input[type="range"] {
    position: relative;
    z-index: 2;
}
.accel-zones {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 3px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.accel-zone { height: 100%; }
.zone-comfort { background: #0c6; }      /* 0–1.5g: comfortable */
.zone-human { background: #f90; }        /* 1.5–3g: human limit */
.zone-extreme { background: #f33; }      /* 3–10g: robotic only */
.accel-floor-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff0;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 6px #ff0;
    transition: left 0.15s ease;
}
.accel-warning {
    font-size: 10px;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
}
.accel-warning.warn-comfort { color: #0c6; }
.accel-warning.warn-human { color: #f90; }
.accel-warning.warn-extreme { color: #f55; }
.accel-warning.warn-pnr { color: #ff0; background: rgba(255,255,0,0.1); }
.accel-warning.warn-floor { color: #f44; background: rgba(255,68,68,0.1); }

/* Buttons */
.button-group {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-danger {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #00aaff, #0066cc);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 150, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 150, 255, 0.5);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.12);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger {
    background: rgba(255, 60, 60, 0.15);
    color: #ff6666;
    border: 1px solid rgba(255, 60, 60, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 60, 60, 0.25);
}

/* ---- Length Contraction Visual ---- */
#contraction-visual {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 250px;
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px 20px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.contraction-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 12px;
}

.contraction-bar-group {
    margin-bottom: 10px;
}

.contraction-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.contraction-bar {
    height: 12px;
    border-radius: 6px;
    transition: width 0.15s ease;
}

.rest-bar {
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 255, 100, 0.3), rgba(0, 255, 100, 0.15));
    border: 1px solid rgba(0, 255, 100, 0.3);
}

.contracted-bar {
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.3), rgba(0, 200, 255, 0.15));
    border: 1px solid rgba(0, 200, 255, 0.3);
}

/* ---- Clock Visual ---- */
#clock-visual {
    position: fixed;
    bottom: 30px;
    left: 20px;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.clock-container {
    text-align: center;
}

.clock-container canvas {
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.clock-label {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* ---- Animations ---- */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 200, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 200, 255, 0.4); }
}

.ship-time-panel.active {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   DESKTOP: wrapper divs are invisible to layout
   ============================================ */
#mobile-shell,
#tab-content-area {
    display: contents;
}

#mobile-tabs { display: none; }
.speed-panel { display: none; }
#fuel-panel, #clocks-panel { display: none; }

.mobile-clocks {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px 0;
}

.clock-time {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.clocks-launch-date {
    text-align: center;
    font-size: 12px;
    color: #889;
    padding: 10px 0 5px;
    letter-spacing: 0.5px;
}

.clocks-launch-date span {
    color: #00d4ff;
    font-weight: 600;
}

.clocks-sim-speed {
    padding: 15px 20px 5px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 10px;
}

.clocks-sim-speed label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* ========================================
   RESPONSIVE — Tablets & Small Desktops
   ======================================== */
@media (max-width: 1100px) {
    #controls-panel, #details-panel {
        width: 240px;
        padding: 14px;
    }
    .detail-row { font-size: 12px; }
    .hud-title { font-size: 22px; letter-spacing: 2px; }
}

/* ========================================
   RESPONSIVE — Mobile App Shell
   Zero document scrolling. Flex column layout.
   Only the active tab content area scrolls.
   ======================================== */
@media (max-width: 900px) {
    /* ---- Body: fixed flex column, no scrolling ---- */
    body {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    /* ---- Canvas: relative in flex, not fixed/sticky ---- */
    #canvas-container {
        position: relative;
        flex: 0 0 35vh;
        max-height: 280px;
        min-height: 160px;
        width: 100%;
        z-index: 0;
    }

    /* ---- Title overlays the canvas ---- */
    #top-hud {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 4px 10px;
        z-index: 2;
    }
    .hud-title { font-size: 11px; letter-spacing: 0.5px; opacity: 0.6; }
    .hud-subtitle { display: none; }

    /* ---- Mobile shell: flex column for time + tabs + content ---- */
    #mobile-shell {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* ---- Time display: compact bar, always visible ---- */
    #time-display {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        flex: 0 0 auto;
        display: flex;
        gap: 4px;
        padding: 4px 6px;
        background: rgba(10, 15, 25, 0.98);
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .time-panel {
        width: auto;
        flex: 1;
        min-width: 0;
        padding: 4px 6px;
        border-radius: 6px;
    }
    .time-value { font-size: 14px; }
    .time-label { font-size: 7px; letter-spacing: 0.3px; }
    .time-sub { display: none; }
    .time-date { display: none; }

    /* Speed panel: visible on mobile between time panels */
    .speed-panel {
        display: block !important;
        flex: 0 0 auto;
        padding: 4px 10px;
        border-color: rgba(255, 200, 0, 0.3);
    }
    .speed-panel .time-value {
        color: #ffcc44;
        font-size: 14px;
    }
    .speed-panel .time-label {
        color: #aa8;
    }

    /* ---- Tab bar: always visible ---- */
    #mobile-tabs {
        display: flex;
        flex: 0 0 auto;
        background: rgba(8, 12, 20, 0.98);
        border-bottom: 1px solid rgba(0, 200, 255, 0.15);
    }

    .mobile-tab {
        flex: 1;
        padding: 8px 2px;
        background: none;
        border: none;
        border-bottom: 2px solid transparent;
        color: #556;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        cursor: pointer;
        transition: all 0.15s;
    }

    .mobile-tab.active {
        color: #00d4ff;
        border-bottom-color: #00d4ff;
        background: rgba(0, 200, 255, 0.05);
    }

    /* ---- Tab content area: ONLY scrolling region ---- */
    #tab-content-area {
        display: block;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        background: rgba(10, 15, 25, 0.95);
    }

    /* Tab panels: only active one shown */
    #tab-content-area [data-tab-panel] {
        display: none !important;
    }
    #tab-content-area [data-tab-panel].tab-active {
        display: block !important;
    }

    /* ---- All panels: relative, full-width, no transparency ---- */
    #controls-panel,
    #details-panel,
    #fuel-panel,
    #clocks-panel {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        border-radius: 0;
        border: none;
        background: transparent;
        backdrop-filter: none;
        padding: 12px 14px;
    }

    #controls-panel h3,
    #details-panel h3,
    #fuel-panel h3,
    #clocks-panel h3 {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .control-group { margin-bottom: 10px; }
    .control-group label { font-size: 10px; margin-bottom: 3px; }
    select, input[type="number"] { font-size: 13px; padding: 6px 10px; }

    .detail-row { font-size: 12px; padding: 3px 0; }
    .detail-label { font-size: 11px; }
    .detail-value { font-size: 12px; }

    .toggle-btn { font-size: 11px; padding: 6px 4px; }
    .toggle-sub { font-size: 8px; }

    .btn-primary, .btn-secondary, .btn-danger {
        font-size: 11px;
        padding: 8px 6px;
        letter-spacing: 0.5px;
    }
    .button-group { margin-top: 10px; }

    /* Expansion warning compact */
    .expansion-warning { font-size: 10px; padding: 4px 8px; }

    /* Fuel section */
    .detail-explainer { font-size: 11px; line-height: 1.5; }
    .detail-explainer .fuel-line { padding: 2px 0; }

    /* ---- Hide desktop-only elements ---- */
    #clock-visual { display: none; }
    .desktop-fuel { display: none; }

    /* ---- Info popover: bottom sheet ---- */
    .info-popover {
        position: fixed;
        bottom: 0;
        left: 0 !important;
        right: 0;
        top: auto !important;
        width: 100%;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        z-index: 1000;
        animation: popover-slide-up 0.2s ease-out;
    }

    @keyframes popover-slide-up {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
}

/* Landscape handled by portrait-lock overlay in index.html */

/* ---- Small phones ---- */
@media (max-width: 400px) {
    .hud-title { font-size: 11px; }
    .time-value { font-size: 12px; }
    .time-panel { padding: 3px 4px; }
    .speed-panel .time-value { font-size: 12px; }
    .mobile-tab { font-size: 9px; padding: 6px 1px; }
}
