@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..800;1,9..40,300..800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --ink: #183a40;
    --ink-dark: #0f2529;
    --muted: #5b777b;
    --teal: #136e73;
    --teal-glow: #1db1ba;
    --coral: #f27867;
    --coral-glow: #ff9383;
    --gold: #ffd66a;
    --sky: #b8e5e5;
    --glass: rgba(255, 255, 255, 0.65);
    --glass-card: rgba(255, 255, 255, 0.78);
    --glass-dark: rgba(24, 58, 64, 0.85);
    --line: rgba(255, 255, 255, 0.72);
    --shadow-soft: 0 12px 36px rgba(24, 58, 64, 0.10);
    --shadow-float: 0 20px 48px rgba(24, 58, 64, 0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--sky);
    color: var(--ink);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

button {
    font: inherit;
    border: none;
    outline: none;
}

button:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 4px;
}

/* -------------------------------------------------------------
   1. 3D Canvas & Ambient Backdrop
   ------------------------------------------------------------- */
#world {
    position: fixed;
    inset: 0;
    touch-action: none;
    z-index: 1;
}

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

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(55, 101, 104, 0.18));
    z-index: 2;
}

#flash {
    position: fixed;
    inset: 0;
    background: var(--coral);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.25s ease-out;
}

/* -------------------------------------------------------------
   2. Main Header
   ------------------------------------------------------------- */
header {
    position: fixed;
    top: max(24px, env(safe-area-inset-top));
    left: 32px;
    right: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    pointer-events: none;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--ink);
    border-radius: 14px;
    color: white;
    display: grid;
    place-items: center;
    transform: rotate(-7deg);
    font-size: 22px;
    box-shadow: 0 8px 20px rgba(24, 58, 64, 0.22);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-icon {
    transform: rotate(0deg) scale(1.06);
}

.brand strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.8px;
    font-size: 22px;
    color: var(--ink);
}

.brand small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: 2.8px;
    font-weight: 700;
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.record, .icon-button, .mobile-toggle-btn {
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.record {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.record span {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.record b {
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
    color: var(--ink);
}

.mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}

.mobile-toggle-btn:hover {
    background: white;
    transform: translateY(-2px);
}

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
    transition: all 0.3s ease;
}

.conn-dot.connected {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.28), 0 0 10px #10b981;
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.icon-button:hover:not(:disabled) {
    background: white;
    transform: translateY(-2px);
}

.icon-button:disabled {
    opacity: 0.38;
    cursor: default;
}

/* -------------------------------------------------------------
   3. HUD (Heads-Up Display)
   ------------------------------------------------------------- */
#hud {
    position: fixed;
    top: 108px;
    left: 34px;
    z-index: 10;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.hud-label {
    font-size: 10px;
    letter-spacing: 2.5px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
}

#score {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(44px, 5.5vw, 68px);
    font-weight: 700;
    letter-spacing: -3.5px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.metrics {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.metric {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(24, 58, 64, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.metric.gold {
    color: #926917;
    background: rgba(255, 248, 224, 0.8);
    border-color: rgba(255, 226, 133, 0.9);
}

.metric.throttle-meter {
    color: var(--teal);
    display: flex;
    gap: 8px;
    align-items: center;
    transition: all 0.2s ease;
}

.throttle-bar-mini {
    width: 38px;
    height: 6px;
    background: rgba(19, 110, 115, 0.15);
    border-radius: 999px;
    overflow: hidden;
}

.throttle-bar-fill {
    height: 100%;
    width: 50%;
    background: var(--teal);
    border-radius: 999px;
    transition: width 0.1s linear, background-color 0.2s ease;
}

/* -------------------------------------------------------------
   4. Menu Overlay & Panels
   ------------------------------------------------------------- */
#overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    padding: 100px max(7vw, 28px);
    background: linear-gradient(90deg, rgba(227, 242, 237, 0.92) 0%, rgba(227, 242, 237, 0.65) 55%, transparent 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.35s ease, visibility 0.35s ease;
    overflow-y: auto;
}

#overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.panel {
    width: min(540px, 100%);
    animation: panelEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes panelEnter {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(24, 58, 64, 0.05);
}

.eyebrow i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #208b78;
    box-shadow: 0 0 0 4px rgba(32, 139, 120, 0.18);
}

h1 {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(48px, 7vw, 92px);
    line-height: 0.98;
    letter-spacing: -4.5px;
    margin: 22px 0 18px;
    font-weight: 700;
    color: var(--ink);
}

h1 em {
    display: block;
    font-style: normal;
    color: var(--teal);
}

#description {
    font-size: 15px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 420px;
    margin-bottom: 24px;
}

.actions-row-main {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

#play {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    min-width: 220px;
    padding: 16px 24px;
    border-radius: 16px;
    background: var(--ink);
    color: white;
    box-shadow: 0 12px 28px rgba(24, 58, 64, 0.28);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-weight: 700;
    font-size: 15px;
}

#play:hover:not(:disabled) {
    transform: translateY(-3px);
    background: var(--teal);
    box-shadow: 0 16px 36px rgba(19, 110, 115, 0.35);
}

#play:disabled {
    opacity: 0.55;
    cursor: wait;
}

#play .arrow {
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.2s ease;
}

#play:hover .arrow {
    transform: translate(3px, -3px);
}

/* -------------------------------------------------------------
   5. Mobile Controller Card inside Menu
   ------------------------------------------------------------- */
.menu-qr-card {
    background: var(--glass-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: var(--shadow-soft);
    margin: 18px 0 20px;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-qr-card:hover {
    box-shadow: var(--shadow-float);
}

.qr-thumb-box {
    background: #ffffff;
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-thumb-box img, .qr-thumb-box canvas {
    display: block;
    border-radius: 6px;
}

.menu-qr-info {
    flex: 1;
    min-width: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(234, 179, 8, 0.15);
    color: #926917;
    margin-bottom: 6px;
}

.status-pill.online {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
}

.menu-qr-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 2px;
}

.menu-qr-desc {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(24, 58, 64, 0.08);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-link-btn:hover {
    background: rgba(24, 58, 64, 0.14);
}

.instructions {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #ffffff;
    border-bottom: 2px solid #b3cfcc;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.85);
    font: 11px "DM Sans", sans-serif;
    font-weight: 700;
    color: var(--ink);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.legend {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.dot.coral {
    background: var(--coral);
}

.dot.yellow {
    background: #e9b947;
    transform: rotate(45deg);
}

/* -------------------------------------------------------------
   6. QR Modal Popup (View Anytime)
   ------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 37, 41, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-float);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-backdrop.open .modal-box {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--ink);
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
}

.modal-title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ink);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.modal-qr-frame {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 20px;
    display: inline-block;
    margin-bottom: 18px;
}

.modal-qr-frame img, .modal-qr-frame canvas {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

.url-box {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-family: monospace;
    color: var(--ink);
    word-break: break-all;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
}

/* -------------------------------------------------------------
   7. Toast Notifications
   ------------------------------------------------------------- */
#toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translate(-50%, -10px);
    border-radius: 30px;
    padding: 10px 22px;
    background: var(--ink);
    color: white;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(24, 58, 64, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
}

#toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* -------------------------------------------------------------
   8. Footer
   ------------------------------------------------------------- */
footer {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 32px;
    right: 32px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
    z-index: 10;
    color: #42666d;
    font-size: 10px;
    letter-spacing: 1.8px;
    font-weight: 600;
}

footer b {
    color: var(--ink);
}

/* -------------------------------------------------------------
   9. Mobile Controller Interface (controller.php)
   ------------------------------------------------------------- */
.controller-body {
    background: #0d1e22;
    color: #f1f5f9;
    font-family: "DM Sans", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow-x: hidden;
}

.controller-bg-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 20%, rgba(29, 177, 186, 0.15) 0%, transparent 60%),
                radial-gradient(circle at 50% 80%, rgba(242, 120, 103, 0.12) 0%, transparent 65%);
    z-index: 0;
}

.controller-card {
    background: rgba(18, 41, 46, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    padding: 22px 20px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    z-index: 5;
    position: relative;
}

.ctrl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ctrl-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--coral);
    color: white;
    display: grid;
    place-items: center;
    font-size: 16px;
    transform: rotate(-7deg);
}

.ctrl-brand strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 17px;
    color: #ffffff;
}

.ctrl-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ctrl-status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

/* Controller Dual Deck: Throttle + Attitude Dial */
.controller-deck {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 16px 0;
    gap: 16px;
}

/* Throttle Lever */
.throttle-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 12px 10px;
    width: 90px;
}

.deck-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 8px;
    font-family: "Space Grotesk", sans-serif;
}

.throttle-track {
    width: 26px;
    height: 150px;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    position: relative;
    touch-action: none;
    display: flex;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.throttle-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(0deg, var(--teal), var(--teal-glow));
    border-radius: 999px;
    pointer-events: none;
}

.throttle-thumb {
    width: 44px;
    height: 30px;
    background: #ffffff;
    border: 2px solid var(--teal-glow);
    border-radius: 10px;
    position: absolute;
    bottom: calc(50% - 15px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 12px rgba(29, 177, 186, 0.5);
    pointer-events: none;
    display: grid;
    place-items: center;
}

.throttle-thumb::after {
    content: '';
    width: 16px;
    height: 3px;
    background: #0d1e22;
    border-radius: 2px;
}

.throttle-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 8px;
}

/* Gyro Attitude Visualizer Dial */
.gyro-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gyro-visualizer {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.22);
    background: radial-gradient(circle, rgba(29, 177, 186, 0.12) 0%, transparent 70%);
    position: relative;
    display: grid;
    place-items: center;
    touch-action: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.gyro-crosshair-x {
    position: absolute;
    width: 80%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.gyro-crosshair-y {
    position: absolute;
    height: 80%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.gyro-plane-cursor {
    width: 40px;
    height: 40px;
    position: absolute;
    pointer-events: none;
    display: grid;
    place-items: center;
    transition: transform 0.04s linear;
}

.gyro-plane-cursor svg {
    filter: drop-shadow(0 0 8px rgba(242, 120, 103, 0.7));
}

/* Big Action Flight Button */
.main-flight-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--teal), #10b981);
    color: white;
    font-family: "Space Grotesk", sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    margin: 12px 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.main-flight-btn:active {
    transform: scale(0.97);
}

.main-flight-btn.paused {
    background: linear-gradient(135deg, #eab308, #d97706);
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.35);
}

.main-flight-btn.gameover {
    background: linear-gradient(135deg, var(--coral), #e11d48);
    box-shadow: 0 10px 25px rgba(242, 120, 103, 0.4);
}

/* Tools Row (Calibrate + Invert) */
.ctrl-tools-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

.ctrl-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.16);
}

.ctrl-btn.active {
    background: rgba(242, 120, 103, 0.25);
    border-color: var(--coral);
    color: var(--coral-glow);
}

/* Sensitivity Row */
.sens-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.sens-label {
    font-size: 11px;
    color: #94a3b8;
    margin-right: 4px;
}

.sens-pill {
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 10px;
    font-weight: 700;
    color: #cbd5e1;
    cursor: pointer;
}

.sens-pill.active {
    background: var(--teal);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(19, 110, 115, 0.4);
}

.telemetry-row {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 10px;
}

/* -------------------------------------------------------------
   10. Responsive Breakpoints
   ------------------------------------------------------------- */
@media (max-width: 640px) {
    header { top: 16px; left: 16px; right: 16px; }
    .brand strong { font-size: 18px; }
    .brand small { display: none; }
    .brand-icon { width: 36px; height: 36px; font-size: 18px; }
    .record { padding: 9px 12px; }
    .record span { display: none; }
    .mobile-toggle-btn span.conn-text { display: none; }
    #hud { top: 88px; left: 20px; }
    #overlay { padding: 90px 20px 60px; }
    h1 { letter-spacing: -2.5px; }
    #description { font-size: 14px; max-width: 320px; }
    .menu-qr-card { flex-direction: column; text-align: center; }
    footer { left: 16px; right: 16px; font-size: 8px; }
    footer span:last-child { display: none; }
    body.menu #hud { opacity: 0; }
}

@media (max-height: 650px) {
    h1 { font-size: 46px; margin: 12px 0; letter-spacing: -2.5px; }
    #description { margin-bottom: 12px; }
    .legend, .instructions { margin-top: 10px; }
    .menu-qr-card { margin: 10px 0; padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
