/* ============================================================
   DCS MISSION COMMAND — Component Library
   Canonical components. All use ui-* prefix to avoid collisions
   with legacy classes in style.css.
   Opt-in: existing pages keep working. Migrate gradually.
   Requires: tokens.css + style.css (theme vars) loaded first.
   ============================================================ */

/* ---------- BUTTON ---------- */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 36px;
    padding: 0 var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-h3-size);
    font-weight: var(--t-h3-weight);
    letter-spacing: var(--t-h3-track);
    text-transform: var(--t-h3-case);
    color: var(--c-text);
    background: var(--c-surface-2);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    cursor: pointer;
    user-select: none;
    transition: background var(--m-fast) var(--m-ease),
                border-color var(--m-fast) var(--m-ease),
                color var(--m-fast) var(--m-ease),
                box-shadow var(--m-fast) var(--m-ease);
}
.ui-btn:hover {
    background: var(--c-surface-3);
    border-color: var(--c-line-active);
}
.ui-btn:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 1px;
}
.ui-btn:active { transform: translateY(1px); }
.ui-btn[disabled],
.ui-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variants */
.ui-btn--primary {
    color: var(--c-accent);
    background: rgba(255, 170, 0, 0.06);
    border-color: var(--c-accent);
}
.ui-btn--primary:hover {
    background: rgba(255, 170, 0, 0.14);
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.2);
}
.ui-btn--success {
    color: var(--c-success);
    background: rgba(93, 217, 138, 0.06);
    border-color: var(--c-success);
}
.ui-btn--success:hover {
    background: rgba(93, 217, 138, 0.14);
    box-shadow: 0 0 10px rgba(93, 217, 138, 0.22);
}
.ui-btn--danger {
    color: var(--c-crit);
    background: rgba(255, 51, 68, 0.06);
    border-color: var(--c-crit);
}
.ui-btn--danger:hover {
    background: rgba(255, 51, 68, 0.14);
    box-shadow: 0 0 10px rgba(255, 51, 68, 0.22);
}
.ui-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--c-text-dim);
}
.ui-btn--ghost:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
    border-color: var(--c-line);
}

/* Sizes */
.ui-btn--sm { min-height: 28px; padding: 0 var(--s-3); font-size: var(--t-label-size); }
.ui-btn--lg { min-height: 44px; padding: 0 var(--s-5); font-size: var(--t-h2-size); }
.ui-btn--block { display: flex; width: 100%; }
.ui-btn--icon { padding: 0; width: 36px; }

/* ---------- PANEL ---------- */
.ui-panel {
    position: relative;
    background: var(--c-surface-1);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    padding: var(--s-4);
    box-shadow: var(--lift-2);
}
.ui-panel--flush { padding: 0; }
.ui-panel--lift-0 { box-shadow: none; }
.ui-panel--lift-3 { box-shadow: var(--lift-3); }

/* Bracket corners — HUD element */
.ui-panel--hud::before,
.ui-panel--hud::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: var(--bw-thin) solid var(--c-accent);
    pointer-events: none;
}
.ui-panel--hud::before {
    top: -1px; left: -1px;
    border-right: none; border-bottom: none;
}
.ui-panel--hud::after {
    bottom: -1px; right: -1px;
    border-left: none; border-top: none;
}

.ui-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: var(--bw-thin) solid var(--c-line);
    background: var(--c-surface-2);
}
.ui-panel__title {
    font-family: var(--font-mono);
    font-size: var(--t-h2-size);
    font-weight: var(--t-h2-weight);
    letter-spacing: var(--t-h2-track);
    text-transform: var(--t-h2-case);
    color: var(--c-text-bright);
    margin: 0;
}
.ui-panel__kicker {
    font-size: var(--t-label-size);
    font-weight: var(--t-label-weight);
    letter-spacing: var(--t-label-track);
    text-transform: var(--t-label-case);
    color: var(--c-accent);
}
.ui-panel__body { padding: var(--s-4); }
.ui-panel__footer {
    display: flex;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-top: var(--bw-thin) solid var(--c-line);
    background: var(--c-surface-2);
}

/* ---------- FIELD / INPUT ---------- */
.ui-field {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}
.ui-field__label {
    font-family: var(--font-mono);
    font-size: var(--t-label-size);
    font-weight: var(--t-label-weight);
    letter-spacing: var(--t-label-track);
    text-transform: var(--t-label-case);
    color: var(--c-text-dim);
}
.ui-field__hint {
    font-size: var(--t-mono-micro);
    letter-spacing: 0.8px;
    color: var(--c-text-dim);
    text-transform: uppercase;
}
.ui-field__error {
    font-size: var(--t-mono-micro);
    color: var(--c-crit);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    min-height: 36px;
    padding: 0 var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--t-body-size);
    color: var(--c-text-bright);
    background: var(--c-surface-0);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    outline: none;
    transition: border-color var(--m-fast) var(--m-ease),
                box-shadow var(--m-fast) var(--m-ease),
                background var(--m-fast) var(--m-ease);
}
.ui-textarea {
    min-height: 96px;
    padding: var(--s-2) var(--s-3);
    resize: vertical;
    line-height: var(--t-body-height);
}
.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
    border-color: var(--c-accent);
    background: var(--c-surface-1);
    box-shadow: 0 0 0 2px rgba(255, 170, 0, 0.12);
}
.ui-input::placeholder,
.ui-textarea::placeholder {
    color: var(--c-text-dim);
    opacity: 0.7;
}
.ui-input[disabled],
.ui-select[disabled],
.ui-textarea[disabled] { opacity: 0.5; cursor: not-allowed; }

.ui-select {
    appearance: none;
    padding-right: var(--s-6);
    background-image: linear-gradient(45deg, transparent 50%, var(--c-text-dim) 50%),
                      linear-gradient(-45deg, transparent 50%, var(--c-text-dim) 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
}

/* Checkbox / radio — square, HUD-style */
.ui-check {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--t-body-size);
    color: var(--c-text);
    user-select: none;
}
.ui-check input[type="checkbox"],
.ui-check input[type="radio"] {
    appearance: none;
    width: 16px; height: 16px;
    margin: 0;
    background: var(--c-surface-0);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    cursor: pointer;
    position: relative;
    transition: border-color var(--m-fast) var(--m-ease), background var(--m-fast) var(--m-ease);
}
.ui-check input[type="radio"] { border-radius: var(--r-pill); }
.ui-check input:checked {
    border-color: var(--c-accent);
    background: var(--c-accent);
}
.ui-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--c-surface-0);
    clip-path: polygon(15% 45%, 35% 65%, 85% 15%, 100% 30%, 38% 100%, 0 55%);
}
.ui-check input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--c-surface-0);
    border-radius: var(--r-pill);
}

/* ---------- BADGE / PILL / TAG ---------- */
.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 2px var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--c-accent);
    background: rgba(255, 170, 0, 0.08);
    border: var(--bw-thin) solid rgba(255, 170, 0, 0.28);
    border-radius: var(--r-1);
}
.ui-badge--success { color: var(--c-success); background: rgba(93,217,138,0.08); border-color: rgba(93,217,138,0.3); }
.ui-badge--danger  { color: var(--c-crit);    background: rgba(255,51,68,0.08);  border-color: rgba(255,51,68,0.3); }
.ui-badge--dim     { color: var(--c-text-dim); background: var(--c-surface-2);   border-color: var(--c-line); }

.ui-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 3px var(--s-3);
    font-size: var(--t-mono-micro);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--c-text-dim);
    background: var(--c-surface-2);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-pill);
}

.ui-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-dim);
    border-left: 2px solid var(--c-accent);
    background: var(--c-surface-2);
}

/* ---------- KBD ---------- */
.ui-kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    color: var(--c-text-bright);
    background: var(--c-surface-2);
    border: var(--bw-thin) solid var(--c-line);
    border-bottom-width: 2px;
    border-radius: var(--r-1);
}

/* ---------- TABS ---------- */
.ui-tabs {
    display: flex;
    gap: 0;
    border-bottom: var(--bw-thin) solid var(--c-line);
}
.ui-tab {
    padding: var(--s-2) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-label-size);
    font-weight: var(--t-label-weight);
    letter-spacing: var(--t-label-track);
    text-transform: var(--t-label-case);
    color: var(--c-text-dim);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--m-fast) var(--m-ease), border-color var(--m-fast) var(--m-ease);
}
.ui-tab:hover { color: var(--c-text); }
.ui-tab.is-active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
}

/* ---------- TABLE ---------- */
.ui-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: var(--t-data-size);
    font-variant-numeric: tabular-nums;
}
.ui-table th {
    padding: var(--s-2) var(--s-3);
    text-align: left;
    font-size: var(--t-label-size);
    font-weight: var(--t-label-weight);
    letter-spacing: var(--t-label-track);
    text-transform: var(--t-label-case);
    color: var(--c-text-dim);
    background: var(--c-surface-2);
    border-bottom: var(--bw-thin) solid var(--c-line);
}
.ui-table td {
    padding: var(--s-2) var(--s-3);
    color: var(--c-text);
    border-bottom: var(--bw-thin) solid var(--c-line);
}
.ui-table tbody tr:hover td {
    background: var(--c-surface-2);
}
.ui-table--zebra tbody tr:nth-child(even) td {
    background: var(--c-surface-1);
}

/* ---------- MODAL ---------- */
.ui-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 12, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-5);
    animation: ui-fade var(--m-base) var(--m-ease);
}
.ui-modal {
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--c-surface-1);
    border: var(--bw-thin) solid var(--c-line-active);
    border-radius: var(--r-1);
    box-shadow: var(--lift-4);
    animation: ui-slide-up var(--m-base) var(--m-ease);
}
.ui-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-4);
    border-bottom: var(--bw-thin) solid var(--c-line);
}
.ui-modal__body {
    padding: var(--s-4);
    overflow: auto;
}
.ui-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-top: var(--bw-thin) solid var(--c-line);
    background: var(--c-surface-2);
}

/* ---------- TOAST ---------- */
.ui-toast-stack {
    position: fixed;
    top: var(--s-5);
    right: var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    z-index: var(--z-toast);
    pointer-events: none;
}
.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-width: 280px;
    padding: var(--s-3) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-body-size);
    color: var(--c-text-bright);
    background: var(--c-surface-1);
    border: var(--bw-thin) solid var(--c-line-active);
    border-left: 3px solid var(--c-accent);
    border-radius: var(--r-1);
    box-shadow: var(--lift-3);
    animation: ui-slide-in var(--m-base) var(--m-ease);
}
.ui-toast--success { border-left-color: var(--c-success); }
.ui-toast--danger  { border-left-color: var(--c-crit); }

/* ---------- DIVIDER / SECTION TITLE ---------- */
.ui-divider {
    height: 1px;
    background: var(--c-line);
    border: none;
    margin: var(--s-4) 0;
}
.ui-section-title {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--t-label-size);
    font-weight: var(--t-label-weight);
    letter-spacing: var(--t-label-track);
    text-transform: var(--t-label-case);
    color: var(--c-accent);
    margin: 0 0 var(--s-3) 0;
}
.ui-section-title::before,
.ui-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-line);
}

/* ---------- LAYOUT HELPERS ---------- */
.ui-stack   { display: flex; flex-direction: column; gap: var(--s-3); }
.ui-stack--sm { gap: var(--s-2); }
.ui-stack--lg { gap: var(--s-5); }
.ui-row     { display: flex; flex-direction: row; gap: var(--s-3); align-items: center; }
.ui-row--between { justify-content: space-between; }
.ui-row--end     { justify-content: flex-end; }
.ui-grid    { display: grid; gap: var(--s-4); }
.ui-grid-2  { grid-template-columns: repeat(2, 1fr); }
.ui-grid-3  { grid-template-columns: repeat(3, 1fr); }
.ui-grid-4  { grid-template-columns: repeat(4, 1fr); }
.ui-center  { display: flex; align-items: center; justify-content: center; }
.ui-spacer  { flex: 1; }

/* ---------- ANIMATIONS ---------- */
@keyframes ui-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ui-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ui-slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ui-pulse {
    0%,100% { opacity: 1; }
    50%     { opacity: 0.4; }
}
.ui-pulse { animation: ui-pulse 1.4s var(--m-ease) infinite; }

/* ---------- REDUCED MOTION (opt-in, toggled via body class) ---------- */
body.fx-no-motion *,
body.fx-no-motion *::before,
body.fx-no-motion *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
}

/* ---------- COMMAND PALETTE (Ctrl+K global) ---------- */
.cmd-palette {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    pointer-events: none;
}
.cmd-palette.is-open {
    display: block;
    pointer-events: auto;
}
.cmd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 12, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: ui-fade var(--m-base) var(--m-ease);
}
.cmd-panel {
    position: absolute;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, 92vw);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--c-surface-1);
    border: var(--bw-thin) solid var(--c-line-active);
    border-radius: var(--r-1);
    box-shadow: var(--lift-4), 0 0 0 1px rgba(255, 170, 0, 0.08);
    overflow: hidden;
    animation: ui-slide-up var(--m-base) var(--m-ease);
}
.cmd-header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: var(--bw-thin) solid var(--c-line);
    background: var(--c-surface-2);
}
.cmd-prompt {
    font-family: var(--font-mono);
    font-size: var(--t-h2-size);
    font-weight: 700;
    color: var(--c-accent);
    line-height: 1;
}
.cmd-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: var(--t-h2-size);
    color: var(--c-text-bright);
    padding: 0;
}
.cmd-input::placeholder {
    color: var(--c-text-dim);
    opacity: 0.7;
}
.cmd-kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    color: var(--c-text-dim);
    background: var(--c-surface-0);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    letter-spacing: 0.8px;
}
.cmd-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-2) 0;
}
.cmd-group {
    padding: var(--s-2) var(--s-4) var(--s-1);
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--c-accent);
}
.cmd-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-body-size);
    color: var(--c-text);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background var(--m-fast) var(--m-ease), border-color var(--m-fast) var(--m-ease);
}
.cmd-row:hover { background: var(--c-surface-2); }
.cmd-row.is-active {
    background: var(--c-surface-2);
    border-left-color: var(--c-accent);
    color: var(--c-text-bright);
}
.cmd-label { flex: 1; }
.cmd-hint {
    font-size: var(--t-mono-micro);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--c-text-dim);
}
.cmd-row.is-active .cmd-hint { color: var(--c-accent); }
.cmd-empty {
    padding: var(--s-5) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-body-size);
    color: var(--c-text-dim);
    text-align: center;
}
.cmd-footer {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-2) var(--s-4);
    border-top: var(--bw-thin) solid var(--c-line);
    background: var(--c-surface-2);
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    color: var(--c-text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.cmd-footer .cmd-spacer { flex: 1; }
.cmd-footer .cmd-brand {
    color: var(--c-accent);
    letter-spacing: 2px;
}
body.cmd-open { overflow: hidden; }

/* ---------- HUD STATUSLINE (fixed bottom) ---------- */
.hud-statusline {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--hud-footer-h);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: 0 var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--t-mono-micro);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--c-text-dim);
    background: linear-gradient(180deg, rgba(10, 14, 19, 0.92), rgba(5, 8, 12, 0.98));
    border-top: var(--bw-thin) solid var(--c-line);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1200;
    user-select: none;
    pointer-events: none;
}
.hud-statusline > * { pointer-events: auto; }
.hud-sl-left,
.hud-sl-center,
.hud-sl-right {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.hud-sl-left { flex: 1; min-width: 0; }
.hud-sl-center {
    flex: 0 0 auto;
    justify-content: center;
}
.hud-sl-right {
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}
.hud-sl-brand {
    color: var(--c-accent);
    letter-spacing: 2px;
    font-weight: 600;
}
.hud-sl-page {
    color: var(--c-text-bright);
    letter-spacing: 1.4px;
    font-weight: 500;
}
.hud-sl-sep { opacity: 0.4; }
.hud-sl-status {
    color: var(--c-success);
    letter-spacing: 1.4px;
    font-weight: 500;
    position: relative;
    padding-left: 14px;
}
.hud-sl-status::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 8px; height: 8px;
    background: var(--c-success);
    border-radius: var(--r-pill);
    box-shadow: 0 0 8px var(--c-success);
    animation: ui-pulse 2s var(--m-ease) infinite;
}
.hud-sl-status.is-offline { color: var(--c-crit); }
.hud-sl-status.is-offline::before {
    background: var(--c-crit);
    box-shadow: 0 0 8px var(--c-crit);
}
.hud-sl-clock {
    font-variant-numeric: tabular-nums;
    color: var(--c-text-bright);
    letter-spacing: 1.2px;
}
.hud-sl-version {
    color: var(--c-accent);
    letter-spacing: 1.4px;
}
.hud-sl-hint {
    color: var(--c-text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}
.hud-sl-kbd {
    display: inline-block;
    padding: 0 4px;
    font-size: 9px;
    color: var(--c-text-bright);
    background: var(--c-surface-2);
    border: var(--bw-thin) solid var(--c-line);
    border-radius: var(--r-1);
    letter-spacing: 0.6px;
}
/* Lift fixed footers above statusline */
body.has-hud-statusline .site-footer,
body.has-hud-statusline .lobby-footer {
    bottom: var(--hud-footer-h);
}
/* When both site-footer and statusline are stacked, make them feel unified */
body.has-hud-statusline .site-footer {
    box-shadow: none;
    border-bottom: none;
}
body.has-hud-statusline .hud-statusline {
    border-top: none;
}
/* Lobby uses its own zoom-scaled layout. Hide HUD statusline there
   since the lobby-footer already fills the brand/nav role. */
body.lobby-view .hud-statusline { display: none; }
body.lobby-view.has-hud-statusline #lobby-panel { padding-bottom: 68px; }
body.lobby-view.has-hud-statusline .lobby-footer { bottom: 0; }
/* Tiny viewports: hide center/hint to save space */
@media (max-width: 720px) {
    .hud-sl-center,
    .hud-sl-hint { display: none; }
}

/* ---------- FOCUS RING (global accessibility) ---------- */
.ui-btn:focus-visible,
.ui-input:focus-visible,
.ui-select:focus-visible,
.ui-textarea:focus-visible,
.ui-tab:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* ============================================================
   MIGRATION LAYER — non-destructive aliases.
   Aligns legacy classes with the ui-* system without changing HTML.
   Safe: only touches typography, focus-ring, transitions, colors
   — no size/layout changes. Remove per-selector if a regression shows.
   ============================================================ */

/* Global focus ring for all interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    outline-style: solid;
}

/* Native form elements — enforce mono font + numeric alignment */
input, select, textarea, button {
    font-family: inherit;
}
input[type="number"],
input[type="text"].num,
td.num {
    font-variant-numeric: tabular-nums;
}

/* Legacy button classes — match ui-btn feel (font + transitions only, no size changes) */
.action-btn,
.settings-btn,
.btn-primary,
.btn-secondary,
.btn-live,
.btn-squad,
.btn-squad-primary,
.btn-squad-danger,
.btn-squad-mini,
.miz-btn,
.export-btn,
.ord-action,
.control-btn,
.mode-tab {
    font-family: var(--font-mono);
    letter-spacing: 1px;
    transition: background var(--m-fast) var(--m-ease),
                border-color var(--m-fast) var(--m-ease),
                color var(--m-fast) var(--m-ease),
                box-shadow var(--m-fast) var(--m-ease);
}

/* Consistent caret color in all text inputs */
input, textarea { caret-color: var(--c-accent); }

/* Selection highlight */
::selection {
    background: var(--c-accent);
    color: var(--c-surface-0);
}

/* Scroll shadow for long panels — subtle hint that content continues */
.ui-panel__body,
.ui-modal__body,
.cmd-list {
    scroll-behavior: smooth;
}

/* Placeholder color across all pages */
input::placeholder,
textarea::placeholder {
    color: var(--c-text-dim);
    opacity: 0.65;
}
