/* ===================================================================
   SwiftTier — token system
   Color:  bg #0a0912 / panel #14112a / card #1a1636 / border #2c2650
           violet #8b6bff / cyan #3fd1ff / gold #ffc861 / text #f1eefc
   Type:   display = Chakra Petch (angular, matches the bolt mark)
           body = Inter | data/mono = JetBrains Mono
   =================================================================== */

:root {
  --bg: #09080f;
  --panel: #121022;
  --card: #171531;
  --card-hover: #1d1a3c;
  --border: #2a2650;
  --border-soft: #201d40;

  --violet: #8b6bff;
  --violet-soft: #6f57cf;
  --cyan: #3fd1ff;
  --gold: #ffc861;

  --text: #f2f0fb;
  --text-muted: #9791b8;
  --text-faint: #635d85;

  --radius: 10px;
  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- ambient glow ---------- */
.bolt-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(45% 60% at 20% 0%, rgba(139, 107, 255, 0.16), transparent 70%),
    radial-gradient(35% 50% at 80% 10%, rgba(63, 209, 255, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 8, 15, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-bolt { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(139,107,255,0.6)); }

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-word em { font-style: normal; color: var(--cyan); }

.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab.is-active { color: var(--text); background: rgba(139,107,255,0.14); box-shadow: inset 0 0 0 1px rgba(139,107,255,0.35); }

.server-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  flex-shrink: 0;
}

.server-chip-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.server-chip-value {
  appearance: none;
  border: none;
  background: rgba(139,107,255,0.14);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.server-chip-value:hover { background: rgba(139,107,255,0.26); }
.server-chip-value svg { color: var(--cyan); }

/* ---------- layout ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.panel { display: none; }
.panel.is-active { display: block; }

.panel h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.sub { color: var(--text-muted); font-size: 15px; margin: 0; }

/* ---------- rankings head ---------- */
.rankings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 260px;
  color: var(--text-faint);
}
.search-wrap:focus-within { border-color: var(--violet-soft); color: var(--violet); }

.search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}
.search-wrap input::placeholder { color: var(--text-faint); }

/* ---------- gamemode pills ---------- */
.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}
.pill:hover { color: var(--text); border-color: var(--violet-soft); }
.pill.is-active {
  color: #0b0817;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-color: transparent;
}

/* ---------- table ---------- */
.table-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-head { border-radius: var(--radius) var(--radius) 0 0; }
.row:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.table-head, .row {
  display: grid;
  grid-template-columns: 56px 1fr 90px 2.2fr;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
}

.table-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-soft);
}

.row {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--card-hover); }

.col-rank { font-family: var(--font-mono); color: var(--text-faint); }
.rank-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--card-hover);
  border: 1px solid var(--border);
  font-size: 13px;
}
.rank-num.top1 { color: #241500; background: linear-gradient(135deg, #ffd76a, #f5a623); border-color: #ffc861; font-weight: 700; box-shadow: 0 0 12px rgba(255, 200, 97, 0.35); }
.rank-num.top2 { color: #17151f; background: linear-gradient(135deg, #eceaf7, #aeaac7); border-color: #d8d3ef; font-weight: 700; }
.rank-num.top3 { color: #2a1300; background: linear-gradient(135deg, #e59a5c, #b06a33); border-color: #c98f52; font-weight: 700; }

.player-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-avatar {
  width: 30px; height: 30px;
  border-radius: 6px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.player-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Player name bubble — clickable, opens the detail modal */
.name-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.row:hover .name-chip,
.name-chip:hover {
  border-color: var(--violet-soft);
  color: var(--violet);
  background: #221e46;
}
.player-info { min-width: 0; display: flex; flex-direction: column; }
.player-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; padding-left: 2px; }
.player-points {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* Title badges (Novice / Rising / Skilled / Expert / Pro) */
.title-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.title-badge.title-pro     { background: rgba(255,200,97,0.14);  color: var(--gold);       border-color: rgba(255,200,97,0.35); }
.title-badge.title-expert  { background: rgba(139,107,255,0.16); color: #b3a1ff;           border-color: rgba(139,107,255,0.35); }
.title-badge.title-skilled { background: rgba(63,214,143,0.13);  color: #5fe0a5;           border-color: rgba(63,214,143,0.32); }
.title-badge.title-rising  { background: rgba(63,209,255,0.13);  color: var(--cyan);       border-color: rgba(63,209,255,0.3); }
.title-badge.title-novice  { background: rgba(255,255,255,0.06); color: var(--text-muted); border-color: var(--border); }

/* Progress toward next title */
.progress-track {
  display: block;
  width: 100%;
  max-width: 190px;
  height: 5px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--card-hover);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.progress-fill.title-pro     { background: linear-gradient(90deg, #ffd76a, var(--gold)); }
.progress-fill.title-expert  { background: linear-gradient(90deg, var(--violet), #b3a1ff); }
.progress-fill.title-skilled { background: linear-gradient(90deg, #2fae72, #5fe0a5); }
.progress-fill.title-rising  { background: linear-gradient(90deg, #2f9dcf, var(--cyan)); }
.progress-fill.title-novice  { background: #4a4570; }

.col-region {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
}
/* Region bubble — centered under the "Region" header */
.region-chip {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.region-chip.region-AS { color: #7cc4ff; border-color: rgba(63,169,255,0.45); background: rgba(63,169,255,0.10); }
.region-chip.region-EU { color: #b3a1ff; border-color: rgba(139,107,255,0.45); background: rgba(139,107,255,0.11); }
.region-chip.region-NA { color: #ffb37c; border-color: rgba(255,155,63,0.45);  background: rgba(255,155,63,0.10); }
.region-chip.region-SA { color: #5fe0a5; border-color: rgba(63,214,143,0.45);  background: rgba(63,214,143,0.10); }
.region-chip.region-AU { color: #ff9ec4; border-color: rgba(255,95,143,0.45);  background: rgba(255,95,143,0.10); }
.table-head .col-region { text-align: center; justify-content: center; }

.modes-wrap { display: flex; flex-wrap: wrap; gap: 10px; }

.mode-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 44px;
}
/* Icon bubble — circular chip around every gamemode icon (table, modal, stats) */
.mode-slot-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-hover);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.mode-slot:hover .mode-slot-icon { border-color: var(--violet-soft); }

/* Real pixel-art gamemode icons (16x16 PNGs from the old site) */
.gm-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  display: inline-block;
  flex-shrink: 0;
}
.bar-row-label { display: inline-flex; align-items: center; gap: 8px; }
.pill .gm-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.slot-badge { font-size: 11px; padding: 2px 7px; }
.mode-slot.is-untested { opacity: 0.32; }

.row { cursor: pointer; }

.tier-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tier-badge .gm { opacity: 0.65; margin-right: 4px; }

.tier-1 { background: rgba(255, 200, 97, 0.14); color: var(--gold); border-color: rgba(255,200,97,0.3); }
.tier-2 { background: rgba(139, 107, 255, 0.16); color: #b3a1ff; border-color: rgba(139,107,255,0.32); }
.tier-3 { background: rgba(63, 209, 255, 0.14); color: var(--cyan); border-color: rgba(63,209,255,0.3); }
.tier-4 { background: rgba(72, 214, 168, 0.14); color: #6fe0bb; border-color: rgba(72,214,168,0.3); }
.tier-5 { background: rgba(255,255,255,0.06); color: var(--text-muted); border-color: var(--border); }

/* ---------- states ---------- */
.state-msg {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 22px; height: 22px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 24px 50px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.footer .dot { margin: 0 8px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--cyan); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--violet-soft);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; }
  .table-head { display: none; }
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 18px;
  }
  .col-rank { display: none; }
  .col-region { justify-content: flex-start; align-items: center; gap: 8px; }
  .col-region::before { content: "Region:"; color: var(--text-faint); }
}

/* ============ content pages (Rules / FAQ / Stats / Resources) ============ */

.page-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 0 auto 32px;
  max-width: 640px;
}

.page-icon {
  font-size: 32px;
  line-height: 1;
}

.edit-note {
  margin-top: 28px;
  padding: 10px 16px;
  background: rgba(255, 200, 97, 0.08);
  border: 1px dashed rgba(255, 200, 97, 0.35);
  border-radius: 8px;
  color: var(--gold);
  font-size: 12.5px;
}

code {
  font-family: var(--font-mono);
  background: rgba(139,107,255,0.14);
  color: var(--violet);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ---- Rules ---- */
.prose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 0 auto 16px;
  max-width: 920px;
}

.prose-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin: 0 auto 16px;
  max-width: 920px;
}
.prose-grid .prose-card { margin-bottom: 0; max-width: none; }
.prose-card.full-width { width: 100%; }

.prose-card.accent-green { border-left-color: #4ade80; }
.prose-card.accent-cyan { border-left-color: var(--cyan); }
.prose-card.accent-red { border-left-color: #f87171; }
.prose-card.accent-gold { border-left-color: var(--gold); }

.prose-card h2 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accent-green h2 { color: #4ade80; }
.accent-cyan h2 { color: var(--cyan); }
.accent-red h2 { color: #f87171; }
.accent-gold h2 { color: var(--gold); }

.badge-icon { font-size: 15px; }

.prose-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  margin: 16px 0 4px;
}
.prose-label:first-of-type { margin-top: 0; }

.prose-text { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.ok-note { display: block; color: #4ade80; margin-top: 4px; font-size: 12.5px; }

.prose-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prose-card li { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.prose-card strong { color: var(--text); }
.prose-card strong.warn { color: var(--gold); }
.prose-card strong.danger { color: #f87171; }

.prose-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.prose-columns.two-col { grid-template-columns: 1fr 1fr; gap: 30px; }

.numbered { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.numbered li { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.numbered li::marker { color: var(--violet); font-family: var(--font-mono); font-weight: 600; }

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 26px auto 0;
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #0b0817;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.rules-cta-wrap { display: flex; justify-content: center; }
.cta-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta-button.is-disabled { background: var(--card); color: var(--text-faint); cursor: default; pointer-events: none; }

/* ---- FAQ ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 22px;
  transition: border-color 0.15s ease;
}
.faq-item:hover { border-color: var(--border-soft); }
.faq-item[open] { border-color: var(--violet-soft); }

.faq-item summary {
  cursor: pointer;
  padding: 19px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,107,255,0.22), rgba(63,209,255,0.16));
  border: 1px solid rgba(139,107,255,0.35);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-item[open] .faq-q { color: var(--cyan); border-color: rgba(63,209,255,0.4); }

.faq-item p {
  margin: 0 0 20px;
  padding-left: 40px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 auto 20px;
  max-width: 1000px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.stat-icon { font-size: 16px; }

.stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}

.stat-label { font-size: 12px; color: var(--text-faint); }

.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.stats-columns .prose-card h2 { color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }

.tier-bars, .region-bars { display: flex; flex-direction: column; gap: 14px; }

.bar-row { display: block; margin-bottom: 16px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.bar-row-label {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}
.bar-row-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); text-align: right; white-space: nowrap; }

.bar-track { display: block; height: 8px; background: var(--card); border: 1px solid var(--border-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2f7dff, var(--cyan)); transition: width 0.4s ease; }
.bar-fill.fill-region-AS { background: linear-gradient(90deg, #2f7dff, #3fa9ff); }
.bar-fill.fill-region-EU { background: linear-gradient(90deg, var(--violet-soft), var(--violet)); }
.bar-fill.fill-region-NA { background: linear-gradient(90deg, #e07b1f, #ff9b3f); }
.bar-fill.fill-region-SA { background: linear-gradient(90deg, #2fae72, #3fd68f); }
.bar-fill.fill-region-AU { background: linear-gradient(90deg, #d94f7e, #ff5f8f); }

/* ---- Resources ---- */
.mod-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 520px;
  margin: 0 auto 24px;
  text-align: center;
}
.mod-card.is-disabled { opacity: 0.72; }

.mod-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(139,107,255,0.14);
  font-size: 19px;
  margin-bottom: 16px;
}

.mod-card h2 { font-family: var(--font-display); font-size: 17px; margin: 0 0 10px; }
.mod-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; }
.mod-card strong { color: var(--text); }

.mod-steps { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 8px; padding: 16px 18px; margin-bottom: 20px; text-align: left; }
.mod-buttons { display: flex; justify-content: center; gap: 10px; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
}

.resource-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.resource-card:hover { border-color: var(--violet-soft); transform: translateY(-2px); }

.resource-icon { font-size: 24px; }
.resource-title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; }
.resource-desc { font-size: 12.5px; color: var(--text-faint); }

@media (max-width: 720px) {
  .prose-columns { grid-template-columns: 1fr; }
  .prose-columns.two-col { grid-template-columns: 1fr; }
}

/* ============ player detail modal ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 4, 10, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
/* CRITICAL: without this, display:flex overrides the hidden attribute and the
   invisible overlay covers the whole page, swallowing every click on the site. */
.modal-overlay[hidden] { display: none; }
.modal-overlay.is-open { opacity: 1; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.15s ease;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.modal-close:hover { color: var(--text); border-color: var(--violet-soft); }

.modal-avatar-wrap {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 14px;
}
.modal-avatar { height: 150px; image-rendering: pixelated; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4)); }

.modal-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 10px;
}

.modal-title-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  margin-bottom: 8px;
}
.modal-title-badge.title-pro { background: rgba(255,200,97,0.14); color: var(--gold); border-color: rgba(255,200,97,0.32); }
.modal-title-badge.title-expert { background: rgba(139,107,255,0.16); color: #b3a1ff; border-color: rgba(139,107,255,0.32); }
.modal-title-badge.title-skilled { background: rgba(63,214,143,0.13); color: #5fe0a5; border-color: rgba(63,214,143,0.3); }
.modal-title-badge.title-rising { background: rgba(63,209,255,0.14); color: var(--cyan); border-color: rgba(63,209,255,0.3); }
.modal-title-badge.title-novice { background: rgba(255,255,255,0.06); color: var(--text-muted); border-color: var(--border); }

.modal-region { display: block; font-size: 12.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 22px; }

.modal-section { width: 100%; margin-bottom: 18px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
  text-align: left;
}

.modal-position-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
}
.modal-points { color: var(--cyan); font-family: var(--font-mono); }

.modal-tiers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.modal-tier-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 46px; }
.modal-empty { font-size: 12.5px; color: var(--text-faint); }


/* ============ floating tooltip (old-site style: gamemode above, tier | pts below) ============ */
.tt {
  position: fixed;
  z-index: 9999;
  background: #0d0b1e;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 13px;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  width: max-content;
  max-width: 260px;
}
.tt-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.tt-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tt-sep { color: var(--text-faint); font-weight: 400; }
.tt-pts { color: #5fe0a5; } /* points in green, like the old site */
.tt-muted { color: var(--text-faint); font-size: 11.5px; font-weight: 500; }
.tt-plain { color: var(--text); font-size: 11.5px; font-weight: 500; }
/* tier text colored by its tier bucket */
.tt-tier.tier-text-1 { color: var(--gold); }
.tt-tier.tier-text-2 { color: #b3a1ff; }
.tt-tier.tier-text-3 { color: var(--cyan); }
.tt-tier.tier-text-4 { color: #6fe0bb; }
.tt-tier.tier-text-5 { color: var(--text-muted); }

/* Crown on the Overall pill */
.pill-crown { margin-right: 6px; font-size: 13px; line-height: 1; filter: drop-shadow(0 0 4px rgba(255, 200, 97, 0.5)); }
