:root {
  --bg: #0a0a0b;
  --rose-950: #4c0519;
  --rose-600: #e11d48;
  --rose-500: #f43f5e;
  --rose-400: #fb7185;
  --amber-400: #fbbf24;
  --slate-300: #cbd5e1;
  --orange-400: #fb923c;
  --w05: rgba(255,255,255,0.05);
  --w07: rgba(255,255,255,0.07);
  --w10: rgba(255,255,255,0.10);
  --w20: rgba(255,255,255,0.20);
  --w30: rgba(255,255,255,0.30);
  --w40: rgba(255,255,255,0.40);
  --w50: rgba(255,255,255,0.50);
  --w60: rgba(255,255,255,0.60);
  --w02: rgba(255,255,255,0.02);
  --w03: rgba(255,255,255,0.03);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: #fff;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--w05);
  background: rgba(10,10,11,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.logo-icon-wrap { position: relative; display: flex; }

.logo-icon { width: 1.75rem; height: 1.75rem; color: var(--rose-500); position: relative; z-index: 1; transition: color .15s; }
.logo:hover .logo-icon { color: var(--rose-400); }

.logo-glow {
  position: absolute;
  inset: 0;
  background: rgba(244,63,94,0.3);
  filter: blur(12px);
  z-index: 0;
}
.logo:hover .logo-glow { background: rgba(251,113,133,0.4); }

.logo-text { line-height: 1; }
.logo-soose, .logo-list { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.logo-list { color: var(--rose-500); }

.header-right { display: flex; align-items: center; gap: 0.75rem; }

.nav-desktop { display: none; align-items: center; gap: 0.25rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--w50);
  transition: color .15s, background-color .15s;
}
.nav-link:hover { color: #fff; background: var(--w05); }
.nav-link.active { background: var(--w10); color: #fff; }
.nav-link .icon { width: 1rem; height: 1rem; }

.menu-btn {
  background: none;
  border: none;
  color: var(--w60);
  display: flex;
  padding: 0;
}
.menu-btn:hover { color: #fff; }
.menu-btn .icon { width: 1.5rem; height: 1.5rem; }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1rem 1rem;
  gap: 0.25rem;
  border-top: 1px solid var(--w05);
}
.nav-mobile.open { display: flex; }

@media (min-width: 640px) {
  .header-inner { padding: 0 1.5rem; }
  .nav-desktop { display: flex; }
  .menu-btn { display: none; }
  .nav-mobile { display: none !important; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--w05);
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(76,5,25,0.3), transparent 60%);
}
.hero-blob {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: rgba(225,29,72,0.1);
  border-radius: 999px;
  filter: blur(120px);
}
.hero-inner {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1rem;
  text-align: center;
}
.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.05;
}
.hero-title .accent { color: var(--rose-500); }
.hero-sub {
  margin: 1.25rem auto 0;
  max-width: 36rem;
  color: var(--w50);
  font-size: 1rem;
}

@media (min-width: 640px) {
  .hero-inner { padding: 6rem 1.5rem; }
  .hero-title { font-size: 4.5rem; }
  .hero-sub { font-size: 1.125rem; }
}

/* ---------- Section shells ---------- */

.section-wide { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }
.section-narrow { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem; }

@media (min-width: 640px) {
  .section-wide, .section-narrow { padding: 2rem 1.5rem; }
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.section-title-group { display: flex; align-items: center; gap: 0.625rem; }
.section-title-group .icon { width: 1.25rem; height: 1.25rem; color: var(--rose-500); }
.section-title-group h2, .page-title-row h1 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.count-badge { font-size: 0.875rem; color: var(--w30); }

.page-title-row { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 2rem; }
.page-title-row .icon { width: 1.25rem; height: 1.25rem; color: var(--rose-500); }
.page-title-row .icon.text-amber { color: var(--amber-400); }
.page-title-row h1 { font-size: 1.5rem; font-weight: 700; }
@media (min-width: 640px) { .page-title-row h1 { font-size: 1.875rem; } }

.page-subtitle { color: var(--w40); font-size: 0.875rem; margin: 0.25rem 0 0; }

.list-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Search ---------- */

.search-wrap { position: relative; }
.search-wrap .icon-search {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--w30);
}
.search-input {
  width: 16rem;
  max-width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  background: var(--w05);
  border: 1px solid var(--w10);
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
}
.search-input::placeholder { color: var(--w30); }
.search-input:focus {
  outline: none;
  border-color: rgba(244,63,94,0.5);
  background: var(--w07);
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--w30);
  border: 1px solid var(--w05);
  border-radius: 0.75rem;
}
.empty-state .icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  opacity: 0.4;
}
.empty-state p { margin: 0; }

/* ---------- Leaderboard ---------- */

.leaderboard-list {
  border-radius: 0.75rem;
  border: 1px solid var(--w05);
  background: var(--w02);
  overflow: hidden;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--w05);
  transition: background-color .15s;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: var(--w03); }
.rank-cell { width: 2rem; text-align: center; flex-shrink: 0; }
.rank-cell .icon { width: 1.5rem; height: 1.5rem; margin: 0 auto; display: block; }
.rank-number { font-family: ui-monospace, monospace; font-size: 0.875rem; color: var(--w30); }
.rank-cell .rank-1 { color: var(--amber-400); }
.rank-cell .rank-2 { color: var(--slate-300); }
.rank-cell .rank-3 { color: var(--orange-400); }
.player-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.player-name { font-weight: 600; color: #fff; display: block; transition: color .15s; }
.player-cell:hover .player-name { color: var(--rose-400); }
.player-country { font-size: 0.75rem; color: var(--w30); }
.score-cell { text-align: right; flex-shrink: 0; }
.score-num { font-size: 1.125rem; font-weight: 700; color: var(--amber-400); }
.score-label { font-size: 0.75rem; color: var(--w40); margin-left: 0.25rem; }

/* ---------- Level detail ---------- */

.detail-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.detail-item { display: flex; align-items: center; justify-content: space-between; font-size: 0.875rem; }
.detail-label { color: var(--w40); }
.detail-value { color: #fff; font-weight: 500; }
.level-description { color: var(--w50); font-size: 0.875rem; line-height: 1.5; margin: 0.75rem 0 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--w05);
  margin-top: 5rem;
  padding: 2rem 1rem;
  text-align: center;
}
.site-footer p { margin: 0; font-size: 0.75rem; color: var(--w30); }

/* ---------- Icons ---------- */

.icon { display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: #16161a;
  border: 1px solid var(--w10);
  border-left: 3px solid var(--rose-500);
  color: #fff;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Level list (home) ---------- */

.level-list {
  border-radius: 0.75rem;
  border: 1px solid var(--w05);
  background: var(--w02);
  overflow: hidden;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--w05);
  transition: background-color .15s;
}
.level-row:last-child { border-bottom: none; }
.level-row:hover { background: var(--w03); }

.level-row-gold { background: #362b0a; }
.level-row-gold:hover { background: #40340d; }
.level-row-silver { background: #2b2b2e; }
.level-row-silver:hover { background: #333336; }
.level-row-bronze { background: #33210f; }
.level-row-bronze:hover { background: #3d2812; }

.level-thumb {
  width: 4.5rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--w05);
}

.level-rank {
  width: 2.5rem;
  flex-shrink: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--w40);
  text-align: center;
}

.level-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  text-align: left;
}
.level-name { font-weight: 600; color: #fff; }
.level-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.points-chip {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.3);
  color: var(--rose-400);
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  color: #34d399;
}
.verified-badge .icon { width: 0.75rem; height: 0.75rem; }
.unverified-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--w05);
  border: 1px solid var(--w10);
  color: var(--w30);
}

.leaderboard-row-wrap { border-bottom: 1px solid var(--w05); }
.leaderboard-row-wrap:last-child { border-bottom: none; }
.leaderboard-row-wrap .leaderboard-row { border-bottom: none; }

/* ---------- Verifications ---------- */

.verification-list {
  border-radius: 0.75rem;
  border: 1px solid var(--w05);
  background: var(--w02);
  overflow: hidden;
}
.verification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--w05);
}
.verification-row:last-child { border-bottom: none; }
.verification-main { display: flex; flex-direction: column; gap: 0.25rem; }
.verification-level { font-weight: 600; color: #fff; }
.verification-meta { font-size: 0.8125rem; color: var(--w40); }
.verification-video { font-size: 0.8125rem; color: var(--rose-400); }
.verification-video:hover { color: var(--rose-400); text-decoration: underline; }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 28rem;
  max-height: 85vh;
  overflow-y: auto;
  background: #121214;
  border: 1px solid var(--w10);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.modal-image {
  display: block;
  width: calc(100% + 3.5rem);
  height: 12rem;
  object-fit: cover;
  margin: -1.75rem -1.75rem 1.25rem;
  border-radius: 1rem 1rem 0 0;
  background: var(--w05);
}
.modal-close {
  position: absolute;
  z-index: 1;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: none;
  background: var(--w05);
  color: var(--w60);
}
.modal-close:hover { background: var(--w10); color: #fff; }
.modal-close .icon { width: 1rem; height: 1rem; }
.modal-rank { font-family: ui-monospace, monospace; color: var(--w30); font-size: 0.875rem; margin-bottom: 0.25rem; }
.modal-title { font-size: 1.375rem; font-weight: 700; margin: 0 0 0.5rem; }
.modal-points-badge {
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.3);
  color: var(--rose-400);
  margin-bottom: 1.25rem;
}
.modal-section { margin-top: 1.25rem; text-align: left; }
.modal-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--w40);
  margin: 0 0 0.625rem;
}
.verifier-line { display: flex; align-items: center; gap: 0.375rem; font-weight: 600; color: #34d399; margin-bottom: 0.75rem; }
.verifier-line .icon { width: 1rem; height: 1rem; }
.verifier-line.muted { color: var(--w30); font-weight: 400; }
.beaten-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.beaten-list li { font-size: 0.875rem; color: #fff; }

.muted { color: var(--w30); }
.small { font-size: 0.8125rem; }
