/* =========================================================
   Ultimate Roleplay UCP — "Terminal Uplink" theme
   Gold-on-black systems terminal: pure black base, metallic
   gold primary signal, amber reserved for caution/warning
   states only, dedicated green for success/online states.
   Signature: a slow scanline pulse along panel edges and a
   HUD corner-bracket motif on card surfaces.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --ink-950: #000000;
  --ink-900: #0a0a0a;
  --ink-800: #131313;
  --ink-700: #1c1c1c;
  --ink-600: #262626;
  --line: #2a2a2a;
  --line-bright: #3d3d3d;
  --text-hi: #eef2f7;
  --text-mid: #aab2c4;
  --text-lo: #6f7790;
  --cyan: #d4af37;
  --cyan-dim: #6b5818;
  --cyan-glow: rgba(212, 175, 55, 0.35);
  --amber: #e8a33d;
  --teal: #d4af37; /* alias kept for existing markup that references --teal */
  --red: #ff5a36;
  --green: #34c77b;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse 900px 600px at 8% -5%, rgba(212, 175, 55, 0.09), transparent 60%),
    #000000;
  background-attachment: fixed;
  color: var(--text-hi);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-hi);
  margin: 0 0 4px;
}

code, .mono, .stat-value, .data-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--cyan-glow); color: var(--text-hi); }

/* Thin cyan scrollbar to keep the terminal feel consistent everywhere */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 6px; border: 2px solid var(--ink-900); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes scan-pulse {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }
  .scanline {
    background: linear-gradient(90deg, transparent 0%, var(--cyan) 45%, var(--cyan) 55%, transparent 100%);
    background-size: 200% 100%;
    animation: scan-pulse 5s linear infinite;
  }
  @keyframes breathe-glow {
    0%, 100% { box-shadow: 0 0 10px var(--cyan-glow); }
    50%      { box-shadow: 0 0 20px var(--cyan-glow), 0 0 34px var(--cyan-glow); }
  }
  .brand-mark { animation: breathe-glow 3.2s ease-in-out infinite; }
}

/* ---------- Shell layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink-900);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
}
.sidebar-brand .scanline { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; }

.brand-mark {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan);
  color: var(--ink-950);
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  border-radius: var(--radius);
  clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 15px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-lo);
  margin: 18px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}

.nav-item:hover { background: var(--ink-800); text-decoration: none; color: var(--text-hi); }
.nav-item.active { background: var(--ink-800); color: var(--cyan); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}
.nav-item.active .nav-dot, .nav-item:hover .nav-dot { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.account-chip-name { font-weight: 600; font-size: 13.5px; }
.account-chip-rank { font-size: 11.5px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.05em; }
.logout-link { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--text-lo); }
.logout-link:hover { color: var(--red); }

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1180px;
}

/* ---------- Page furniture ---------- */
.page-head { margin-bottom: 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 {
  font-size: 24px;
  background: linear-gradient(90deg, var(--text-hi) 60%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.25);
}
.page-sub { color: var(--text-lo); font-size: 13.5px; margin-top: 2px; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 0.14em; color: var(--cyan); text-transform: uppercase; margin-bottom: 6px; display: block; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13.5px; border-left: 3px solid; }
.alert-error { background: rgba(255, 90, 54, 0.1); border-color: var(--red); color: #ffc4b0; }
.alert-success { background: rgba(52, 199, 123, 0.08); border-color: var(--green); color: #b9f2d0; }

/* ---------- Cards / panels ---------- */
.panel {
  background: rgba(22, 27, 38, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  position: relative;
}

/* HUD corner-bracket motif — a quiet signature reused on every card surface */
.panel::before, .panel::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.panel::before { top: -1px; left: -1px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.panel::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }
.panel:hover::before, .panel:hover::after { opacity: 1; }

.panel-file-tag {
  position: absolute;
  top: -1px; right: -1px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-top: none; border-right: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-lo);
  padding: 3px 9px;
  letter-spacing: 0.05em;
  border-bottom-left-radius: var(--radius);
}

.panel h2, .panel h3 { font-size: 15px; margin-bottom: 14px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card {
  background: rgba(22, 27, 38, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 2px solid var(--cyan-dim);
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-lo); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 600; color: var(--text-hi); }
.stat-value.amber { color: var(--amber); }
.stat-value.teal { color: var(--cyan); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}
td { padding: 10px; border-bottom: 1px solid var(--ink-800); color: var(--text-mid); }
tr:hover td { background: var(--ink-800); }
.table-wrap { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge-ok { color: var(--green); }
.badge-warn { color: var(--amber); }
.badge-danger { color: var(--red); }
.badge-muted { color: var(--text-lo); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 12.5px; color: var(--text-mid); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--text-hi);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-block;
  background: var(--cyan);
  color: var(--ink-950);
  border: none;
  padding: 10px 20px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #e8c766; text-decoration: none; box-shadow: 0 0 16px var(--cyan-glow); }
.btn:disabled { background: var(--ink-700); color: var(--text-lo); cursor: not-allowed; box-shadow: none; clip-path: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--line);
  clip-path: none;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); background: transparent; box-shadow: 0 0 10px var(--cyan-glow); }
.btn-danger { background: var(--red); color: #2a0a0f; }
.btn-danger:hover { background: #ff8a68; box-shadow: 0 0 16px rgba(255, 90, 54, 0.35); }
.btn-sm { padding: 6px 12px; font-size: 11.5px; }

/* ---------- Auth pages (login/register) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink-950);
  background-image:
    linear-gradient(var(--ink-900) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-900) 1px, transparent 1px);
  background-size: 34px 34px;
}
.auth-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 380px;
  background: rgba(22, 27, 38, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 32px 30px;
  position: relative;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.08);
}
.auth-card::before, .auth-card::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  opacity: 0.6;
}
.auth-card::before { top: -1px; left: -1px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.auth-card::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }
.auth-card .brand-mark { margin-bottom: 14px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .page-sub { margin-bottom: 22px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--text-lo); text-align: center; }

/* ---------- Site watermark ---------- */
.site-watermark {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 130px;
  height: auto;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
@media (max-width: 700px) { .site-watermark { width: 80px; right: 10px; bottom: 10px; } }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-lo); }
.divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.char-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--ink-800); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.char-card-name { font-weight: 600; font-size: 15px; }
.char-card-meta { color: var(--text-lo); font-size: 12.5px; margin-top: 2px; }

/* ---------- Public site (home / news / rules for anonymous visitors) ---------- */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }

.public-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.public-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.public-nav-brand { display: flex; align-items: center; gap: 10px; color: var(--text-hi); }
.public-nav-brand:hover { text-decoration: none; }
.public-nav-links { display: flex; align-items: center; gap: 22px; flex: 1; }
.public-nav-links a { color: var(--text-mid); font-size: 13.5px; font-weight: 500; }
.public-nav-links a:hover, .public-nav-links a.active { color: var(--cyan); text-decoration: none; }
.public-nav-actions { display: flex; align-items: center; gap: 10px; }

.public-main { flex: 1; }
.public-section { max-width: 1180px; margin: 0 auto; padding: 48px 24px; }

/* ---------- Hero ---------- */
.hero {
  padding: 90px 24px 60px;
  text-align: center;
  background:
    radial-gradient(ellipse 1000px 500px at 50% -10%, rgba(212, 175, 55, 0.16), transparent 65%);
}
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero-badge-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  background: rgba(212, 175, 55, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 44px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-sub {
  color: var(--text-mid);
  font-size: 15.5px;
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-stat-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.hero-stat-row .stat-card { min-width: 150px; text-align: left; }
.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

@media (max-width: 700px) { .hero-title { font-size: 32px; } }

.step-card { text-align: left; }
.step-card h3 { margin: 10px 0 8px; }
.step-card p { margin-bottom: 14px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-item { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-bright); aspect-ratio: 16 / 10; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ---------- Public footer ---------- */
.public-footer { border-top: 1px solid var(--line); padding: 40px 24px 20px; background: var(--ink-900); }
.public-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.public-footer-col { display: flex; flex-direction: column; gap: 8px; }
.public-footer-col a { color: var(--text-mid); font-size: 13px; }
.public-footer-col a:hover { color: var(--cyan); text-decoration: none; }
.public-footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-lo);
  font-size: 12.5px;
}
@media (max-width: 700px) { .public-footer-inner { grid-template-columns: 1fr; } }
