/* LUMINA ARENA — Mobile QR Fan PWA Stylesheet */

:root {
  color-scheme: light dark;

  /* Light defaults */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.86);
  --surface-muted: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --border: rgba(15, 23, 42, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.80);
  --glass-border: rgba(15, 23, 42, 0.16);
  --glass-text: #0f172a;
  --dialog-backdrop: rgba(15, 23, 42, 0.62);

  /* Brand accent with >= 3:1 contrast against both light and dark surfaces */
  --brand-accent: #b45309;
  --brand-accent-hover: #92400e;
  --brand-accent-fg: #ffffff;

  --status-ok: #047857;
  --status-warn: #b45309;
  --status-err: #be123c;

  --svg-bowl: #cbd5e1;
  --svg-sector: #e2e8f0;
  --svg-sector-stroke: #64748b;
  --svg-sector-active: #b45309;
  --svg-sector-text: #0f172a;
  --svg-sector-active-text: #ffffff;
  --svg-pitch: #15803d;

  --scrollbar-thumb: rgba(15, 23, 42, 0.35);
  --scrollbar-track: transparent;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14;
    --surface: #0f172a;
    --surface-elevated: rgba(15, 23, 42, 0.86);
    --surface-muted: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(248, 250, 252, 0.16);
    --glass-bg: rgba(9, 13, 24, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-text: #f8fafc;
    --dialog-backdrop: rgba(2, 6, 17, 0.78);

    --brand-accent: #fbbf24;
    --brand-accent-hover: #f59e0b;
    --brand-accent-fg: #090d16;

    --status-ok: #34d399;
    --status-warn: #fbbf24;
    --status-err: #fb7185;

    --svg-bowl: #111827;
    --svg-sector: #1e293b;
    --svg-sector-stroke: #475569;
    --svg-sector-active: #fbbf24;
    --svg-sector-text: #e2e8f0;
    --svg-sector-active-text: #090d16;
    --svg-pitch: #166534;

    --scrollbar-thumb: rgba(248, 250, 252, 0.32);
    --scrollbar-track: transparent;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --surface: #0f172a;
  --surface-elevated: rgba(15, 23, 42, 0.86);
  --surface-muted: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(248, 250, 252, 0.16);
  --glass-bg: rgba(9, 13, 24, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-text: #f8fafc;
  --dialog-backdrop: rgba(2, 6, 17, 0.78);

  --brand-accent: #fbbf24;
  --brand-accent-hover: #f59e0b;
  --brand-accent-fg: #090d16;

  --status-ok: #34d399;
  --status-warn: #fbbf24;
  --status-err: #fb7185;

  --svg-bowl: #111827;
  --svg-sector: #1e293b;
  --svg-sector-stroke: #475569;
  --svg-sector-active: #fbbf24;
  --svg-sector-text: #e2e8f0;
  --svg-sector-active-text: #090d16;
  --svg-pitch: #166534;

  --scrollbar-thumb: rgba(248, 250, 252, 0.32);
  --scrollbar-track: transparent;
}

:root[data-theme="light"] {
  color-scheme: light;
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(#f1f5f9, #070b14);
    --surface: light-dark(#ffffff, #0f172a);
    --surface-elevated: light-dark(rgba(255, 255, 255, 0.86), rgba(15, 23, 42, 0.86));
    --surface-muted: light-dark(#e2e8f0, #1e293b);
    --text: light-dark(#0f172a, #f8fafc);
    --text-muted: light-dark(#475569, #94a3b8);
    --border: light-dark(rgba(15, 23, 42, 0.14), rgba(248, 250, 252, 0.16));
    --glass-bg: light-dark(rgba(255, 255, 255, 0.80), rgba(9, 13, 24, 0.72));
    --glass-border: light-dark(rgba(15, 23, 42, 0.16), rgba(255, 255, 255, 0.18));
    --glass-text: light-dark(#0f172a, #f8fafc);
    --dialog-backdrop: light-dark(rgba(15, 23, 42, 0.62), rgba(2, 6, 17, 0.78));

    --brand-accent: light-dark(#b45309, #fbbf24);
    --brand-accent-hover: light-dark(#92400e, #f59e0b);
    --brand-accent-fg: light-dark(#ffffff, #090d16);

    --status-ok: light-dark(#047857, #34d399);
    --status-warn: light-dark(#b45309, #fbbf24);
    --status-err: light-dark(#be123c, #fb7185);

    --svg-bowl: light-dark(#cbd5e1, #111827);
    --svg-sector: light-dark(#e2e8f0, #1e293b);
    --svg-sector-stroke: light-dark(#64748b, #475569);
    --svg-sector-active: light-dark(#b45309, #fbbf24);
    --svg-sector-text: light-dark(#0f172a, #e2e8f0);
    --svg-sector-active-text: light-dark(#ffffff, #090d16);
    --svg-pitch: light-dark(#15803d, #166534);

    --scrollbar-thumb: light-dark(rgba(15, 23, 42, 0.35), rgba(248, 250, 252, 0.32));
    --scrollbar-track: transparent;
  }
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  *::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  *::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Form controls with high-contrast brand accent */
input,
input[type="range"],
input[type="checkbox"],
progress {
  accent-color: var(--brand-accent);
}

@supports not (accent-color: var(--brand-accent)) {
  input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border);
    background: var(--surface);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
  }
  input[type="checkbox"]:checked {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
  }
  input[type="checkbox"]:checked::after {
    content: "✓";
    color: var(--brand-accent-fg);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }
  input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-muted);
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-accent);
    border: 2px solid var(--brand-accent-fg);
  }
  progress {
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface-muted);
    border-radius: 999px;
    overflow: hidden;
  }
  progress::-webkit-progress-bar {
    background: var(--surface-muted);
  }
  progress::-webkit-progress-value {
    background: var(--brand-accent);
  }
}

/* Active camera video holder for hardware torch (never display:none or visibility:hidden) */
#torch-video {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}

/* Full-screen HDR canvas stage */
#stage-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  display: block;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.flash-flare {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 35%, transparent 72%);
  mix-blend-mode: screen;
  transition: opacity 0.06s linear;
}

.tifo-glow-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  transition: opacity 0.2s ease;
}

.tifo-live-glyph {
  font-size: clamp(1.1rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.26);
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.35);
  text-align: center;
  padding: 0 20px;
}

.battery-veil {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgba(2, 4, 9, 0.94);
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.battery-veil[hidden] {
  display: none;
}

.battery-veil-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.85rem;
}

.battery-veil-badge p {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: #94a3b8;
}

.battery-icon {
  font-size: 1.5rem;
}

/* Glass HUD layout */
.hud-root {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  gap: 10px;
  pointer-events: none;
}

.hud-top,
.hud-telemetry,
.hud-dock {
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.hud-root.is-hud-hidden .hud-top,
.hud-root.is-hud-hidden .hud-telemetry,
.hud-root.is-hud-hidden .hud-dock {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.hud-root.is-hud-hidden .hud-top {
  transform: translateY(-8px);
}

.hud-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
}

.hud-status-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--glass-text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.seat-pill {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.seat-pill:active {
  transform: scale(0.97);
}

.hw-pill[data-torch="true"] {
  border-color: var(--brand-accent);
}

.hw-pill.is-torch-lit {
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.55);
}

.hud-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  pointer-events: none;
}

.telemetry-chip {
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--glass-text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 600;
}

.hud-dock {
  margin-top: auto;
  width: 100%;
  max-width: 480px;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--glass-text);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.hype-meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.hype-meter-label {
  white-space: nowrap;
}

.hype-progress {
  flex: 1;
  height: 9px;
  border: none;
  border-radius: 999px;
}

.bpm-badge {
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.72rem;
}

.hype-primary-row {
  display: flex;
}

.hype-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: var(--brand-accent);
  color: var(--brand-accent-fg);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.hype-btn:hover {
  background: var(--brand-accent-hover);
}

.hype-btn:active,
.hype-btn.is-pulsing {
  transform: scale(0.96);
}

.color-vote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-vote-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: auto;
}

.color-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: var(--chip);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-chip.is-selected {
  transform: scale(1.16);
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--surface);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

@media (min-width: 420px) {
  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.brand-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
}

.brand-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
}

.hud-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ghost-btn {
  flex: 1;
  min-width: 90px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ghost-btn[aria-pressed="true"] {
  border-color: var(--brand-accent);
  background: var(--surface-muted);
}

.hud-wake-hint {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--glass-text);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hud-root.is-hud-hidden .hud-wake-hint {
  opacity: 0.72;
}

/* Onboarding overlay */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(4, 7, 15, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-card {
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-accent);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
}

.onboarding-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.2;
}

.onboarding-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.preselected-seat-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.preselected-seat-box[hidden] {
  display: none;
}

.preselected-seat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}

.preselected-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.primary-cta {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.98rem;
  font-weight: 800;
  background: var(--brand-accent);
  color: var(--brand-accent-fg);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.primary-cta:hover {
  background: var(--brand-accent-hover);
}

.primary-cta:active {
  transform: scale(0.98);
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-note {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Native <dialog> compliance: NEVER set display unconditionally on dialog */
dialog {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(94vw, 440px);
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--dialog-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-surface {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.dialog-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.dialog-footer {
  padding-top: 4px;
}

/* Tactile SVG Mini-Stadyum Tribün Seçici */
.picker-slot[hidden] {
  display: none;
}

.stadium-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stadium-svg {
  width: 100%;
  max-height: 210px;
  height: auto;
  display: block;
}

.stadium-zone-shape {
  fill: var(--svg-sector);
  stroke: var(--svg-sector-stroke);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.stadium-zone-shape[data-active="true"] {
  fill: var(--svg-sector-active);
  stroke: var(--brand-accent-hover);
  stroke-width: 2.5;
}

.stadium-pitch-shape {
  fill: var(--svg-pitch);
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
  cursor: pointer;
}

.stadium-pitch-shape[data-active="true"] {
  fill: var(--svg-sector-active);
  stroke: var(--brand-accent-hover);
}

.stadium-zone-label {
  fill: var(--svg-sector-text);
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.stadium-zone-label[data-active="true"] {
  fill: var(--svg-sector-active-text);
}

.stadium-pitch-label {
  fill: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.stadium-pitch-label[data-active="true"] {
  fill: var(--svg-sector-active-text);
}

.tier-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tier-btn {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.tier-btn[aria-pressed="true"] {
  background: var(--brand-accent);
  color: var(--brand-accent-fg);
  border-color: var(--brand-accent);
}

.slider-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.slider-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.slider-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-field input[type="range"] {
  width: 100%;
  margin: 2px 0;
}

/* HTTP -> HTTPS Upgrade Card */
.https-upgrade-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--brand-accent);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.8rem;
}

.https-upgrade-card[hidden] {
  display: none;
}

.hud-https-banner {
  width: 100%;
  max-width: 480px;
  align-self: center;
  background: var(--glass-bg);
  color: var(--glass-text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.hud-root.is-hud-hidden .hud-https-banner {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.https-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.https-dismiss-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.https-tip,
.https-tip-small {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.https-tip-small {
  font-size: 0.7rem;
}

.https-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.https-upgrade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--brand-accent);
  color: var(--brand-accent-fg);
  font-size: 0.82rem;
  font-weight: 800;
  touch-action: manipulation;
  transition: background-color 0.2s ease, transform 0.12s ease;
}

.https-upgrade-btn:hover {
  background: var(--brand-accent-hover);
}

.ca-cert-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

/* Compact Simulator Mode (?sim=1) for Director 4-Phone Drawer */
html.is-sim .onboarding-overlay {
  display: none !important;
}

html.is-sim .hud-root {
  padding: 6px;
  gap: 4px;
}

html.is-sim .hud-top {
  gap: 4px;
}

html.is-sim .glass-pill {
  padding: 3px 7px;
  font-size: 0.65rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.is-sim .hud-telemetry {
  gap: 4px;
}

html.is-sim .telemetry-chip {
  padding: 2px 6px;
  font-size: 0.6rem;
}

html.is-sim #shader-badge {
  display: none;
}

html.is-sim .hud-dock {
  padding: 6px 8px;
  border-radius: 12px;
  gap: 5px;
}

html.is-sim .hype-meter-row,
html.is-sim .color-vote-row,
html.is-sim .controls-grid,
html.is-sim .hud-actions-row,
html.is-sim .hud-wake-hint,
html.is-sim .hud-https-banner {
  display: none;
}

html.is-sim .hype-btn {
  padding: 6px 8px;
  font-size: 0.72rem;
  border-radius: 8px;
}
