/* ==========================================================
   EAS — Time Bomb Duel League
   Design tokens
   ========================================================== */
:root {
  --bg-void: #0a0a12;
  --bg-panel: #14131f;
  --bg-panel-raised: #1c1a2b;

  --fuse-orange: #ff5c1a;
  --fuse-red: #ff2d55;
  --spark-cyan: #2ce8ff;
  --pixel-yellow: #ffd23f;

  --text-primary: #f0eef7;
  --text-muted: #8b899e;
  --line: #2a2838;

  --font-display: 'Orbitron', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Rajdhani', sans-serif;

  --container: 1180px;
  --radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================
   Reset & base
   ========================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
input { font-family: inherit; }
img, svg { display: block; max-width: 100%; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--spark-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.container, .header-inner, .footer-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ambient overlays */
.scanline-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 61;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* eyebrow / section labels */
.eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--spark-cyan);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.pixel-tag {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--pixel-yellow);
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  margin-right: 8px;
  vertical-align: middle;
}

.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: 0.01em; }
.section-sub { margin-top: 12px; color: var(--text-muted); font-size: 1.05rem; }

section { padding: 88px 0; }
section .container { max-width: var(--container); }
.leaderboard-section, .how-it-works, .comms { padding-left: 32px; padding-right: 32px; }
.leaderboard-section, .how-it-works, .comms { max-width: var(--container); margin: 0 auto; }

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--fuse-orange), #ff8a3d);
  color: #140c06;
  box-shadow: 0 0 0 rgba(255, 92, 26, 0);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(255, 92, 26, 0.65); }

.btn-outline {
  background: transparent;
  border-color: var(--spark-cyan);
  color: var(--spark-cyan);
}
.btn-outline:hover { background: rgba(44, 232, 255, 0.1); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.btn-ghost:hover { border-color: var(--fuse-orange); color: var(--fuse-orange); }

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 18, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  height: 76px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-shadow: 0 0 18px rgba(255, 92, 26, 0.35);
}
.wordmark-bracket { color: var(--fuse-orange); }

.main-nav { display: flex; align-items: center; gap: 28px; margin-right: auto; }
.main-nav a {
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.15s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--fuse-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.main-nav a:hover { color: var(--text-primary); }
.main-nav a:hover::after { transform: scaleX(1); }

.header-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 72px 32px 56px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 24px;
  min-height: 78vh;
}
.hero-title {
  font-size: clamp(3.6rem, 11vw, 7.2rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(255, 92, 26, 0.28), 0 0 90px rgba(44, 232, 255, 0.08);
  margin: 6px 0 18px;
}
.hero-title-bracket { color: var(--fuse-orange); }

/* ==========================================================
   Interactive hex background
   ========================================================== */
#hex-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
body > *:not(#hex-canvas):not(.scanline-overlay):not(.grain-overlay) { position: relative; z-index: 1; }

/* ==========================================================
   Background audio toggle
   ========================================================== */
.audio-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.audio-toggle.available { display: flex; }
.audio-toggle:hover { color: var(--fuse-orange); border-color: var(--fuse-orange); transform: translateY(-2px); }
.audio-toggle.playing { color: var(--fuse-orange); border-color: var(--fuse-orange); }
.hero-sub {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--text-muted);
  max-width: 34ch;
  font-weight: 500;
}
.hero-actions { display: flex; gap: 16px; margin: 32px 0 22px; flex-wrap: wrap; }
.hero-note { color: var(--text-muted); font-size: 0.92rem; display: flex; align-items: center; }

.hero-fuse { width: 100%; }
#fuse-svg { width: 100%; height: auto; overflow: visible; }

.bomb-halo { opacity: 0; transition: opacity 1.2s ease; }
.hero-fuse.armed .bomb-halo { opacity: 1; animation: halo-pulse 2.6s ease-in-out infinite; }

.fuse-path-lit {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  filter: drop-shadow(0 0 6px rgba(255, 92, 26, 0.8));
  animation: burn 1.7s ease-in forwards;
}
.spark {
  offset-path: path("M160,108 C186,86 168,52 214,34 C252,19 274,44 300,26");
  offset-rotate: auto;
  filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.95));
  animation: spark-travel 1.7s ease-in forwards;
}
.bomb-body { transition: stroke 0.6s ease; }
.hero-fuse.armed .bomb-body { stroke: var(--fuse-orange); }

@keyframes burn { to { stroke-dashoffset: 0; } }
@keyframes spark-travel {
  from { offset-distance: 0%; opacity: 1; }
  92% { opacity: 1; }
  to { offset-distance: 100%; opacity: 0; }
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .fuse-path-lit { stroke-dashoffset: 0; animation: none; }
  .spark { display: none; }
  .bomb-halo { opacity: 0.6; animation: none; }
  .bomb-body { stroke: var(--fuse-orange); }
}

/* section-connecting fuse divider */
.fuse-divider {
  position: relative;
  height: 2px;
  max-width: var(--container);
  margin: 0 auto;
  background: linear-gradient(to right, transparent, var(--line) 15%, var(--line) 85%, transparent);
}
.fuse-spark-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--pixel-yellow);
  box-shadow: 0 0 10px 2px rgba(255, 210, 63, 0.8);
  animation: travel 7s linear infinite;
}
@keyframes travel {
  0% { left: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ==========================================================
   Blast strip (stats)
   ========================================================== */
.blast-strip {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat-value {
  font-family: var(--font-pixel);
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  color: var(--pixel-yellow);
  text-shadow: 0 0 22px rgba(255, 210, 63, 0.35);
}
.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ==========================================================
   Leaderboard
   ========================================================== */
.leaderboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tab-group { display: flex; gap: 10px; }
.tab {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { border-color: var(--spark-cyan); color: var(--text-primary); }
.tab.active {
  background: linear-gradient(135deg, var(--fuse-orange), #ff8a3d);
  color: #140c06;
  border-color: transparent;
}

.search-wrap input {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 999px;
  min-width: 220px;
  font-size: 0.95rem;
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { border-color: var(--spark-cyan); outline: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel); }
.leaderboard-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.leaderboard-table thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.leaderboard-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.leaderboard-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr { transition: background 0.15s ease; border-left: 3px solid transparent; }
.leaderboard-table tbody tr:hover { background: var(--bg-panel-raised); }
.leaderboard-table tbody tr.tier-1 { border-left-color: var(--pixel-yellow); }
.leaderboard-table tbody tr.tier-2, .leaderboard-table tbody tr.tier-3 { border-left-color: var(--spark-cyan); }

.rank-cell { font-family: var(--font-pixel); font-size: 0.85rem; color: var(--text-muted); }
.tier-1 .rank-cell { color: var(--pixel-yellow); }
.tier-2 .rank-cell, .tier-3 .rank-cell { color: var(--spark-cyan); }

.duelist-cell { display: flex; align-items: center; gap: 12px; }
.avatar-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: #100f19;
  flex-shrink: 0;
}
.duelist-name { font-weight: 700; }

.badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  padding: 5px 8px;
  border-radius: 5px;
}
.badge-win { background: rgba(44, 232, 255, 0.12); color: var(--spark-cyan); }
.badge-loss { background: rgba(255, 45, 85, 0.12); color: var(--fuse-red); }

.elo-cell { font-variant-numeric: tabular-nums; font-family: var(--font-body); font-weight: 800; font-size: 1.05rem; }
.trend-cell { font-size: 1.1rem; }
.trend-up { color: var(--spark-cyan); }
.trend-down { color: var(--fuse-red); }
.trend-flat { color: var(--text-muted); }

.form-cell { display: flex; gap: 4px; }
.form-pip {
  width: 20px; height: 20px;
  border-radius: 5px;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  display: flex; align-items: center; justify-content: center;
}
.form-pip.w { background: rgba(44, 232, 255, 0.15); color: var(--spark-cyan); }
.form-pip.l { background: rgba(255, 45, 85, 0.15); color: var(--fuse-red); }

.no-results { padding: 32px 18px; text-align: center; color: var(--text-muted); }

.demo-flag { margin-top: 18px; color: var(--text-muted); font-size: 0.85rem; font-style: italic; }
.demo-flag code {
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  background: var(--bg-panel-raised);
  padding: 2px 6px;
  border-radius: 4px;
  font-style: normal;
}

/* ==========================================================
   How it works
   ========================================================== */
.round-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.round-steps li {
  position: relative;
  background: var(--bg-panel);
  padding: 34px 26px 30px;
  overflow: hidden;
}
.step-index {
  position: absolute;
  top: -6px;
  right: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4.6rem;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
}
.round-steps h3 { position: relative; font-size: 1.15rem; margin-bottom: 10px; color: var(--fuse-orange); }
.round-steps p { position: relative; color: var(--text-muted); font-size: 0.98rem; }

/* ==========================================================
   Comms / Discord
   ========================================================== */
.comms-panel {
  background: radial-gradient(circle at 20% 0%, rgba(255, 92, 26, 0.08), transparent 55%), var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 56px;
  max-width: 720px;
}
.comms-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--spark-cyan);
  box-shadow: 0 0 10px 2px rgba(44, 232, 255, 0.7);
  animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.comms-label { font-family: var(--font-pixel); font-size: 0.6rem; letter-spacing: 0.06em; color: var(--spark-cyan); text-transform: uppercase; }

.comms-panel h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 14px; max-width: 20ch; }
.comms-copy { color: var(--text-muted); max-width: 52ch; margin-bottom: 30px; }

.comms-stats { display: flex; gap: 40px; margin-bottom: 30px; }
.comms-stats strong { display: block; font-family: var(--font-pixel); font-size: 1.4rem; color: var(--pixel-yellow); margin-bottom: 6px; }
.comms-stats span { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

.demo-flag-light { margin-top: 22px; opacity: 0.8; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.footer-wordmark { font-size: 1.05rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; }
.footer-sitemap { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col-title {
  font-family: var(--font-pixel); font-size: 0.55rem;
  color: var(--spark-cyan); text-transform: uppercase;
  margin-bottom: 4px;
}
.footer-col a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--text-primary); }

/* ==========================================================
   Page header (secondary pages)
   ========================================================== */
.page-header {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 32px 8px;
}
.page-header h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  font-weight: 900;
  margin: 10px 0 14px;
}
.page-header p { color: var(--text-muted); max-width: 60ch; font-size: 1.05rem; }

.empty-state { color: var(--text-muted); font-style: italic; padding: 18px 0; }

.about-copy { display: flex; flex-direction: column; gap: 16px; max-width: 68ch; }
.about-copy p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }
.about-copy p:first-child { color: var(--text-primary); font-size: 1.15rem; }

/* ==========================================================
   Scroll-reveal (used across every page's card grids)
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.rules-list > .reveal:nth-child(1) { transition-delay: 0ms; }
.rules-list > .reveal:nth-child(2) { transition-delay: 70ms; }
.rules-list > .reveal:nth-child(3) { transition-delay: 140ms; }
.rules-list > .reveal:nth-child(4) { transition-delay: 210ms; }
.rules-list > .reveal:nth-child(5) { transition-delay: 280ms; }
.rules-list > .reveal:nth-child(6) { transition-delay: 350ms; }

.links-featured > .reveal:nth-child(1) { transition-delay: 0ms; }
.links-featured > .reveal:nth-child(2) { transition-delay: 90ms; }

.main-nav a.nav-current { color: var(--text-primary); }
.main-nav a.nav-current::after { transform: scaleX(1); }

/* ==========================================================
   Rank badges
   ========================================================== */
.rank-badge {
  --rank-color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--rank-color);
  background: var(--bg-panel-raised);
  color: var(--rank-color);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: 0.6rem; font-weight: 700;
  text-shadow: 0 0 8px currentColor;
  overflow: hidden;
  flex-shrink: 0;
}
.rank-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rank-badge-lg { width: 52px; height: 52px; font-size: 0.85rem; }
.rank-badge-sm { width: 26px; height: 26px; font-size: 0.55rem; }

.rank-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.rank-tier-chip {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.rank-tier-name { font-weight: 700; }

/* ==========================================================
   Team cards
   ========================================================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.team-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.team-card:hover { border-color: var(--spark-cyan); transform: translateY(-3px); }
.team-crest {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  color: #100f19;
}
.team-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.team-owner { color: var(--text-muted); font-size: 0.92rem; }
.team-owner-label {
  font-family: var(--font-pixel); font-size: 0.55rem;
  color: var(--text-muted); text-transform: uppercase;
  margin-right: 8px;
}
.team-formerly {
  align-self: flex-start;
  font-family: var(--font-pixel); font-size: 0.55rem;
  color: var(--pixel-yellow);
  background: rgba(255, 210, 63, 0.08);
  border: 1px solid rgba(255, 210, 63, 0.3);
  padding: 4px 7px; border-radius: 4px;
}

/* ==========================================================
   Retired players
   ========================================================== */
.retired-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.retired-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  opacity: 0.82;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}
.retired-card:hover { border-color: var(--line); opacity: 1; }
.avatar-muted { filter: grayscale(0.4); }
.retired-meta { color: var(--spark-cyan); font-size: 0.82rem; margin: 4px 0 8px; }
.retired-note { color: var(--text-muted); font-size: 0.92rem; }

/* ==========================================================
   Partnerships
   ========================================================== */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 32px; }
.partner-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.partner-card:hover { border-color: var(--spark-cyan); transform: translateY(-3px); }
.partner-type {
  font-family: var(--font-pixel); font-size: 0.55rem; color: var(--spark-cyan);
  text-transform: uppercase; margin-bottom: 10px;
}
.partner-name { font-family: var(--font-display); font-weight: 800; margin-bottom: 8px; }
.partner-blurb { color: var(--text-muted); font-size: 0.92rem; }
.partner-cta {
  background: var(--bg-panel-raised);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

/* ==========================================================
   News
   ========================================================== */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.news-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.news-card:hover { border-color: var(--spark-cyan); transform: translateY(-3px); }
.news-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.news-badge {
  font-family: var(--font-pixel); font-size: 0.55rem;
  padding: 5px 8px; border-radius: 5px; text-transform: uppercase;
}
.news-badge-announcement { background: rgba(255, 92, 26, 0.12); color: var(--fuse-orange); }
.news-badge-ota { background: rgba(44, 232, 255, 0.12); color: var(--spark-cyan); }
.news-date { color: var(--text-muted); font-size: 0.8rem; }
.news-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.news-card p:last-child { color: var(--text-muted); font-size: 0.94rem; }

/* ==========================================================
   Community spotlight
   ========================================================== */
.spotlight-subhead { margin: 48px 0 20px; }
.spotlight-subhead:first-of-type { margin-top: 0; }
.spotlight-subhead h3 { font-family: var(--font-display); font-size: 1.3rem; }

.clip-grid, .art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.clip-card, .art-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.clip-card:hover, .art-card:hover { border-color: var(--spark-cyan); transform: translateY(-3px); }
.clip-card:hover .clip-play { transform: scale(1.15); }
.clip-play { transition: transform 0.15s ease; }
.clip-thumb, .art-thumb {
  height: 130px;
  background: var(--bg-panel-raised);
  display: flex; align-items: center; justify-content: center;
}
.clip-play { font-size: 1.6rem; color: var(--fuse-orange); }
.clip-title, .art-title { font-weight: 700; margin: 14px 16px 4px; }
.clip-meta, .art-meta { color: var(--spark-cyan); font-size: 0.82rem; margin: 0 16px 8px; }
.clip-note, .art-note { color: var(--text-muted); font-size: 0.88rem; margin: 0 16px 16px; }

/* ==========================================================
   League links
   ========================================================== */
.links-featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 40px; }
.link-feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-feature-card:hover { border-color: var(--spark-cyan); transform: translateY(-3px); }
.link-feature-card h3 { font-size: 1.1rem; }
.link-feature-card p { color: var(--text-muted); font-size: 0.92rem; }

.documents-list { display: flex; flex-direction: column; gap: 8px; }
.document-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}
.document-row:hover { border-color: var(--spark-cyan); }
.document-row:hover .document-arrow { transform: translateX(4px); }
.document-arrow { color: var(--spark-cyan); display: inline-block; transition: transform 0.15s ease; }

/* ==========================================================
   Rules page
   ========================================================== */
.rules-list { display: flex; flex-direction: column; gap: 16px; }
.rule-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.rule-card.rule-critical { border-color: rgba(255, 45, 85, 0.5); background: radial-gradient(circle at 0% 0%, rgba(255, 45, 85, 0.08), transparent 60%), var(--bg-panel); }
.rule-card h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--fuse-orange); }
.rule-card.rule-critical h3 { color: var(--fuse-red); }
.rule-card ul { display: flex; flex-direction: column; gap: 8px; }
.rule-card li { color: var(--text-muted); font-size: 0.96rem; padding-left: 18px; position: relative; }
.rule-card li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fuse-orange);
}
.rule-card.rule-critical li::before { background: var(--fuse-red); }

/* ==========================================================
   Admin panel
   ========================================================== */
.admin-body { overflow: hidden; }

/* ---- login gate ---- */
.admin-gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.admin-login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-wordmark { font-size: 1.5rem; margin-bottom: 6px; }
.admin-login-card h2 { font-size: 1.4rem; }
.admin-login-card p { color: var(--text-muted); font-size: 0.95rem; }
.admin-gate-error { color: var(--fuse-red); font-size: 0.88rem; }
.login-back { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
.login-back:hover { color: var(--fuse-orange); }

/* ---- three-column shell ---- */
.panel-shell {
  display: grid;
  grid-template-columns: 210px 340px 1fr;
  height: 100vh;
}

/* ---- sidebar ---- */
.panel-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
}
.panel-brand { padding: 0 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.panel-brand .wordmark { font-size: 1.2rem; }
.panel-brand-tag {
  font-family: var(--font-pixel); font-size: 0.5rem;
  color: var(--text-muted); text-transform: uppercase;
}
.panel-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.panel-nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.panel-nav-item:hover { background: var(--bg-panel-raised); color: var(--text-primary); }
.panel-nav-item.active { background: var(--bg-panel-raised); color: var(--fuse-orange); }
.panel-nav-icon { width: 18px; text-align: center; font-size: 0.9rem; }

.panel-sidebar-foot {
  margin-top: auto;
  padding: 22px 22px 0;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line);
}
.panel-user { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; }
.panel-user strong { color: var(--text-primary); word-break: break-all; }
.panel-foot-link { color: var(--text-muted); font-size: 0.85rem; }
.panel-foot-link:hover { color: var(--fuse-orange); }
.panel-sidebar-foot .btn-text-danger { text-align: left; padding: 0; }

/* ---- editor column ---- */
.panel-editor {
  overflow-y: auto;
  padding: 28px 24px 60px;
  border-right: 1px solid var(--line);
  background: rgba(20, 19, 31, 0.4);
}
.panel-view-head { margin-bottom: 26px; }
.panel-view-head h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 8px; }
.panel-view-head p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.panel-view-head code {
  font-family: var(--font-pixel); font-size: 0.65rem;
  background: var(--bg-panel-raised); padding: 2px 6px; border-radius: 4px;
}

.panel-search {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 18px;
}
.panel-search:focus { border-color: var(--spark-cyan); outline: none; }

/* ---- layout view ---- */
.page-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.page-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.page-chip:hover { border-color: var(--spark-cyan); color: var(--text-primary); }
.page-chip.active {
  background: linear-gradient(135deg, var(--fuse-orange), #ff8a3d);
  color: #140c06; border-color: transparent;
}

.layout-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: grab;
  transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}
.layout-row:hover { border-color: var(--spark-cyan); }
.layout-row.dragging { opacity: 0.45; cursor: grabbing; transform: scale(0.99); }
.layout-row.is-hidden { opacity: 0.45; }
.layout-row.is-hidden .layout-name { text-decoration: line-through; }
.layout-grip { color: var(--text-muted); font-size: 1.1rem; letter-spacing: -2px; }
.layout-name { flex: 1; font-weight: 600; font-size: 0.95rem; }
.layout-eye {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 4px 6px; border-radius: 6px;
  transition: background 0.15s ease;
}
.layout-eye:hover { background: var(--bg-panel-raised); }

/* ---- live preview column ---- */
.panel-preview {
  background: var(--bg-void);
  display: flex; flex-direction: column;
  padding: 14px 18px 18px;
  overflow: hidden;
  position: relative;
}
.preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.preview-label {
  font-family: var(--font-pixel); font-size: 0.5rem;
  color: var(--spark-cyan); text-transform: uppercase;
}
.preview-hint { color: var(--text-muted); font-size: 0.78rem; margin-right: auto; }
.preview-select {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.preview-refresh {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 6px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.preview-refresh:hover { color: var(--fuse-orange); border-color: var(--fuse-orange); }

.preview-frame-wrap {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  background: var(--bg-void);
  position: relative;
  min-height: 0;
}
/* The iframe renders at full desktop width, then scales to fit the
   available space — so the preview shows the real desktop layout
   rather than the mobile one a narrow frame would trigger. The scale
   factor is set by JS in setupPreviewScale(). */
#preview-frame {
  width: 1440px;
  border: 0;
  transform-origin: top left;
  position: absolute;
  top: 0; left: 0;
  background: var(--bg-void);
}

/* ---- shared admin form bits ---- */
.admin-form { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="url"],
.form-row select,
.form-row textarea {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.98rem;
  font-family: inherit;
}
.form-row textarea { resize: vertical; min-height: 110px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--spark-cyan); outline: none; }
.form-row input[type="range"] { accent-color: var(--fuse-orange); }

.admin-list { margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.admin-list-tag {
  font-family: var(--font-pixel); font-size: 0.5rem;
  color: var(--spark-cyan); margin-left: 8px; text-transform: uppercase;
}

.admin-rank-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.admin-rank-row:last-child { border-bottom: none; }
.admin-rank-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-rank-name { font-weight: 700; min-width: 130px; }
.admin-upload-btn { cursor: pointer; padding: 9px 18px; font-size: 0.88rem; }
.btn-text-danger {
  background: none; border: none; color: var(--fuse-red);
  font-size: 0.85rem; cursor: pointer; text-decoration: underline;
  font-family: inherit;
}
.admin-btn-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.audio-current { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

/* ---- site text editor ---- */
.text-group {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.text-group summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  transition: color 0.15s ease;
}
.text-group summary::-webkit-details-marker { display: none; }
.text-group summary::before { content: "▸ "; color: var(--fuse-orange); }
.text-group[open] summary::before { content: "▾ "; }
.text-group summary:hover { color: var(--fuse-orange); }
.text-group-body {
  padding: 4px 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--line);
}
.text-group-body input[type="text"],
.text-group-body textarea {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.94rem;
  font-family: inherit;
  resize: vertical;
}
.text-group-body input:focus, .text-group-body textarea:focus { border-color: var(--spark-cyan); outline: none; }

/* ---- save confirmation ---- */
.save-flash {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translate(-50%, 20px);
  background: var(--fuse-orange);
  color: #140c06;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 70;
}
.save-flash.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- panel responsive: drop the preview, then the sidebar ---- */
@media (max-width: 1180px) {
  .panel-shell { grid-template-columns: 190px 300px 1fr; }
}
@media (max-width: 980px) {
  .panel-shell { grid-template-columns: 190px 1fr; }
  .panel-preview { display: none; }
}
@media (max-width: 820px) {
  .admin-body { overflow: auto; }
  .panel-shell { grid-template-columns: 1fr; height: auto; }
  .panel-sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .panel-nav { flex-direction: row; flex-wrap: wrap; }
  .panel-nav-item { width: auto; }
  .panel-sidebar-foot { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .panel-editor { padding: 24px 20px 60px; }
}

/* ==========================================================
   Page transition — detonation wipe
   ========================================================== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.page-transition.pt-active { opacity: 1; visibility: visible; pointer-events: all; }

/* two shutters that slam closed, then peel back open */
.pt-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: linear-gradient(180deg, #12111c 0%, #0a0a12 100%);
  transform: scaleY(0);
}
.pt-panel-top { top: 0; transform-origin: top; }
.pt-panel-bottom { bottom: 0; transform-origin: bottom; }

/* white-hot flash at the moment of detonation */
.pt-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fff6e0 0%, var(--fuse-orange) 32%, transparent 70%);
  opacity: 0;
}

/* expanding shockwave ring */
.pt-shock {
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid var(--pixel-yellow);
  opacity: 0;
}

/* ---- leaving: detonate ---- */
.pt-out .pt-flash  { animation: pt-flash-out 620ms ease-out forwards; }
.pt-out .pt-shock  { animation: pt-shock-out 620ms cubic-bezier(.2,.7,.3,1) forwards; }
.pt-out .pt-panel  { animation: pt-close 620ms cubic-bezier(.7,0,.3,1) forwards; }

@keyframes pt-flash-out {
  0%   { opacity: 0; transform: scale(0.2); }
  18%  { opacity: 0.95; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(2.4); }
}
@keyframes pt-shock-out {
  0%   { opacity: 0; transform: scale(0.2); border-width: 5px; }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: scale(38); border-width: 0.5px; }
}
@keyframes pt-close {
  0%   { transform: scaleY(0); }
  55%  { transform: scaleY(1); }
  100% { transform: scaleY(1); }
}

/* ---- arriving: blast clears ---- */
.pt-in .pt-panel { animation: pt-open 700ms cubic-bezier(.6,0,.2,1) forwards; }
.pt-in .pt-flash { animation: pt-flash-in 460ms ease-out forwards; }

@keyframes pt-open {
  0%   { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}
@keyframes pt-flash-in {
  0%   { opacity: 0.55; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(2.6); }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition { display: none; }
}

/* ==========================================================
   Interface sound toggle
   ========================================================== */
.sfx-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease, bottom 0.2s ease;
}
/* When background music is loaded, its ♪ button takes the bottom slot
   and this one stacks above it. */
body.has-music-toggle .sfx-toggle { bottom: 74px; }
.sfx-toggle:hover { color: var(--fuse-orange); border-color: var(--fuse-orange); transform: translateY(-2px); }
.sfx-toggle.muted { opacity: 0.5; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: 44px; min-height: unset; }
  .hero-fuse { max-width: 340px; margin: 40px auto 0; }
  .blast-strip { grid-template-columns: repeat(2, 1fr); }
  .round-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 76px;
    left: 0; right: 0;
    background: var(--bg-void);
    border-bottom: 1px solid var(--line);
    padding: 20px 32px 28px;
    gap: 18px;
  }
  .site-header.nav-open .header-cta { margin-top: 4px; }
  .hero { padding-left: 24px; padding-right: 24px; }
  .header-inner, .footer-inner, .leaderboard-section, .how-it-works, .comms { padding-left: 24px; padding-right: 24px; }
  .blast-strip { padding-left: 24px; padding-right: 24px; }
  .round-steps { grid-template-columns: 1fr; }
  .comms-panel { padding: 36px 26px; }
  .comms-stats { gap: 28px; }
}

@media (max-width: 520px) {
  .blast-strip { grid-template-columns: 1fr 1fr; gap: 32px 16px; }
  .leaderboard-controls { align-items: stretch; }
  .search-wrap input { width: 100%; }
  .footer-sitemap { gap: 32px; }
  .admin-rank-row { flex-direction: column; align-items: flex-start; }
  .retired-card { flex-direction: column; }
}

/* ==========================================================
   Visual builder — in-page edit mode (inside preview iframe)
   ========================================================== */
.eas-edit-mode { cursor: default; }
.eas-edit-mode a, .eas-edit-mode button { cursor: pointer; }

.eas-hover-box, .eas-select-box {
  position: absolute;
  pointer-events: none;
  z-index: 9998;
  display: none;
  border-radius: 3px;
}
.eas-hover-box { border: 1px dashed rgba(44, 232, 255, 0.8); background: rgba(44, 232, 255, 0.06); }
.eas-select-box { border: 2px solid var(--fuse-orange); background: rgba(255, 92, 26, 0.08); z-index: 9999; }

[data-eas-selected] { outline: none; }

[contenteditable="true"] {
  outline: 2px solid var(--pixel-yellow) !important;
  outline-offset: 2px;
  background: rgba(255, 210, 63, 0.06);
  cursor: text;
}

.eas-drop-active {
  outline: 3px dashed var(--spark-cyan) !important;
  outline-offset: -6px;
  background: rgba(44, 232, 255, 0.05);
}

/* ==========================================================
   Custom blocks added from the builder
   ========================================================== */
.custom-blocks { max-width: var(--container); margin: 0 auto; padding: 12px 0 0; }
.cb-heading { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin: 22px 0 10px; }
.cb-paragraph { color: var(--text-muted); font-size: 1rem; margin: 10px 0; max-width: 68ch; }
.cb-button { margin: 14px 0; }
.cb-divider { height: 1px; background: var(--line); margin: 26px 0; }
.cb-spacer { height: 40px; }
.cb-note {
  background: var(--bg-panel);
  border-left: 3px solid var(--fuse-orange);
  border-radius: 6px;
  padding: 16px 20px;
  color: var(--text-muted);
  margin: 18px 0;
  max-width: 68ch;
}

/* ==========================================================
   Builder palette + block list (admin side)
   ========================================================== */
.builder-sublabel {
  font-family: var(--font-pixel); font-size: 0.5rem;
  color: var(--spark-cyan); text-transform: uppercase;
  margin: 26px 0 12px;
}
.builder-sublabel:first-of-type { margin-top: 0; }

.block-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: grab;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.palette-item:hover { border-color: var(--spark-cyan); transform: translateY(-2px); }
.palette-item.dragging { opacity: 0.5; cursor: grabbing; }
.palette-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel-raised);
  border-radius: 6px;
  color: var(--fuse-orange);
  font-weight: 700;
  flex-shrink: 0;
}

.block-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 6px;
}
.block-row-type {
  font-weight: 700; font-size: 0.9rem; text-transform: capitalize;
}
.block-row-where { color: var(--text-muted); font-size: 0.82rem; margin-right: auto; }
.block-remove {
  background: none; border: none;
  color: var(--fuse-red);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 7px;
  border-radius: 5px;
  transition: background 0.15s ease;
}
.block-remove:hover { background: rgba(255, 45, 85, 0.12); }

/* ==========================================================
   Style inspector
   ========================================================== */
.inspector-float {
  position: absolute;
  top: 62px; right: 30px;
  width: 300px;
  max-height: calc(100vh - 100px);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  z-index: 20;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.inspector-float.is-empty { width: 232px; }
.inspector {
  padding: 16px;
  overflow-y: auto;
}
.inspector-empty { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 20px 10px; line-height: 1.6; }
.inspector-empty-icon { font-size: 1.6rem; color: var(--line); margin-bottom: 8px; }
.inspector-empty strong { color: var(--text-primary); }

.inspector-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.inspector-tag {
  font-family: var(--font-pixel); font-size: 0.5rem;
  background: var(--bg-panel-raised);
  color: var(--fuse-orange);
  padding: 6px 9px; border-radius: 5px;
  margin-right: auto;
  word-break: break-all;
}
.inspector-hint { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 12px; }

.inspector-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.inspector-row { display: flex; flex-direction: column; gap: 4px; }
.inspector-row label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.inspector-row input[type="number"], .inspector-row select {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}
.inspector-row input:focus, .inspector-row select:focus { border-color: var(--spark-cyan); outline: none; }
.inspector-color { display: flex; align-items: center; gap: 6px; }
.inspector-color input[type="color"] {
  width: 100%; height: 31px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}
.inspector-clear {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  flex-shrink: 0;
}
.inspector-clear:hover { color: var(--fuse-orange); }
.inspector-reset { width: 100%; margin-top: 14px; padding: 9px; font-size: 0.85rem; }

/* sidebar nav grouping */
.panel-nav-group {
  font-family: var(--font-pixel); font-size: 0.45rem;
  color: var(--text-muted); text-transform: uppercase;
  padding: 16px 14px 6px;
}
.panel-nav-group:first-child { padding-top: 0; }



/* ==========================================================
   Builder responsive — appended last so these override the
   base definitions above rather than being overridden by them.
   ========================================================== */
@media (max-width: 1180px) {
  .inspector-float { width: 260px; right: 20px; top: 58px; }
  .inspector-float.is-empty { width: 210px; }
  .preview-hint { display: none; }
}
@media (max-width: 980px) {
  .inspector-float { display: none; }
}

/* ==========================================================
   Player avatars & team crests with real images
   ========================================================== */
.avatar-photo { padding: 0; overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.team-crest-photo { padding: 0; overflow: hidden; background: var(--bg-panel-raised); }
.team-crest-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-crest { width: 44px; height: 44px; font-size: 0.9rem; flex-shrink: 0; }

/* ==========================================================
   Clip of the Month submission form
   ========================================================== */
.clip-form {
  display: flex; flex-direction: column; gap: 18px;
  max-width: 640px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}
.clip-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.clip-form .form-row label { font-size: 0.88rem; color: var(--text-primary); font-weight: 600; }
.label-hint { color: var(--text-muted); font-weight: 400; font-size: 0.82rem; }
.clip-form input[type="text"],
.clip-form input[type="url"],
.clip-form textarea {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.98rem;
  font-family: inherit;
  resize: vertical;
}
.clip-form input:focus, .clip-form textarea:focus { border-color: var(--spark-cyan); outline: none; }

.clip-file-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.clip-file-btn { cursor: pointer; padding: 10px 20px; font-size: 0.9rem; }
.clip-file-name { color: var(--text-muted); font-size: 0.88rem; }

.clip-status { font-size: 0.9rem; min-height: 1.2em; }
.clip-status.error { color: var(--fuse-red); }
.clip-status.success { color: var(--spark-cyan); }

@media (max-width: 640px) {
  .clip-form-grid { grid-template-columns: 1fr; }
  .clip-form { padding: 22px; }
}

/* ==========================================================
   Admin: managed rows, setup steps, warning notes
   ========================================================== */
.managed-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.managed-title { flex: 1; font-size: 0.88rem; font-weight: 600; }

.setup-steps { margin-bottom: 22px; }
.setup-list { counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.setup-list li {
  counter-increment: step;
  position: relative;
  padding-left: 30px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.setup-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  background: var(--bg-panel-raised);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: 0.5rem;
  color: var(--fuse-orange);
}
.setup-list strong { color: var(--text-primary); }

.warn-note {
  margin-top: 24px;
  background: rgba(255, 210, 63, 0.07);
  border: 1px solid rgba(255, 210, 63, 0.3);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}
.warn-note strong { color: var(--pixel-yellow); }

/* ==========================================================
   API connections reference
   ========================================================== */
.api-legend {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 20px;
  line-height: 2;
}
.api-legend .api-status { margin-left: 8px; }
.api-legend .api-status:first-child { margin-left: 0; }

.api-status {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.api-status.live  { background: rgba(61, 220, 132, 0.14); color: #3ddc84; }
.api-status.setup { background: rgba(255, 210, 63, 0.14); color: var(--pixel-yellow); }
.api-status.code  { background: rgba(138, 125, 255, 0.16); color: #a99cff; }

.api-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.api-card summary {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}
.api-card summary::-webkit-details-marker { display: none; }
.api-card summary:hover { background: var(--bg-panel-raised); }
.api-title { font-weight: 700; font-size: 0.92rem; }
.api-card[open] summary { border-bottom: 1px solid var(--line); }

.api-body { padding: 16px 15px 18px; }
.api-summary { color: var(--text-primary); font-size: 0.88rem; margin-bottom: 10px; line-height: 1.5; }
.api-needs { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.api-needs strong { color: var(--spark-cyan); }

.api-steps { counter-reset: apistep; display: flex; flex-direction: column; gap: 11px; }
.api-steps li {
  counter-increment: apistep;
  position: relative;
  padding-left: 28px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}
.api-steps li::before {
  content: counter(apistep);
  position: absolute; left: 0; top: 1px;
  width: 19px; height: 19px;
  background: var(--bg-panel-raised);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: 0.45rem;
  color: var(--fuse-orange);
}
.api-steps strong { color: var(--text-primary); }
.api-steps code, .api-note code, .api-summary code {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  background: var(--bg-panel-raised);
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--spark-cyan);
  word-break: break-all;
  line-height: 2;
}

.api-note {
  margin-top: 16px;
  background: var(--bg-panel-raised);
  border-left: 2px solid var(--line);
  border-radius: 0 6px 6px 0;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ---- setup guides: rich content blocks ---- */
.api-status.info { background: rgba(139, 137, 158, 0.18); color: var(--text-muted); }

.api-text { color: var(--text-muted); font-size: 0.86rem; line-height: 1.65; margin-bottom: 14px; }
.api-text:last-child { margin-bottom: 0; }
.api-text strong { color: var(--text-primary); }
.api-text em { color: var(--text-muted); }

.api-steps { margin-bottom: 14px; }
.api-body > .api-steps:last-child { margin-bottom: 0; }

.api-code-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg-void);
}
.api-code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px 7px 12px;
  background: var(--bg-panel-raised);
  border-bottom: 1px solid var(--line);
}
.api-code-label {
  font-family: var(--font-pixel); font-size: 0.45rem;
  color: var(--text-muted); text-transform: uppercase;
}
.api-copy {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.api-copy:hover { color: var(--fuse-orange); border-color: var(--fuse-orange); }

.api-code {
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.65;
  color: #c8d4e8;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.api-warn {
  margin-bottom: 14px;
  background: rgba(255, 210, 63, 0.07);
  border: 1px solid rgba(255, 210, 63, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.6;
}
.api-warn strong { color: var(--pixel-yellow); }
.api-note { margin-bottom: 14px; margin-top: 0; }
.api-note strong { color: var(--text-primary); }
.api-body > .api-note:last-child, .api-body > .api-warn:last-child { margin-bottom: 0; }
