/* Fifth Forever - public view theme.
 * Modern dark editorial: near-black page, translucent blurred nav, spacious
 * sections, card grids with hover lift, gold accent identity. Pure CSS
 * decoration (gradients, glows, borders); no webfonts, no external assets.
 *
 * Token system at the top; everything below consumes tokens only. */

:root {
  /* Surfaces */
  --ff-bg: #0a0b0e;
  --ff-surface: #12141a;
  --ff-surface-2: #171a21;
  --ff-border: rgba(255, 255, 255, 0.08);
  --ff-border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --ff-text: #e8eaf0;
  --ff-text-muted: #9aa1ad;

  /* Accent: gold identity */
  --ff-accent: #c8a951;
  --ff-accent-bright: #f0d98c;
  --ff-accent-soft: rgba(200, 169, 81, 0.14);
  --ff-accent-border: rgba(200, 169, 81, 0.35);

  /* Blue post / info */
  --ff-blue: #6ec6ff;
  --ff-blue-soft: rgba(64, 120, 220, 0.16);
  --ff-blue-border: rgba(96, 150, 240, 0.45);

  /* Status */
  --ff-ok: #71c971;
  --ff-warn: #ffb84d;
  --ff-bad: #ff7b72;

  /* Shape + rhythm */
  --ff-radius: 16px;
  --ff-radius-sm: 10px;
  --ff-space-1: 0.5rem;
  --ff-space-2: 1rem;
  --ff-space-3: 1.5rem;
  --ff-space-4: 2.5rem;
  --ff-space-5: 4rem;
  --ff-space-6: 6rem;

  /* Shadows */
  --ff-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --ff-shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
  --ff-shadow-3: 0 16px 48px rgba(0, 0, 0, 0.55);
  --ff-lift-glow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(200, 169, 81, 0.08);
}

/* --- Page shell ---------------------------------------------------------- */

html { color-scheme: dark; }

body {
  background:
    radial-gradient(900px 480px at 85% -120px, rgba(200, 169, 81, 0.07) 0%, transparent 60%),
    radial-gradient(1100px 560px at 12% -160px, rgba(64, 96, 200, 0.10) 0%, transparent 62%),
    var(--ff-bg);
  color: var(--ff-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.ff-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--ff-space-4) 24px var(--ff-space-6);
}

a { color: var(--ff-accent-bright); }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--ff-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Form controls (global: inputs, selects, buttons everywhere) ---------- */

input, select, textarea {
  background: var(--ff-surface-2);
  color: var(--ff-text);
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
}

input::placeholder { color: var(--ff-text-muted); }

button {
  background: var(--ff-surface-2);
  color: var(--ff-text);
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

button:hover {
  border-color: var(--ff-accent);
  background: var(--ff-surface);
  color: var(--ff-accent-bright);
}

button.danger {
  color: #ff7b72;
  border-color: rgba(255, 123, 114, 0.35);
}
button.danger:hover {
  border-color: #ff7b72;
  color: #ff7b72;
}

.ff-ok { color: #7ec97e; font-weight: 600; }
.error { color: #ff7b72; font-weight: 600; }

h1, h2, h3 {
  color: var(--ff-text);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
h1 { font-size: 2rem; font-weight: 750; margin: 0 0 var(--ff-space-1); }
h2 { font-size: 1.25rem; font-weight: 650; margin: 0 0 var(--ff-space-2); }
h3 { font-size: 1.05rem; font-weight: 600; }

.ff-muted { color: var(--ff-text-muted); }
.ff-num { font-variant-numeric: tabular-nums; text-align: right; }

.ff-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Sticky nav ----------------------------------------------------------- */

.ff-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ff-border);
}

.ff-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ff-space-2);
}

.ff-brand {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--ff-text);
  text-decoration: none;
  white-space: nowrap;
}
.ff-brand-mark { color: var(--ff-accent); font-weight: 400; margin: 0 0.1em; }
.ff-brand:hover { color: var(--ff-accent-bright); }

.ff-nav-links { display: flex; align-items: center; gap: var(--ff-space-2); }

.ff-nav-link {
  color: var(--ff-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}
.ff-nav-link:hover { color: var(--ff-text); }
.ff-nav-link.ff-active {
  color: var(--ff-text);
  border-bottom-color: var(--ff-accent);
}

.ff-nav-cta {
  color: var(--ff-accent-bright);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--ff-accent-border);
  border-radius: 999px;
  background: var(--ff-accent-soft);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ff-nav-cta:hover {
  background: rgba(200, 169, 81, 0.22);
  border-color: var(--ff-accent);
  color: #fff;
}

/* --- Hero ------------------------------------------------------------------ */

.ff-hero {
  padding: var(--ff-space-5) 0 var(--ff-space-4);
  text-align: center;
}

.ff-hero-eyebrow {
  color: var(--ff-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 var(--ff-space-2);
}

.ff-hero-title {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--ff-space-2);
  background: linear-gradient(180deg, #fff 0%, var(--ff-accent-bright) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--ff-accent-bright);
}

.ff-hero-tag {
  color: var(--ff-text-muted);
  max-width: 42rem;
  margin: 0 auto var(--ff-space-4);
  font-size: 1.05rem;
}

.ff-hero-chart { margin-top: var(--ff-space-4); text-align: left; }

/* --- Stat tiles ------------------------------------------------------------ */

.ff-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ff-space-2);
  justify-content: center;
}

.ff-stat {
  flex: 1 1 9rem;
  max-width: 14rem;
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  padding: var(--ff-space-2) var(--ff-space-3);
  text-align: center;
}

.ff-stat-num {
  font-size: 1.9rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ff-accent-bright);
  line-height: 1.2;
}
.ff-stat-label {
  color: var(--ff-text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* Character detail: denser 12-tile grid. */
.ff-statsgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--ff-space-2);
}
.ff-statsgrid .ff-stat { max-width: none; }
.ff-statsgrid .ff-stat-num { font-size: 1.45rem; }

/* --- Cards / panels --------------------------------------------------------- */

.ff-panel {
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: var(--ff-space-3);
  margin: var(--ff-space-3) 0;
  box-shadow: var(--ff-shadow-1);
}

.ff-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ff-space-2);
  margin-bottom: var(--ff-space-2);
}
.ff-panel-head h2 { margin: 0; }

.ff-panel-foot {
  margin: var(--ff-space-2) 0 0;
  font-size: 0.92rem;
}

.ff-section { margin-top: var(--ff-space-5); }

.ff-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 var(--ff-space-3);
}

.ff-pagehead { margin-bottom: var(--ff-space-4); }

/* Feature card grid (landing). */
.ff-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--ff-space-2);
}

.ff-card {
  position: relative;
  display: block;
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: var(--ff-space-3);
  text-decoration: none;
  color: var(--ff-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.ff-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ff-lift-glow);
  border-color: var(--ff-accent-border);
  color: var(--ff-text);
}
.ff-card-title { color: var(--ff-accent-bright); margin: 0 0 var(--ff-space-1); }
.ff-card-sub { color: var(--ff-text-muted); font-size: 0.92rem; margin: 0; }
.ff-card-arrow {
  position: absolute;
  top: var(--ff-space-3);
  right: var(--ff-space-3);
  color: var(--ff-text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}
.ff-card:hover .ff-card-arrow { color: var(--ff-accent-bright); transform: translateX(3px); }

/* --- Blue post announcement ------------------------------------------------- */

.ff-announcement {
  background: var(--ff-blue-soft);
  border: 1px solid var(--ff-blue-border);
  border-radius: var(--ff-radius);
  padding: var(--ff-space-3);
  margin: var(--ff-space-4) 0 0;
  box-shadow: 0 0 24px rgba(64, 120, 220, 0.12);
}

.ff-blue-head {
  display: flex;
  align-items: center;
  gap: var(--ff-space-2);
  margin-bottom: var(--ff-space-2);
}

.ff-blue-chip {
  background: rgba(96, 150, 240, 0.22);
  border: 1px solid var(--ff-blue-border);
  color: var(--ff-blue);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.ff-blue-meta { color: var(--ff-text-muted); font-size: 0.85rem; }
.ff-blue-body { color: var(--ff-text); }

/* --- Tables ------------------------------------------------------------------ */

.ff-tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  font-size: 0.94rem;
}

th, td {
  border: none;
  border-bottom: 1px solid var(--ff-border);
  padding: 0.65rem 0.9rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--ff-text-muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--ff-surface-2);
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }

tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

.ff-rank { width: 2.5rem; }
.ff-progress-col { width: 30%; min-width: 8rem; }

/* Level badge: gold pill. */
.ff-lvl-badge {
  display: inline-block;
  min-width: 1.9rem;
  text-align: center;
  background: var(--ff-accent-soft);
  border: 1px solid var(--ff-accent-border);
  color: var(--ff-accent-bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
}

/* Small chips: professions, realm, race/class, player. */
.ff-chip {
  display: inline-block;
  background: var(--ff-surface-2);
  border: 1px solid var(--ff-border);
  color: var(--ff-text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ff-chip-realm { color: var(--ff-blue); border-color: var(--ff-blue-border); background: var(--ff-blue-soft); }
.ff-chip-player { color: var(--ff-text); }
.ff-profcell { white-space: normal; }
.ff-profcell .ff-chip { margin: 0.1rem 0.25rem 0.1rem 0; }

.ff-charlink { text-decoration: none; font-weight: 600; }
.ff-charlink:hover { text-decoration: underline; }

.ff-lastseen { white-space: nowrap; }

/* Class-colored names. */
.ff-class { font-weight: 700; }

/* --- Profession bars ---------------------------------------------------------- */

.ff-bar {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  height: 0.6rem;
  width: 100%;
  min-width: 6rem;
  overflow: hidden;
}

.ff-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(200, 169, 81, 0.55), var(--ff-accent));
}

/* --- Charts --------------------------------------------------------------------- */

.ff-chart {
  background: var(--ff-surface-2);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  padding: var(--ff-space-2);
  margin: var(--ff-space-2) 0 0;
  height: 280px;
  position: relative;
}
.ff-chart canvas { width: 100% !important; height: 100% !important; }

/* Range selector: segmented control. */
.ff-ranges {
  display: inline-flex;
  background: var(--ff-surface-2);
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ff-ranges button {
  background: transparent;
  color: var(--ff-text-muted);
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.ff-ranges button:hover { color: var(--ff-text); }
.ff-ranges button.ff-range-active {
  color: var(--ff-accent-bright);
  background: var(--ff-accent-soft);
  box-shadow: inset 0 0 0 1px var(--ff-accent-border);
}

/* --- Character banner -------------------------------------------------------------- */

.ff-char-banner {
  background:
    radial-gradient(600px 200px at 0% 0%, var(--ff-accent-soft) 0%, transparent 65%),
    var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: var(--ff-space-4) var(--ff-space-3);
  margin: var(--ff-space-3) 0;
}

.ff-char-banner h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 var(--ff-space-2);
}

.ff-char-chips { display: flex; flex-wrap: wrap; gap: var(--ff-space-1); margin-bottom: var(--ff-space-2); }

.ff-char-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ff-space-2) var(--ff-space-4);
  font-size: 1rem;
}

.ff-vital { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.ff-vital-label {
  color: var(--ff-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Money --------------------------------------------------------------------------- */

.ff-money { white-space: nowrap; }
.ff-money .ff-gold { color: var(--ff-accent-bright); }
.ff-money .ff-silver { color: #c9ced8; }
.ff-money .ff-copper { color: #c87a4d; }

/* --- Timelines: gear changes + events feed -------------------------------------------- */

.ff-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.ff-timeline::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 1px;
  background: var(--ff-border);
}

.ff-tl-item {
  position: relative;
  padding: 0 0 0 1.6rem;
  margin-bottom: var(--ff-space-2);
}
.ff-tl-item:last-child { margin-bottom: 0; }

.ff-tl-dot {
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 50%;
  background: var(--ff-surface-2);
  border: 2px solid var(--ff-accent);
  box-shadow: 0 0 8px rgba(200, 169, 81, 0.35);
}

.ff-tl-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; }
.ff-tl-time { font-size: 0.82rem; min-width: 4.5rem; }
.ff-tl-main { font-weight: 550; }
.ff-tl-extra { color: var(--ff-text-muted); font-size: 0.88rem; }

.ff-event-kind {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ff-accent);
  background: var(--ff-accent-soft);
  border: 1px solid var(--ff-accent-border);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
}

/* Latest level-ups list (landing). */
.ff-levelups { list-style: none; margin: 0; padding: 0; }
.ff-levelup {
  display: flex;
  align-items: baseline;
  gap: var(--ff-space-2);
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--ff-border);
}
.ff-levelup:last-child { border-bottom: none; }
.ff-levelup-char { text-decoration: none; font-weight: 600; }
.ff-levelup-char:hover { text-decoration: underline; }
.ff-levelup-time { margin-left: auto; color: var(--ff-text-muted); font-size: 0.85rem; }

/* --- Buttons (404 + future use) ---------------------------------------------------------- */

.ff-btn {
  display: inline-block;
  background: var(--ff-accent-soft);
  border: 1px solid var(--ff-accent-border);
  color: var(--ff-accent-bright);
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.ff-btn:hover { background: rgba(200, 169, 81, 0.24); color: #fff; }

/* --- 404 ----------------------------------------------------------------------------------- */

.ff-404 {
  text-align: center;
  padding: var(--ff-space-6) var(--ff-space-2);
}
.ff-404-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  background: linear-gradient(180deg, var(--ff-accent-bright) 0%, rgba(200, 169, 81, 0.15) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--ff-accent-bright);
}
.ff-404 h1 { font-size: 1.6rem; margin: var(--ff-space-3) 0 var(--ff-space-2); }
.ff-404 .ff-404-sub { color: var(--ff-text-muted); max-width: 34rem; margin: 0 auto var(--ff-space-4); }

/* --- Responsive ----------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .ff-container { padding: var(--ff-space-3) 16px var(--ff-space-5); }
  .ff-hero { padding-top: var(--ff-space-4); }
  .ff-stat { flex: 1 1 100%; max-width: none; }
  .ff-statsgrid { grid-template-columns: repeat(2, 1fr); }
  .ff-char-banner h1 { font-size: 1.8rem; }
  .ff-panel-head { flex-direction: column; align-items: flex-start; }
  .ff-nav-link { padding: 0.35rem 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
