/* Aurion UCP — Member desk
 * UX-first app shell: persistent nav, primary tasks first, calm gold city tone.
 */

:root {
  --gold: var(--aurion-gold, #c9a227);
  --gold-muted: var(--aurion-muted-gold, #a68b2c);
  --gold-soft: rgba(201, 162, 39, 0.14);
  --black: var(--aurion-black, #0f0f0f);
  --charcoal: var(--aurion-charcoal, #1c1c1c);
  --surface: #161616;
  --surface-2: #1a1a1a;
  --ivory: var(--aurion-ivory, #f5f0e6);
  --ivory-soft: rgba(245, 240, 230, 0.72);
  --ivory-dim: rgba(245, 240, 230, 0.48);
  --border: rgba(201, 162, 39, 0.18);
  --border-soft: rgba(245, 240, 230, 0.08);
  --ok: #9dca8c;
  --bad: #e0a0a0;
  --font-display: var(--aurion-font-display, "Cinzel", "Times New Roman", serif);
  --font-body: var(--aurion-font-body, "Inter", system-ui, sans-serif);
  --sidebar-w: 260px;
  --topbar-h: 4.25rem;
  --bottom-h: 4.25rem;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 3px rgba(201, 162, 39, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ivory);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

body.is-app {
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

strong {
  font-weight: 600;
  color: var(--ivory);
}

code,
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  word-break: break-all;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  font-size: 0.88rem;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Shell */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sidebar — desktop wayfinding */

.sidebar {
  display: none;
  flex-direction: column;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #121212 0%, #0c0c0c 100%);
  border-right: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.15rem 0.9rem 1rem;
  gap: 1rem;
}

.sidebar-top {
  display: grid;
  gap: 0.75rem;
  padding: 0 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-inline {
  gap: 0.5rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.mock-chip {
  margin: 0;
  width: fit-content;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-muted);
  border: 1px dashed var(--border);
  background: rgba(201, 162, 39, 0.06);
}

.side-nav {
  display: grid;
  gap: 0.25rem;
  flex: 1;
  align-content: start;
}

.side-group {
  margin: 0.35rem 0.55rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.side-link {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.65rem;
  border-radius: 12px;
  color: var(--ivory-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover {
  background: rgba(245, 240, 230, 0.04);
  color: var(--ivory);
}

.side-link.is-active {
  background: var(--gold-soft);
  color: var(--ivory);
  box-shadow: inset 3px 0 0 var(--gold);
}

.side-ico {
  color: var(--gold-muted);
  display: grid;
  place-items: center;
}

.side-link.is-active .side-ico {
  color: var(--gold);
}

.side-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.side-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.side-hint {
  font-size: 0.72rem;
  color: var(--ivory-dim);
}

.side-ext {
  font-size: 0.8rem;
  color: var(--ivory-dim);
}

.sidebar-foot {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem;
  border-radius: 12px;
  background: rgba(28, 28, 28, 0.8);
  border: 1px solid var(--border-soft);
}

.user-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--black);
  background: linear-gradient(145deg, #e0c45a, var(--gold-muted));
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-email {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-vip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.user-vip.is-muted {
  color: var(--ivory-dim);
  font-weight: 500;
}

.sidebar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  padding: 0 0.35rem;
  font-size: 0.8rem;
  color: var(--ivory-dim);
}

.sidebar-links a:hover,
.linkish:hover {
  color: var(--gold);
}

.linkish {
  padding: 0;
  color: var(--ivory-dim);
}

.muted-inline {
  color: var(--ivory-dim);
}

/* Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0.75rem 1.15rem;
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-left {
  min-width: 0;
}

.topbar-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.topbar-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Main */

.main {
  flex: 1;
  width: min(100% - 2rem, 1080px);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.page {
  display: grid;
  gap: 1rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  min-height: 2.15rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.84rem;
}

.btn-xs {
  min-height: 1.8rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}

.btn-lg {
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
}

.btn-gold {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 8px 22px rgba(201, 162, 39, 0.18);
}

.btn-gold:hover {
  background: #d4ad35;
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--ivory);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--gold-muted);
  color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
}

.btn-ghost {
  color: var(--ivory-soft);
}

.btn-ghost:hover {
  color: var(--gold);
  background: rgba(245, 240, 230, 0.04);
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-copied {
  border-color: rgba(157, 202, 140, 0.45);
  color: var(--ok);
}

/* Panels */

.panel {
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}

.panel-vip {
  border-color: rgba(201, 162, 39, 0.28);
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(201, 162, 39, 0.12), transparent 50%),
    var(--surface);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.text-link {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--gold);
  white-space: nowrap;
}

.text-link:hover {
  color: #d4ad35;
}

/* Hero desk */

.hero-desk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(201, 162, 39, 0.1), transparent 42%),
    var(--charcoal);
}

.hero-copy {
  display: flex;
  align-items: center;
  min-height: 2.4rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0;
  font-family: var(--font-body, inherit);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: none;
  color: var(--ivory);
}

.hero-sub {
  margin: 0;
  max-width: 36rem;
  color: var(--ivory-soft);
  font-size: 0.98rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

/* Desk grid */

.desk-grid {
  display: grid;
  gap: 1rem;
}

.rail {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.meta-line {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.9rem;
}

.meta-line.subtle,
.subtle {
  color: var(--ivory-dim);
}

.dot {
  margin: 0 0.2rem;
  color: var(--ivory-dim);
}

.focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Equal character list (dashboard) */

.equal-char-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.equal-char {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.55rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.equal-char:hover {
  background: rgba(245, 240, 230, 0.04);
  border-color: var(--border-soft);
}

.equal-char-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.equal-char-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.equal-char-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.equal-char-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--ivory-dim);
}

.chev {
  color: var(--gold-muted);
}

/* Avatars */

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--black);
  background: linear-gradient(145deg, #e0c45a, var(--gold-muted));
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
  border-radius: 9px;
}

.avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1.15rem;
}

.avatar-xl {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.35rem;
  border-radius: 14px;
}

/* Server */

.server-players {
  margin: 0 0 0.85rem;
  font-weight: 500;
}

.ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-soft);
}

.field-label {
  margin: 0 0 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.ip-value {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}

/* VIP */

.vip-expiry {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.perk-compact,
.perk-list {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.perk-compact li,
.perk-list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9rem;
  color: var(--ivory-soft);
}

.perk-compact li::before,
.perk-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.perk-box {
  margin: 0.25rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-soft);
}

.vip-strong {
  color: var(--gold);
  font-weight: 600;
}

/* Timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.timeline li:first-child {
  padding-top: 0;
}

.timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-mark {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--gold-muted);
  padding-top: 0.15rem;
}

.timeline-title {
  margin: 0 0 0.15rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.timeline-time {
  font-size: 0.78rem;
  color: var(--ivory-dim);
  white-space: nowrap;
  padding-top: 0.2rem;
}

/* Characters page */

.page-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.intro-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--ivory-soft);
  font-size: 0.98rem;
}

.char-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.char-row {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.char-row-main {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.char-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.char-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.char-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
}

.char-stats dt {
  margin: 0 0 0.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.char-stats dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.char-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.callout {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(201, 162, 39, 0.05);
}

.callout p {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.92rem;
}

.callout a {
  color: var(--gold);
  font-weight: 500;
}

/* Settings */

.settings-layout {
  display: grid;
  gap: 1rem;
}

.settings-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.settings-toc a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ivory-soft);
  background: rgba(28, 28, 28, 0.6);
}

.settings-toc a:hover {
  border-color: var(--border);
  color: var(--gold);
}

.settings-panels {
  display: grid;
  gap: 1rem;
}

.detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.detail-list-2 {
  grid-template-columns: 1fr;
}

.detail-list dt {
  margin: 0 0 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

.detail-list dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.help-text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ivory-dim);
}

.help-text a {
  color: var(--gold);
}

.pref-form {
  display: grid;
  gap: 0.75rem;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: default;
}

.switch-row:first-of-type {
  padding-top: 0;
}

.switch-title {
  display: block;
  margin: 0 0 0.15rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.switch-row input {
  margin-top: 0.2rem;
  accent-color: var(--gold);
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.action-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.action-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.action-rows li:first-child {
  padding-top: 0;
}

.action-rows li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Status & badges */

.status-ok {
  color: var(--ok);
  font-weight: 500;
}

.status-bad {
  color: var(--bad);
  font-weight: 500;
}

.status-muted {
  color: var(--ivory-dim);
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-vip {
  color: #1a1408;
  background: linear-gradient(135deg, #e4c65a, var(--gold));
  border: 1px solid rgba(255, 220, 120, 0.4);
}

.badge-muted {
  color: var(--ivory-dim);
  background: rgba(245, 240, 230, 0.06);
  border: 1px solid var(--border-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pill-live {
  color: var(--ok);
  background: rgba(100, 160, 90, 0.15);
  border: 1px solid rgba(120, 180, 100, 0.3);
}

.pill-soon {
  color: var(--gold-muted);
  border: 1px solid var(--border);
  background: rgba(201, 162, 39, 0.06);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(157, 202, 140, 0.5);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(157, 202, 140, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(157, 202, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(157, 202, 140, 0); }
}

/* Alerts */

.alert {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(180, 60, 60, 0.15);
  border: 1px solid rgba(220, 100, 100, 0.35);
  color: #f0c0c0;
}

.alert-ok {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: #e8d9a0;
}

/* Gate (logged-out) — full-width shell, centered hero */

body.is-gate .main {
  width: min(100% - 2rem, 40rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(1.5rem, 8vh, 4rem) 2rem;
}

body.is-gate .footer {
  justify-content: center;
  text-align: center;
}

.gate {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.gate-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.gate-lead {
  margin: 0 auto 1.5rem;
  max-width: 26rem;
  color: var(--ivory-soft);
  line-height: 1.55;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.gate-help {
  max-width: 24rem;
  margin-inline: auto;
}

/* Footer */

.footer {
  margin-top: auto;
  padding: 1.25rem 1.15rem 1.5rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  color: var(--ivory-dim);
  font-size: 0.82rem;
}

.footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.footer-links a:hover {
  color: var(--gold);
}

/* Bottom nav — mobile */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 12, 12, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-soft);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.15rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ivory-dim);
  transition: color 0.15s ease, background 0.15s ease;
}

.bottom-nav a svg {
  color: currentColor;
}

.bottom-nav a.is-active {
  color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.bottom-nav a:hover {
  color: var(--ivory-soft);
}

.hide-mobile {
  display: none;
}

/* Responsive */

@media (min-width: 720px) {
  .hero-desk {
    flex-wrap: nowrap;
  }

  .char-row {
    grid-template-columns: 1.3fr 1fr auto;
    align-items: center;
  }

  .detail-list-2 {
    grid-template-columns: 1fr 1fr;
  }

  .hide-mobile {
    display: inline-flex;
  }
}

@media (min-width: 960px) {
  body.is-app {
    padding-bottom: 0;
  }

  /* Two-column shell only when the app sidebar exists (not gate). */
  body.is-app .app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  body.is-app .sidebar {
    display: flex;
  }

  body.is-app .bottom-nav {
    display: none;
  }

  .topbar {
    padding-inline: 1.5rem;
  }

  body.is-app .main {
    width: min(100% - 3rem, 1080px);
    padding-top: 1.5rem;
  }

  body.is-gate .main {
    width: min(100% - 3rem, 40rem);
  }

  .desk-grid {
    grid-template-columns: 1.35fr 0.9fr;
    align-items: start;
  }

  .settings-layout {
    grid-template-columns: 10rem 1fr;
    align-items: start;
  }

  .settings-toc {
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    flex-direction: column;
    align-items: stretch;
  }

  .settings-toc a {
    border-radius: 10px;
  }
}

@media (max-width: 519px) {
  .char-stats {
    grid-template-columns: 1fr 1fr;
  }

  .char-stats > :last-child {
    grid-column: 1 / -1;
  }

  .gate-actions {
    flex-direction: column;
  }

  .gate-actions .btn {
    width: 100%;
  }

  .timeline li {
    grid-template-columns: 1.75rem 1fr;
  }

  .timeline-time {
    grid-column: 2;
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pulse {
    animation: none;
  }

  .btn,
  .side-link,
  .equal-char {
    transition: none;
  }
}

/* Admin panel (/adp) */

.adp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.adp-bar-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.badge-gold {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1c1c1c;
  background: var(--gold);
}

.adp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.adp-tabs a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--ivory-soft);
}

.adp-tabs a.is-active,
.adp-tabs a:hover {
  color: var(--ivory);
  border-color: var(--border);
  background: var(--gold-soft);
}

.adp-help {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--ivory-soft);
}

.adp-help code {
  font-size: 0.84em;
}

.table-wrap {
  overflow-x: auto;
}

.adp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.adp-table th,
.adp-table td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.adp-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  font-weight: 600;
}

.adp-table tr.is-muted {
  opacity: 0.55;
}

.adp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.inline-form {
  display: inline;
}

.adp-form {
  max-width: 40rem;
  margin-bottom: 1rem;
}

.field-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  color: var(--ivory-soft);
  font-size: 0.92rem;
}

.adp-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.adp-inline-form input,
.adp-inline-form select {
  min-width: 8rem;
}

.muted {
  color: var(--ivory-soft);
}
