/* ============================================================
   New Horizons — shared UI theme
   Serviceware Code Blue 3.0 tokens on the dark game ground,
   as designed in "New Horizons GM.dc.html" (options 1a / 1d–1f).
   Loaded by both the player app (/app) and the GM dashboard.
   ============================================================ */

:root {
  color-scheme: dark;

  /* ---- Code Blue brand palette ---- */
  --cb-brand-classical-blue: rgb(0, 107, 170);
  --cb-brand-deepwater-blue: rgb(0, 63, 114);
  --cb-brand-mechanical-gray: rgb(44, 66, 76);
  --cb-brand-artic-currant: rgb(93, 182, 202);
  --cb-brand-summer-orange: rgb(247, 148, 29);
  --cb-brand-electric-yellow: rgb(255, 204, 50);
  --cb-brand-green-apple: rgb(102, 182, 73);
  --cb-brand-red-berry: rgb(211, 68, 63);
  --cb-brand-sugar-plum: rgb(165, 137, 204);

  /* ---- Semantic scale steps used on dark ground ---- */
  --cb-neutral-200: rgb(238, 240, 241);
  --cb-secondary-400: rgb(250, 191, 119);
  --cb-success-300: rgb(158, 202, 141);
  --cb-error-300: rgb(221, 143, 141);
  --cb-info-base: rgb(69, 158, 178);
  --cb-support-300: rgb(192, 168, 214);

  /* ---- The five ship properties ----
     A crew reads the five bars against each other, so the five carry five
     hues far enough apart to be told apart at a glance — Control used to be
     `--cb-info-base`, two degrees of hue off Speed's cyan, and the two were
     one colour on a phone. What the cards *added* is drawn on top of a stat's
     own bar, so it is deliberately neutral rather than a sixth hue: a green
     gain segment was Defense's own green. */
  --nh-stat-speed: rgb(93, 182, 202);    /* artic currant — cyan */
  --nh-stat-control: rgb(102, 182, 73);  /* green apple */
  --nh-stat-energy: rgb(255, 204, 50);   /* electric yellow */
  --nh-stat-defense: rgb(211, 68, 63);   /* red berry */
  --nh-stat-tech: rgb(165, 137, 204);    /* sugar plum */
  --nh-stat-gain: rgb(238, 240, 241);    /* neutral 200 — what the cards added */

  /* ---- Brand gradients ---- */
  --cb-gradient-morning-sunrise: linear-gradient(-26deg, rgb(255, 204, 50) 1%, rgb(247, 148, 29) 100%);
  --cb-gradient-faded-charcoal: linear-gradient(180deg, rgb(44, 66, 76) 0%, rgb(74, 93, 101) 100%);

  /* ---- Spacing / radius / sizing ---- */
  --cb-space-3xs: 4px;
  --cb-space-2xs: 6px;
  --cb-space-xs: 8px;
  --cb-space-sm: 12px;
  --cb-space-md: 16px;
  --cb-space-xm: 20px;
  --cb-space-lg: 24px;
  --cb-space-xl: 32px;
  --cb-space-2xl: 40px;
  --cb-radius-sm: 4px;
  --cb-radius-md: 8px;
  --cb-radius-lg: 16px;
  --cb-radius-full: 999px;
  --cb-height-sm: 32px;
  --cb-height-md: 40px;
  --cb-height-lg: 48px;

  /* ---- Typography ---- */
  --cb-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, sans-serif;
  --cb-font-family-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* ---- Game ground (dark canvas the Code Blue palette sits on) ---- */
  --nh-bg: #0a1219;
  --nh-fg: #eef0f1;
  --nh-fg-strong: rgba(238, 240, 241, .9);
  --nh-fg-muted: rgba(238, 240, 241, .65);
  --nh-fg-dim: rgba(238, 240, 241, .45);
  --nh-fg-faint: rgba(238, 240, 241, .3);
  --nh-line: rgba(255, 255, 255, .1);
  --nh-line-soft: rgba(255, 255, 255, .05);
  --nh-panel: rgba(255, 255, 255, .02);
  --nh-panel-raised: rgba(255, 255, 255, .03);
}

/* ---- Page ground ---------------------------------------------------- */

body {
  margin: 0;
  background: radial-gradient(1200px 520px at 15% -10%, rgba(0, 107, 170, .22), transparent 65%),
              var(--nh-bg);
  background-attachment: fixed;
  color: var(--nh-fg);
  font-family: var(--cb-font-family);
  font-size: 14px;
  line-height: 20px;
}

.nh-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--cb-space-lg) var(--cb-space-xl) var(--cb-space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--cb-space-xm);
}

/* ---- Masthead ------------------------------------------------------- */

.nh-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cb-space-lg);
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.nh-brand { display: flex; align-items: center; gap: 14px; }

/* The event's own mark. The file is an Illustrator export carrying a viewBox
   but no width/height, so the height is set here and the width follows the
   artwork's ratio — a bare `auto` on both would render it at zero. */
.nh-mark {
  height: 34px;
  width: auto;
  flex: none;
}

.nh-title { font: 700 19px/1.1 var(--cb-font-family); letter-spacing: .4px; margin: 0; }

.nh-subtitle {
  font: 600 10px/1 var(--cb-font-family-ui);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cb-brand-summer-orange);
  margin-top: 2px;
}

.nh-live {
  display: flex; align-items: center; gap: 10px;
  font: 600 11px var(--cb-font-family-ui);
  letter-spacing: .6px;
  color: rgba(238, 240, 241, .6);
}

.nh-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--nh-fg-faint);
}
.nh-dot.live { background: var(--cb-brand-electric-yellow); }
.nh-dot.idle { background: var(--cb-brand-green-apple); }
.nh-dot.down { background: var(--cb-brand-red-berry); }

/* ---- Panels --------------------------------------------------------- */

.nh-panel {
  border: 1px solid var(--nh-line);
  border-radius: var(--cb-radius-md);
  background: var(--nh-panel-raised);
  padding: var(--cb-space-xm) 22px;
  display: flex;
  flex-direction: column;
  gap: var(--cb-space-md);
}

.nh-panel.flush { padding: 0; background: var(--nh-panel); overflow: hidden; }

/* Author `display` on the panels would otherwise beat the UA sheet's rule for
   the `hidden` attribute, which the player app uses to switch views. */
[hidden] { display: none !important; }

.nh-panel-head {
  padding: 14px var(--cb-space-xm);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font: 600 10px var(--cb-font-family-ui);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(238, 240, 241, .55);
}

.nh-panel-body { padding: var(--cb-space-md) var(--cb-space-xm); }

.nh-status { font: 400 14px/20px var(--cb-font-family); color: rgba(238, 240, 241, .82); }

/* ---- Buttons -------------------------------------------------------- */

.nh-btn {
  height: var(--cb-height-md);
  padding: 0 var(--cb-space-md);
  border: 0;
  border-radius: var(--cb-radius-md);
  background: var(--cb-gradient-morning-sunrise);
  color: var(--nh-bg);
  font: 700 13.5px var(--cb-font-family);
  cursor: pointer;
}

.nh-btn:disabled { opacity: .45; cursor: default; }

/* A link that has to read as a button: `.nh-btn` sets a height, which an inline
   anchor would ignore, and browsers underline anchors. */
a.nh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
}

.nh-btn.secondary {
  border: 1px solid rgba(247, 148, 29, .55);
  background: transparent;
  color: var(--cb-secondary-400);
  font-weight: 600;
}
.nh-btn.secondary:hover:not(:disabled) { background: rgba(247, 148, 29, .12); }

.nh-btn.ghost {
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  color: rgba(238, 240, 241, .7);
  font-weight: 600;
}
.nh-btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .07); }

.nh-btn.danger {
  border: 1px solid rgba(211, 68, 63, .5);
  background: rgba(211, 68, 63, .12);
  color: var(--cb-error-300);
  font-weight: 600;
}
.nh-btn.danger:hover:not(:disabled) { background: rgba(211, 68, 63, .22); }

.nh-btn.sm { height: var(--cb-height-sm); padding: 0 var(--cb-space-sm); font-size: 11.5px; }
.nh-btn.lg { height: var(--cb-height-lg); padding: 0 var(--cb-space-lg); font-size: 15px; }

.nh-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nh-spacer { flex: 1; }

/* ---- Form fields ---------------------------------------------------- */

.nh-field {
  height: var(--cb-height-md);
  box-sizing: border-box;
  padding: 0 var(--cb-space-sm);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--cb-radius-md);
  background: rgba(255, 255, 255, .04);
  color: var(--nh-fg);
  font: 400 14px var(--cb-font-family);
}
.nh-field::placeholder { color: var(--nh-fg-faint); }
.nh-field:focus-visible {
  outline: none;
  border-color: rgba(0, 107, 170, .9);
  box-shadow: 0 0 0 2px rgba(0, 107, 170, .35);
}

.nh-label {
  font: 600 12px var(--cb-font-family);
  color: var(--nh-fg-muted);
}

/* ---- Pills / badges ------------------------------------------------- */

.nh-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
  padding: 0 var(--cb-space-xs);
  border-radius: var(--cb-radius-sm);
  font: 700 9.5px var(--cb-font-family-ui);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .07);
  color: rgba(238, 240, 241, .5);
  justify-self: start;
  white-space: nowrap;
}
.nh-pill.active  { background: rgba(255, 204, 50, .14); color: var(--cb-brand-electric-yellow); }
.nh-pill.done    { background: rgba(102, 182, 73, .14); color: var(--cb-success-300); }
.nh-pill.warn    { background: rgba(247, 148, 29, .14); color: var(--cb-brand-summer-orange); }
.nh-pill.info    { background: rgba(69, 158, 178, .16); color: var(--cb-info-base); }

/* ---- Micro type ----------------------------------------------------- */

.nh-eyebrow {
  font: 600 10px var(--cb-font-family-ui);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--nh-fg-dim);
}

.nh-num { font: 700 15px var(--cb-font-family-ui); font-variant-numeric: tabular-nums; }
.nh-muted { color: var(--nh-fg-muted); font-size: 13px; }
.nh-dim { color: var(--nh-fg-dim); }

.nh-hint { min-height: 16px; font-size: 13px; color: var(--cb-error-300); }
.nh-hint.ok { color: var(--cb-success-300); }
/* A request under way: neither a refusal nor a result yet, so neither colour. */
.nh-hint.pending { color: var(--nh-fg-dim); }

/* Message — the design system's inline status surface (Code Blue "Message"),
   in this app's dark theme. It sits in the layout next to the thing it is about
   and stays while that situation holds, rather than floating or auto-hiding.
   The icon plus the wording carry the meaning, so colour is never the only
   signal; the role (status / alert) is what announces it. */
.nh-msg {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border: 1px solid; border-radius: var(--cb-radius-sm);
  font: 400 13.5px/20px var(--cb-font-family); text-wrap: pretty;
}
.nh-msg > .nh-msg-icon { flex: none; font-weight: 700; line-height: 20px; }
.nh-msg.success { background: rgba(102, 182, 73, .12); border-color: rgba(102, 182, 73, .5);
                  color: var(--cb-success-300); }
.nh-msg.error   { background: rgba(211, 68, 63, .12); border-color: rgba(211, 68, 63, .5);
                  color: var(--cb-error-300); }
.nh-msg.info    { background: rgba(69, 158, 178, .12); border-color: rgba(69, 158, 178, .5);
                  color: var(--cb-info-base); }

a { color: var(--cb-brand-artic-currant); }
