/* ===== Root ===== */
:root {
  --bg: #12171c;
  --surface: #181f26;
  --surface-elevated: #1e262e;
  --primary: #2addf3;
  --primary-dim: rgba(42, 221, 243, 0.12);
  --primary-glow: rgba(42, 221, 243, 0.25);
  --gold: #ecca25;
  --gold-dim: rgba(236, 202, 37, 0.15);
  --danger: #f44754;
  --danger-dim: rgba(244, 71, 84, 0.12);
  --text: #ffffff;
  --text-muted: #a6c0d8;
  --border: #4e787d;
  --border-dim: rgba(78, 120, 125, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== Page ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.site-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border-dim);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
}

.site-header h1 {
  margin: 0 0 0.2rem;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.season-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.season-display {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--primary-dim);
  border: 1px solid rgba(42, 221, 243, 0.22);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.3px;
  min-width: 160px;
}

.season-arrow {
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(42, 221, 243, 0.22);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.7rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}
.season-arrow:hover {
  background: var(--primary-dim);
  border-color: rgba(42, 221, 243, 0.5);
}
.season-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn.danger.refresh-btn {
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1;
  height: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.danger.refresh-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}
.btn.danger.refresh-btn:hover {
  background: #ff6a74;
  color: #fff;
}
.btn.danger.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.refresh-btn.refreshing {
  animation: refresh-pulse 1.2s ease-in-out infinite;
}
@keyframes refresh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ===== Charts header kebab menu ===== */
.chart-menu {
  position: relative;
  display: inline-flex;
  margin-left: auto;
}
.chart-menu-btn {
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chart-menu-btn:hover {
  background: var(--primary-dim);
  border-color: rgba(42, 221, 243, 0.5);
  color: var(--text);
}
.chart-menu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chart-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 12rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.chart-menu-dropdown[hidden] {
  display: none;
}
.chart-menu-item {
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}
.chart-menu-item:hover {
  background: var(--primary-dim);
  color: var(--text);
}
.chart-menu-item svg {
  flex: none;
}
.chart-menu-item.refresh-btn {
  color: var(--danger);
}
.chart-menu-item.refresh-btn:hover {
  background: var(--danger-dim);
  color: var(--danger);
}
.chart-menu-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
  align-items: center;
  width: max-content;
  max-width: min(92vw, 30rem);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.6rem 0.75rem 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  animation: toast-in 0.2s ease-out;
}
.toast--success { border-left: 5px solid #34d399; }
.toast--error   { border-left: 5px solid var(--danger); }
.toast--info    { border-left: 5px solid var(--primary); }
.toast--leaving {
  animation: toast-out 0.2s ease-in forwards;
}
.toast-message {
  flex: 1;
}
.toast-close {
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.toast-close:hover {
  color: var(--text);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ===== Content ===== */
.content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== Network Error ===== */
.network-error {
  background: var(--danger-dim);
  border: 1px solid rgba(244, 71, 84, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--danger);
}
.network-error p {
  margin: 0.25rem 0;
  font-weight: 700;
}
.network-error .sub {
  font-weight: 400;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 23, 28, 0.85);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 100;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(42, 221, 243, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  display: none;
}
.progress-bar.visible {
  display: block;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== Boards ===== */
.boards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ===== Played today strips ===== */
.board-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.played-today {
  text-align: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.played-today .pt-line {
  display: block;
}
.played-today .pt-count {
  font-weight: 900;
  color: var(--gold);
}
.played-today .pt-best {
  color: var(--primary);
  font-weight: 700;
}

@media (min-width: 800px) {
  .boards {
    grid-template-columns: 1fr 1fr;
  }
  .played-today {
    min-height: 5.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .chart-controls .chart-toggle {
    flex: 1 1 0;
  }
}

.board {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-dim);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.board-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.3px;
}

.board-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.copy-board-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-board-btn svg {
  flex: none;
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
}

/* Previous seasons have no "today/yesterday" data */
.table-wrap.no-days th.col-today,
.table-wrap.no-days td.today-cell,
.table-wrap.no-days td.yesterday-cell {
  display: none;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--border-dim);
}

th {
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.15);
}

tbody tr {
  transition: background 0.15s;
}
tbody tr:hover {
  background: rgba(42, 221, 243, 0.04);
}

.col-rank {
  width: 36px;
}
.col-user {
  width: auto;
}
.col-score {
  width: 76px;
}
.col-rank-off {
  width: 68px;
}

.col-today {
  width: 46px;
}

.rank-cell {
  font-weight: 900;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Top 3 podium styling */
.rank-1 .rank-cell { color: var(--gold); text-shadow: 0 0 8px rgba(236, 202, 37, 0.35); }
.rank-2 .rank-cell { color: #c0c0c0; }
.rank-3 .rank-cell { color: #cd7f32; }

/* Score column alignment */
.score-cell {
  font-weight: 700;
  color: var(--text);
}

.user-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.user-cell.expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* Long-press highlight (your player) */
.user-cell {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}
.user-cell.pressing {
  opacity: 0.6;
}

tr.highlighted {
  background: rgba(180, 139, 255, 0.12);
}
tr.highlighted > td:first-child {
  border-left: 3px solid #b48bff;
}
tr.highlighted .user-cell {
  color: #b48bff;
  font-weight: 700;
}

.score-badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-weight: 700;
  text-align: center;
  min-width: 52px;
}
.rank-1 .score-badge { color: var(--gold); border-color: var(--gold); background: rgba(236, 202, 37, 0.08); }
.rank-2 .score-badge { color: #c0c0c0; border-color: #c0c0c0; background: rgba(192, 192, 192, 0.08); }
.rank-3 .score-badge { color: #cd7f32; border-color: #cd7f32; background: rgba(205, 127, 50, 0.08); }

.rank-off-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.today-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.today-score {
  color: #34d399;
  font-weight: 900;
}

.day-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.4rem;
  line-height: 1.1;
}

.day-score {
  font-weight: 700;
}

.day-correct {
  font-size: 0.7rem;
  opacity: 0.75;
}

.day-loading {
  color: var(--text-muted);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.yesterday-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Empty State ===== */
.board-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.board-empty p {
  margin: 0.25rem 0;
}
.board-empty .sub {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ===== Charts ===== */
.charts-section {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.charts-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.charts-header .charts-title-row {
  order: 1;
  flex: 1 1 auto;
}
.charts-header .chart-menu {
  order: 1;
  margin-left: auto;
}
.charts-header .chart-controls {
  order: 2;
  width: 100%;
}
.charts-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.charts-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-show-btn {
  width: 100%;
  margin-bottom: 1rem;
}

.chart-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.chart-loading {
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chart-progress {
  width: 100%;
  margin: 0.5rem 0;
}

.chart-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}

.chart-toggle button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  flex: 1;
}

.chart-toggle button.active {
  background: var(--primary);
  color: #0b1218;
}

@media (max-width: 799px) {
  .chart-toggle {
    flex: 1 1 100%;
  }

  .chart-toggle button {
    flex: 1;
  }
}

.chart-block {
  margin-top: 1.25rem;
}

.chart-block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.copy-chart-btn {
  cursor: pointer;
  border: 1px solid var(--border-dim);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-chart-btn svg,
.chart-block .copy-chart-btn svg {
  flex: none;
  width: 14px;
  height: 14px;
  display: inline-block;
  background: none;
  border: none;
  border-radius: 0;
}

.copy-chart-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.chart-block svg {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

.chart-block svg line.grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.chart-block svg path.data-line,
.chart-block svg path.avg-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-block svg text {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
}

.chart-block svg text.ylabel {
  text-anchor: end;
}

.chart-block svg text.xlabel {
  text-anchor: middle;
}

.chart-block svg text.xlabel-end {
  text-anchor: end;
}

.chart-block svg .hover-guide {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.chart-block svg .hover-dot {
  stroke: #0b1218;
  stroke-width: 1.5;
}

.chart-block svg .data-dot {
  stroke: #0b1218;
  stroke-width: 1.5;
}

.chart-block svg text.hover-value {
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(11, 18, 24, 0.9);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.chart-block svg text.hover-day {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend .legend-item {
  cursor: pointer;
  transition: opacity 0.2s;
}

.chart-legend .legend-item:hover {
  opacity: 0.75;
}

.chart-legend .legend-item.highlighted {
  opacity: 1;
  font-weight: 700;
  color: var(--text);
}
.chart-legend .legend-item.highlighted .swatch {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}

.chart-legend .legend-item.hidden-line {
  opacity: 0.35;
  text-decoration: line-through;
}

.chart-legend .swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.chart-legend .swatch.avg {
  height: 0;
  width: 14px;
  background: none;
  border-top: 2px dashed #d1d5db;
  border-radius: 0;
}

/* ===== Bottom Section ===== */
.bottom-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 800px) {
  .bottom-section {
    grid-template-columns: 1.4fr 1fr;
  }
}

.bottom-card {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.bottom-card h2 {
  margin: 0 0 0.15rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.bottom-card .sub {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.search-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.search-results {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
}

/* ===== Result Card ===== */
.result-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  transition: border-color 0.2s;
}
.result-card:hover {
  border-color: rgba(78, 120, 125, 0.6);
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.result-name {
  font-weight: 700;
  font-size: 1rem;
}

.result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-score {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

.result-rank {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

/* ===== Player Manager ===== */
.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-dim);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.player-chip:hover {
  border-color: var(--danger);
}

.chip-remove {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
  transition: color 0.2s;
}
.chip-remove:hover {
  color: var(--danger);
}

.manager-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.manager-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn:active {
  transform: translateY(1px);
}

.btn.small {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.btn.primary {
  background: var(--primary);
  color: #0b1218;
}
.btn.primary:hover {
  background: #6ef0ff;
  box-shadow: 0 0 14px var(--primary-glow);
}

.btn.primary.outline {
  background: transparent;
  border: 1px solid rgba(42, 221, 243, 0.35);
  color: var(--primary);
}
.btn.primary.outline:hover {
  background: var(--primary-dim);
  border-color: rgba(42, 221, 243, 0.55);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: rgba(78, 120, 125, 0.15);
}

.btn.danger {
  color: var(--danger);
}
.btn.danger.outline {
  background: transparent;
  border: 1px solid rgba(244, 71, 84, 0.35);
}
.btn.danger.outline:hover {
  background: var(--danger-dim);
  border-color: rgba(244, 71, 84, 0.55);
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-dim);
  margin-top: auto;
}

.site-footer .footer-links {
  margin-top: 0.5rem;
  opacity: 0.75;
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(78, 120, 125, 0.45);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 120, 125, 0.7);
}
