/* ============================================================
   DeuceSG — dark premium + gold theme
   Derived from the DeuceCards brand: charcoal #07070a, panels
   #11131a/#171923, gold #d6a85b, warm text #f4f0e8.
   Local fonts only (assets/fonts). ASCII chrome, no emoji.
   ============================================================ */

:root {
  --bg: #07070a;
  --panel: #11131a;
  --panel-2: #171923;
  --text: #f4f0e8;
  --muted: #b7afa2;
  --gold: #d6a85b;
  --gold-2: #f0c67b;
  --line: #2a2d38;
  --red: #d9534f;
  --green: #3ba55d;
  --radius: 12px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font: 'Inter', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #17111f 0%, #07070a 38%);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(214,168,91,.35); }

/* ---- Themed scrollbar ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a3e4d; }
* { scrollbar-width: thin; scrollbar-color: var(--line) var(--bg); }

/* ---- Focus states (keyboard) ---- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container { width: min(1100px, 92%); margin: 0 auto; }

/* ============================================================
   Brand mark (inline SVG "DS") — logo is ALWAYS the home link
   ============================================================ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(214,168,91,.18), rgba(214,168,91,.05));
  border: 1px solid rgba(214,168,91,.45);
  flex: 0 0 auto;
}
.brand-mark svg { width: 24px; height: 24px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand-name em { font-style: normal; color: var(--gold); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 6%;
  background: rgba(7,7,10,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav nav { display: flex; gap: 26px; font-size: 14px; color: var(--muted); }
.nav nav a { transition: color .15s; }
.nav nav a:hover { color: var(--gold); }

/* ============================================================
   Buttons — gold gradient primary / ghost / danger
   ============================================================ */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #14100a;
  padding: 14px 24px;
  border-radius: 9px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .06em;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: transform .12s, box-shadow .12s, filter .12s;
  text-align: center;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(214,168,91,.28); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(214,168,91,.45);
}
.btn.ghost:hover { background: rgba(214,168,91,.08); box-shadow: none; }
.btn.danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(217,83,79,.5);
}
.btn.danger:hover { background: rgba(217,83,79,.1); box-shadow: none; }
.btn.small { padding: 9px 16px; font-size: 12px; }
.btn.block { width: 100%; }

/* ============================================================
   Forms — dark fill, gold focus ring
   ============================================================ */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: rgba(7,7,10,.6);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: rgba(183,175,162,.5); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214,168,91,.18);
}
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ============================================================
   Panel / card surfaces
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
}

/* ============================================================
   Splash — plain full-viewport landing + login (2026-08-21)
   ============================================================ */
/* Ambient gold-dust canvas behind the content (public/js/splash-bg.js).
   Transparent when the animation cannot run or prefers-reduced-motion is
   set, so the static body gradient below always shows. */
#splash-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
body.splash-bg .splash,
body.splash-bg .splash-footer { position: relative; z-index: 1; }

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 14px;
}
.splash {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 6%;
  text-align: center;
}
.splash-inner { width: min(640px, 100%); }
.splash-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 26px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(214,168,91,.18), rgba(214,168,91,.05));
  border: 1px solid rgba(214,168,91,.45);
}
.splash-mark svg { width: 48px; height: 48px; display: block; }
.splash-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 96px);
  line-height: 1.02;
  margin: 0 0 18px;
  font-weight: 700;
}
.splash-title.small { font-size: clamp(36px, 6vw, 54px); }
.splash-line {
  color: var(--muted);
  font-size: 17px;
  max-width: 460px;
  margin: 0 auto 30px;
  line-height: 1.65;
}
.splash-form { width: min(380px, 100%); margin: 0 auto; text-align: left; }

/* Footer */
footer {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  padding: 30px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
footer .signin {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(183,175,162,.28);
  letter-spacing: .06em;
  text-transform: uppercase;
}
footer .signin:hover { color: var(--gold); }

/* Slim splash footer (landing + login) — quiet, borderless */
.splash-footer { border-top: none; padding: 14px 6% 26px; font-size: 13px; }

/* Sign-in modal error line */
.modal-error {
  color: var(--red);
  font-size: 13.5px;
  margin: 0 0 14px;
}
.modal-error[hidden] { display: none; }

/* ============================================================
   Hub page
   ============================================================ */
.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.hub-actions { display: flex; gap: 12px; align-items: center; }
.hub-link {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 4px;
}
.hub-link:hover { color: var(--gold); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 26px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  min-height: 130px;
}
.hub-card:hover {
  border-color: rgba(214,168,91,.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.hub-card-tag {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.hub-card.tag-public .hub-card-tag { color: var(--gold); border-color: rgba(214,168,91,.45); }
.hub-card.tag-tailnet .hub-card-tag { color: #7ec8e3; border-color: rgba(126,200,227,.4); }
.hub-card.tag-local .hub-card-tag { color: var(--green); border-color: rgba(59,165,93,.45); }
.hub-card h3 { font-family: var(--font-display); font-size: 18px; margin: 4px 0 0; }
.hub-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.hub-card::after {
  content: 'OPEN \2197';
  margin-top: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(214,168,91,.75);
}
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ============================================================
   Modal (change password) — replaces browser prompts
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7,7,10,.72);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-overlay.open { display: grid; }
.modal-box {
  width: min(440px, 100%);
  background: var(--panel-2);
  border: 1px solid rgba(214,168,91,.35);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-box h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.modal-box .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.modal-actions { display: flex; gap: 12px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

/* ============================================================
   Toast — themed, replaces alert()
   ============================================================ */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(420px, 92%);
}
.toast {
  background: var(--panel-2);
  border: 1px solid rgba(214,168,91,.5);
  border-left: 3px solid var(--gold);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  text-align: center;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(217,83,79,.6); border-left-color: var(--red); }

/* ============================================================
   Back to top
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(214,168,91,.5);
  background: linear-gradient(135deg, rgba(214,168,91,.25), rgba(214,168,91,.08));
  color: var(--gold);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .12s;
  backdrop-filter: blur(6px);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(214,168,91,.25); }

/* ============================================================
   404 / offline pages
   ============================================================ */
.center-page {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 6%;
}
.center-page .big {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 120px);
  line-height: 1;
  margin: 0;
  color: var(--gold);
}
.center-page h1 { font-family: var(--font-display); font-size: 30px; margin: 10px 0 8px; }
.center-page p { color: var(--muted); max-width: 460px; margin: 0 auto 28px; }

/* ============================================================
   Responsive (360px+): stack, no horizontal scroll
   ============================================================ */
@media (max-width: 900px) {
  .nav { padding: 12px 5%; }
  .nav nav { gap: 18px; font-size: 13px; }
}
@media (max-width: 560px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-top { flex-direction: column; align-items: flex-start; }
  .splash { padding: 50px 5%; }
}
