/* 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);
  background-repeat: no-repeat;
  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;
  margin-bottom: 44px;
}

.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;
}
.ff-stat-sub { color: var(--ff-text-muted); font-size: 0.82rem; margin-top: 0.1rem; }
.ff-stat-num .ff-money { font-size: 1.5rem; }

/* Stats page: responsive two-column chart grid (single column under 900px). */
.ff-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ff-space-2);
  margin-top: var(--ff-space-4);
}
.ff-charts .ff-panel { margin: 0; }
.ff-chart-wide { grid-column: 1 / -1; }

/* Stats page sections (General / Classes & Specs / Economy): big bold
   headings plus a faint per-section corner glow on every panel, the same
   treatment the professions page gives its profession panels. */
.ff-stat-section .ff-section-title {
  margin: 48px 0 20px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ff-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}
.ff-stat-section .ff-panel {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-section-color, var(--ff-accent)) 12%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}

/* --- 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);
}

/* Profession panels: a faint corner glow tinted with the profession's
   color (set per section in professions.html). */
.ff-prof {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-prof-color, var(--ff-accent)) 18%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}

.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; }
/* The body text is an authentic Blizzard blue post: the exact blue Blizzard
   uses for its forum/news posts (#007DD7, same family Wowhead renders). */
.ff-blue-body { color: #007dd7; }

/* --- 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); }

/* Online-on-Discord green dot (players table + character owner chip). */
.ff-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #3ba55d;
  vertical-align: middle;
}
/* Offline variant: same dot, muted grey. */
.ff-online-off { background: #6b7280; }

/* Standard player-name cell: avatar -> presence dot -> name, used anywhere a
   player/member name renders so the order is identical everywhere. */
.ff-presence {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.ff-presence .ff-avatar { margin-right: 5px; }
.ff-presence .ff-online { margin-right: 5px; }

/* Raid Leader badge (profile, character owner chip, members roster). */
.ff-raid-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ff-gold, #c8a951);
  border: 1px solid rgba(200, 169, 81, 0.45);
  background: rgba(200, 169, 81, 0.12);
}

/* Main/alt + raid-role chips (character banner, players list, profile). */
.ff-chip-main {
  color: var(--ff-gold, #c8a951);
  border-color: rgba(200, 169, 81, 0.45);
  background: rgba(200, 169, 81, 0.12);
}
.ff-chip-alt { color: var(--ff-text-muted); }
.ff-chip-raidrole { color: var(--ff-blue); border-color: var(--ff-blue-border); background: var(--ff-blue-soft); }

/* Guild Settings role chips + management table controls. */
.ff-chip-guild_leader { color: var(--ff-gold); border-color: var(--ff-gold-border, var(--ff-gold)); background: color-mix(in srgb, var(--ff-gold) 12%, transparent); }
.ff-chip-officer { color: var(--ff-blue); border-color: var(--ff-blue-border); background: var(--ff-blue-soft); }
.ff-chip-member { color: var(--ff-text-muted); }
.ff-gs-actions { white-space: nowrap; }
.ff-gs-actions .ff-inline-form { display: inline-block; margin: 0 2px 2px 0; }
.ff-gs-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ff-gs-role {
  background: var(--ff-surface, #15140f);
  color: var(--ff-text, #e8e6e3);
  border: 1px solid color-mix(in srgb, var(--ff-gold, #c8a951) 25%, transparent);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.85rem;
}
.ff-gs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ff-text-muted, #9a948a);
  cursor: pointer;
  white-space: nowrap;
}
#gs-search {
  background: var(--ff-surface, #15140f);
  color: var(--ff-text, #e8e6e3);
  border: 1px solid color-mix(in srgb, var(--ff-gold, #c8a951) 25%, transparent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.ff-btn-small { padding: 2px 8px; font-size: 0.8em; }

/* Character page: player-authored description + edit controls. */
.ff-char-description {
  margin: 0 0 var(--ff-space-2);
  max-width: 560px;
  white-space: pre-line;
  font-size: 0.92em;
  color: var(--ff-text-muted);
  text-align: left;
}
.ff-char-edit {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem; /* the true corner; the class icon is mid-height right */
  z-index: 5;
  text-align: right;
}
/* Small, quiet trigger: an affordance, not a CTA. */
.ff-char-edit .ff-btn {
  padding: 2px 9px;
  font-size: 0.78rem;
  border-color: transparent;
  background: transparent;
  color: var(--ff-text-muted);
}
.ff-char-edit .ff-btn:hover {
  color: var(--ff-gold, #c8a951);
  border-color: rgba(200, 169, 81, 0.35);
  background: rgba(200, 169, 81, 0.08);
}
/* Open panel floats over the banner content instead of pushing it around.
   The popup anchors to the summary so "Edit profile" stays put in the
   corner; everything (profile + background + remove) lives in ONE popup. */
.ff-char-edit .ff-profile-edit[open] {
  position: relative;
  z-index: 6;
}
.ff-char-edit .ff-profile-edit[open] summary {
  display: block;
  text-align: right;
}
.ff-char-edit .ff-profile-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--ff-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 6;
  text-align: left;
}
.ff-char-edit .ff-profile-popup .ff-profile-form {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  width: auto;
  margin: 0;
}
.ff-popup-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.ff-profile-edit { display: inline-block; text-align: left; }
.ff-profile-edit summary { list-style: none; cursor: pointer; }
.ff-profile-edit[open] summary { margin-bottom: 6px; }
.ff-profile-form {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 290px;
  font-size: 0.85rem;
  background: var(--ff-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
}
/* Multi-select raid-role checkboxes. */
.ff-role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 2px 0;
}
.ff-role-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--ff-text);
  cursor: pointer;
  white-space: nowrap;
}

/* Achievements: square badges with a hover tooltip (name + description). */
.ff-ach-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ff-space-3);
}
.ff-ach-badge {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(200, 169, 81, 0.45);
  background:
    radial-gradient(46px 46px at 50% 42%, color-mix(in srgb, var(--ff-gold, #c8a951) 16%, transparent) 0%, transparent 70%),
    color-mix(in srgb, var(--ff-gold, #c8a951) 7%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  cursor: help;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.ff-ach-badge:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(200, 169, 81, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.45),
    0 0 18px color-mix(in srgb, var(--ff-gold, #c8a951) 28%, transparent);
}
.ff-ach-badge img { border-radius: 10px; width: 64px; height: 64px; }
/* Rarity frames (wowhead colors; GOD animates through the rainbow). */
.ff-r-common { border-color: rgba(255, 255, 255, 0.55); }
.ff-r-uncommon { border-color: rgba(30, 255, 0, 0.65); }
.ff-r-rare { border-color: rgba(0, 112, 221, 0.75); }
.ff-r-epic { border-color: rgba(163, 53, 238, 0.8); }
.ff-r-legendary { border-color: rgba(255, 128, 0, 0.85); }
.ff-r-god { border-color: transparent; }
.ff-rarity-common { color: #ffffff; }
.ff-rarity-uncommon { color: #1eff00; }
.ff-rarity-rare { color: #4fc3ff; }
.ff-rarity-epic { color: #c564ff; }
.ff-rarity-legendary { color: #ff8000; }
.ff-rarity-god {
  background: linear-gradient(90deg, #ff4d4d, #ffb84d, #ffff4d, #4dff88, #4dd2ff, #b84dff, #ff4d94);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ff-god-hue 3s linear infinite;
}
@keyframes ff-god-hue {
  to { filter: hue-rotate(360deg); }
}
.ff-r-epic, .ff-r-legendary, .ff-r-god { box-shadow: 0 0 12px color-mix(in srgb, currentColor 30%, transparent); }
.ff-r-legendary {
  animation: ff-legendary-pulse 2.4s ease-in-out infinite;
}
@keyframes ff-legendary-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 128, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 22px rgba(255, 128, 0, 0.75), 0 4px 14px rgba(0, 0, 0, 0.35); }
}
/* GOD tier: rainbow ring (mask-punched so the center stays clean) that
   hue-cycles instead of rotating (a rotated square pokes corners out). */
.ff-r-god::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  padding: 3px;
  background: conic-gradient(#ff4d4d, #ffb84d, #ffff4d, #4dff88, #4dd2ff, #b84dff, #ff4d94, #ff4d4d);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: ff-god-hue 4s linear infinite;
  z-index: -1;
}
.ff-ach-spark {
  display: none;
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  opacity: 0;
}
.ff-r-legendary .ff-ach-spark,
.ff-r-god .ff-ach-spark { display: block; }
.ff-r-god .ff-ach-spark { width: 10px; height: 10px; }
.ff-ach-spark-1 {
  top: -4px; left: -4px;
  animation: ff-sparkle 2.2s ease-in-out infinite;
}
.ff-ach-spark-2 {
  top: 20px; right: -6px;
  animation: ff-sparkle 2.2s ease-in-out 0.7s infinite;
}
.ff-ach-spark-3 {
  bottom: -4px; left: 26px;
  animation: ff-sparkle 2.2s ease-in-out 1.4s infinite;
}
@keyframes ff-sparkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .ff-r-legendary, .ff-r-god::before, .ff-ach-spark, .ff-rarity-god { animation: none; }
  .ff-r-god::before { background: none; border: 2px solid #ff69b4; }
}
/* Wowhead-style tooltip: dark box, quality-colored name, gray description. */
.ff-ach-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(10, 12, 16, 0.96);
  border: 1px solid rgba(200, 169, 81, 0.5);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.ff-ach-badge:hover .ff-ach-tip { opacity: 1; }
.ff-ach-tip-name { font-weight: 600; font-size: 0.82rem; }
.ff-ach-tip-desc { color: #c9cdd4; }
.ff-ach-tip-earned { color: #8a8f98; font-style: italic; }
/* Screen-edge flips (set by view.js on hover). */
.ff-ach-badge.ff-tip-left .ff-ach-tip { left: 0; transform: translateX(0); }
.ff-ach-badge.ff-tip-right .ff-ach-tip { left: auto; right: 0; transform: translateX(0); }
.ff-ach-icon-blank {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: block;
  background:
    radial-gradient(30px 30px at 50% 40%, color-mix(in srgb, var(--ff-gold, #c8a951) 30%, transparent) 0%, transparent 70%),
    color-mix(in srgb, var(--ff-gold, #c8a951) 10%, transparent);
}

/* Paperdoll background: the sharp image fills the panel (cover), with a
   vignette on the edges plus a light scrim so gear and names stay readable.
   The center class icon is hidden by the template when a background is set. */
.ff-sheet-bg {
  position: relative;
  overflow: hidden;
  background-image: var(--ff-paperdoll-img);
  background-size: cover;
  background-position: center;
}
.ff-sheet-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Isolated to the frame: fully transparent through the middle ~60%. */
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 62%,
    rgba(0, 0, 0, 0.55) 96%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 0;
}
.ff-sheet-bg > * { position: relative; z-index: 1; }
.ff-profile-form textarea, .ff-profile-form select, .ff-profile-form input {
  font: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ff-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
}

/* Raid reminder banner. */
.ff-banner-raid {
  color: var(--ff-blue);
  background: var(--ff-blue-soft);
  border-bottom: 1px solid var(--ff-blue-border);
}
.ff-banner a { color: inherit; }

/* Character page raid panel. */
.ff-raid-role-line { margin: 0 0 var(--ff-space-2); }
.ff-raid-panel .ff-profile-form { width: 280px; }

/* Players page filter bar + tags column. */
.ff-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--ff-space-3);
}
.ff-filter-label { color: var(--ff-text-muted); font-size: 0.85rem; margin-right: 2px; }
.ff-filter-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ff-text);
  text-decoration: none;
  font-size: 0.85rem;
}
.ff-filter-pill:hover { border-color: rgba(200, 169, 81, 0.5); }
.ff-filter-active {
  border-color: rgba(200, 169, 81, 0.55);
  color: var(--ff-gold, #c8a951);
  background: rgba(200, 169, 81, 0.12);
}
.ff-filter-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.ff-filter-select label { color: var(--ff-text-muted); font-size: 0.85rem; }
.ff-filter-select select {
  font: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ff-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3px 6px;
}
.ff-tagcell { white-space: nowrap; }
.ff-tagcell .ff-chip { font-size: 0.75em; padding: 1px 7px; }

@media (max-width: 720px) {
  .ff-char-edit { position: static; text-align: left; margin-bottom: var(--ff-space-2); }
  .ff-profile-form { min-width: 0; width: 100%; }
}

/* Raids page. */
.ff-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--ff-space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
.ff-subnav-link {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  color: var(--ff-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.ff-subnav-link:hover { color: var(--ff-text); }
.ff-subnav-active {
  color: var(--ff-gold, #c8a951);
  background: rgba(200, 169, 81, 0.12);
  border: 1px solid rgba(200, 169, 81, 0.4);
}

.ff-raid-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
}
.ff-raid-form input, .ff-raid-form textarea {
  font: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ff-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
}
.ff-h3 { margin: 16px 0 6px; }
.ff-statgrid { display: flex; gap: 16px; flex-wrap: wrap; }
.ff-statgrid .ff-stat { flex: 0 0 auto; }
.ff-roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ff-space-3);
}
@media (max-width: 720px) { .ff-roster-grid { grid-template-columns: 1fr; } }
.ff-roster-table { margin-bottom: var(--ff-space-3); }

/* DKP colors. */
.ff-dkp-pos { color: #4fba5a; }
.ff-dkp-neg { color: #d98080; }
.ff-ilvl-tag {
  font-size: 0.78em;
  color: var(--ff-text-muted);
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Nav user chip + avatar. */
.ff-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ff-text);
  text-decoration: none;
}
.ff-nav-user:hover { color: var(--ff-gold, #c8a951); }
.ff-avatar {
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

/* Waiting-for-approval banner. */
.ff-banner {
  padding: 12px 24px;
  text-align: center;
  font-size: 0.95em;
}
.ff-banner-pending {
  color: var(--ff-gold, #c8a951);
  background: rgba(200, 169, 81, 0.08);
  border-bottom: 1px solid rgba(200, 169, 81, 0.25);
}

/* Profile / members page bits. */
.ff-callout {
  border: 1px solid var(--ff-border, rgba(255,255,255,0.08));
  border-radius: var(--ff-radius, 10px);
  padding: 16px 20px;
  margin: 16px 0;
}
.ff-callout-pending { border-color: rgba(200, 169, 81, 0.35); }
.ff-token {
  font-size: 1.05em;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(200, 169, 81, 0.4);
  user-select: all;
  overflow-wrap: anywhere;
}
.ff-charlist { list-style: none; padding: 0; margin: 0; }
.ff-charlist li { padding: 4px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ff-char-delete .ff-profile-form { width: 280px; }
.ff-inline-form { display: inline-block; margin: 0; }
.ff-btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(200, 169, 81, 0.45);
  background: rgba(200, 169, 81, 0.12);
  color: var(--ff-gold, #c8a951);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.ff-btn:hover { background: rgba(200, 169, 81, 0.2); }
.ff-btn-danger { border-color: rgba(220, 80, 80, 0.5); color: #d98080; background: rgba(220, 80, 80, 0.1); }
.ff-btn-danger:hover { background: rgba(220, 80, 80, 0.18); }
.ff-table { width: 100%; border-collapse: collapse; }
.ff-table th, .ff-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06); }
.ff-chip-alliance {
  color: #6ec6ff;
  border-color: rgba(110, 198, 255, 0.45);
  background: rgba(64, 120, 220, 0.18);
}
.ff-chip-horde {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(200, 60, 60, 0.18);
}
.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; }

/* Sortable tables: clickable headers with an active-column caret. */
table[data-sortable] thead th {
  cursor: pointer;
  user-select: none;
}
table[data-sortable] thead th:hover { color: var(--ff-text); }
table[data-sortable] thead th:focus-visible { outline: 2px solid var(--ff-accent); outline-offset: -2px; }
table[data-sortable] thead th.ff-sort-asc,
table[data-sortable] thead th.ff-sort-desc { color: var(--ff-accent-bright); }
table[data-sortable] thead th.ff-sort-asc::after { content: " \25B2"; color: var(--ff-accent); }
table[data-sortable] thead th.ff-sort-desc::after { content: " \25BC"; color: var(--ff-accent); }

/* 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 {
  position: relative;
  background:
    radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--ff-class-color, #f0d98c) 14%, transparent) 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); }

/* Owner line, directly under the character name. */
.ff-char-owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: calc(-1 * var(--ff-space-1)) 0 var(--ff-space-2);
  color: var(--ff-text);
  text-decoration: none;
  font-size: 0.95rem;
}
.ff-char-owner:hover span:first-of-type { color: var(--ff-gold, #c8a951); }
.ff-char-owner .ff-avatar { border-radius: 50%; }

.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;
}

/* --- Character sheet: gear pane + stats panel ----------------------------------------- */

.ff-sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ff-space-3);
  align-items: start;
}

/* Empty slots get a dark plate so their labels read over any background. */
.ff-slot-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(10, 11, 14, 0.72);
}
.ff-slot-empty .ff-slot-fallback-empty { color: rgba(255, 255, 255, 0.55); }

/* In-game paperdoll: item columns pinned to the panel edges, a large
   open center for the character image, weapons centered below. */
.ff-sheet-gear {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.55rem;
}
.ff-gear-col { display: grid; gap: 0.45rem; }
.ff-gear-col:first-child { justify-self: start; }
.ff-gear-col:last-child { justify-self: end; }
.ff-gear-model {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
  width: 100%;
  min-height: 14rem;
  padding: 0.5rem;
  border-radius: var(--ff-radius-sm);
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--ff-class-color, #f0d98c) 10%, transparent), transparent 75%);
}
.ff-gear-model-icon {
  width: 7rem;
  height: 7rem;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 28px color-mix(in srgb, var(--ff-class-color, #f0d98c) 22%, transparent);
}
.ff-gear-model-level {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ff-accent-bright);
}
.ff-sheet-weapons {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}
.ff-slot-fallback-empty { color: rgba(255, 255, 255, 0.28); }

/* Class + profession icons */
.ff-classicon-hero {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 14px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--ff-class-color, #f0d98c) 18%, transparent);
}
.ff-proficon {
  width: 1.4rem;
  height: 1.4rem;
  vertical-align: -0.3rem;
  margin-right: 0.45rem;
  border-radius: 4px;
}

/* Money coins (g/s/c) next to values */
.ff-coin {
  width: 0.8em;
  height: 0.8em;
  vertical-align: -0.08em;
  margin-right: 0.15em;
  border-radius: 2px;
}

/* Stats tile: richest character is a link */
.ff-stat-link { color: var(--ff-accent-bright); text-decoration: none; }
.ff-stat-link:hover { text-decoration: underline; }

/* Talent calculator embed */
.ff-talent-frame {
  /* 600px = the embed's content height at desktop width (measured off
     Eric's screenshot: tree art + heading row); the bg matches Wowhead's
     embed page (body.ctc-embed #181818) so drift blends invisibly. */
  height: 517px;
  border: 1px solid var(--ff-border);
  border-radius: 6px;
  overflow: hidden;
  background: #181818;
}
.ff-talent-frame iframe { display: block; }
/* Points-per-tree chips: our own data, always visible; on mobile they
   replace the iframe entirely (the fixed 3-column calc cannot fit). */
.ff-talent-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.ff-talent-chip {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  background: var(--ff-surface-2);
  color: var(--ff-text-muted);
}
.ff-talent-chip b { color: var(--ff-accent-bright); margin-left: 0.25rem; }
.ff-talent-open { color: var(--ff-accent); text-decoration: none; font-size: 0.85rem; }
.ff-talent-open:hover { text-decoration: underline; }
/* Main/off spec tabs, styled like the range pills. */
.ff-talent-tabs { display: flex; gap: 0.25rem; }
.ff-tab {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ff-text-muted);
  cursor: pointer;
}
.ff-tab-active {
  background: var(--ff-accent-soft, rgba(240, 217, 140, 0.12));
  border-color: var(--ff-accent);
  color: var(--ff-accent-bright);
}
button.ff-tab:hover { color: var(--ff-accent-bright); }

@media (max-width: 768px) {
  .ff-talent-frame { display: none; }
}

.ff-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0.3rem;
  background: var(--ff-surface-2);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
}
/* Icon-only paperdoll: the slot label is the title/aria-label, never
   rendered. Unresolvable items show the label text in the square. */
.ff-slot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.ff-slot-icon:hover { border-radius: 3px; box-shadow: 0 0 0 1px var(--ff-accent); }
.ff-slot-icon img { width: 100%; height: 100%; border-radius: 3px; object-fit: cover; }
.ff-slot-fallback {
  font-size: 0.6rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ff-text-muted);
  text-align: center;
  line-height: 1.2;
}
.ff-slot-empty { border-style: dashed; border-color: rgba(255, 255, 255, 0.14); background: rgba(10, 11, 14, 0.72); }

.ff-sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ff-space-2);
  align-content: start;
}
.ff-sheet-block {
  background: var(--ff-surface-2);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  padding: var(--ff-space-2);
}
.ff-sheet-head {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ff-accent);
}
.ff-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem 1rem;
}
.ff-sheet-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--ff-border);
}
.ff-sheet-stat-label { color: var(--ff-text-muted); font-size: 0.82rem; }
.ff-sheet-stat-value { font-weight: 600; }

/* --- 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: 900px) {
  .ff-charts { grid-template-columns: 1fr; }
  /* The paperdoll needs the full width before the stats collapse. */
  .ff-sheet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@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-char-banner h1 { font-size: 1.8rem; }
  .ff-panel-head { flex-direction: column; align-items: flex-start; }
  .ff-sheet-stats { grid-template-columns: 1fr; }
  /* One stat pair per row so long values never collide with the neighbor. */
  .ff-sheet-grid { grid-template-columns: 1fr; }
  .ff-sheet-stat { flex-wrap: wrap; min-width: 0; }
  .ff-classicon-hero { width: 3.5rem; height: 3.5rem; right: 0.75rem; }
  .ff-gear-model-icon { width: 4.5rem; height: 4.5rem; }
  .ff-gear-model { min-height: 9rem; }
  .ff-nav-link { padding: 0.35rem 0.4rem; }
  .ff-online-float { right: 12px; bottom: 12px; padding: 0.28rem 0.65rem; font-size: 0.76rem; }
}

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

/* Glow pass: faint gold corner glow on every panel of the raid pages and
   the characters list - the professions-page treatment, page-wide. */
.ff-glowpage .ff-panel {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-gold, #c8a951) 10%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}

/* Catalog entries: the top-left corner glow marks the kind - gold for raids,
   blue for dungeons, green for events. */
.ff-glowpage .ff-panel.ff-catalog-raid {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-gold, #c8a951) 14%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}
.ff-glowpage .ff-panel.ff-catalog-dungeon {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-blue, #6ec6ff) 16%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}
.ff-glowpage .ff-panel.ff-catalog-event {
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--ff-green, #6ecf7a) 16%, transparent) 0%, transparent 65%),
    var(--ff-surface);
}

/* Catalog entries: header + collapsible boss list. Each boss is one flex row
   (name, item chips, compact actions) so long boss lists stay scannable. */
.ff-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ff-space-2);
  flex-wrap: wrap;
}
.ff-catalog-head h2 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ff-catalog-meta { font-size: 0.8rem; font-weight: 400; color: var(--ff-text-muted); }

.ff-bosses { margin-top: 10px; }
.ff-bosses-summary {
  list-style: none;
  cursor: pointer;
  color: var(--ff-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ff-bosses-summary::-webkit-details-marker { display: none; }
.ff-bosses-summary::before { content: "\25B8 "; }
.ff-bosses[open] > .ff-bosses-summary::before { content: "\25BE "; }

.ff-boss-list { list-style: none; margin: 0; padding: 0; }
.ff-boss {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ff-boss:last-child { border-bottom: 0; }
.ff-boss-name { min-width: 10rem; font-weight: 600; }
.ff-boss-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 12rem;
}
.ff-boss-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.ff-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px 1px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
}
.ff-item-chip a { color: var(--ff-accent-bright, #f0d98c); text-decoration: none; }
.ff-item-chip a:hover { text-decoration: underline; }

.ff-additem { display: inline-block; }
.ff-additem > summary { list-style: none; cursor: pointer; }
.ff-additem > summary::-webkit-details-marker { display: none; }
/* Open item form drops onto its own full-width line under the boss row. */
.ff-additem[open] { flex-basis: 100%; }
.ff-additem .ff-profile-form { width: min(360px, 100%); }

.ff-x-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--ff-text-muted);
  border-radius: 6px;
  line-height: 1;
  font-size: 0.95rem;
  padding: 2px 7px;
  cursor: pointer;
}
.ff-x-btn:hover {
  color: #d98080;
  border-color: rgba(220, 80, 80, 0.5);
  background: rgba(220, 80, 80, 0.1);
}

.ff-addboss { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .ff-boss-name { min-width: 0; flex-basis: 100%; }
  .ff-boss-actions { margin-left: 0; }
}

/* Notification bell. */
.ff-nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ff-text);
  padding: 4px;
}
.ff-nav-bell:hover { color: var(--ff-gold, #c8a951); }
.ff-bell-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.ff-notif-unread { background: rgba(200, 169, 81, 0.06); }

/* Toasts (new notifications). */
#ff-toasts {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.ff-toast {
  background: var(--ff-surface);
  border: 1px solid rgba(200, 169, 81, 0.45);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 0.9rem;
}
.ff-toast strong { color: var(--ff-gold, #c8a951); display: block; }

/* Discord online pulse: floats fixed at the bottom-right of the viewport,
   out of the nav so it never crowds the links. */
.ff-online-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ff-text-muted);
  font-size: 0.82rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ff-online-float .ff-online {
  margin-right: 0;
  box-shadow: 0 0 0 3px rgba(59, 165, 93, 0.18);
}

/* Activity heatmap: GitHub-style day cells, one column per week. Sits in a
   half-width stats panel, so cells are compact and quiet days stay visible. */
.ff-heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  overflow-x: auto;
  padding: 4px 0;
}
.ff-heat-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ff-gold, #c8a951) 16%, transparent);
  display: inline-block;
  vertical-align: middle;
}
.ff-heat-1 { background: color-mix(in srgb, var(--ff-gold, #c8a951) 32%, transparent); }
.ff-heat-2 { background: color-mix(in srgb, var(--ff-gold, #c8a951) 52%, transparent); }
.ff-heat-3 { background: color-mix(in srgb, var(--ff-gold, #c8a951) 74%, transparent); }
.ff-heat-4 { background: var(--ff-gold, #c8a951); }
.ff-heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ff-heat-legend .ff-heat-cell { width: 9px; height: 9px; }

/* Character page: quiet compare toggle under the vitals row. Muted text,
   not a button; the picker only appears once opened. */
.ff-char-compare { margin-top: 8px; }
.ff-char-compare > summary {
  cursor: pointer;
  color: var(--ff-text-muted, #9a948a);
  font-size: 0.85rem;
  text-decoration: underline dotted;
  width: fit-content;
}
.ff-char-compare > summary:hover { color: var(--ff-gold, #c8a951); }
.ff-char-compare[open] > summary { margin-bottom: 6px; }

/* Guild feed: one row per milestone. */
.ff-feed { list-style: none; margin: 0; padding: 0; }
.ff-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--ff-gold, #c8a951) 10%, transparent);
}
.ff-feed-item:last-child { border-bottom: 0; }
.ff-feed-glyph {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ff-bg, #0a0b0e);
  background: var(--ff-gold, #c8a951);
}
.ff-feed-avatar {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

/* Events overview: event-manager cards. */
.ff-em-list { display: flex; flex-wrap: wrap; gap: var(--ff-space-2); }
.ff-em-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  color: var(--ff-text);
  text-decoration: none;
}
.ff-em-card:hover { border-color: rgba(200, 169, 81, 0.45); }

/* Achievements admin: card grid on the list page. */
.ff-prof-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--ff-space-2);
}
.ff-prof-tile {
  display: flex;
  align-items: center;
  gap: var(--ff-space-2);
  padding: 10px 12px;
  border: 1px solid var(--ff-border);
  border-left: 3px solid var(--ff-prof-color, var(--ff-gold, #c8a951));
  border-radius: var(--ff-radius);
  color: var(--ff-text);
  text-decoration: none;
  transition: border-color 0.12s ease;
}
.ff-prof-tile:hover { border-color: var(--ff-prof-color, rgba(200, 169, 81, 0.6)); }
.ff-prof-tile-icon .ff-proficon { width: 34px; height: 34px; border-radius: 6px; }
.ff-prof-tile-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ff-prof-tile-body strong { font-size: 0.95rem; }
.ff-prof-tile-leader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

/* Achievements admin: card grid on the list page. */
.ff-ach-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--ff-space-2);
}
.ff-ach-admin-card {
  display: flex;
  align-items: center;
  gap: var(--ff-space-2);
  padding: var(--ff-space-2);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  color: var(--ff-text);
  text-decoration: none;
  transition: border-color 0.12s ease;
}
.ff-ach-admin-card:hover { border-color: rgba(200, 169, 81, 0.5); }
.ff-ach-admin-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ff-ach-admin-meta { display: flex; flex-direction: column; gap: 2px; }
.ff-ach-admin-row {
  display: flex;
  align-items: center;
  gap: var(--ff-space-2);
}
.ff-ach-admin-row .ff-ach-admin-meta { flex: 1; }

/* Achievement roster: aligned columns on desktop, stacked cards on mobile. */
.ff-ach-roster {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ff-ach-roster-head,
.ff-ach-roster-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) 90px minmax(120px, 1fr) minmax(220px, 1.1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
}
.ff-ach-roster-head {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ff-text-muted, #9a948a);
}
.ff-ach-roster-row:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.ff-ach-roster-char { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ff-ach-roster-char .ff-muted { font-size: 0.78rem; }
.ff-ach-roster-status { display: flex; }
.ff-ach-roster-note { color: var(--ff-text-muted, #9a948a); font-size: 0.82rem; min-width: 0; overflow-wrap: anywhere; }
.ff-ach-roster-action { display: flex; justify-content: flex-end; }
.ff-ach-grant-form { display: flex; gap: 6px; align-items: center; }
.ff-ach-grant-form input[type="text"] {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ff-text, #e8e6e3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.82rem;
}
@media (max-width: 720px) {
  .ff-ach-roster-head { display: none; }
  .ff-ach-roster-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "char status"
      "char action"
      "note note";
    row-gap: 6px;
  }
  .ff-ach-roster-char { grid-area: char; }
  .ff-ach-roster-status { grid-area: status; justify-content: flex-end; }
  .ff-ach-roster-note { grid-area: note; }
  .ff-ach-roster-action { grid-area: action; }
  .ff-ach-grant-form input[type="text"] { width: 100%; }
}
.ff-feed-profession { background: #6ec6ff; }
.ff-feed-loot { background: #a335ee; }
.ff-feed-member { background: #6ecf7a; }
.ff-feed-body { line-height: 1.35; }
