/* =====================================================================
   Swingelo — app-shell layout.
   Component visuals live in components.css (generated from ds/ — the single
   source). This file holds only the app shell: header, footer, hero, page
   layout, table/list shells, profile scaffolding, and the responsive rules.
   Load order in index.html: themes.css → components.css → style.css.
   ===================================================================== */

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection {
  background: rgba(255, 106, 61, 0.3);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #2c241b;
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
button {
  font-family: inherit;
  color: inherit;
}
a {
  color: inherit;
}

.bg-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--veil);
  z-index: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4.5vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 24px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.brand-chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  color: var(--bg);
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.search {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 420px;
}
#search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-card);
  border: 1px solid rgba(246, 239, 228, 0.1);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
#search-input:focus {
  border-color: rgba(255, 106, 61, 0.6);
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  z-index: 50;
}
.search-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

.nav-spacer {
  flex: 1;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-link.active {
  color: var(--ink);
}
.nav-edge {
  color: var(--accent-2);
}
.nav-sep {
  font-size: 13px;
  color: #5b5347;
}

/* ---- layout ---- */
.content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.5vw, 28px) 90px;
}
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4.5vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
}
.footer-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #5b5347;
  letter-spacing: 0.02em;
}

/* ---- hero ---- */
.hero {
  padding: clamp(28px, 6vw, 46px) 0 clamp(20px, 4vw, 30px);
}
.hero-copy {
  max-width: 640px;
  animation: fadeUp 0.5s ease both;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* stat-tiles grid (tiles themselves are components) */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

/* ---- section bar ---- */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.015em;
  margin: 0;
}
.section-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 5px 0 0;
}

/* ---- panel scaffolding (card itself is a component) ---- */
.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.panel-head-copy {
  max-width: 560px;
}
.panel-note-sm {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 8px 0 0;
}
.empty-note {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---- spotlight layout containers ---- */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.rise-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.rise-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.rise-note {
  font-size: 12.5px;
  color: var(--muted);
}
.rise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

/* ---- leaderboard shell (rows are components) ---- */
.list-card,
.lb-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.lb-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  cursor: default;
}
.lb-more-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.lb-more-count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.lb-more-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--bg-card);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.lb-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* ---- profile scaffolding ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin: 26px 0 22px;
}
.back-link:hover {
  color: var(--ink);
}
.p-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.p-header-main {
  flex: 1;
  min-width: 240px;
}
.p-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.p-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: -0.02em;
  margin: 0;
}
.p-level-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.p-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.synced {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--up);
}
.synced-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
}
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.p-grid-hero {
  margin-top: 24px;
}
.card-muted {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.muted-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink-2);
}
.stats-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.stats-row {
  display: flex;
  gap: 18px 22px;
  flex-wrap: wrap;
}
.stat-mini-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
}
.stat-mini-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.stats-summary {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ---- points breakdown ---- */
.pb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.pb-head-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pb-list {
  display: flex;
  flex-direction: column;
}
.pb-row {
  display: grid;
  grid-template-columns: 78px 1fr 130px 56px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.pb-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 5px 0;
  border-radius: 7px;
}
.pb-event {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pb-event-name {
  font-weight: 600;
  font-size: 14.5px;
}
.pb-event-loc {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.pb-date {
  color: var(--muted);
  font-size: 12.5px;
}
.pb-pts {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.pb-more {
  padding: 12px 0 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pb-total {
  border-bottom: none;
  padding-top: 14px;
}
.pb-total-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
}
.pb-total-val {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

/* ---- funnel note + judges grouping (rows are components) ---- */
.card-note {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.jgroup-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 18px 0 9px;
}
.jgroup-label.good {
  color: var(--up);
}
.jgroup-label.bad {
  color: var(--down);
}
.jgroup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.be-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}
.moves {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
}

/* =====================================================================
   Responsive — phones are the priority consumer
   ===================================================================== */
@media (max-width: 680px) {
  .nav-spacer,
  #nav-rankings,
  .nav-sep {
    display: none;
  }
  .stat-tiles {
    grid-template-columns: 1fr 1fr;
  }
  .stat-value {
    font-size: 26px;
  }

  /* leaderboard collapses to Rank / Dancer / Score */
  .lb-row {
    grid-template-columns: 38px 1fr 88px;
  }
  .lb-trend,
  .lb-finals,
  .lb-cb {
    display: none;
  }

  /* points breakdown drops the date column */
  .pb-row {
    grid-template-columns: 58px 1fr 44px;
  }
  .pb-date {
    display: none;
  }

  .panel,
  .card {
    padding: 18px;
  }
  .lb-row,
  .lb-head {
    padding: 12px 16px;
  }
  .points-big {
    font-size: 48px;
  }
}
