/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens — Stadium Night ── */
:root {
  --bg:       #0a1210;   /* deep teal-black — field under lights */
  --panel:    #0f1d19;   /* header / tab bar */
  --card:     #132118;   /* track rows */
  --card-on:  #1c3024;   /* hovered card */
  --accent:   #d4a827;   /* scoreboard amber */
  --accent-hi:#e8be45;
  --text:     #c0d4c8;   /* chalk-white with faint green cast */
  --text-soft:#567060;
  --field:    #4ba368;   /* turf green — available */
  --out:      #b54040;   /* taken / error */
  --border:   #1a3028;
  --radius:   7px;
}

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* ── Header ── */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1rem 0.8rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.site-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.site-header p {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

/* ── Tabs ── */
.tabs {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  position: sticky;
  top: 70px;
  z-index: 9;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Main ── */
main {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem 6rem;
}

.tab-panel { display: none; padding-top: 1.5rem; }
.tab-panel.active { display: block; }

/* ── Section description ── */
.section-desc {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  max-width: 52ch;
}

/* ── Form fields ── */
.field { margin-bottom: 1.125rem; }

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.required-mark { color: var(--out); font-weight: 400; }
.optional-mark { color: var(--text-soft); font-weight: 400; }

.field input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.625rem 0.75rem;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus { border-color: var(--accent); }

.field input::placeholder {
  color: var(--text-soft);
  opacity: 0.55;
}

/* ── Collapsible track list ── */
.track-list-details {
  margin-bottom: 1.25rem;
}

.track-list-details .track-grid {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.track-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}

.track-list-summary::-webkit-details-marker { display: none; }

.track-list-summary:hover {
  background: var(--card-on);
  color: var(--text);
}

.track-list-details[open] .track-list-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  color: var(--text);
}

.summary-chevron {
  flex-shrink: 0;
  transition: transform .2s;
  color: var(--text-soft);
}

.track-list-details[open] .summary-chevron {
  transform: rotate(180deg);
}

/* ── Track grid — list on mobile, 2-col on wider ── */
.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 500px) {
  .track-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

.loading-msg {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* ── Track card — horizontal row ── */
.track-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 62px;
}

.track-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.track-card.available:hover,
.track-card.available:focus-within {
  background: var(--card-on);
  border-left-color: var(--field);
}

.track-card.selected {
  background: #1a2a10;
  border-left-color: var(--accent);
  border-right-color: var(--border);
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}

/* ── Play button ── */
.play-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.play-btn:hover  { background: rgba(255,255,255,.14); }
.play-btn:active { transform: scale(.88); }

.play-btn.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e06;
}

/* ── Track text ── */
.track-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.track-artist {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.15rem;
}

.track-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-taken-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--out);
  line-height: 1.3;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Custom track divider ── */
.custom-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.custom-divider::before,
.custom-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Time section ── */
.time-section {
  background: #111e0e;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 1.125rem;
  margin-bottom: 1.25rem;
  display: none;
}

.time-section.visible { display: block; }

.selected-track-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.time-row .field { margin-bottom: 0; }

.time-note {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.625rem;
  opacity: 0.7;
}

/* ── Submit button ── */
.btn {
  width: 100%;
  padding: 0.875rem;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: var(--accent);
  color: #0c1008;
}

.btn-primary:hover    { background: var(--accent-hi); }
.btn-primary:disabled { opacity: .38; cursor: not-allowed; transform: none; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(5rem);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,.65);
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  max-width: calc(100vw - 2rem);
  text-align: center;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { border-color: var(--field); color: #6cc48a; }
.toast.error   { border-color: var(--out);   color: #d07070; }

/* ── Game day suggestion list ── */
.suggestion-list { margin-top: 2rem; }

.suggestion-list-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.625rem;
}

.suggestion-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.suggestion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--field);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.suggestion-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.suggestion-artist {
  font-size: 0.8125rem;
  color: var(--text-soft);
}

/* ── Locked-in approved walkout list ── */
.locked-in-section { margin-bottom: 1.25rem; }

.locked-in-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.locked-in-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem 0.625rem;
}

.locked-in-player {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.locked-in-song {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-in-times {
  font-size: 0.75rem;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
