:root {
  --ink: #0f1a1f;
  --ink-soft: #24313a;
  --paper: #f7f3ee;
  --accent: #f0642b;
  --accent-deep: #ca3f17;
  --teal: #3cc6a3;
  --gold: #f4c95d;
  --shadow: rgba(15, 26, 31, 0.2);
  --radius-lg: 22px;
  --radius-md: 14px;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, #f4efe7 40%, #efe6db 100%);
  color: var(--ink);
  min-height: 100vh;
}

.pattern {
  background-image: linear-gradient(120deg, rgba(15, 26, 31, 0.06) 0%, rgba(15, 26, 31, 0) 60%),
    radial-gradient(circle at 15% 25%, rgba(240, 100, 43, 0.12), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(60, 198, 163, 0.12), transparent 45%);
}

.brand-title {
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(16, 23, 28, 0.78) 0%, rgba(27, 37, 44, 0.74) 60%, rgba(39, 53, 61, 0.72) 100%),
    url("../img/Mega-Bouldertraverse.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fef6ea;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% 40% auto -20%;
  height: 220%;
  background: radial-gradient(circle, rgba(240, 100, 43, 0.35), transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border: none;
}

.cta:hover {
  color: #fff;
  filter: brightness(0.95);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fef6ea;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  backdrop-filter: blur(8px);
}

.stat-card h3 {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.section-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 12px 24px rgba(12, 18, 22, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.section-card .meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.section-card.status-unclaimed {
  border: 2px solid rgba(15, 26, 31, 0.08);
}

.section-card.status-claimed {
  border: 2px solid rgba(244, 201, 93, 0.9);
  background: #fff7df;
}

.section-card.status-approved {
  border: 2px solid rgba(60, 198, 163, 0.7);
  background: #ecfbf6;
}

.section-card.status-rejected {
  border: 2px solid rgba(240, 100, 43, 0.55);
  background: #fff0eb;
}

.section-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}

.status-pill {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.status-pill.claimed {
  background: #fff1c2;
  color: #7a5b00;
}

.status-pill.approved {
  background: #d9f8ee;
  color: #0a6c56;
}

.status-pill.rejected {
  background: #ffe1d8;
  color: #8f2a13;
}

.section-badge {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.histogram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 0.5rem;
  align-items: end;
  height: 160px;
}

.histogram-bin {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.3rem;
  align-items: end;
  height: 100%;
}

.histogram-bar {
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  position: relative;
}

.histogram-bar span {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.histogram-label {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.leaderboard {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(12, 18, 22, 0.1);
}

.leaderboard thead {
  background: var(--ink);
  color: #fef6ea;
}

#teamsScoreHeader {
  white-space: nowrap;
}

.score-symbol {
  font-size: 0.72em;
  opacity: 0.85;
  font-weight: 500;
}

.score-info-trigger {
  margin-left: 0.25rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82em;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.score-info-trigger:hover,
.score-info-trigger:focus {
  color: var(--ink);
}

.leaderboard tbody tr:nth-child(odd) {
  background: #fff9f2;
}

.rank-badge {
  background: var(--gold);
  color: var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}

.team-card {
  background: #fffaf4;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 1px solid rgba(240, 100, 43, 0.1);
}

.team-card.active {
  border-color: rgba(60, 198, 163, 0.6);
  box-shadow: 0 12px 24px rgba(60, 198, 163, 0.18);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(15, 26, 31, 0.1);
  padding: 0.6rem 0;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  border: 1px dashed rgba(36, 49, 58, 0.25);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
}

.my-team-item {
  cursor: pointer;
}

.my-team-item.active {
  border-color: rgba(240, 100, 43, 0.45);
  background: #fff2ed;
  color: var(--ink) !important;
}

.my-team-item.active .helper {
  color: var(--ink-soft) !important;
}

.my-team-item.active .fw-semibold {
  color: var(--ink) !important;
}

.team-member-current {
  background: #f0fbf7;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.footer-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.helper {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.form-panel {
  max-width: 520px;
  margin: 0 auto;
}

.auth-hero-panel {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  color: #fef6ea;
}

.auth-hero-panel .form-label {
  color: #fef6ea;
}

.auth-hero-panel .helper {
  color: rgba(254, 246, 234, 0.88);
}

.rules-nav .nav-link:hover,
.rules-nav .nav-link:focus {
  color: var(--ink);
  background: #fff5ea;
}

.keyfacts {
  border-radius: var(--radius-md);
  padding: 1rem;
  background: #fff7ea;
  border: 1px solid rgba(240, 100, 43, 0.2);
}

@media (min-width: 769px) {
  .hero {
    padding: 3rem;
  }

  .histogram {
    height: 200px;
  }
}
