/* ---------------------------------------------------------------------
   HUD theme (design "D", 2026-10-02): sci-fi mission-control shell for
   every Dashboard page, shared components, plus the Overview (Index)
   page. Loaded after site.css, so the rules here win over the older
   ones there. From the theme (/theme.css) only the accent-type colours
   (--panel-navbar-hover, --panel-heading) still apply; card and navbar
   backgrounds are fixed by the HUD. The Panel carries a copy of the
   shell + component sections in its own wwwroot/css/hud.css.
   --------------------------------------------------------------------- */

:root {
  --hud-bg: #04060A;
  --hud-panel: rgba(10, 16, 26, 0.88);
  --hud-panel-hover: rgba(18, 22, 32, 0.95);
  --hud-line: rgba(92, 198, 255, 0.16);
  --hud-cyan: #5CC6FF;
  --hud-text: #A9B6CC;
  --hud-bright: #EAF2FF;
  --hud-dim: #8494AE;
  --hud-faint: #5E6C86;
  --hud-display: "Oxanium", "Inter", sans-serif;
  --hud-body: "Barlow", "Inter", sans-serif;
}

html,
body {
  background-color: var(--hud-bg);
}

/* The classic surface colours, redefined on body so they beat both :root and the
   Customization theme's :root overrides. Every page-level rule that still paints with these
   (Scenes editor rows, Food Stall/DMX bits, ...) picks up the HUD palette automatically. */
body {
  --panel-card: #0b1019;
  --panel-card-soft: rgba(17, 26, 40, 0.92);
  --panel-border: rgba(92, 198, 255, 0.16);
  background-image:
    linear-gradient(rgba(92, 198, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 198, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  background-attachment: fixed;
}

/* ---- Top bar ---- */
.topbar {
  gap: 36px;
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--hud-line);
  background: rgba(4, 6, 10, 0.88);
}

.brand {
  gap: 12px;
  font-family: var(--hud-display);
}

.brand-logo {
  width: 64px;
  height: 56px;
  margin: 0;
  filter: drop-shadow(0 0 12px rgba(244, 110, 0, 0.25));
}

.brand strong {
  color: var(--hud-bright);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: none;
}

.brand strong span {
  color: var(--panel-accent);
}

.brand small {
  margin-top: 4px;
  color: var(--hud-dim);
  font-family: var(--hud-display);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
}

.topnav {
  gap: 8px;
}

.topnav a {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--hud-dim);
  font-family: var(--hud-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: none;
}

.topnav a::after {
  display: none;
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a.active {
  color: var(--panel-navbar-hover, var(--panel-accent));
  border-color: color-mix(in srgb, var(--panel-navbar-hover, var(--panel-accent)) 50%, transparent);
  background: color-mix(in srgb, var(--panel-navbar-hover, var(--panel-accent)) 8%, transparent);
  box-shadow: none;
}

.user-badge {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.user-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.user-badge strong {
  font-family: var(--hud-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.user-badge-role {
  margin-top: 2px;
  color: var(--panel-accent);
  font-family: var(--hud-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.user-badge .user-avatar {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  box-shadow: none;
}

.user-badge .user-avatar-fallback {
  color: #0A0A0E;
  font-family: var(--hud-display);
  font-weight: 800;
  font-size: 1.1rem;
}

/* ---- Footer ---- */
.site-footer {
  margin: auto 0 0;
  padding: 18px 28px;
  border: 0;
  border-top: 1px solid var(--hud-line);
  border-radius: 0;
  background: rgba(4, 6, 10, 0.7);
  box-shadow: none;
  color: var(--hud-faint);
  font-family: var(--hud-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-footer-brand {
  color: var(--hud-dim);
}

.site-footer-version,
.site-footer-copy {
  color: var(--hud-faint);
}

/* ---- Shared components: cards, headings, metrics, buttons, forms ----
   Corner brackets are drawn with background gradients, so any card gets
   them without extra markup. --hud-corner sets their colour. */
.hero-card,
.panel-card,
.server-card,
.update-overlay-card {
  --hud-corner: var(--panel-accent);
  --hud-tint: transparent;
  border: 1px solid var(--hud-line);
  border-radius: 0;
  box-shadow: none;
  background:
    linear-gradient(var(--hud-corner), var(--hud-corner)) top left / 14px 2px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) top left / 2px 14px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) top right / 14px 2px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) top right / 2px 14px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) bottom left / 14px 2px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) bottom left / 2px 14px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--hud-corner), var(--hud-corner)) bottom right / 2px 14px no-repeat,
    linear-gradient(180deg, var(--hud-tint), transparent 80%) var(--hud-panel);
}

/* Status tints (Panel list cards): the old site.css gradients, folded into
   the HUD card so the brackets and border take the status colour too. */
.status-tint-good,
.server-card.status-tint-good {
  --hud-corner: var(--panel-success);
  --hud-tint: rgba(99, 209, 122, 0.16);
  border-color: rgba(99, 209, 122, 0.4);
}

.status-tint-warning,
.server-card.status-tint-warning {
  --hud-corner: var(--panel-warning);
  --hud-tint: rgba(240, 177, 74, 0.18);
  border-color: rgba(240, 177, 74, 0.42);
}

.status-tint-stopped,
.server-card.status-tint-stopped {
  --hud-corner: var(--panel-danger);
  --hud-tint: rgba(255, 100, 100, 0.16);
  border-color: rgba(255, 100, 100, 0.4);
}

.status-tint-offline,
.server-card.status-tint-offline {
  --hud-corner: #E03A3A;
  --hud-tint: rgba(150, 24, 24, 0.5);
  border-color: rgba(178, 34, 34, 0.6);
}

.server-card {
  --hud-corner: rgba(92, 198, 255, 0.45);
}

.node-card,
.game-server-card {
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.node-card:hover,
.node-card:focus-visible,
.game-server-card:hover {
  --hud-corner: var(--hud-cyan);
  border-color: rgba(244, 110, 0, 0.6);
  box-shadow: none;
  transform: translateY(-2px);
}

.hero-card h1,
.section-header h2,
.server-card-head h3,
.node-card-title strong {
  font-family: var(--hud-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--panel-heading, var(--hud-bright));
}

.section-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
}

.section-header h2::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--panel-accent);
  transform: rotate(45deg);
}

.eyebrow {
  color: var(--hud-cyan);
  font-family: var(--hud-display);
  font-weight: 700;
  letter-spacing: 0.26em;
}

.eyebrow::before {
  content: "> ";
}

.muted,
.field-help {
  color: var(--hud-dim);
}

.metric-card,
.definition-list div {
  border-radius: 0;
  border: 1px solid rgba(92, 198, 255, 0.12);
  background: rgba(92, 198, 255, 0.04);
}

.metric-card span,
.definition-list dt {
  color: var(--hud-dim);
  font-family: var(--hud-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}

.metric-card strong,
.overview-metric-card strong {
  font-family: var(--hud-display);
  font-weight: 800;
}

/* Buttons: display font. Solid (primary) buttons get cut corners; outlined ones stay square
   with two small corner ticks instead, because clip-path would also cut away their border
   at the diagonals. */
.action-button {
  min-height: 38px;
  padding: 10px 16px;
  border-radius: 0;
  border: 1px solid rgba(92, 198, 255, 0.22);
  background-color: rgba(92, 198, 255, 0.05);
  color: var(--hud-bright);
  font-family: var(--hud-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

/* Corner ticks in the button's own text colour, so danger/success/warning variants match.
   Only background-image is set here: the variants' background colours from site.css stay. */
.action-button:not(.primary) {
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);
  background-size: 8px 2px, 2px 8px, 8px 2px, 2px 8px;
  background-position: top left, top left, bottom right, bottom right;
  background-repeat: no-repeat;
}

.action-button:hover,
.action-button:focus-visible {
  border-color: var(--hud-cyan);
  background-color: rgba(92, 198, 255, 0.12);
}

.action-button.primary {
  border-color: var(--panel-accent);
  background: var(--panel-accent);
  color: #0A0A0E;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.action-button.primary:hover,
.action-button.primary:focus-visible {
  background: var(--panel-accent);
  filter: brightness(1.12);
}

.action-button.danger:hover,
.action-button.danger:focus-visible {
  border-color: var(--panel-danger);
  background-color: rgba(255, 100, 100, 0.16);
}

/* Form fields: square, dark, cyan focus. */
.stack-form input,
.stack-form textarea,
.stack-form select,
.editor-grid input,
.editor-grid textarea,
.editor-grid select,
.editor-select {
  border-radius: 0;
  border-color: rgba(92, 198, 255, 0.2);
  background-color: rgba(4, 6, 10, 0.6);
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus,
.editor-grid input:focus,
.editor-grid textarea:focus,
.editor-grid select:focus,
.editor-select:focus {
  border-color: var(--hud-cyan);
  box-shadow: 0 0 0 3px rgba(92, 198, 255, 0.12);
}

/* Tab bars (Dashboard Settings, Panel per-game / per-node pages, OBS Scenes). */
.server-tabs {
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--hud-line);
  border-radius: 0;
  background: var(--hud-panel);
}

.server-tab {
  padding: 10px 14px;
  border-radius: 0;
  color: var(--hud-dim);
  font-family: var(--hud-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.server-tab:hover {
  color: var(--hud-bright);
  border-color: rgba(92, 198, 255, 0.25);
  background: rgba(92, 198, 255, 0.06);
}

.server-tab.is-active {
  color: var(--panel-accent);
  border-color: rgba(244, 110, 0, 0.5);
  background: rgba(244, 110, 0, 0.08);
  box-shadow: inset 0 -2px 0 var(--panel-accent);
}

/* Any other text field inside a card (e.g. inline hero forms) gets square corners too. */
.hero-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.panel-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.hero-card select,
.panel-card select,
.panel-card textarea {
  border-radius: 0;
}

/* Remaining rounded components (Panel console/file browser/stats, Dashboard user and audit rows). */
.compact-actions .action-button,
.compact-user-action,
.action-select,
.audit-entry,
.user-row,
.console-box,
.console-command-input,
.console-filter-input,
.file-browser-path,
.file-browser-table-wrap,
.file-edit-textarea,
.file-upload-form input[type="file"],
.node-overview-hero .metric-card,
.resource-stat,
.runtime-note,
.skeleton-block,
.skeleton-button {
  border-radius: 0;
}

.resource-stat,
.runtime-note {
  border-color: rgba(92, 198, 255, 0.12);
}

/* Everything that still asked for the classic display font (Orbitron) gets the HUD one.
   `body` prefix so page-level <style> blocks (Settings, Users, Profile, Auto Scene) lose too. */
body .audit-entry-head,
body .audit-table thead th,
body .console-autoscroll-toggle,
body .file-browser-table th,
body .node-server-card .game-name,
body .overview-metric-card .state,
body .resource-stat span,
body .toast-message strong,
body .user-row-main span,
body .user-row-main strong,
body .settings-link-copy strong,
body .toggle-label,
body .modal-subhead,
body .steam-avatar-fallback,
body .as-countdown strong,
body .as-now-scene {
  font-family: var(--hud-display);
}

/* ---- Sweep fixes (2026-10-02 page-by-page pass) ---- */
/* Status pills and badges: square, HUD font. Their ::before status dots stay round. */
body .state,
body .file-entry-icon,
body .skeleton-badge,
body .audit-badge,
body .dmx-status-badge,
body .sim-safe-badge,
body .obs-status-pill,
body .scene-card-badge,
body .scene-card-undeployed,
body .scene-undeployed-pill,
body .obs-scene-btn small,
body .as-pill,
body .as-dirty-pill,
body .as-playing-badge {
  border-radius: 2px;
  font-family: var(--hud-display);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Progress bars. */
body .migration-progress-track,
body .migration-progress-fill,
body .as-progress,
body .as-progress-fill {
  border-radius: 0;
}

/* Every heading inside page content, including custom cards (DMX lamps, Scenes rail). */
body .page-content h2,
body .page-content h3,
body .scene-card-pinned {
  font-family: var(--hud-display);
}

/* Form fields that no card/form rule above reaches (e.g. Liveview's transition picker). */
body .page-content input[type="text"],
body .page-content input[type="number"],
body .page-content input[type="url"],
body .page-content input[type="password"],
body .page-content input[type="search"],
body .page-content input[type="email"],
body .page-content input:not([type]),
body .page-content select,
body .page-content textarea {
  border-radius: 0;
  border-color: rgba(92, 198, 255, 0.2);
  background-color: rgba(4, 6, 10, 0.6);
  color: var(--hud-bright);
}

body .page-content input:focus,
body .page-content select:focus,
body .page-content textarea:focus {
  border-color: var(--hud-cyan);
}

/* Users / audit rows. */
body .user-row,
body .audit-entry {
  border-color: var(--hud-line);
  background: var(--hud-panel);
}

/* Native file inputs' "Choose File" button. */
body input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid rgba(92, 198, 255, 0.3);
  border-radius: 0;
  background: rgba(92, 198, 255, 0.08);
  color: var(--hud-bright);
  font-family: var(--hud-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Native checkboxes, radios and sliders follow the accent instead of the browser's blue. */
body input[type="checkbox"],
body input[type="radio"],
body input[type="range"] {
  accent-color: var(--panel-accent);
}

/* Scenes editor: section header rows and the preview's Refresh / Open full size links. */
body .scene-content-section {
  background: rgba(92, 198, 255, 0.05);
}

body .scene-preview-tools a,
body .scene-preview-tools button {
  border-radius: 0;
  border-color: var(--hud-line);
  background: rgba(4, 6, 10, 0.85);
  font-family: var(--hud-display);
  letter-spacing: 0.08em;
}

.toast-message {
  border-radius: 0;
  border-color: rgba(244, 110, 0, 0.5);
  background: rgba(10, 16, 26, 0.96);
  font-family: var(--hud-body);
}

/* ---- Login page (Layout = null, own markup) ---- */
.login-card {
  border: 1px solid var(--hud-line);
  border-radius: 0;
  box-shadow: 0 0 60px rgba(244, 110, 0, 0.08);
  background:
    linear-gradient(var(--panel-accent), var(--panel-accent)) top left / 18px 2px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) top left / 2px 18px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) top right / 18px 2px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) top right / 2px 18px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) bottom left / 18px 2px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) bottom left / 2px 18px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) bottom right / 18px 2px no-repeat,
    linear-gradient(var(--panel-accent), var(--panel-accent)) bottom right / 2px 18px no-repeat,
    var(--hud-panel);
  font-family: var(--hud-body);
}

.login-brand img {
  width: 110px;
  height: 94px;
  filter: drop-shadow(0 0 18px rgba(244, 110, 0, 0.3));
}

.login-brand strong {
  color: var(--hud-bright);
  font-family: var(--hud-display);
  font-weight: 800;
}

.login-brand strong span {
  color: var(--panel-accent);
}

.login-brand small,
.login-field label {
  color: var(--hud-dim);
  font-family: var(--hud-display);
  letter-spacing: 0.22em;
}

.login-field input {
  border-radius: 0;
  border-color: rgba(92, 198, 255, 0.2);
  background: rgba(4, 6, 10, 0.6);
  font-family: var(--hud-body);
}

.login-field input:focus {
  border-color: var(--hud-cyan);
  box-shadow: 0 0 0 3px rgba(92, 198, 255, 0.12);
}

.login-submit {
  border-radius: 0;
  font-family: var(--hud-display);
  letter-spacing: 0.16em;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.login-error {
  border-radius: 0;
}

/* ---- Overview (Index) page ---- */
.hud-page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: var(--hud-text);
  font-family: var(--hud-body);
}

.hud-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: center;
}

.hud-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hud-kicker {
  color: var(--hud-cyan);
  font-family: var(--hud-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.hud-kicker::after {
  content: "_";
  animation: hud-blink 1.1s steps(1) infinite;
}

.hud-title {
  margin: 0;
  color: var(--hud-bright);
  font-family: var(--hud-display);
  font-size: clamp(2.4rem, 4.6vw, 4.25rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hud-title-name {
  /* The name as stored (v0ndE, Cpt.SwaggaLicious), not the title's uppercase. */
  text-transform: none;
  color: transparent;
  -webkit-text-stroke: 2px var(--panel-accent);
}

.hud-art {
  position: relative;
  height: 220px;
}

.hud-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud-art-ring {
  transform-origin: 220px 190px;
  animation: hud-spin 40s linear infinite;
}

.hud-art img {
  position: absolute;
  left: 52px;
  top: 29px;
  width: 197px;
  height: 169px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(244, 110, 0, 0.35));
}

.hud-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hud-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--hud-display);
}

.hud-section-head::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--panel-accent);
  transform: rotate(45deg);
}

.hud-section-head h2 {
  margin: 0;
  color: var(--hud-bright);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hud-section-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(92, 198, 255, 0.4), transparent);
}

.hud-section-meta {
  color: var(--hud-cyan);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.hud-empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--hud-line);
  color: var(--hud-dim);
}

/* A HUD panel: corner brackets, accent per tile via --tile-accent. */
.hud-panel {
  --tile-accent: var(--panel-accent);
  position: relative;
  overflow: hidden;
  background: var(--hud-panel);
  border: 1px solid var(--hud-line);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.hud-corner {
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 0 solid var(--panel-accent);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease;
}

.hud-corner-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud-corner-tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.hud-corner-bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.hud-corner-br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.hud-tile {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 200px;
  padding: 22px;
  color: var(--hud-text);
  text-decoration: none;
}

/* Scan line that sweeps down the tile on hover. */
.hud-tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--tile-accent) 14%, transparent), transparent);
  opacity: 0;
  pointer-events: none;
}

.hud-tile:hover,
.hud-tile:focus-visible {
  border-color: color-mix(in srgb, var(--tile-accent) 70%, transparent);
  background: var(--hud-panel-hover);
  transform: translateY(-2px);
  outline: none;
}

.hud-tile:hover::after,
.hud-tile:focus-visible::after {
  opacity: 1;
  animation: hud-scan 1.2s ease-out;
}

.hud-tile:hover .hud-corner,
.hud-tile:focus-visible .hud-corner {
  width: 24px;
  height: 24px;
  border-color: var(--tile-accent);
}

.hud-tile-watermark {
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 150px;
  height: 150px;
  color: var(--tile-accent);
  opacity: 0.06;
  transform: rotate(-12deg);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.hud-tile:hover .hud-tile-watermark,
.hud-tile:focus-visible .hud-tile-watermark {
  opacity: 0.12;
  transform: rotate(-4deg) scale(1.05);
}

.hud-tile-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--hud-cyan);
  font-family: var(--hud-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.hud-tile-target {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hud-faint);
  letter-spacing: 0.08em;
}

.hud-tile-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.hud-hex {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  color: var(--tile-accent);
  background: color-mix(in srgb, var(--tile-accent) 12%, transparent);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  font-size: 1.8rem;
  line-height: 1;
}

.hud-tile-name {
  margin: 0;
  color: var(--hud-bright);
  font-family: var(--hud-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hud-tile-desc {
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.hud-tile-launch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed rgba(92, 198, 255, 0.16);
  color: var(--tile-accent);
  font-family: var(--hud-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hud-tile-launch svg {
  transition: transform 0.18s ease;
}

.hud-tile:hover .hud-tile-launch svg,
.hud-tile:focus-visible .hud-tile-launch svg {
  transform: translateX(6px);
}

/* ---- My Loadout (personal links) ---- */
.hud-loadout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}

.hud-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.hud-slot {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(92, 198, 255, 0.14);
  background: rgba(92, 198, 255, 0.04);
  transition: border-color 0.15s ease;
}

.hud-slot:hover {
  border-color: rgba(244, 110, 0, 0.5);
}

.hud-slot-open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  color: var(--hud-bright);
}

.hud-slot-key {
  color: var(--panel-accent);
  font-family: var(--hud-display);
  font-size: 0.75rem;
  font-weight: 800;
}

/* Title on top, domain underneath, so a long title gets the slot's full width. */
.hud-slot-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  line-height: 1.25;
}

.hud-slot-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.hud-slot-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hud-dim);
  font-size: 0.75rem;
}

.hud-slot form {
  margin: 0;
}

.hud-slot-remove {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--hud-faint);
  cursor: pointer;
}

.hud-slot-remove:hover,
.hud-slot-remove:focus-visible {
  color: var(--panel-danger);
}

.hud-loadout-empty {
  margin: 0;
  color: var(--hud-dim);
  font-size: 0.9rem;
}

.hud-equip summary {
  display: grid;
  place-items: center;
  width: 280px;
  max-width: 100%;
  height: 42px;
  border: 1px dashed rgba(244, 110, 0, 0.6);
  color: var(--panel-accent);
  font-family: var(--hud-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.hud-equip summary::-webkit-details-marker {
  display: none;
}

.hud-equip summary:hover {
  background: rgba(244, 110, 0, 0.08);
}

.hud-equip-form {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.8fr) minmax(0, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.hud-equip-form label {
  display: grid;
  gap: 6px;
  color: var(--hud-dim);
  font-family: var(--hud-display);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hud-equip-form input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(92, 198, 255, 0.2);
  background: rgba(4, 6, 10, 0.6);
  color: var(--hud-bright);
  font-family: var(--hud-body);
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  outline: none;
}

.hud-equip-form input:focus {
  border-color: var(--panel-accent);
}

.hud-equip-form button {
  height: 40px;
  padding: 0 24px;
  border: 0;
  background: var(--panel-accent);
  color: #0A0A0E;
  font-family: var(--hud-display);
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
}

[data-hud-item][hidden] {
  display: none;
}

@keyframes hud-scan {
  from { top: -40%; }
  to { top: 100%; }
}

@keyframes hud-spin {
  to { transform: rotate(360deg); }
}

@keyframes hud-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-kicker::after,
  .hud-art-ring,
  .hud-tile:hover::after {
    animation: none;
  }
}

@media (max-width: 1100px) {
  .hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hud-art {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }

  .hud-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hud-page {
    gap: 24px;
  }

  .hud-equip-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    margin: auto 0 0;
    padding: 16px;
  }
}

/* ---- Dashboard pages with their own <style> blocks (DMX, Food Stall, Settings) ----
   Those blocks load after this file, so selectors here are prefixed with `body` to win.
   Color pickers, range sliders and avatars keep their own shapes. */
body .dmx-all-lamps-card,
body .dmx-live-card,
body .dmx-scene-card,
body .dmx-scene-step,
body .settings-link-row {
  border-radius: 0;
  border-color: var(--hud-line);
  background: rgba(92, 198, 255, 0.04);
}

body [data-server-tab-panel="panel"] .panel-card,
body [data-server-tab-panel="panel"] .definition-list div,
body [data-server-tab-panel="panel"] .stack-form select,
body .hero-integration-form input,
body .audit-scroll,
body .dmx-form-error,
body .dmx-group-lamp-checklist,
body .dmx-scene-action select,
body .dmx-scene-loop-row input[type="number"],
body .dmx-scene-step-header input[type="number"],
body .sim-field select,
body .sim-stage,
body .sim-step-chip,
body .fs-image-current img,
body .fs-image-grid button,
body .fs-item-form-details summary,
body .fs-item-thumb,
body .fs-liveview-frame,
body .fs-view-link-row code {
  border-radius: 0;
}

/* ---- OBS Studio pages (Liveview, Scenes, Auto Scene) ----
   Duplicated from OBSStudio/wwwroot/css/hud.css on purpose: in production the OBS pages'
   "~/css/hud.css" resolves to /css/hud.css, which the reverse proxy routes to Dashboard, so
   this file is the one they actually load. Keep both copies in sync.
   Those pages carry their own <style> blocks, which load after this file, so every
   selector here is prefixed with `body` to outrank them. */
body .scene-card,
body .as-playlist-card,
body .scene-asset-card,
body .as-item {
  border-radius: 0;
  border-color: var(--hud-line);
  background: rgba(92, 198, 255, 0.04);
}

body .scene-card:hover,
body .as-playlist-card:hover {
  border-color: rgba(92, 198, 255, 0.5);
  background: rgba(92, 198, 255, 0.08);
}

body .scene-card.is-active,
body .as-playlist-card.is-active {
  outline: none;
  border-color: rgba(244, 110, 0, 0.6);
  background: rgba(244, 110, 0, 0.08);
  box-shadow: inset 3px 0 0 var(--panel-accent);
}

body .scene-card .scene-card-title,
body .as-playlist-card strong {
  font-family: var(--hud-display);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Text fields and selects. */
body .scene-name-input,
body .scene-content-input,
body .scene-ticker-textarea,
body .scene-link-row input,
body .as-name-input,
body .as-field select,
body .as-add-row select,
body .as-item input[type="number"],
body .scene-content-size {
  border-radius: 0;
  border-color: rgba(92, 198, 255, 0.2);
  background-color: rgba(4, 6, 10, 0.6);
}

body .scene-name-input:focus,
body .scene-content-input:focus,
body .scene-ticker-textarea:focus,
body .scene-link-row input:focus,
body .as-name-input:focus {
  border-color: var(--hud-cyan);
  outline: none;
}

/* Popovers and menus. */
body .scene-new-menu,
body .asset-picker-popover {
  border-radius: 0;
  border-color: var(--hud-line);
  background: rgba(10, 16, 26, 0.97);
}

/* Everything else on those pages just loses its rounded corners. */
body .obs-banner,
body .obs-feed-frame,
body .scene-preview-frame,
body .scene-preview-tools a,
body .scene-content-rows,
body .scene-content-empty,
body .scene-content-color,
body .scene-content-image-thumb,
body .scene-content-image-thumb img,
body .scene-asset-thumb,
body .asset-picker-item,
body .asset-picker-item img,
body .as-empty,
body .as-options,
body .as-mini-button {
  border-radius: 0;
}

/* Scenes header: the page splits "+ New" / "Deploy All to OBS" 50/50, which clips the longer
   label in the wider HUD font. Let both buttons take their natural width instead. */
body .scene-rail-head-new,
body .scene-rail-head-deploy {
  flex: 0 0 auto;
}

body .scene-rail-head-btn {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 10px 18px;
}

/* Same button text size everywhere on the OBS pages. */
body .scene-new-menu .action-button,
body .as-mini-button {
  font-size: 0.78rem;
}

body .scene-new-menu {
  min-width: 230px;
}

body .scene-new-menu .action-button {
  white-space: nowrap;
}

body .scene-new-menu .action-button:hover,
body .scene-new-menu .action-button:focus-visible {
  color: #0A0A0E;
}

/* Global search (Dashboard only - search.js is not loaded by Panel/OBSStudio): square HUD corners. */
.topbar-search-button,
.global-search,
.global-search-kbd,
.search-results,
.search-item {
  border-radius: 0;
}

.topbar-search-button {
  border-color: var(--hud-line);
  color: var(--hud-dim);
  font-family: var(--hud-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.global-search {
  border-color: var(--hud-line);
}

.search-group-title {
  font-family: var(--hud-display);
}
