:root {
  --color-primary: #1a56db;
  --color-danger: #e02424;
  --color-success: #057a55;
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-900: #111827;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9fafb;
  color: #111827;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
}

.nav {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #1a56db;
  flex-wrap: wrap;
}

.nav a {
  color: #fff;
  text-decoration: none;
}

.nav a.active {
  font-weight: 700;
  text-decoration: underline;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
}

.btn-primary {
  background: #1a56db;
  color: #fff;
}

.btn-danger {
  background: #e02424;
  color: #fff;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.points-positive {
  color: #057a55;
  font-weight: 700;
}

.points-negative {
  color: #e02424;
  font-weight: 700;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fde8e8;
  color: #9b1c1c;
}

.alert-success {
  background: #def7ec;
  color: #03543f;
}

.alert-info {
  background: #e1effe;
  color: #1e429f;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f3f4f6;
  font-weight: 600;
}

.rank-me {
  background: #e1effe;
}

@media (max-width: 400px) {
  .nav {
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

.hidden {
  display: none;
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-top-color: #1a56db;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--color-neutral-300);
  transition: 0.2s;
  border-radius: 28px;
}

.toggle-switch .slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .slider {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.container-wide {
  max-width: 1200px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  .device-login-card {
    display: none;
  }

  .leaderboard-chart .leaderboard-canvas {
    height: 420px !important;
  }
}
