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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-black);
}

body {
  font-family: var(--font-body);
  color: var(--c-text-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
}

body.idle {
  cursor: none;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, var(--c-hull-800) 0%, var(--c-black) 62%);
  overflow: hidden;
}

/* Subtle vignette to keep true blacks at the edges (OLED-friendly) and
   focus the eye on the centre instrument cluster. */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,0.55) 100%);
}

/* Faint scanline / brushed-metal texture for an instrument-panel feel. */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--c-text-100) 0px,
    var(--c-text-100) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */

.bridge-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6) var(--space-3);
  flex: 0 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  font-size: 1.6rem;
  color: var(--c-brass-500);
  opacity: 0.85;
  transform: translateY(-2px);
}

.location-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.06em;
  color: var(--c-brass-100);
  text-shadow: 0 0 24px var(--c-brass-glow);
}

.location-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-text-500);
  margin-top: 0.2rem;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(201, 164, 100, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-300);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color var(--dur-med) var(--ease-bridge);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-warn);
  box-shadow: 0 0 10px currentColor;
  transition: background var(--dur-med) var(--ease-bridge);
}

.status-pill[data-state="live"] .status-dot { background: var(--c-good); color: var(--c-good); }
.status-pill[data-state="loading"] .status-dot { background: var(--c-warn); color: var(--c-warn); animation: pulse-dot 1.6s ease-in-out infinite; }
.status-pill[data-state="error"] .status-dot { background: var(--c-bad); color: var(--c-bad); }
.status-pill[data-state="stale"] .status-dot { background: var(--c-warn); color: var(--c-warn); }
.status-pill[data-state="preview"] .status-dot { background: var(--c-brass-500); color: var(--c-brass-500); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.header-right {
  display: flex;
  justify-content: flex-end;
  min-width: 14rem;
}

.clock-block {
  text-align: right;
}

.clock-time {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  color: var(--c-text-100);
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-500);
  margin-top: 0.2rem;
}

/* ---------------------------------------------------------------- */
/* Main                                                               */
/* ---------------------------------------------------------------- */

.bridge-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-4);
  min-height: 0;
}

/* ---------------------------------------------------------------- */
/* Footer                                                             */
/* ---------------------------------------------------------------- */

.bridge-footer {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-6) var(--space-4);
  border-top: 1px solid rgba(201, 164, 100, 0.12);
}

.footer-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-label {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-700);
}

.footer-value {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--c-text-300);
  font-variant-numeric: tabular-nums;
}

.footer-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.fullscreen-hint {
  background: transparent;
  border: 1px solid rgba(201, 164, 100, 0.3);
  color: var(--c-brass-300);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity var(--dur-med) var(--ease-bridge), all var(--dur-fast) var(--ease-bridge);
}

.fullscreen-hint:hover {
  background: rgba(201, 164, 100, 0.08);
  border-color: rgba(201, 164, 100, 0.6);
}

/* Fullscreen used to hide this unconditionally, on top of the idle
   fade below - meaning it vanished the instant fullscreen was entered
   and stayed gone permanently, leaving no on-screen way to exit
   fullscreen again on a touchscreen (no Escape key to fall back on).
   It now just follows the same idle-based fade as windowed mode in
   both cases: gone during genuinely passive viewing, but a tap always
   brings it right back. */
body.idle .fullscreen-hint {
  opacity: 0;
  pointer-events: none;
}
