/* ════════════════════════════════════════════════════════════════════
   StromgardeBot · Redesign · shared stylesheet
   Anchored to existing visual DNA: dark slate-violet, Press Start 2P + Inter,
   purple-leaning accents, glassmorphism, neon-tinted shadows, snowflakes,
   per-section accent colors, tabular-num figures throughout.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0a22;
  --bg-2:      #100a26;
  --surface:   #15102e;
  --surface2:  #1a1338;
  --border:    rgba(168,145,210,.16);
  --border-2:  rgba(255,255,255,.06);
  --text:      #e9e1ff;
  --muted:     #a99fc8;
  --dim:       #6e6896;

  --acc-fights:    #f87171;
  --acc-players:   #fbbf24;
  --acc-market:    #34d399;
  --acc-alliances: #a855f7;
  --acc-legacy:    #c4b5fd;
  --acc-purple:    #a855f7;
  --acc-frost:     #bae6fd;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 22px;

  --shadow-card: 0 12px 36px rgba(0,0,0,.55), 0 2px 0 rgba(168,145,210,.04) inset;

  --nav-h: 60px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 60% at 12% 0%,  rgba(168,85,247,.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 88% 30%, rgba(56,189,248,.06), transparent 60%);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

.tn { font-variant-numeric: tabular-nums; }

/* ───────── shared scrollbar ───────── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(0,0,0,.3); }
*::-webkit-scrollbar-thumb { background: rgba(168,85,247,.25); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(168,85,247,.45); }

/* ════════════════════════════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  background: rgba(13,10,34,.85);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.nav-brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav-brand-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px; letter-spacing: .12em;
  color: #c4b5fd;
  text-shadow: 0 0 18px rgba(168,85,247,.6);
}
.nav-links {
  display: flex; align-items: center; gap: 2px;
}
.nav-links a {
  font-size: 12px; color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: .04em;
  font-weight: 500;
  transition: color .15s, background .15s, border-color .15s;
}
.nav-links a:hover {
  color: #e9d5ff; background: rgba(168,85,247,.1);
  border-color: rgba(168,85,247,.25);
}
.nav-links a.active {
  color: #e9d5ff; background: rgba(168,85,247,.16);
  border-color: rgba(168,85,247,.4);
}
.nav-sep {
  width: 1px; height: 12px;
  background: var(--border);
  margin: 0 6px;
  display: inline-block;
}

@media (max-width: 820px) {
  .nav-sep { display: none; }
  .nav-links { gap: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
  .nav-links a { padding: 5px 8px; font-size: 11px; }
  .nav-brand-name { font-size: 9px; }
}

/* ════════════════════════════════════════════════════════════════════
   PAGE HEADER (per-section flourishes)
   ════════════════════════════════════════════════════════════════════ */
.ph {
  position: relative; isolation: isolate; overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 44px 32px 36px;
  min-height: 220px;
  background: linear-gradient(180deg, #110d28 0%, #0c0820 100%);
}
.ph::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(67deg, transparent 0 6px, rgba(168,85,247,.022) 6px 7px),
    radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: auto, 28px 28px;
  mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, black 30%, transparent 90%);
}
.ph-glow {
  position: absolute; pointer-events: none;
  width: 600px; height: 400px; border-radius: 50%;
  filter: blur(110px); opacity: .22;
  top: -150px; left: -120px;
}
.ph-bottom-line {
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
}
.ph-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snowflake {
  position: absolute;
  width: 2px; height: 2px;
  background: #cfe6ff;
  opacity: .7;
  box-shadow: 0 0 4px rgba(186,230,253,.6);
  animation: fall linear infinite;
}
.snowflake.lg { width: 3px; height: 3px; opacity: .9; box-shadow: 0 0 6px rgba(186,230,253,.7); }
@keyframes fall {
  0%   { transform: translate3d(0,-20px,0); }
  100% { transform: translate3d(20px, 580px, 0); }
}

/* ── Page-wide snowfall (used by /fights, /players, /market, /alliances,
   /legacy and /fights/<id>). Drop a <div class="page-snow" id="pageSnow">
   right after <body> and the auto-init in app.js seeds it on load. The
   layer sits behind all content (z-index: 0); footers are made opaque so
   flakes don't render over them. */
body:has(.page-snow) { position: relative; }
.page-snow {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.page-snow .snowflake { animation-name: page-fall; }
@keyframes page-fall {
  0%   { transform: translate3d(0, -10vh, 0); }
  100% { transform: translate3d(40px, 110vh, 0); }
}
/* Lift real content above the snow layer */
body:has(.page-snow) .nav,
body:has(.page-snow) .ph,
body:has(.page-snow) .main,
body:has(.page-snow) .footer { position: relative; z-index: 1; }
/* Footer must fully cover the page-snow layer so flakes don't fall over it */
body:has(.page-snow) .footer {
  background: linear-gradient(180deg, #0a0720 0%, #070518 100%) !important;
}
.ph-inner {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.ph-l { flex: 1; min-width: 280px; }
.ph-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.45;
  margin-bottom: 10px;
  text-shadow: 0 0 40px rgba(255,255,255,.06);
}
.ph-sub { font-size: 13.5px; color: var(--muted); max-width: 540px; line-height: 1.6; }
.ph-flourish { position: relative; z-index: 2; flex-shrink: 0; }

/* per-section glow + accent line */
.ph--fights    .ph-glow { background: var(--acc-fights); }
.ph--fights    .ph-bottom-line { background: linear-gradient(90deg, rgba(248,113,113,.55), rgba(56,189,248,.25) 60%, transparent); }
.ph--players   .ph-glow { background: var(--acc-players); }
.ph--players   .ph-bottom-line { background: linear-gradient(90deg, rgba(251,191,36,.55), transparent 70%); }
.ph--market    .ph-glow { background: var(--acc-market); }
.ph--market    .ph-bottom-line { background: linear-gradient(90deg, rgba(52,211,153,.55), transparent 70%); }
.ph--alliances .ph-glow { background: var(--acc-alliances); }
.ph--alliances .ph-bottom-line { background: linear-gradient(90deg, rgba(168,85,247,.55), transparent 70%); }
.ph--legacy    .ph-glow { background: var(--acc-legacy); }
.ph--legacy    .ph-bottom-line { background: linear-gradient(90deg, rgba(196,181,253,.55), rgba(56,189,248,.25) 60%, transparent); }

/* ───────── flourish: spark bars (fights) ───────── */
.flourish-spark {
  width: 280px; height: 70px;
  display: flex; align-items: end; gap: 3px;
  padding: 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.spark-bar {
  flex: 1; background: linear-gradient(180deg, rgba(248,113,113,.9), rgba(248,113,113,.3));
  border-radius: 1px;
  animation: barpulse 1.6s ease-in-out infinite;
}
@keyframes barpulse {
  0%, 100% { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
  50% { opacity: .55; transform: scaleY(.85); transform-origin: bottom; }
}

/* ───────── flourish: KDA dial (players) ───────── */
.flourish-dial {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dial-info { display: flex; flex-direction: column; gap: 2px; }
.dial-info-row { display: flex; gap: 10px; align-items: baseline; }
.dial-info-num { font-family: 'Press Start 2P', monospace; font-size: 14px; }
.dial-info-num.k { color: #6ee7b7; }
.dial-info-num.d { color: #fda4af; }
.dial-info-num.a { color: #93c5fd; }
.dial-info-lbl { font-size: 10px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; }

/* ───────── flourish: power bars (alliances) ───────── */
.flourish-power {
  width: 280px; padding: 12px 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.pwr-row { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 8px; }
.pwr-name { font-family: 'Press Start 2P', monospace; font-size: 8px; color: var(--muted); letter-spacing: .06em; }
.pwr-bar-track { height: 6px; background: rgba(255,255,255,.05); border-radius: 4px; overflow: hidden; }
.pwr-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #c084fc, #a855f7);
  box-shadow: 0 0 8px rgba(168,85,247,.5);
  animation: barslide 2s ease-out forwards;
}
@keyframes barslide { from { width: 0; } }
.pwr-pct { font-family: 'Press Start 2P', monospace; font-size: 8px; color: #c4b5fd; text-align: right; }

/* ───────── flourish: legacy seal ───────── */
.flourish-seal {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.flourish-seal::before, .flourish-seal::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
}
.flourish-seal::before {
  border: 1px solid rgba(196,181,253,.35);
  animation: spin 30s linear infinite;
  background-image: radial-gradient(rgba(196,181,253,.4) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: radial-gradient(circle, transparent 50%, black 51%, black 100%);
  -webkit-mask-image: radial-gradient(circle, transparent 50%, black 51%, black 100%);
}
.flourish-seal::after {
  inset: 14px;
  border: 1px dashed rgba(196,181,253,.25);
  animation: spin 50s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.flourish-seal-rune {
  font-family: 'Press Start 2P', monospace;
  font-size: 32px;
  color: #c4b5fd;
  text-shadow: 0 0 18px rgba(196,181,253,.6);
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════════════
   GENERAL: page main, cards, footer
   ════════════════════════════════════════════════════════════════════ */
.main {
  max-width: 1320px; margin: 0 auto;
  padding: 36px 24px 60px;
}

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 60%),
    rgba(15,11,38,.6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
}

.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px; letter-spacing: .08em;
  color: #c4b5fd;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.section-title::before {
  content: ''; width: 22px; height: 1px;
  background: rgba(196,181,253,.4);
}
.section-title-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title-row .section-title { margin-bottom: 0; }
.section-title-row .section-meta {
  font-size: 11.5px; color: var(--dim);
  letter-spacing: .1em; text-transform: uppercase;
}

/* ── footer (forge stamp style) ── */
.footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(8,6,22,.6));
  padding: 36px 24px 28px;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,.5), transparent);
}
.footer-inner {
  max-width: 1320px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand-row { display: flex; align-items: center; gap: 10px; }
.footer-brand-row img { width: 36px; height: 36px; image-rendering: pixelated; filter: drop-shadow(0 0 16px rgba(168,85,247,.4)); }
.footer-brand-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px; color: #c4b5fd; letter-spacing: .12em;
}
.footer-tag {
  font-size: 11px; color: var(--muted);
  font-style: italic;
  max-width: 280px; line-height: 1.6;
}
.footer-col-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; letter-spacing: .14em;
  color: var(--dim);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.footer-col-title::before { display: none; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-col a {
  font-size: 12.5px; color: var(--muted);
  transition: color .14s;
  display: inline-flex; align-items: center; gap: 6px;
}
.footer-col a:hover { color: #e9d5ff; }
.footer-col a .ext-arrow { font-size: 10px; opacity: .6; }
.footer-bottom {
  max-width: 1320px; margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  font-size: 11px; color: var(--dim);
  text-align: center;
}
.footer-runes {
  font-family: 'Press Start 2P', monospace;
  color: rgba(196,181,253,.4);
  letter-spacing: .3em;
  font-size: 10px;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   GLOBAL UTILITIES
   ════════════════════════════════════════════════════════════════════ */
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.55; transform:scale(.85);} }

.shimmer-text {
  background: linear-gradient(100deg, #c084fc 0%, #e9d5ff 30%, #bae6fd 55%, #c084fc 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(180deg, rgba(168,85,247,.4), rgba(124,58,237,.6));
  border: 1px solid rgba(196,181,253,.4);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124,58,237,.4), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,.6), inset 0 1px 0 rgba(255,255,255,.2); }
.btn--ghost {
  padding: 10px 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}
.btn--ghost:hover { color: var(--text); border-color: rgba(196,181,253,.4); background: rgba(168,85,247,.06); transform: translateY(-2px); }

/* spinner */
.spinner-rune {
  width: 32px; height: 32px;
  position: relative;
  margin: 0 auto;
}
.spinner-rune::before, .spinner-rune::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
}
.spinner-rune::before {
  border-top-color: #a855f7;
  border-right-color: rgba(168,85,247,.4);
  animation: spin 1.2s linear infinite;
}
.spinner-rune::after {
  inset: 6px;
  border-bottom-color: #c4b5fd;
  border-left-color: rgba(196,181,253,.4);
  animation: spin 0.8s linear infinite reverse;
}
.loading-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 20px;
  color: var(--muted);
}
.loading-block .lbl {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; letter-spacing: .14em;
  color: var(--dim);
}

/* ════════════════════════════════════════════════════════════════════
   PAGE-SPECIFIC styles imported by their own files at end of <head>
   See per-page <style> blocks for hero, fight cards, leaderboard, etc.
   ════════════════════════════════════════════════════════════════════ */
