:root {
  color-scheme: light;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --bg: #ffffff;
  --panel: #f8f9fa;
  --panel-alt: #e9ecef;
  --text: #212529;
  --muted: #6c757d;
  --accent: #007bff;
  --gold: linear-gradient(120deg, #ffd700, #ffb347);
  --silver: linear-gradient(120deg, #d7d7dd, #9fa6b2);
  --bronze: linear-gradient(120deg, #d18b60, #b05a2b);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 1rem;
}

.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 0.5rem 0;
  position: relative;
}

.eyebrow {
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.subheading {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 1rem;
}

.metrics .label {
  font-size: 0.8rem;
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metrics .value {
  margin: 0.1rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.board {
  background: var(--panel);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.card {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e0e0e0;
}

.card--gold {
  border: 2px solid #ffd700;
  background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
  color: #1b1b1b;
}

.card--silver {
  border: 2px solid #c0c0c0;
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  color: #212529;
}

.card--bronze {
  border: 2px solid #cd7f32;
  background: linear-gradient(135deg, #faf5f0 0%, #ffffff 100%);
  color: #212529;
}

.card__rank {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.rank-number {
  font-size: 1.7rem;
  font-weight: 700;
}

.badge {
  font-size: 1.2rem;
}

.card__body {
  text-align: right;
}

.name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.sales {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.sales__value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-right: 0.3rem;
  color: var(--text);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.pill {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.pill--ghost {
  background: #ffffff;
  border: 1px solid #dee2e6;
  color: var(--text);
}

.pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sound-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sound-toggle:hover {
  background: #f8f9fa;
  border-color: var(--accent);
  transform: scale(1.05);
}

.sound-toggle--active {
  background: #e7f3ff;
  border-color: var(--accent);
}

.sound-toggle .sound-icon {
  display: block;
  font-size: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard__header {
    flex-direction: column;
  }

  .sound-toggle {
    position: static;
    align-self: flex-end;
    margin-top: 0.5rem;
  }

  body {
    padding: 0.5rem;
  }
}

.card--flash {
  animation: flash 1s ease;
}

@keyframes flash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.celebration-overlay--show {
  opacity: 1;
  visibility: visible;
}

.celebration-overlay--fadeout {
  opacity: 0;
  transition: opacity 1s ease;
}

.celebration-content {
  text-align: center;
  z-index: 10001;
}

.celebration-item {
  margin: 1rem 0;
}

.celebration-name {
  font-size: 4rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
  font-family: "Space Grotesk", sans-serif;
}

.celebration-increase {
  font-size: 3rem;
  font-weight: 700;
  color: #28a745;
  font-family: "Space Grotesk", sans-serif;
}

#confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -10px;
  animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}