/* ============================================================
   PLAYBSGO.COM — shared site tokens + components.
   Matches the launcher's visual system: Sofia Sans body,
   JetBrains Mono for labels, faction-aware accent swap,
   ambient starfield hooks. Single source of truth for
   landing / changelog / support / 404.
   ============================================================ */

@font-face {
  font-family: 'Sofia Sans';
  src: url('SofiaSans_Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Surfaces */
  --bg:        #0a0b0e;
  --bg-2:      #0d0f14;
  --bg-3:      #11141b;
  --card:      #12151c;
  --card-hi:   #181c25;
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.1);

  /* Type */
  --text:      #E6E7EA;
  --text-2:    #B7BCC6;
  --text-3:    #7C8494;
  --text-4:    #4E5563;

  /* Faction accents — Colonial primary is blue, secondary gold */
  --colonial:         #4AA3E0;
  --colonial-glow:    rgba(74,163,224,0.32);
  --colonial-soft:    rgba(74,163,224,0.10);
  --colonial-line:    rgba(74,163,224,0.38);
  --colonial-2:       #D9A441;   /* secondary (gold) */
  --colonial-2-soft:  rgba(217,164,65,0.12);
  --colonial-2-line:  rgba(217,164,65,0.38);

  --cylon:            #E33A3A;
  --cylon-glow:       rgba(227,58,58,0.32);
  --cylon-soft:       rgba(227,58,58,0.08);
  --cylon-line:       rgba(227,58,58,0.35);
  --cylon-2:          #F0C070;   /* secondary for visual balance */
  --cylon-2-soft:     rgba(240,192,112,0.10);
  --cylon-2-line:     rgba(240,192,112,0.30);

  /* Active (swapped by data-faction) */
  --accent:         var(--colonial);
  --accent-glow:    var(--colonial-glow);
  --accent-soft:    var(--colonial-soft);
  --accent-line:    var(--colonial-line);
  --accent-2:       var(--colonial-2);
  --accent-2-soft:  var(--colonial-2-soft);
  --accent-2-line:  var(--colonial-2-line);
  --faction-glyph:  '\25C6'; /* ◆ */
  --enemy:          var(--cylon);
  --enemy-soft:     var(--cylon-soft);

  /* Status */
  --success: #4bd36b;
  --warn:    #e8a020;
  --danger:  #e3524b;

  /* Motion */
  --dur-1: 140ms;
  --dur-2: 280ms;
  --dur-3: 520ms;

  /* Chrome */
  --radius: 3px;
  --radius-lg: 6px;
  --panel-radius: 4px;
}

[data-faction="cylon"] {
  --accent:        var(--cylon);
  --accent-glow:   var(--cylon-glow);
  --accent-soft:   var(--cylon-soft);
  --accent-line:   var(--cylon-line);
  --accent-2:      var(--cylon-2);
  --accent-2-soft: var(--cylon-2-soft);
  --accent-2-line: var(--cylon-2-line);
  --faction-glyph: '\25B2'; /* ▲ */
  --enemy:         var(--colonial);
  --enemy-soft:    var(--colonial-soft);
}

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

html { scroll-behavior: smooth; }
body {
  font-family: 'Sofia Sans', system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   AMBIENT — subtle starfield behind everything.
   Canvas is optional (site.js lights it up); the gradient
   fallback still gives depth if JS is off.
   ============================================================ */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(74,163,224,0.05), transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 75%, rgba(217,164,65,0.035), transparent 65%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(255,255,255,0.015), transparent 70%);
  transition: background var(--dur-3);
}
[data-faction="cylon"] .ambient {
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(227,58,58,0.07), transparent 60%),
    radial-gradient(ellipse 70% 55% at 85% 75%, rgba(240,192,112,0.03), transparent 65%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(255,255,255,0.015), transparent 70%);
}
#ambient_stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.7;
}
.ambient_scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.012) 0,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px);
  mix-blend-mode: overlay;
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  #ambient_stars { display: none; }
}

/* ============================================================
   TYPE
   ============================================================ */
.mono {
  font-family: 'JetBrains Mono', ui-monospace, 'Menlo', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; color: #fff; }
h1 { font-size: 44px; letter-spacing: -0.02em; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p  { color: var(--text-2); }

a { color: var(--accent); text-decoration: none; transition: color var(--dur-1); }
a:hover { filter: brightness(1.2); }

.faction_glyph::before {
  content: var(--faction-glyph);
  font-size: 0.9em; margin-right: 0.5ch;
  color: var(--accent);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.site_wrap { position: relative; z-index: 2; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.container_narrow { max-width: 760px; margin: 0 auto; padding: 0 28px; }

.section { padding: 72px 0; position: relative; }
.section_head { margin-bottom: 28px; }
.section_head .eyebrow { display: block; margin-bottom: 6px; }
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  margin: 0 auto;
  max-width: 1160px;
  opacity: 0.8;
}

/* ============================================================
   TOP NAV — public pages only.
   Mirrors the launcher's compact HUD look.
   ============================================================ */
.site_nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10,11,14,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site_nav_inner {
  display: flex; align-items: center; gap: 4px;
  height: 52px;
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
}
.nav_brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-2); padding-right: 18px;
  border-right: 1px solid var(--line);
  height: 100%;
}
.nav_brand b { color: var(--accent); font-weight: 700; letter-spacing: 3px; }
.nav_brand::before {
  content: var(--faction-glyph);
  color: var(--accent); font-size: 14px;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}
.nav_links { display: flex; height: 100%; }
.nav_link {
  display: inline-flex; align-items: center;
  padding: 0 16px; height: 100%;
  color: var(--text-3); text-decoration: none;
  border-right: 1px solid var(--line);
  transition: color var(--dur-1);
}
.nav_link:hover, .nav_link.active { color: var(--text); }
.nav_link.active { box-shadow: inset 0 -2px 0 var(--accent); }
.nav_spacer { flex: 1; }
.nav_status {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); padding: 0 14px; height: 100%;
  border-left: 1px solid var(--line);
}
.nav_status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}
.nav_status .dot.offline {
  background: var(--text-3); box-shadow: none; animation: none;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.faction_toggle {
  display: inline-flex; height: 100%; border-left: 1px solid var(--line);
}
.faction_toggle button {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 0 12px;
  font: inherit; letter-spacing: 2px;
  transition: color var(--dur-1), background var(--dur-1);
}
.faction_toggle button.active[data-side="colonial"] {
  color: var(--colonial); background: rgba(74,163,224,0.10);
}
.faction_toggle button.active[data-side="cylon"] {
  color: var(--cylon); background: rgba(227,58,58,0.08);
}
.faction_toggle button:hover:not(.active) { color: var(--text); }

.nav_enlist {
  display: inline-flex; align-items: center; padding: 0 20px; height: 100%;
  background: var(--accent-soft);
  color: var(--accent) !important;
  border-left: 1px solid var(--accent-line);
  font-weight: 700;
}
.nav_enlist:hover { filter: brightness(1.2); }

@media (max-width: 820px) {
  .nav_hide_sm { display: none !important; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--accent); color: #0a0b0e;
  border: 1px solid var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  cursor: pointer;
  text-decoration: none !important;
  transition: filter var(--dur-1), transform var(--dur-1);
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn_ghost {
  background: transparent; color: var(--text-2) !important;
  border-color: var(--line-2);
}
.btn_ghost:hover { color: var(--text) !important; border-color: var(--accent); background: var(--accent-soft); }
.btn_lg { padding: 14px 26px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 22px 24px;
}
.card_hi { background: var(--card-hi); }

/* ============================================================
   EVENT CARD — same vocab as the launcher.
   ============================================================ */
.events_stack { display: flex; flex-direction: column; gap: 10px; }
.event_card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--card);
  overflow: hidden;
  min-height: 108px;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color var(--dur-2);
}
.event_card:hover { border-color: var(--accent-line); }
.event_bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(1.1) brightness(.75);
  transform: scale(1); transition: transform var(--dur-3);
}
.event_card:hover .event_bg { transform: scale(1.06); }
.event_overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,11,14,0.15) 0%, rgba(10,11,14,0.92) 100%);
}
.event_content { position: relative; z-index: 2; padding: 12px 14px 0; }
.event_status_bar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  margin-bottom: 6px;
}
.event_badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; letter-spacing: 2px; color: #fff;
}
.event_badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}
.event_badge.upcoming .dot { background: var(--text-3); box-shadow: none; animation: none; }
.event_badge.empty .dot    { background: var(--text-4); box-shadow: none; animation: none; }
.event_timer {
  color: var(--text); font-variant-numeric: tabular-nums;
}
.event_name {
  font-size: 14px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: #fff; margin-bottom: 3px;
}
.event_meta {
  font-size: 12px; color: var(--text-2); margin-bottom: 10px;
}
.event_progress_track {
  height: 2px; background: rgba(0,0,0,0.55);
  margin: 0 -14px;
}
.event_progress_fill {
  height: 100%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width var(--dur-3);
}

/* ============================================================
   MOTD — mirrors the launcher
   ============================================================ */
.motd {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-line);
  border-radius: var(--panel-radius);
  font-size: 13px; color: var(--text);
}
.motd[hidden] { display: none; }
.motd .tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px; font-weight: 800; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site_footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 12px; color: var(--text-3);
}
.site_footer .container { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site_footer a { color: var(--text-3); }
.site_footer a:hover { color: var(--text); }
.footer_mark { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 3px; }
.footer_links { display: flex; gap: 20px; }

/* ============================================================
   FORMS (used by support + any CTA inputs)
   ============================================================ */
label, .form_label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--text-3); text-transform: uppercase;
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  transition: border-color var(--dur-1), background var(--dur-1);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--bg-3);
}
.form_row { margin-bottom: 16px; }
.form_hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.alert_error   { background: rgba(227,82,75,0.08); border: 1px solid rgba(227,82,75,0.35); color: #ff8a84; }
.alert_success { background: rgba(75,211,107,0.08); border: 1px solid rgba(75,211,107,0.35); color: #8bdfa0; }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr_only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  color: transparent !important;
  border-radius: 2px;
}
@keyframes shimmer { 0% {background-position: 200% 0;} 100% {background-position: -200% 0;} }
