:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2196f3;
  --accent-ink: #ffffff;
  --secondary: #32d74b;
  --open: #e3f2fd;
  --open-ink: #1565c0;
  --open-border: #90caf9;
  --filled: #f1f5f9;
  --danger: #c62828;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --font: "Outfit", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(160deg, #e1f5fe 0%, #bbdefb 42%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 6rem;
}

.page-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.brand-name {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.page-header h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.error {
  color: var(--danger);
  margin: 0.5rem 0 0;
}

.hidden {
  display: none !important;
}

.state-message {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.sport-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sport-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.sport-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.game-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.game-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0.95rem 1rem;
  cursor: pointer;
}

.game-summary:hover,
.game-summary:focus-visible {
  background: rgba(33, 150, 243, 0.06);
  outline: none;
}

.game-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.game-when {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.game-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.game-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.game-sport {
  font-weight: 600;
  color: var(--ink);
}

.game-open-count {
  font-weight: 700;
  color: var(--open-ink);
}

.game-chevron {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.game-row.is-expanded .game-chevron {
  transform: rotate(180deg);
}

.game-expand-body {
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.position-group {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
}

.position-header {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.position-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 540px) {
  .position-teams {
    grid-template-columns: 1fr;
  }
}

.position-team-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.slot-chips {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slot-chip {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  background: var(--filled);
  color: var(--ink);
}

.slot-chip.open {
  background: var(--open);
  color: var(--open-ink);
  border-color: var(--open-border);
  cursor: pointer;
}

.slot-chip.open:hover,
.slot-chip.open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.slot-chip.filled {
  cursor: default;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 20;
}

.claim-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem 1.25rem;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 0.25rem auto 0.75rem;
}

.claim-sheet h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.claim-sheet form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.claim-sheet label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.claim-sheet input {
  font: inherit;
  font-weight: 400;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.claim-sheet input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.sheet-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
