/* Starlight — design system
   Warm cantina-glow palette: cream & parchment, amber lantern light, coral flourish accent. */

:root {
  --cream-50: #fffaf1;
  --cream-100: #fbf2e1;
  --cream-200: #f4e6c9;
  --parchment: #efe1bf;
  --parchment-line: #e6d3a8;

  --ink-900: #3a2a1c;
  --ink-700: #5c4630;
  --ink-500: #8a7256;
  --ink-300: #b9a583;

  --gold-300: #f3c568;
  --gold-400: #e8a33d;
  --gold-500: #cf8620;
  --gold-600: #a86815;
  --gold-glow: rgba(232, 163, 61, 0.35);

  --coral-300: #f6a58f;
  --coral-400: #ef7f63;
  --coral-500: #dd5f42;
  --coral-glow: rgba(239, 127, 99, 0.3);

  --sage-400: #7da572;
  --sage-500: #5f8a54;

  --danger: #c8503c;
  --success: #5f8a54;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-panel: 0 18px 40px -20px rgba(120, 84, 32, 0.28);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream-50);
  color: var(--ink-700);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  color: var(--ink-900);
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.15;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-500); }
p.lead { font-size: 1.15rem; color: var(--ink-700); }

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--gold-600);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.9em;
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold-500);
  display: inline-block;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; position: relative; }
.section-tight { padding: 52px 0; }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: #3a2205;
  box-shadow: 0 10px 26px -12px var(--gold-glow);
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px var(--gold-glow); filter: brightness(1.03); }
.btn-ghost {
  background: #fff;
  color: var(--ink-900);
  border-color: var(--parchment-line);
}
.btn-ghost:hover { border-color: var(--coral-400); color: var(--coral-500); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255, 250, 241, 0.86);
  border-bottom: 1px solid var(--parchment-line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink-900);
  line-height: 1.1;
}
.brand-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-top: 2px;
  font-weight: 600;
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-500);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--coral-500); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding: 110px 0 80px; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 50% -10%, var(--cream-200) 0%, var(--cream-50) 55%);
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 820px; margin: 0 auto; }
.hero-sub { font-size: 1.15rem; color: var(--ink-500); max-width: 640px; margin: 0 auto 2.2em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}
.hero-content { text-align: left; }
.hero-content .hero-sub { margin: 0 0 2.2em; }
.hero-content .hero-actions { justify-content: flex-start; margin-bottom: 2.2rem; }
.hero-content .status-strip { display: flex; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-content { text-align: center; }
  .hero-content .hero-actions { justify-content: center; }
  .hero-content .status-strip { display: inline-flex; }
  .hero-cam { max-width: 560px; margin: 0 auto; }
}

.status-strip {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  flex-wrap: wrap;
}
.status-item {
  padding: 16px 26px;
  border-right: 1px solid var(--parchment-line);
  text-align: left;
  min-width: 140px;
}
.status-item:last-child { border-right: none; }
.status-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-300);
  margin-bottom: 6px;
}
.status-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-300); flex: none; }
.dot.online { background: var(--success); box-shadow: 0 0 0 0 rgba(95, 138, 84, 0.6); animation: pulse 2s infinite; }
.dot.offline { background: var(--danger); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95, 138, 84, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(95, 138, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 138, 84, 0); }
}

/* Panels / cards */
.panel {
  background: #fff;
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-panel);
  position: relative;
}
.panel::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gold-400), var(--coral-400));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.panel-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(232, 163, 61, 0.14);
  border: 1px solid rgba(232, 163, 61, 0.4);
  color: var(--gold-600);
  margin-bottom: 18px;
}

.subnav {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px;
}
.subnav a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--parchment-line);
  color: var(--ink-500);
  background: #fff;
}
.subnav a.active { color: #fff; background: var(--coral-500); border-color: var(--coral-500); }

/* Table / board */
.board-table { width: 100%; border-collapse: collapse; }
.board-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-300);
  padding: 10px 14px;
  border-bottom: 1px solid var(--parchment-line);
}
.board-table td {
  padding: 14px;
  border-bottom: 1px solid var(--parchment-line);
  color: var(--ink-700);
}
.board-table tr:last-child td { border-bottom: none; }
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-open { background: rgba(232, 163, 61, 0.16); color: var(--gold-600); border: 1px solid rgba(232, 163, 61, 0.45); }
.tag-claimed { background: rgba(95, 138, 84, 0.14); color: var(--success); border: 1px solid rgba(95, 138, 84, 0.4); }
.credits { font-family: var(--font-mono); color: var(--coral-500); }
.rank-1 { color: var(--gold-600); }
.rank-2 { color: var(--ink-900); }
.rank-3 { color: var(--coral-500); }

/* Forms */
.form-field { margin-bottom: 20px; text-align: left; }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.form-field input, .form-field textarea {
  width: 100%;
  background: var(--cream-50);
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--coral-400);
  box-shadow: 0 0 0 3px var(--coral-glow);
}
.form-hint { font-size: 0.82rem; color: var(--ink-300); margin-top: 6px; }
.form-error {
  background: rgba(200, 80, 60, 0.1);
  border: 1px solid rgba(200, 80, 60, 0.35);
  color: #a13f2c;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.form-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* Footer */
.footer { border-top: 1px solid var(--parchment-line); padding: 56px 0 40px; background: var(--cream-100); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: 0.85rem; letter-spacing: 0.1em; color: var(--ink-500); margin-bottom: 14px; font-family: var(--font-mono); text-transform: uppercase; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer a { text-decoration: none; color: var(--ink-500); font-size: 0.92rem; }
.footer a:hover { color: var(--coral-500); }
.footer-bottom {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--parchment-line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 0.8rem; color: var(--ink-300); font-family: var(--font-mono);
}

/* Holomap */
.holomap { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.planet-chip {
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--cream-50);
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.planet-chip.hot { border-color: rgba(239, 127, 99, 0.55); box-shadow: 0 0 20px -8px var(--coral-glow); }
.planet-name { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); }
.planet-count { font-family: var(--font-mono); color: var(--coral-500); font-size: 1.3rem; margin-top: 6px; }

/* Schedule cards (Cantina Schedule) */
.schedule-card {
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: var(--cream-50);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.schedule-when { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold-600); letter-spacing: 0.04em; text-transform: uppercase; min-width: 150px; }
.schedule-act { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); font-size: 1.1rem; }
.schedule-meta { color: var(--ink-500); font-size: 0.88rem; }

/* Devlog */
.devlog-entry { border-bottom: 1px solid var(--parchment-line); padding: 24px 0; }
.devlog-entry:last-child { border-bottom: none; }
.devlog-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold-600); letter-spacing: 0.08em; text-transform: uppercase; }

/* Misc */
.center { text-align: center; }
.text-muted { color: var(--ink-300); }
.mt-0 { margin-top: 0; }
.flash-success {
  background: rgba(95, 138, 84, 0.12);
  border: 1px solid rgba(95, 138, 84, 0.35);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.scroll-fade { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.scroll-fade.in-view { opacity: 1; transform: translateY(0); }

/* Live cantina cam */
.hero-cam { width: 100%; }
.cam-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--parchment-line);
  background: var(--ink-900);
  box-shadow: var(--shadow-panel);
}
#camVideo { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.cam-badge {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(58, 42, 28, 0.72); backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: #fff;
}
.cam-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-300); }
.cam-dot.live { background: #ff6b4d; box-shadow: 0 0 8px #ff6b4d; animation: camPulse 1.4s ease-in-out infinite; }
@keyframes camPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.cam-label {
  position: absolute; bottom: 12px; left: 12px; z-index: 4;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em;
  color: #fff; background: rgba(58, 42, 28, 0.6);
  padding: 5px 11px; border-radius: var(--radius-sm); font-weight: 500;
}
.cam-mute-btn {
  position: absolute; bottom: 10px; right: 10px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(58, 42, 28, 0.72); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cam-mute-btn:hover { background: rgba(232, 163, 61, 0.55); }
.cam-offline {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, var(--ink-700), var(--ink-900));
  text-align: center; padding: 16px;
}
.cam-offline-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; color: var(--gold-300); }
.cam-offline-sub { font-size: 0.82rem; color: var(--cream-200); }
