/* «Богема» — официальная тема ЧМ-2026: чёрный / белый / золото. Плоско, без теней. */

:root {
  --black:   #0C0C0D;
  --gold:    #C8A24A;
  --gold-tx: #3E2F0C;
  --gold-dk: #9A7B2E;

  --bg:      #F2F2F4;
  --card:    #FFFFFF;
  --text:    #15151A;
  --muted:   #8A8A91;
  --line:    #E6E6EA;
  --green:   #1F9D55;
  --red:     #C0392B;

  --radius: 14px;
  --nav-h: 58px;
}

body.dark {
  --bg:    #101013;
  --card:  #1B1B20;
  --text:  #F2F2F4;
  --muted: #9A9AA2;
  --line:  #2B2B31;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }

/* ---------- загрузка ---------- */
.boot-spinner {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: var(--black); color: #fff;
}
.boot-trophy { font-size: 44px; }
.boot-title { font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--gold); }

/* ---------- онбординг ---------- */
.onboarding {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--black); color: #fff;
  padding: 48px 20px calc(24px + env(safe-area-inset-bottom));
}
.onboarding-hero { text-align: center; margin-bottom: 36px; }
.onboarding-hero .trophy { font-size: 56px; display: block; margin-bottom: 12px; }
.onboarding-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: .03em; color: var(--gold); }
.onboarding-hero p { color: #B9B9BE; margin-top: 6px; font-size: 15px; }

.onboarding-card {
  background: var(--card); color: var(--text);
  border-radius: var(--radius); padding: 20px; margin-top: auto;
}
.onboarding-card h2 { font-size: 19px; margin-bottom: 14px; }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); padding: 12px 14px; font-size: 17px; outline: none;
}
.name-input:focus { border-color: var(--gold); }
.name-counter { color: var(--muted); font-size: 13px; min-width: 40px; text-align: right; }
.start-note {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
  background: rgba(200, 162, 74, .12); color: var(--gold-dk);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600;
}
.form-error { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 16px; }

.btn-gold {
  display: block; width: 100%; margin-top: 14px;
  background: var(--gold); color: var(--gold-tx);
  border-radius: 12px; padding: 14px; font-size: 17px; font-weight: 700;
}
.btn-gold:disabled { opacity: .55; }

/* ---------- каркас приложения ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--black); color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.app-header .trophy { font-size: 26px; }
.app-header .titles { flex: 1; min-width: 0; }
.app-header .app-name { font-size: 17px; font-weight: 800; letter-spacing: .03em; color: var(--gold); }
.app-header .app-sub { font-size: 12px; color: #B9B9BE; }
.balance-pill {
  background: var(--gold); color: var(--gold-tx);
  border-radius: 999px; padding: 7px 13px;
  font-weight: 800; font-size: 14px; white-space: nowrap;
}

.content {
  padding: 12px 12px calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}

/* строка игрока */
.player-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 12px;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--black); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex: none;
}
.player-row .info { flex: 1; min-width: 0; }
.player-row .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row .sub { color: var(--muted); font-size: 13px; }
.chevron { color: var(--muted); font-size: 20px; }

/* фильтр матчей */
.seg {
  display: flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px; margin-bottom: 12px;
}
.seg button {
  flex: 1; padding: 8px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.seg button.active { background: var(--black); color: var(--gold); }

/* ---------- карточка матча ---------- */
.match-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.match-meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.match-meta .grp { color: var(--gold-dk); font-weight: 700; }
.match-teams {
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.match-score { color: var(--gold-dk); font-weight: 800; white-space: nowrap; }
.match-chip {
  display: inline-block; margin-top: 8px;
  background: var(--bg); color: var(--muted);
  border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 600;
}

.market-group { margin-top: 12px; }
.market-caption { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.market-row { display: flex; gap: 8px; }

.odd-btn {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 4px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card);
}
.odd-btn .lbl { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odd-btn .val { font-weight: 800; font-size: 16px; }
.odd-btn.selected { border-color: var(--gold); outline: 2px solid var(--gold); outline-offset: -2px; }
.odd-btn.selected .val { color: var(--gold-dk); }
.odd-btn:disabled { opacity: .45; }

.more-link {
  display: block; width: 100%; margin-top: 12px;
  color: var(--gold-dk); font-size: 14px; font-weight: 700; text-align: center;
}
.extra-markets { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 2px; }
.extra-loading { color: var(--muted); font-size: 14px; text-align: center; padding: 10px 0; }

.empty-state {
  text-align: center; color: var(--muted);
  padding: 48px 20px; font-size: 15px; line-height: 1.5;
}
.empty-state .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ---------- таблица ---------- */
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px;
}
.lb-row.me { border-color: var(--gold); outline: 1px solid var(--gold); outline-offset: -1px; }
.lb-rank {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); font-weight: 800; font-size: 13px;
}
.lb-rank.top1 { background: var(--gold); color: var(--gold-tx); }
.lb-row .info { flex: 1; min-width: 0; }
.lb-row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .you { color: var(--gold-dk); font-weight: 600; font-size: 13px; }
.lb-money { text-align: right; }
.lb-money .bal { font-weight: 800; }
.lb-money .roi { font-size: 13px; font-weight: 700; }
.roi-pos { color: var(--green); }
.roi-neg { color: var(--red); }
.roi-zero { color: var(--muted); }

/* ---------- профиль ---------- */
.profile-head {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0 6px; gap: 10px;
}
.profile-head .avatar { width: 64px; height: 64px; font-size: 22px; }
.profile-name { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.edit-btn { color: var(--gold-dk); font-size: 15px; padding: 4px; }
.profile-sub { color: var(--muted); font-size: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-top: 12px;
}
.balance-card .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.balance-card .value { font-size: 28px; font-weight: 800; margin-top: 2px; }
.balance-card .roi { margin-top: 2px; font-size: 14px; font-weight: 700; }

.section-title { font-size: 16px; font-weight: 800; margin: 18px 2px 8px; }

.bet-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bet-item:last-child { border-bottom: none; }
.bet-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bet-label { font-weight: 700; font-size: 15px; }
.bet-status { font-size: 12px; font-weight: 800; white-space: nowrap; border-radius: 7px; padding: 3px 8px; }
.st-open { background: rgba(200,162,74,.15); color: var(--gold-dk); }
.st-won  { background: rgba(31,157,85,.13); color: var(--green); }
.st-lost { background: rgba(192,57,43,.12); color: var(--red); }
.st-void { background: var(--bg); color: var(--muted); }
.bet-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.bet-result { font-size: 14px; font-weight: 700; margin-top: 5px; }

.ghost-btn {
  display: block; width: 100%; margin-top: 12px; padding: 11px;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600; text-align: center;
}

/* редактирование имени */
.edit-name-row { display: flex; gap: 8px; margin-top: 10px; }
.edit-name-row .name-input { padding: 10px 12px; }
.edit-name-row .btn-gold { width: auto; margin: 0; padding: 10px 16px; font-size: 15px; }

/* ---------- нижняя навигация ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; padding: 8px 0 7px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.bottom-nav button.active { color: var(--gold-dk); }
.bottom-nav .ico { font-size: 21px; line-height: 1; }

/* ---------- купон (bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .2s ease;
  max-width: 560px; margin: 0 auto;
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet-match { color: var(--muted); font-size: 13px; }
.sheet-pick {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sheet-pick .lbl { font-size: 17px; font-weight: 700; }
.sheet-pick .odds { color: var(--gold-dk); font-size: 19px; font-weight: 800; white-space: nowrap; }
.stake-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.stake-input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); padding: 12px 14px; font-size: 20px; font-weight: 700; outline: none;
}
.stake-input:focus { border-color: var(--gold); }
.stake-cur { color: var(--muted); font-weight: 700; }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chips button {
  flex: 1; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px; font-size: 14px; font-weight: 700; color: var(--gold-dk);
}
.potential {
  display: flex; justify-content: space-between;
  margin-top: 14px; font-size: 14px; color: var(--muted);
}
.potential .win { color: var(--text); font-weight: 800; font-size: 15px; }
.sheet-error { color: var(--red); font-size: 13px; min-height: 17px; margin-top: 8px; }
.sheet .btn-gold { margin-top: 6px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-80px);
  z-index: 50; background: var(--black); color: #fff;
  border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 600;
  transition: transform .22s ease; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .gold { color: var(--gold); }
