:root {
  --bg: #070b14;
  --bg-elevated: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2438;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --gold: #f5c542;
  --gold-dim: rgba(245, 197, 66, 0.15);
  --green: #22c55e;
  --blue: #3b82f6;
  --red: #ef4444;
  --draw: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 132px;
  --tabbar-h: calc(64px + env(safe-area-inset-bottom, 0px));
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 197, 66, 0.12), transparent),
    var(--bg);
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 16px 10px;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(245, 197, 66, 0.4));
}

.brand__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__sub {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.icon-btn:active {
  transform: scale(0.94);
  background: var(--bg-card-hover);
}

.icon-btn.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.header__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.header__controls[hidden] {
  display: none !important;
}

.chip {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 1.2rem;
  cursor: pointer;
}

.date-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color-scheme: dark;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.toggle input {
  accent-color: var(--gold);
}

.stats-bar {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stats-bar span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
}

/* Main */
.main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(var(--tabbar-h) + 16px);
  contain: layout style;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Match card */
.match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}

.match-card:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}

.match-card--wc {
  border-color: rgba(245, 197, 66, 0.25);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 197, 66, 0.06) 100%);
}

.match-card__league {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.match-card__league img,
.league-badge {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.league-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.league-icon--wc {
  filter: drop-shadow(0 0 4px rgba(245, 197, 66, 0.5));
}

.match-card__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.match-card--pick-1 {
  box-shadow: inset 3px 0 0 var(--green);
}

.match-card--pick-2 {
  box-shadow: inset 3px 0 0 var(--blue);
}

.match-card--pick-X {
  box-shadow: inset 3px 0 0 var(--draw);
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: relative;
  transition: opacity 0.2s, transform 0.2s;
}

.team--winner {
  transform: scale(1.03);
}

.team--winner .team__flag {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.35), 0 0 16px rgba(245, 197, 66, 0.25);
}

.team--winner .team__name {
  color: var(--gold);
  font-weight: 800;
}

.team--muted {
  opacity: 0.45;
}

.team--draw-pick .team__flag,
.team--draw-pick .team__name {
  opacity: 0.85;
}

.team__crown {
  position: absolute;
  top: -4px;
  right: calc(50% - 28px);
  font-size: 0.85rem;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(245, 197, 66, 0.8);
  line-height: 1;
}

.team--away {
  text-align: right;
}

.team__flag {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.team__flag--initials {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(245, 197, 66, 0.12));
}

.team__name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.match-card__center {
  text-align: center;
  min-width: 64px;
}

.match-card__time--sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.predicted-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.predicted-score--large .predicted-score__value {
  font-size: 1.75rem;
}

.predicted-score__label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.predicted-score__value {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245, 197, 66, 0.35);
  font-variant-numeric: tabular-nums;
}

.score-analysis {
  border: 1px solid rgba(245, 197, 66, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(245, 197, 66, 0.05);
}

.score-analysis--card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}

.score-analysis__title {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}

.score-analysis--card .score-analysis__pick {
  font-size: 1.45rem;
}

.score-analysis--card .score-analysis__meta,
.score-analysis--card .score-analysis__sources {
  font-size: 0.78rem;
}

.match-card__score-analysis {
  margin-top: 0;
}

.match-card__score-analysis .score-analysis {
  margin-top: 0;
}

.score-analysis__pick {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.score-analysis__meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.score-analysis__sources {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.score-analysis__sources li + li {
  margin-top: 4px;
}

.score-note {
  color: #ff9b6a;
  font-size: 0.75rem;
}

.prono-hero {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.14), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(245, 197, 66, 0.22);
  text-align: center;
}

.prono-hero__main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.prono-hero__winner {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.prono-hero__score {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.prono-hero__conf {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.match-card__pick-sep {
  opacity: 0.35;
}

.detail-prono-hero {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-prono-hero__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}

.detail-prono-hero__winner {
  font-size: 1.15rem;
  font-weight: 800;
}

.detail-prono-hero__score {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.detail-prono-hero__conf {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section--highlight {
  margin-top: 0;
}

.verdict-card {
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
}

.verdict-card--1 {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.04));
  border-color: rgba(34, 197, 94, 0.35);
}

.verdict-card--2 {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04));
  border-color: rgba(59, 130, 246, 0.35);
}

.verdict-card--X {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.18), rgba(167, 139, 250, 0.04));
  border-color: rgba(167, 139, 250, 0.35);
}

.verdict-card__winner {
  font-size: 1.1rem;
  font-weight: 800;
}

.verdict-card__score {
  margin-top: 10px;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.verdict-card__meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section__sub {
  margin: -6px 0 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.odds-preview {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.odds-preview__title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.odds-preview__hint {
  margin-top: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

.odds-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.72rem;
}

.odds-table--compact {
  font-size: 0.68rem;
}

.odds-table__head,
.odds-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
}

.odds-table__head {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.odds-table__head span:not(.odds-book) {
  text-align: center;
}

.odds-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.odds-row--avg {
  background: rgba(245, 197, 66, 0.08) !important;
  border-top: 1px solid rgba(245, 197, 66, 0.2);
  font-weight: 700;
}

.odds-book {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.odds-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 3px 4px;
  border-radius: 4px;
}

.odds-cell--pick {
  background: rgba(245, 197, 66, 0.15);
  color: var(--gold);
  font-weight: 800;
}

.odds-cell--best {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
  color: var(--green);
  font-weight: 700;
}

.odds-cell--pick.odds-cell--best {
  box-shadow: inset 0 0 0 1px rgba(245, 197, 66, 0.6);
}

.odds-link,
.odds-book--link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 28px;
  transition: background 0.15s, transform 0.1s;
}

.odds-book--link {
  justify-content: flex-start;
  gap: 4px;
  color: var(--gold);
}

.odds-link:active,
.odds-book--link:active {
  transform: scale(0.96);
}

.odds-link:hover,
.odds-book--link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.odds-link__icon {
  font-size: 0.55rem;
  opacity: 0.75;
  line-height: 1;
}

.match-card__status {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.match-card__score {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.match-card__time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
}

.match-card__pick {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
}

.pick-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.7rem;
}

.pick-badge--1 {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.pick-badge--X {
  background: rgba(167, 139, 250, 0.2);
  color: var(--draw);
}

.pick-badge--2 {
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue);
}

.prob-mini {
  display: flex;
  gap: 3px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.prob-mini__seg {
  height: 100%;
}

.prob-mini__seg--1 {
  background: var(--green);
}

.prob-mini__seg--X {
  background: var(--draw);
}

.prob-mini__seg--2 {
  background: var(--blue);
}

/* Skeleton */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-card {
  height: 280px;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Empty */
.empty {
  text-align: center;
  padding: 48px 24px;
}

.empty__icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.empty__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Search */
.search-panel {
  margin-bottom: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 1rem;
}

.search-hint {
  margin: 8px 4px 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--tabbar-h);
  padding-bottom: var(--safe-bottom);
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}

.tabbar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  min-height: 44px;
}

.tabbar__btn.is-active {
  color: var(--gold);
}

.tabbar__icon {
  font-size: 1.15rem;
}

/* Sheet (match detail) */
.sheet[hidden] {
  display: none !important;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.sheet__panel {
  position: relative;
  max-height: 92dvh;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
}

.sheet__handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.sheet__header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
}

.sheet__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(24px + var(--safe-bottom));
}

.detail-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  text-align: center;
}

.detail-teams .team__flag {
  width: 56px;
  height: 56px;
}

.detail-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.meta-pill {
  font-size: 0.68rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.section {
  margin-top: 20px;
}

.section__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.prob-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prob-row {
  display: grid;
  grid-template-columns: 28px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.prob-row__label {
  font-weight: 800;
}

.prob-row__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.prob-row__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.prob-row__fill--1 {
  background: var(--green);
}

.prob-row__fill--X {
  background: var(--draw);
}

.prob-row__fill--2 {
  background: var(--blue);
}

.prob-row__pct {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.market-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.market-card__label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.market-card__value {
  font-size: 1.1rem;
  font-weight: 800;
}

.form-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.form-block {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.form-block__team {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-letters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.form-letter {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
}

.form-letter--W {
  background: rgba(34, 197, 94, 0.25);
  color: var(--green);
}

.form-letter--D {
  background: rgba(167, 139, 250, 0.25);
  color: var(--draw);
}

.form-letter--L {
  background: rgba(239, 68, 68, 0.25);
  color: var(--red);
}

.form-letter--N {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.scenario {
  padding: 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
}

.scenario__title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.scenario__text {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-item {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
}

.stat-item__label {
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-item__value {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Onboarding bookmakers */
.onboarding[hidden] {
  display: none !important;
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-bottom));
}

.onboarding__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.onboarding__panel {
  position: relative;
  width: min(100%, 400px);
  padding: 24px 20px 20px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: fadeIn 0.25s ease;
}

.onboarding__icon {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}

.onboarding__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.onboarding__text {
  margin: 10px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.bm-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.bm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.bm-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bm-chip__label {
  font-size: 0.82rem;
  font-weight: 600;
}

.bm-chip__check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bm-chip:has(input:checked) {
  border-color: rgba(245, 197, 66, 0.55);
  background: var(--gold-dim);
}

.bm-chip:has(input:checked) .bm-chip__check {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0f1a;
}

.bm-chip:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.onboarding__hint {
  margin: 14px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.onboarding__btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #0a0f1a;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.onboarding__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onboarding__btn:not(:disabled):active {
  transform: scale(0.98);
}

.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 12px);
  left: 16px;
  right: 16px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #1e293b;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  text-align: center;
  animation: slideUp 0.25s ease;
  box-shadow: var(--shadow);
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

@media (min-width: 640px) {
  .app {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .tabbar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }

  .toast {
    max-width: 448px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
