/* ==========================================================================
   TopFive — Ember theme (blackout + ember, podium)
   Loaded after professional.css. Sets the palette, type and the homepage
   podium. Markup contracts are unchanged; to roll back, restore the three
   stylesheet lines in includes/header.php.
   ========================================================================== */

:root,
html[data-theme] {
  --bg: #0b0b0d;
  --bg-elevated: #111113;
  --bg-card: #151517;
  --bg-card-hover: #1c1c1f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f6;
  --text-muted: #b8b8c2;
  --text-dim: #8b8b96;

  --ember: #ff6a3d;
  --ember-soft: #ff8a5c;
  --ember-ink: #260c02;          /* text on ember */
  --gold: #ffc94d;
  --silver: #cfd6e6;
  --bronze: #f09a63;

  /* legacy token names used throughout styles.css */
  --pink: var(--ember);
  --pink-soft: var(--ember-soft);
  --magenta: #e5501f;
  --cyan: var(--gold);
  --cyan-dim: #e0a92e;
  --purple: #c9c9d4;
  --orange: var(--gold);
  --accent: var(--ember);
  --success: #3ddc97;

  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Unbounded', 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --ring: 0 0 0 3px rgba(255, 106, 61, 0.45);
}

html, body { background: var(--bg) !important; }
body { font-family: var(--font); }
.ambient { display: none !important; }
::selection { background: var(--ember); color: var(--ember-ink); }

/* ── Type ── */
h1, .section-title, .hero-title, .cat-title, .error-title, .auth-title, .page-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.12 !important;
  text-wrap: balance;
}
.section-title { font-size: clamp(20px, 2.1vw, 28px) !important; }
.cat-title { font-size: clamp(24px, 2.8vw, 34px) !important; }
.gradient-text { background: none !important; -webkit-text-fill-color: currentColor !important; color: inherit !important; }

/* ── Header ── */
.header {
  background: rgba(11, 11, 13, 0.86) !important;
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.logo-text { font-family: var(--font-display) !important; font-weight: 800 !important; font-size: 18px !important; letter-spacing: -0.01em !important; }
.logo-beta {
  color: var(--text-muted) !important; background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border-strong) !important; text-shadow: none !important;
}
.nav-link { font-weight: 600 !important; }
.nav-link.active { background: rgba(255, 255, 255, 0.09) !important; }
.header-badge { background: var(--ember) !important; color: var(--ember-ink) !important; }

/* ── Buttons ── */
.btn { border-radius: 12px !important; font-weight: 700 !important; }
.btn-primary {
  background: var(--ember) !important;
  color: var(--ember-ink) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
.btn-primary:hover { background: var(--ember-soft) !important; color: var(--ember-ink) !important; }
.btn-ghost, .btn-secondary { background: #26262b !important; border: 1px solid transparent !important; color: var(--text) !important; }
.btn-ghost:hover, .btn-secondary:hover { background: #303036 !important; border-color: transparent !important; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold) !important; outline-offset: 2px;
}

/* ── Surfaces ── */
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select, textarea, .filter-select {
  background-color: var(--bg-card) !important;
  border-color: var(--border-strong) !important;
  border-radius: 12px !important;
}
input:focus, select:focus, textarea:focus { border-color: var(--ember) !important; box-shadow: var(--ring) !important; }
.tag { border-radius: 8px !important; }
a { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.footer { background: #08080a !important; border-top: 1px solid var(--border) !important; }
.footer h4 { color: var(--text) !important; }
.theme-switch { display: none !important; }
.cookie-modal { background: var(--bg-card) !important; border: 1px solid var(--border-strong) !important; border-radius: 18px !important; }

/* Rank colours: gold / silver / bronze instead of neon */
.server-rank.top1 .rank-num { color: var(--gold) !important; text-shadow: none !important; }
.server-rank.top2 .rank-num { color: var(--silver) !important; text-shadow: none !important; }
.server-rank.top3 .rank-num { color: var(--bronze) !important; text-shadow: none !important; }
.rank-num { font-family: var(--font-display) !important; font-weight: 800 !important; }
.server-row { border-radius: 16px !important; }
.dot-online { background: var(--success) !important; box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.2) !important; }

/* Directory accents */
.cat-game.is-on { background: var(--ember) !important; color: var(--ember-ink) !important; }
.cat-chip.is-on { color: var(--text) !important; }
.cat-badge { background: var(--ember) !important; color: var(--ember-ink) !important; }
.cat-tag.is-fw { color: var(--gold) !important; }
.cat-tag.is-lang { color: var(--text-muted) !important; background: rgba(255, 255, 255, 0.06) !important; }

/* ══════════════════════ Homepage podium ══════════════════════ */
.pd-hero {
  position: relative; z-index: 1;
  padding: 44px 0 8px;
  background: radial-gradient(900px 520px at 50% 300px, rgba(255, 90, 43, 0.22), transparent 70%);
}
.pd-intro { display: grid; justify-items: center; gap: 14px; text-align: center; margin-bottom: 30px; }
.pd-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(61, 220, 151, 0.12); color: #7df0b8; font-size: 14px; font-weight: 700; }
.pd-live i { width: 8px; height: 8px; border-radius: 50%; background: #7df0b8; }
.pd-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 4vw, 54px); line-height: 1.1; letter-spacing: -0.015em; max-width: 19ch; text-wrap: balance; margin: 0; }
.pd-sub { color: var(--text-muted); font-size: 18px; max-width: 52ch; margin: 0; }

.pd-stage { display: flex; align-items: flex-end; gap: 20px; }
.pd-card {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-strong);
}
.pd-card.is-1 { flex-grow: 1.25; order: 2; border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(255, 201, 77, 0.12), 0 40px 90px -20px rgba(255, 201, 77, 0.22); }
.pd-card.is-2 { order: 1; }
.pd-card.is-3 { order: 3; }
.pd-art { position: relative; height: 140px; background-color: #1b1b1f; background-size: cover; background-position: center; }
.pd-card.is-1 .pd-art { height: 210px; }
.pd-card.is-3 .pd-art { height: 120px; }
.pd-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 13, 0) 40%, rgba(21, 21, 23, 0.85) 100%); }
.pd-medal {
  position: absolute; left: 20px; bottom: -28px; z-index: 2;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #17130a;
  border: 5px solid var(--bg-card); background: var(--silver);
}
.pd-card.is-1 .pd-medal { width: 74px; height: 74px; font-size: 34px; background: var(--gold); bottom: -34px; }
.pd-card.is-3 .pd-medal { background: var(--bronze); }
.pd-crown { position: absolute; right: 18px; top: 16px; z-index: 2; color: var(--gold); }
.pd-icon { position: absolute; right: 18px; bottom: -22px; z-index: 2; width: 52px; height: 52px; border-radius: 13px; border: 3px solid var(--bg-card); background: #26262b; overflow: hidden; display: grid; place-items: center; }
.pd-icon b { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--text-muted); }
.pd-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd-card { --pd-fallback: repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 22px), linear-gradient(160deg, #2a2a33, #8f8fa1); }
.pd-card.is-1 { --pd-fallback: repeating-linear-gradient(115deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 22px), linear-gradient(160deg, #5c1505, #ff8a3d 70%, #ffc94d); }
.pd-card.is-3 { --pd-fallback: repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 22px), linear-gradient(160deg, #3d140b, #e0603a); }
.pd-body { display: grid; gap: 14px; padding: 44px 22px 22px; }
.pd-card.is-1 .pd-body { padding-top: 50px; }
.pd-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.2; color: var(--text); text-decoration: none; display: block; overflow-wrap: anywhere; }
.pd-card.is-1 .pd-name { font-size: 25px; }
.pd-name:hover { color: var(--gold); }
.pd-meta { color: var(--text-muted); font-size: 15px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pd-meta .pd-on { display: inline-flex; align-items: center; gap: 6px; color: #7df0b8; font-weight: 600; }
.pd-meta .pd-on i { width: 7px; height: 7px; border-radius: 50%; background: #7df0b8; }
.pd-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pd-votes { display: flex; align-items: baseline; gap: 8px; color: var(--text-muted); font-size: 15px; }
.pd-votes strong { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--silver); }
.pd-card.is-1 .pd-votes strong { font-size: 50px; color: var(--gold); }
.pd-card.is-3 .pd-votes strong { color: var(--bronze); }
.pd-vote { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; border-radius: 12px; background: #26262b; color: var(--text); font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; }
.pd-vote:hover { background: #303036; }
.pd-card.is-1 .pd-vote { background: var(--ember); color: var(--ember-ink); padding: 0 26px; }
.pd-card.is-1 .pd-vote:hover { background: var(--ember-soft); }

.pd-rest { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.pd-slim { flex: 1 1 380px; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; background: var(--bg-card); border: 1px solid var(--border-strong); }
.pd-slim-rank { font-family: var(--font-display); font-weight: 800; font-size: 28px; width: 40px; text-align: center; color: var(--text-muted); }
.pd-slim-main { flex: 1; min-width: 0; }
.pd-slim-main a { display: block; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-slim-main a:hover { color: var(--gold); }
.pd-slim-main span { font-size: 14px; color: var(--text-muted); }
.pd-slim .pd-votes strong { font-size: 22px; color: var(--text); }
.pd-slim .pd-vote { min-height: 44px; padding: 0 18px; font-size: 15px; }

.pd-find { display: grid; justify-items: center; gap: 16px; padding: 32px 0 10px; }
.pd-search { display: flex; gap: 8px; width: 100%; max-width: 620px; }
.pd-search input { flex: 1; min-width: 0; min-height: 54px; padding: 0 20px !important; font-size: 17px !important; border-radius: 14px !important; }
.pd-search button { min-height: 54px; padding: 0 26px; border-radius: 14px; border: 0; background: #fff; color: #0b0b0d; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.pd-search button:hover { background: #e9e9ee; }
.pd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pd-chips a { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pd-chips a:hover { border-color: var(--ember); }

.pd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 28px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); }
.pd-stat { padding: 20px 24px; display: grid; gap: 4px; border-left: 1px solid var(--border); }
.pd-stat:first-child { border-left: 0; }
.pd-stat strong { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.pd-stat span { font-size: 14px; color: var(--text-muted); }

.pd-spot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--text-dim); }
.pd-spot-label { padding: 3px 10px; border-radius: 6px; background: rgba(255, 210, 122, 0.14); color: #ffd27a; font-weight: 700; font-size: 13px; }
.pd-spot a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-weight: 600; text-decoration: none; }
.pd-spot a.is-open { border-style: dashed; color: var(--text-muted); }
.pd-spot a i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.pd-spot a.is-live i { background: #7df0b8; }

@media (max-width: 900px) {
  .pd-stage { flex-direction: column; align-items: stretch; }
  .pd-card, .pd-card.is-1 { flex: none; }
  .pd-card.is-1, .pd-card.is-2, .pd-card.is-3 { order: 0; }
  .pd-card.is-1 .pd-art { height: 170px; }
  .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-stat:nth-child(3) { border-left: 0; }
  .pd-stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .pd-hero { padding-top: 28px; }
  .pd-slim { flex-wrap: wrap; }
  .pd-slim-main { flex-basis: 60%; }
  .pd-search { flex-direction: column; }
}

/* Sponsored / kicker labels */
.featured-kicker span, .featured-kicker { color: var(--text-dim) !important; }
.featured-kicker span { color: #ffd27a !important; }

/* ── Floating buttons: Discord + messages ── */
.discord-fab,
.dm-widget .dm-launcher,
.dm-launcher {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: #1c1c1f !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.7) !important;
  color: var(--text) !important;
  filter: none !important;
  transition: transform .15s var(--ease, ease), border-color .15s, background .15s !important;
}
.discord-fab { color: #8e9bff !important; }
.discord-fab svg, .dm-launcher svg { width: 22px; height: 22px; }
.discord-fab:hover,
.dm-launcher:hover {
  transform: translateY(-2px);
  background: #26262b !important;
  border-color: var(--ember) !important;
  filter: none !important;
}
.discord-fab.has-dm-buddy { bottom: 78px !important; right: 20px !important; }
@media (max-width: 860px) { .discord-fab.has-dm-buddy { bottom: 70px !important; right: 12px !important; } }
.dm-launcher.has-unread { border-color: var(--ember) !important; box-shadow: 0 0 0 4px rgba(255, 106, 61, 0.18), 0 10px 28px -8px rgba(0, 0, 0, 0.7) !important; }
.dm-badge {
  top: -4px !important; right: -4px !important;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--ember) !important; color: var(--ember-ink) !important;
  border: 2px solid var(--bg);
  font-size: 11px; font-weight: 800; line-height: 1;
  box-sizing: border-box;
}
.dm-badge[hidden] { display: none !important; }
.discord-fab-tip {
  right: calc(100% + 10px) !important; bottom: 50% !important;
  transform: translate(4px, 50%) !important;
  background: #1c1c1f !important; border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px !important; font-size: 13px !important; font-weight: 600 !important;
}
.discord-fab:hover .discord-fab-tip,
.discord-fab:focus-visible .discord-fab-tip { transform: translate(0, 50%) !important; }
@media (prefers-reduced-motion: reduce) {
  .discord-fab, .dm-launcher { transition: none !important; }
  .discord-fab:hover, .dm-launcher:hover { transform: none; }
}
