:root {
  --bg: #f3f6fb;
  --bg-soft: #e8eef7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: #eef3fa;
  --text: #14233d;
  --muted: #66788f;
  --line: rgba(20, 35, 61, 0.1);
  --accent: #1c6cff;
  --accent-strong: #0f56df;
  --accent-soft: rgba(28, 108, 255, 0.12);
  --shadow: 0 20px 60px rgba(15, 33, 58, 0.1);
  --shadow-strong: 0 28px 80px rgba(15, 33, 58, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

body[data-theme="dark"] {
  --bg: #08111e;
  --bg-soft: #101b2d;
  --surface: rgba(12, 20, 34, 0.9);
  --surface-strong: #0f1b2d;
  --surface-muted: #142338;
  --text: #eff4ff;
  --muted: #96abc7;
  --line: rgba(150, 171, 199, 0.16);
  --accent: #68aaff;
  --accent-strong: #8bc0ff;
  --accent-soft: rgba(104, 170, 255, 0.16);
  --shadow: 0 24px 70px rgba(2, 8, 16, 0.46);
  --shadow-strong: 0 32px 90px rgba(2, 8, 16, 0.54);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(28, 108, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(11, 172, 186, 0.11), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

a,
button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  min-height: 100vh;
}

.container {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

.site-header {
  padding: 16px 0 0;
  background: transparent;
}

.header-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .header-shell {
  background: rgba(8, 17, 30, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(28, 108, 255, 0.2);
}

.brand-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 1.12rem;
}

.brand-copy span {
  display: none;
}

.nav-group {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 800;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
}

.nav-link.is-active {
  color: var(--accent-strong);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(15, 33, 58, 0.08);
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.lang-button {
  min-width: 44px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang-button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #1ea0ff);
}

.icon-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.icon-button:hover,
.button:hover,
.icon-button:focus-visible,
.button:focus-visible {
  transform: translateY(-1px);
}

.icon-button {
  width: 46px;
  height: 46px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

body[data-theme="light"] .icon-sun {
  display: none;
}

body[data-theme="dark"] .icon-moon {
  display: none;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #1ea0ff);
  box-shadow: 0 18px 34px rgba(28, 108, 255, 0.22);
}

.button-secondary {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
}

.button-full {
  width: 100%;
}

.button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.is-hidden {
  display: none !important;
}

.bottom-nav {
  display: none;
}

.main-layout {
  display: grid;
  gap: 26px;
  padding: 24px 0 56px;
}

.card-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.page-hero,
.section-block,
.auth-shell,
.account-card,
.thank-shell {
  padding: 30px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-copy h1,
.section-title {
  margin: 0;
  letter-spacing: -0.05em;
}

.hero-copy h1 {
  max-width: 9ch;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.96;
}

.section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.section-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1;
}

.league-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.league-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.league-tag strong {
  font-size: 0.92rem;
}

.league-tag span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.panel-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-event-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-event-item,
.summary-row,
.activity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.hero-event-copy,
.activity-item > div {
  min-width: 0;
}

.hero-event-copy {
  display: grid;
  gap: 6px;
}

.hero-event-copy strong,
.event-card h3,
.summary-row strong,
.activity-item strong {
  line-height: 1.32;
}

.hero-event-copy span,
.event-time,
.summary-row span,
.activity-item span {
  color: var(--muted);
  font-size: 0.94rem;
}

.hero-odds {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-odds span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-weight: 800;
}

.league-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(28, 108, 255, 0.18);
  font-weight: 800;
}

.event-grid,
.account-grid,
.thank-layout {
  display: grid;
  gap: 18px;
}

.event-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.event-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.event-top,
.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.event-card h3 {
  margin: 0;
  font-size: 1.24rem;
}

.events-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.section-head-compact {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.matchup-stack {
  display: grid;
  gap: 10px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 1.04rem;
  font-weight: 800;
}

.odds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.odd-button {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.odd-button:hover,
.odd-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(28, 108, 255, 0.28);
  box-shadow: 0 16px 28px rgba(15, 33, 58, 0.08);
}

.odd-button.is-selected {
  border-color: rgba(28, 108, 255, 0.42);
  background: linear-gradient(180deg, rgba(28, 108, 255, 0.14), rgba(28, 108, 255, 0.06));
  box-shadow: 0 18px 30px rgba(28, 108, 255, 0.14);
}

.odd-label {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.odd-price {
  font-size: 1.34rem;
  line-height: 1;
}

.slip-shell {
  display: grid;
  gap: 18px;
}

.slip-list {
  display: grid;
  gap: 12px;
}

.slip-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.slip-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.slip-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.slip-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.inline-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
}

.inline-button:hover,
.inline-button:focus-visible {
  color: var(--text);
}

.slip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-weight: 800;
}

.slip-footer span {
  color: var(--muted);
  font-weight: 700;
}

.loading-card {
  pointer-events: none;
}

.loading-line {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-muted), rgba(28, 108, 255, 0.08), var(--surface-muted));
  background-size: 200% 100%;
  animation: loading-pulse 1.2s linear infinite;
}

.loading-line-short {
  width: 32%;
}

.loading-line-medium {
  width: 64%;
}

.loading-chip {
  height: 84px;
}

@keyframes loading-pulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.source-link,
.small-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 800;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.source-link span {
  color: var(--muted);
  font-weight: 700;
}

.auth-shell {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(680px, 100%);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span {
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 52px;
  min-width: 0;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--accent);
}

.auth-support {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 0;
  color: var(--muted);
}

.account-grid,
.thank-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-grid {
  align-items: start;
}

.account-card,
.thank-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

.summary-list,
.activity-list {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: grid;
  gap: 6px;
}

.ticket-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(28, 108, 255, 0.2);
  font-size: 0.88rem;
  font-weight: 800;
}

.ticket-selections {
  display: grid;
  gap: 10px;
}

.ticket-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.ticket-selection span,
.ticket-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ticket-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.summary-row strong,
.summary-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-item {
  align-items: center;
}

.activity-item > div {
  display: grid;
  gap: 6px;
}

.value-positive {
  color: #14874f;
}

.value-negative {
  color: #d14d55;
}

.empty-state {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: var(--surface-muted);
}

.offline-banner {
  position: sticky;
  top: 96px;
  z-index: 24;
  width: min(1180px, calc(100% - 24px));
  margin: 10px auto 0;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  color: #a04b00;
  background: rgba(255, 237, 213, 0.96);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .offline-banner {
  color: #facc15;
  background: rgba(66, 35, 4, 0.94);
  border-color: rgba(250, 204, 21, 0.2);
}

.site-footer {
  padding: 0 0 48px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(22px);
  width: min(420px, calc(100% - 24px));
  padding: 14px 18px;
  border-radius: 16px;
  color: #ffffff;
  background: rgba(8, 17, 29, 0.94);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 40;
}

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

@media (max-width: 1040px) {
  .header-shell {
    grid-template-columns: 1fr;
  }

  .nav-group,
  .header-tools {
    justify-content: flex-start;
  }

  .events-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .page-hero,
  .account-grid,
  .thank-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 92px;
  }

  .top-nav {
    display: none;
  }

  .header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .page-hero,
  .section-block,
  .auth-shell,
  .account-card,
  .thank-shell {
    padding: 22px;
  }

  .action-row,
  .event-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .action-row .button,
  .event-footer .source-link,
  .section-head-compact .button {
    width: 100%;
    justify-content: center;
  }

  .odds-grid {
    grid-template-columns: 1fr;
  }

  .slip-item,
  .slip-footer,
  .ticket-selection {
    align-items: stretch;
    flex-direction: column;
  }

  .slip-side {
    justify-items: stretch;
  }

  .offline-banner {
    top: 92px;
  }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-strong);
  }

  body[data-theme="dark"] .bottom-nav {
    background: rgba(8, 17, 30, 0.9);
  }

  .bottom-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 12px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
  }

  .bottom-nav-link.is-active {
    color: var(--accent-strong);
    background: var(--surface-strong);
    box-shadow: 0 10px 22px rgba(15, 33, 58, 0.08);
  }
}
