:root {
  --bg-main: #070a12;
  --bg-card: #111724;
  --bg-card-strong: #151d2e;
  --bg-soft: #1a2235;
  --bg-soft-2: #202a42;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text-main: #f4f7ff;
  --text-muted: #98a1bb;
  --text-soft: #7e869d;
  --brand: #ffcc3d;
  --brand-strong: #ffb800;
  --green: #38d17c;
  --red: #ff6c78;
  --blue: #77a6ff;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(49, 68, 122, 0.32), transparent 28%),
    linear-gradient(180deg, #0a0d15 0%, #070a12 100%);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 12px 112px;
  display: grid;
  gap: 12px;
}

.topbar,
.wallet-card,
.sports-toolbar,
.league-card,
.featured-card,
.events-card,
.betslip-card,
.history-card,
.event-modal {
  background: linear-gradient(180deg, rgba(19, 25, 38, 0.98), rgba(13, 18, 29, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.topbar {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.balance-chip {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 204, 61, 0.18);
  background: rgba(255, 255, 255, 0.03);
  text-align: right;
}

.balance-chip-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.balance-chip strong {
  display: block;
  margin-top: 1px;
  font-size: 15px;
  line-height: 1.05;
  color: var(--brand);
}

.balance-currency {
  font-size: 10px;
}

.wallet-card,
.sports-toolbar,
.league-card,
.featured-card,
.events-card,
.betslip-card,
.history-card {
  padding: 12px;
}

.wallet-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wallet-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wallet-balance {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand);
}

.wallet-status {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wallet-actions {
  display: grid;
  gap: 8px;
}

.wallet-actions-main {
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-actions-launch {
  margin-top: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.wallet-actions-utility {
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #15120a;
  font-weight: 800;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.wallet-actions-utility .btn {
  min-height: 36px;
  border-radius: 999px;
  font-size: 12px;
}

.sports-toolbar {
  display: grid;
  gap: 10px;
}

.scope-tabs,
.history-tabs,
.league-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.scope-tabs::-webkit-scrollbar,
.history-tabs::-webkit-scrollbar,
.league-strip::-webkit-scrollbar {
  display: none;
}

.scope-tab,
.history-tab,
.league-pill,
.ghost-link {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
}

.scope-tab.active,
.history-tab.active,
.league-pill.active {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #17140b;
  border-color: transparent;
  font-weight: 800;
}

.search-input,
.stake-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-main);
  outline: none;
}

.search-input::placeholder,
.stake-input::placeholder {
  color: var(--text-soft);
}

.section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

.section-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ghost-link {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.featured-match,
.event-card,
.bet-row,
.slip-selection,
.empty-box {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 35, 54, 0.98), rgba(20, 26, 40, 0.98));
}

.featured-match {
  padding: 14px;
  display: grid;
  gap: 14px;
}

.featured-top,
.event-top,
.bet-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.league-badge,
.status-badge {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.league-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.status-badge.live {
  background: rgba(56, 209, 124, 0.14);
  color: #90f3b9;
}

.status-badge.upcoming {
  background: rgba(119, 166, 255, 0.14);
  color: #b4ccff;
}

.status-badge.settled {
  background: rgba(255, 108, 120, 0.12);
  color: #ffadb4;
}

.teams-grid {
  display: grid;
  gap: 10px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.team-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.team-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.team-score {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

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

.odds-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.odd-btn {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

.odd-btn-label {
  font-size: 11px;
  color: var(--text-muted);
}

.odd-btn-price {
  font-size: 15px;
  font-weight: 800;
}

.odd-btn.active {
  border-color: rgba(255, 204, 61, 0.34);
  background: rgba(255, 204, 61, 0.1);
  color: var(--brand);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  padding: 12px;
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-kicker {
  font-size: 12px;
  color: var(--text-muted);
}

.event-card .team-name {
  font-size: 14px;
}

.event-card .team-score {
  font-size: 20px;
}

.event-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.event-card-link {
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
}

.event-skeleton,
.league-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: transparent;
}

.event-skeleton {
  min-height: 148px;
}

.league-skeleton {
  width: 110px;
  min-height: 38px;
}

.event-skeleton::after,
.league-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.betslip-card,
.history-card {
  display: grid;
  gap: 10px;
}

.slip-list,
.history-list {
  display: grid;
  gap: 10px;
}

.slip-selection,
.bet-row {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.slip-selection-top,
.bet-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.slip-event,
.bet-event {
  font-size: 13px;
  font-weight: 700;
}

.slip-market,
.bet-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.slip-price,
.bet-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
}

.remove-selection {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
}

.slip-actions {
  display: grid;
  gap: 10px;
}

.stake-label {
  font-size: 12px;
  color: var(--text-muted);
}

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

.summary-card {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
}

.summary-value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 800;
}

.place-bet-button {
  min-height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #18140a;
  font-weight: 800;
  cursor: pointer;
}

.empty-box {
  padding: 16px;
}

.empty-title {
  font-size: 15px;
  font-weight: 800;
}

.empty-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.history-tab {
  min-height: 34px;
  padding: 0 12px;
}

.bet-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bet-stat {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(8px);
  z-index: 90;
}

.modal-overlay.active {
  display: flex;
}

.event-modal {
  width: min(100%, 720px);
  padding: 14px;
  border-radius: 20px;
}

.modal-close {
  margin-left: auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
}

.event-modal-content {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

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

.market-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.market-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 520px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 24, 38, 0.96);
  color: var(--text-main);
  display: none;
  z-index: 100;
}

.toast.show {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 18px), 480px);
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 20, 32, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  z-index: 80;
}

.bottom-nav-item {
  position: relative;
  min-height: 56px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.bottom-nav-item.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.bottom-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.bottom-nav-item.active .bottom-nav-icon {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #18140a;
  border-color: transparent;
}

.bottom-nav-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-label {
  font-size: 10px;
  line-height: 1;
}

@media (max-width: 560px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .brand-title {
    font-size: 17px;
    letter-spacing: 0.1em;
  }

  .wallet-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-status {
    min-height: 24px;
    padding: 0 8px;
    font-size: 10px;
  }

  .wallet-balance {
    font-size: 21px;
  }

  .odds-row {
    gap: 6px;
  }

  .odd-btn {
    min-height: 44px;
    padding: 7px 8px;
  }

  .team-name {
    font-size: 14px;
  }

  .team-score {
    font-size: 22px;
  }

  .bottom-nav {
    width: min(calc(100% - 16px), 430px);
  }

  .bottom-nav-item {
    min-height: 52px;
  }

  .bottom-nav-icon {
    width: 24px;
    height: 24px;
  }

  .bottom-nav-icon svg {
    width: 13px;
    height: 13px;
  }

  .bottom-nav-label {
    font-size: 9px;
  }
}
