/* ============================================================
   JAPR — Battle of the Junkies
   Dark forged-steel arena aesthetic
   Palette: charcoal black · brushed steel/silver · crimson accent
   Medals: gold / silver / bronze
   ============================================================ */

:root {
  /* Surfaces */
  --bg:          #0a0a0c;
  --bg-2:        #0e0e11;
  --panel-top:   #1b1c20;
  --panel-bot:   #0f1012;
  --panel-edge:  #2a2c33;

  /* Steel */
  --steel-hi:    #f5f6f8;
  --steel:       #c9ccd3;
  --steel-mid:   #8a8d96;
  --steel-lo:    #5a5d66;
  --steel-dark:  #34363d;

  /* Text */
  --text:        #e9eaee;
  --text-2:      #a7aab2;
  --text-3:      #717480;
  --text-4:      #4f525b;

  /* Accent — forged crimson */
  --crimson:      #e23b30;
  --crimson-hot:  #ff5347;
  --crimson-deep: #8f1a13;
  --crimson-soft: rgba(226, 59, 48, 0.14);

  /* Medals */
  --gold-hi:   #ffe9a8;  --gold:   #e9b94a;  --gold-lo:   #9c7415;
  --silver-hi: #f3f5f8;  --silver: #c6cad2;  --silver-lo: #797d87;
  --bronze-hi: #f0c79a;  --bronze: #c47f44;  --bronze-lo: #7c4a20;

  /* Lines */
  --line:        rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px -22px rgba(0,0,0,0.9);

  --maxw: 1080px;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   AMBIENT BACKGROUND
   ============================================================ */
.bg-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.bg-glow {
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(226,59,48,0.13), transparent 60%),
    radial-gradient(900px 600px at 12% 8%, rgba(120,128,150,0.10), transparent 55%),
    radial-gradient(900px 700px at 88% 14%, rgba(90,98,120,0.09), transparent 55%),
    linear-gradient(180deg, #0c0c0f 0%, #08080a 100%);
}

/* Hex "scale" texture echoing the paddle faces in the logo */
.bg-hex {
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.022' stroke-width='1'%3E%3Cpath d='M28 0l24 14v28L28 56 4 42V14z'/%3E%3Cpath d='M28 48l24 14v28L28 104 4 90V62z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 96px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 60%, transparent);
}

.bg-vignette {
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ============================================================
   SHARED LAYOUT
   ============================================================ */
main { width: 100%; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: linear-gradient(90deg, var(--crimson), transparent);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(180deg, var(--steel-hi) 0%, var(--steel) 42%, var(--steel-mid) 78%, var(--steel-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-meta {
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: right;
  letter-spacing: 0.02em;
}

/* ============================================================
   TOP NAV
   ============================================================ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(10,10,12,0.92), rgba(10,10,12,0.72) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transform: translateY(-110%);
  transition: transform 0.4s cubic-bezier(0.2,0.7,0.2,1), border-color 0.4s;
}
.topnav.is-visible {
  transform: translateY(0);
  border-bottom-color: var(--line);
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.18em;
  color: var(--steel-hi);
}
.topnav-logo { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.topnav-links { display: flex; gap: 26px; }
.topnav-links a {
  font-family: var(--font-display);
  font-weight: 500; font-size: 0.82rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-2);
  transition: color 0.2s;
}
.topnav-links a:hover { color: var(--steel-hi); }
.topnav-tag {
  font-family: var(--font-display);
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 92px 24px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-emblem {
  position: relative;
  width: clamp(190px, 34vw, 300px);
  aspect-ratio: 1 / 1.08;
  margin-bottom: 6px;
  animation: emblem-rise 1s cubic-bezier(0.2,0.8,0.2,1) both;
}
.hero-emblem::after {
  /* forge glow behind the shield */
  content: "";
  position: absolute; inset: -14% -14% -4%;
  background: radial-gradient(closest-side, rgba(226,59,48,0.22), transparent 70%);
  filter: blur(6px);
  z-index: -1;
}
.hero-emblem img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 28px rgba(0,0,0,0.7)); }

@keyframes emblem-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 16vw, 8.5rem);
  letter-spacing: 0.06em;
  line-height: 0.9;
  margin-left: 0.06em;
  background: linear-gradient(180deg, #ffffff 0%, var(--steel) 38%, var(--steel-mid) 66%, var(--steel-lo) 88%, #3c3e45 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 0 rgba(0,0,0,0.3);
  position: relative;
}
/* subtle metallic shine sweep */
.hero-wordmark::after {
  content: "JAPR";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.85) 50%, transparent 62%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 250% 100%;
  background-position: 200% 0;
  animation: shine 5.5s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes shine {
  0%, 100% { background-position: 200% 0; }
  18%, 82% { background-position: -120% 0; }
}

.hero-expand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(0.72rem, 1.7vw, 0.95rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: 14px;
}

.hero-tagline {
  max-width: 540px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: clamp(0.95rem, 2.2vw, 1.08rem);
  line-height: 1.6;
}
.hero-tagline strong { color: var(--steel-hi); font-weight: 600; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.hero-stat {
  padding: 14px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-left: 1px solid var(--line);
}
.hero-stat:first-child { border-left: none; }
.hero-stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--steel-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-stat-value.accent { color: var(--crimson-hot); }
.hero-stat-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-cta {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-hi);
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015));
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 14px 30px -18px rgba(0,0,0,0.9);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  border-color: var(--crimson);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 0 0 1px var(--crimson-soft), 0 18px 36px -18px rgba(226,59,48,0.4);
}
.hero-cta svg { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(3px);} }

/* ============================================================
   CHAMPIONS PODIUM
   ============================================================ */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  align-items: end;
  gap: 18px;
}
.plinth {
  position: relative;
  border-radius: 16px;
  padding: 22px 20px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--panel-edge);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: plinth-in 0.7s cubic-bezier(0.2,0.8,0.2,1) both;
}
.plinth::before { /* top accent line in the medal color */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--medal), transparent);
}
.plinth::after { /* radial medal glow */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, var(--medal-glow), transparent 60%);
  pointer-events: none;
}
.plinth--gold   { --medal: var(--gold);   --medal-glow: rgba(233,185,74,0.18); order: 2; transform: translateY(-14px); }
.plinth--silver { --medal: var(--silver); --medal-glow: rgba(198,202,210,0.12); order: 1; }
.plinth--bronze { --medal: var(--bronze); --medal-glow: rgba(196,127,68,0.12); order: 3; }
.plinth--gold   { animation-delay: 0.05s; }
.plinth--silver { animation-delay: 0.16s; }
.plinth--bronze { animation-delay: 0.27s; }

@keyframes plinth-in { from { opacity: 0; transform: translateY(24px);} }
.plinth--gold { animation-name: plinth-in-gold; }
@keyframes plinth-in-gold { from { opacity: 0; transform: translateY(10px);} to { opacity:1; transform: translateY(-14px);} }

.plinth-medal {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.plinth--gold .plinth-medal { font-size: 3.1rem; }
.plinth-place {
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--medal); margin-top: 8px;
}
.plinth-team {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-top: 10px;
  color: var(--steel-hi);
}
.plinth-moniker {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--medal);
  margin-top: 4px;
  opacity: 0.92;
}
.plinth-moniker::before { content: "“"; }
.plinth-moniker::after  { content: "”"; }

/* ============================================================
   LADDER
   ============================================================ */
.ladder-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 11px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line);
}
.toggle-btn {
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.25s, box-shadow 0.25s;
}
.toggle-btn.is-active {
  color: var(--steel-hi);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02));
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 6px 14px -8px rgba(0,0,0,0.8);
}
.toggle-btn:not(.is-active):hover { color: var(--text); }
.toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.search {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line);
  color: var(--text-3);
  transition: border-color 0.2s;
}
.search:focus-within { border-color: var(--steel-lo); }
.search input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 0.88rem; width: 150px;
}
.search input::placeholder { color: var(--text-4); }

.ladder-headrow {
  display: grid;
  grid-template-columns: 64px 1fr 130px 168px;
  align-items: center;
  gap: 16px;
  padding: 0 22px 10px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-4);
  border-bottom: 1px solid var(--line);
}
.lh-rating { text-align: right; }
.lh-tier { text-align: center; }

.ladder { list-style: none; margin-top: 8px; }

.fighter {
  display: grid;
  grid-template-columns: 64px 1fr 130px 168px;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.25s, background 0.25s;
  animation: fighter-in 0.5s ease both;
}
@keyframes fighter-in { from { opacity: 0; transform: translateX(-10px); } }
.fighter + .fighter { margin-top: 2px; }
.fighter::before { /* base hairline divider */
  content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 1px;
  background: var(--line);
}
.fighter:last-child::before { display: none; }

.fighter:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border-color: var(--line-strong);
}
/* metallic shine sweep on hover */
.fighter::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  background-size: 250% 100%; background-position: 200% 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.fighter:hover::after { opacity: 1; animation: sweep 0.9s ease; }
@keyframes sweep { from { background-position: 200% 0; } to { background-position: -60% 0; } }

/* Rank badge */
.f-rank { justify-self: start; }
.rank-badge {
  width: 46px; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--steel);
  position: relative;
  /* shield shape */
  clip-path: polygon(50% 0, 100% 15%, 100% 70%, 50% 100%, 0 70%, 0 15%);
  background: linear-gradient(180deg, var(--steel-dark), #17181c);
  border: 1px solid var(--line-strong);
}
.rank-badge .rk-t { font-size: 0.55rem; letter-spacing: 0.1em; color: var(--text-4); margin-bottom: -3px; }
.fighter--1 .rank-badge,
.fighter--2 .rank-badge,
.fighter--3 .rank-badge { color: #1a1206; border: none; }
.fighter--1 .rank-badge { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); box-shadow: 0 0 18px -4px rgba(233,185,74,0.5); }
.fighter--2 .rank-badge { background: linear-gradient(180deg, var(--silver-hi), var(--silver) 55%, var(--silver-lo)); }
.fighter--3 .rank-badge { background: linear-gradient(180deg, var(--bronze-hi), var(--bronze) 55%, var(--bronze-lo)); }

/* Fighter identity */
.f-fighter { display: flex; align-items: center; gap: 14px; min-width: 0; }
.monogram {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--steel-hi);
  border-radius: 11px;
  background: linear-gradient(155deg, #2c2e35, #15161a);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.fighter--1 .monogram { border-color: rgba(233,185,74,0.55); color: var(--gold-hi); }
.f-id { min-width: 0; }
.f-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.18rem; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.f-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.f-badge {
  font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold); padding: 2px 8px; border-radius: 20px;
  background: rgba(233,185,74,0.10); border: 1px solid rgba(233,185,74,0.28);
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}

/* Tier chip */
.f-tier { justify-self: center; }
.tier-chip {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 5px 14px; border-radius: 9px; min-width: 96px;
  border: 1px solid var(--tier-edge, var(--line-strong));
  background: var(--tier-bg, rgba(255,255,255,0.03));
}
.tier-letter { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--tier-fg, var(--steel)); line-height: 1; }
.tier-name { font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); margin-top: 1px; }

.tier-S { --tier-fg: var(--gold-hi); --tier-edge: rgba(233,185,74,0.4); --tier-bg: linear-gradient(180deg, rgba(233,185,74,0.12), rgba(233,185,74,0.02)); }
.tier-A { --tier-fg: var(--silver-hi); --tier-edge: rgba(198,202,210,0.32); --tier-bg: linear-gradient(180deg, rgba(198,202,210,0.10), rgba(198,202,210,0.02)); }
.tier-B { --tier-fg: var(--steel); }
.tier-C { --tier-fg: var(--steel-mid); }
.tier-D { --tier-fg: var(--text-3); }

/* Rating + bar */
.f-rating { justify-self: end; text-align: right; width: 100%; }
.rating-num {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.75rem; line-height: 1;
  color: var(--steel-hi); font-variant-numeric: tabular-nums;
}
.fighter--1 .rating-num { color: var(--gold-hi); }
.rating-empty { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-4); letter-spacing: 0.1em; }
.rating-bar {
  margin-top: 7px; height: 4px; border-radius: 3px;
  background: rgba(255,255,255,0.06); overflow: hidden;
  margin-left: auto;
}
.rating-bar > i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--steel-lo), var(--steel));
  transform-origin: left;
  animation: bar-grow 0.9s cubic-bezier(0.2,0.8,0.2,1) both;
}
.fighter--1 .rating-bar > i { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.fighter--2 .rating-bar > i { background: linear-gradient(90deg, var(--silver-lo), var(--silver-hi)); }
.fighter--3 .rating-bar > i { background: linear-gradient(90deg, var(--bronze-lo), var(--bronze-hi)); }
@keyframes bar-grow { from { transform: scaleX(0); } }

.ladder-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}
.ladder-empty strong { display: block; color: var(--steel); font-size: 1.3rem; margin-bottom: 8px; text-transform: uppercase; }

/* ============================================================
   TIMELINE / HISTORY
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--crimson), var(--steel-dark) 30%, var(--steel-dark));
}
.event { position: relative; margin-bottom: 22px; animation: fighter-in 0.5s ease both; }
.event::before {
  content: ""; position: absolute; left: -28px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--steel-mid);
  box-shadow: 0 0 0 4px var(--bg);
}
.event--flagship::before { border-color: var(--crimson); box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(226,59,48,0.6); }

.event-card {
  border-radius: 14px;
  border: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.event-card.is-flagship { border-color: rgba(226,59,48,0.4); }
.event-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.event-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.18rem;
  text-transform: uppercase; letter-spacing: 0.01em; color: var(--steel-hi);
}
.event-card.is-flagship .event-name { color: var(--crimson-hot); }
.event-date { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--text-3); text-transform: uppercase; font-family: var(--font-display); }
.event-sub { font-size: 0.74rem; color: var(--text-3); margin-top: 2px; }

.event-rows { padding: 6px 8px; }
.event-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
}
.event-row:hover { background: rgba(255,255,255,0.03); }
.er-medal { font-size: 1.2rem; text-align: center; }
.er-players { font-family: var(--font-display); font-weight: 500; font-size: 1rem; letter-spacing: 0.01em; color: var(--text); }
.er-players .er-moniker { font-family: var(--font-body); font-style: italic; font-weight: 400; font-size: 0.82rem; color: var(--text-3); margin-left: 8px; }
.er-result { display: flex; align-items: center; gap: 12px; }
.er-place { font-size: 0.82rem; color: var(--text-2); letter-spacing: 0.02em; }
.er-points {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  color: var(--steel-hi); font-variant-numeric: tabular-nums;
  min-width: 44px; text-align: right;
}
.er-points span { font-size: 0.6rem; color: var(--text-4); letter-spacing: 0.1em; display: block; font-weight: 400; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  max-width: var(--maxw);
  margin: 80px auto 0;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-mark { display: flex; align-items: center; gap: 11px; }
.footer-mark img { width: 30px; height: 30px; object-fit: contain; opacity: 0.85; }
.footer-mark span {
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3);
}
.footer-meta { font-size: 0.74rem; color: var(--text-4); text-align: right; letter-spacing: 0.03em; }

/* ============================================================
   LADDER — rich fighter detail (partner / record / diff / placement)
   ============================================================ */
.f-name {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  white-space: normal; overflow: visible; text-overflow: clip;
}
.f-place {
  font-family: var(--font-body); font-weight: 600; font-size: 0.6rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.f-place--gold   { color: var(--gold-hi);   background: rgba(233,185,74,0.12); border: 1px solid rgba(233,185,74,0.30); }
.f-place--silver { color: var(--silver-hi); background: rgba(198,202,210,0.10); border: 1px solid rgba(198,202,210,0.26); }
.f-place--bronze { color: var(--bronze-hi); background: rgba(196,127,68,0.12); border: 1px solid rgba(196,127,68,0.30); }
.f-place--neutral{ color: var(--text-3);    background: rgba(255,255,255,0.04); border: 1px solid var(--line); }

.f-sub {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  font-size: 0.8rem; color: var(--text-3); flex-wrap: wrap;
}
.fs-dot { color: var(--text-4); }
.fs-partner { color: var(--text-2); }
.fs-record { color: var(--steel); font-weight: 500; font-variant-numeric: tabular-nums; }
.fs-diff { font-variant-numeric: tabular-nums; }
.fs-diff--pos  { color: #6fbf86; }
.fs-diff--neg  { color: #cf6a60; }
.fs-diff--even { color: var(--text-3); }

.plinth-sub { font-size: 0.82rem; color: var(--text-2); margin-top: 6px; }
.plinth--gold .plinth-sub { color: var(--gold-hi); }

/* ============================================================
   TOURNAMENT — subsection headers, pools, bracket
   ============================================================ */
.subsection-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--steel);
  margin: 38px 0 16px; display: flex; align-items: baseline; gap: 10px;
}
.subsection-note {
  font-family: var(--font-body); font-weight: 400; font-size: 0.78rem;
  letter-spacing: 0.02em; text-transform: none; color: var(--text-3);
}

.pools { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pool-card {
  border: 1px solid var(--panel-edge); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  box-shadow: var(--shadow-card);
}
.pool-head {
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel-hi);
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.pool-table { width: 100%; border-collapse: collapse; }
.pool-table th {
  font-family: var(--font-display); font-weight: 500; font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4);
  text-align: left; padding: 10px 18px 8px;
}
.pool-table th:nth-child(3), .pool-table th:nth-child(4) { text-align: right; }
.pool-table td { padding: 11px 18px; border-top: 1px solid var(--line); }
.pl-rank { width: 28px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-team { font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--text); }
.pl-wl { text-align: right; font-variant-numeric: tabular-nums; color: var(--steel); }
.pl-wl span { color: var(--text-4); margin: 0 1px; }
.pl-diff { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pl-diff--pos { color: #6fbf86; } .pl-diff--neg { color: #cf6a60; } .pl-diff--even { color: var(--text-3); }
.pool-top td { background: linear-gradient(90deg, rgba(233,185,74,0.09), transparent 80%); }
.pool-top .pl-team { color: var(--gold-hi); }

.bracket-scroll { overflow-x: auto; padding-bottom: 6px; }
.bracket { display: flex; align-items: center; min-width: min-content; }
.bracket-gap { width: 28px; flex: 0 0 auto; align-self: stretch; position: relative; }
.bracket-gap::after {
  content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--line-strong);
}
.bracket-col { flex: 0 0 auto; min-width: 205px; display: flex; flex-direction: column; gap: 12px; }
.round-label {
  font-family: var(--font-display); font-weight: 500; font-size: 0.66rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); text-align: center;
}
.bracket-col-matches { display: flex; flex-direction: column; gap: 18px; justify-content: center; flex: 1; }
.match-card {
  border: 1px solid var(--panel-edge); border-radius: 11px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  box-shadow: var(--shadow-card);
}
.match-team { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; }
.match-team + .match-team { border-top: 1px solid var(--line); }
.mt-name { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.01em; color: var(--text-2); }
.mt-score { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.mt-winner .mt-name, .mt-winner .mt-score { color: var(--steel-hi); }
.mt-loser { opacity: 0.5; }
.match-card--final { border-color: rgba(233,185,74,0.45); box-shadow: 0 0 24px -6px rgba(233,185,74,0.4), var(--shadow-card); }
.match-card--final .mt-winner .mt-name, .match-card--final .mt-winner .mt-score { color: var(--gold-hi); }
.bracket-col--final .round-label { color: var(--gold); }
.bracket-col--third .round-label { color: var(--bronze); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .topnav-links { display: none; }
  .topnav-tag { display: none; }

  .ladder-headrow { grid-template-columns: 44px 1fr 84px; }
  .ladder-headrow .lh-tier { display: none; }
  .fighter { grid-template-columns: 44px 1fr 84px; gap: 12px; padding: 12px 14px; }
  .fighter::before { left: 14px; right: 14px; }
  .f-tier { display: none; }
  .rank-badge { width: 38px; height: 42px; font-size: 1.1rem; }
  .monogram { width: 38px; height: 38px; font-size: 0.9rem; }
  .f-name { font-size: 1rem; }
  .rating-num { font-size: 1.4rem; }

  .podium { grid-template-columns: 1fr; gap: 12px; }
  .plinth--gold, .plinth--silver, .plinth--bronze { order: initial; transform: none; }
  .plinth--gold { animation-name: plinth-in; }

  .section { padding-top: 52px; }
  .hero { padding-top: 70px; }
  .section-meta { text-align: left; }

  .pools { grid-template-columns: 1fr; }
  .subsection-title { margin-top: 28px; }

  /* Stack the bracket vertically on phones so the Final/champion is in the
     normal scroll flow instead of off-screen behind a horizontal scroll. */
  .bracket { flex-direction: column; align-items: stretch; gap: 16px; }
  .bracket-col { min-width: 0; width: 100%; }
  .bracket-col-matches { gap: 12px; }
  .bracket-gap { display: none; }
}

@media (max-width: 460px) {
  .hero-stat { padding: 12px 16px; }
  .search input { width: 110px; }
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; transition: none !important; }
}
