:root {
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --border: #E9EBF1;
  --text: #16181D;
  --muted: #868B96;
  --accent: #FF6A3D;
  --accent-tint: #FFF1EA;
  --accent-dark: #E8551F;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 8px 24px rgba(22, 24, 29, 0.05);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top bar --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: 28px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
}

.brand-hoop {
  color: var(--accent);
  text-transform: uppercase;
}

.brand-sync {
  color: #000000;
}

.brand-tld {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 2px;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.segment {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.segment.selected {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* --- Content --- */

.content {
  flex: 1;
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

.page-head .sub {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
  line-height: 1.5;
}

/* --- Cards --- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.result-card {
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(255, 106, 61, 0.08), 0 8px 24px rgba(255, 106, 61, 0.1);
}

/* --- Chips --- */

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* --- Buttons --- */

.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 106, 61, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.99); }

.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }

/* --- Feed box / result --- */

.feed-box {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}

.feed-box input {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.tier-team-list {
  margin-top: 10px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.link-download {
  display: inline-block;
  color: var(--accent-dark);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 0 16px;
}

.link-download:hover { text-decoration: underline; }

.hint {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 4px;
}

.howto {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.howto-row {
  font-size: 13px;
  color: var(--muted);
}

.howto-app {
  display: inline-block;
  min-width: 128px;
  color: var(--text);
  font-weight: 600;
}

/* --- Game list (browse & pick) --- */

.game-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-heading {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 2px;
}

.date-heading:first-child { margin-top: 0; }

.game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.game-row:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.game-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.game-row .game-info {
  flex: 1;
  min-width: 0;
}

.game-row .game-teams {
  font-size: 14px;
  font-weight: 600;
}

.game-row .game-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.status {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .topbar { padding: 14px 16px; }
  .content { padding: 24px 14px 64px; }
  .howto-app { display: block; min-width: 0; margin-bottom: 2px; }
}
