/* Оформление стенда по макету заказчика (Футбол.png, Figma «Тендер Тануки | игры»).
   Палитра снята пипеткой прямо с экспорта: фон #ff0000, карточки #f9f6ed,
   выбранный вариант #fac5be, кнопки чёрные. Заголовки заглавными, крупные
   скругления, флаги стран кружком. */

:root {
  --red: #ff0000;
  --red-dim: #e00000;
  --cream: #f9f6ed;
  --cream-dim: #f2f1ef;
  --pink: #fac5be;
  --ink: #000000;
  --muted: #8a8a8a;
  --gold: #e4b73f;
  --ok: #7ab87a;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #2f2f2f;
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.phone-hint {
  color: #bdbdbd;
  font-size: 12px;
  padding: 10px 16px 0;
  text-align: center;
  max-width: 460px;
}

.app {
  width: 100%;
  max-width: 460px;
  background: var(--red);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Шапка «ВАШ РЕЙТИНГ»: кремовая карта поверх красного ---------- */

.topbar {
  background: var(--cream);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px 16px;
}

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

.brand { display: flex; align-items: center; gap: 9px; }
.brand-title {
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.brand-sub { font-size: 10.5px; color: var(--muted); }

.prizes-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 6px 7px 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.prizes-btn .ava {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cream);
  overflow: hidden;
  display: grid; place-items: center;
  flex: none;
}
.prizes-btn .ava img { width: 150%; height: auto; margin-top: 12%; }

.rating-label {
  font-size: 17px;
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.rating-nums { display: flex; align-items: flex-start; gap: 18px; }
.rating-cell { display: flex; flex-direction: column; }
.rating-cell .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rating-cell .cap { font-size: 11px; color: var(--muted); margin-top: 3px; }
.rating-div { width: 1px; align-self: stretch; background: #ddd8cc; }

.rating-cta {
  width: 100%;
  margin-top: 13px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Вкладки ---------- */

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 12px 14px 4px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.55);
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--cream); color: var(--ink); border-color: var(--cream); font-weight: 700; }

main { flex: 1; padding: 10px 14px 18px; }
.pane { display: none; }
.pane.active { display: block; }

.section-title {
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 6px 0 10px;
}

.hint {
  background: rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #fff;
  margin-bottom: 12px;
}
.hint.small { font-size: 11.5px; margin: 8px 0 10px; }

/* ---------- Лента дат матчей ---------- */

.datestrip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.datestrip::-webkit-scrollbar { display: none; }

.datechip {
  flex: none;
  width: 56px;
  padding: 7px 4px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.6);
  background: transparent;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.datechip.active { background: var(--cream); color: var(--ink); border-color: var(--cream); font-weight: 700; }
.datechip .st { height: 16px; display: grid; place-items: center; }
.datechip svg { display: block; }

/* ---------- Карточка матча ---------- */

.match {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 11px;
}

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.match-when { font-size: 12px; color: var(--muted); }
.match-when b { color: var(--ink); font-weight: 600; margin-right: 8px; }

.pts-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ink);
  color: #fff;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.pts-chip.win { background: var(--ok); }
.pts-chip.zero { background: #c9c4b8; color: #4a4a4a; }

.vs-block {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-side .nm { font-size: 12.5px; color: var(--red); font-weight: 600; text-align: center; }
.vs-mid { display: grid; place-items: center; }
.vs-x { color: var(--red); font-size: 19px; font-weight: 700; }
.vs-score { font-size: 27px; font-weight: 800; color: var(--ink); }

.flag {
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--cream-dim);
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.flag svg { display: block; width: 100%; height: 100%; }
.flag.sm { width: 34px; height: 34px; }

.match-cta {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border-radius: 99px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.match-cta.done { background: var(--cream-dim); color: var(--muted); cursor: default; }
.match-cta.made { background: #cfe3cb; color: #3c6b38; }
.match-cta.finished {
  background: transparent;
  color: var(--ink);
  border: 1px solid #d8d3c7;
}

.detail {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cream-dim);
  font-size: 12.5px;
}
.detail ul { margin: 6px 0 0; padding-left: 17px; color: #6b6b6b; font-size: 12px; }
.detail .pts { color: var(--red); font-weight: 700; }

/* ---------- Экран прогноза (модальный) ---------- */

.predict-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--red);
  display: flex;
  flex-direction: column;
  max-width: 460px;
  margin: 0 auto;
  padding: 16px;
  overflow-y: auto;
}
.pr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pr-back {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px 4px 0;
}
.pr-stage {
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12.5px;
  color: #fff;
}
.pr-q {
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  margin: 18px 0 6px;
  line-height: 1.15;
}
.pr-mascot { display: grid; place-items: center; margin: 4px 0 16px; }
.pr-mascot img { width: 172px; height: auto; }

.pr-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: 99px;
  padding: 10px 16px;
  margin-bottom: 10px;
  font-size: 14.5px;
  cursor: pointer;
  text-align: left;
}
.pr-opt.sel { background: var(--pink); font-weight: 700; text-transform: uppercase; }
.pr-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border-radius: 99px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.pr-submit:disabled { opacity: .45; cursor: not-allowed; }
.pr-foot {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: 11px;
  letter-spacing: .5px;
}
.pr-done { text-align: center; color: #fff; }
.pr-done h2 { font-size: 24px; text-transform: uppercase; margin: 8px 0; }
.pr-done p { color: rgba(255,255,255,.9); font-size: 13px; margin-bottom: 18px; }
.pr-done .btn-w {
  width: 100%; padding: 14px; border-radius: 99px; border: none;
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 10px;
}

/* ---------- Рейтинг ---------- */

.lb-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: var(--cream);
  border-radius: 14px;
  margin-bottom: 8px;
}
.lb-row.prize { border: 2px solid var(--gold); }
.lb-row.me-row { background: var(--pink); }
.rank { width: 27px; font-weight: 800; color: var(--muted); flex: none; text-align: center; }
.rank.medal { display: grid; place-items: center; }
.rank.medal svg { display: block; }
.lb-name { flex: 1; font-size: 14px; font-weight: 600; }
.lb-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.lb-pts { font-weight: 800; font-size: 17px; color: var(--red); }

.win-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--cream);
  border: 2px solid var(--gold);
}
.win-banner img { width: 74px; height: auto; flex: none; }
.win-text b { display: block; font-size: 17px; text-transform: uppercase; }
.win-text span { font-size: 12.5px; color: var(--muted); }

/* ---------- Промокоды ---------- */

.promo { margin-bottom: 13px; }
.coupon-svg { display: block; width: 100%; height: auto; }
.promo .btn { margin-top: 9px; }

.empty {
  color: #fff;
  text-align: center;
  padding: 26px 10px;
  font-size: 14px;
}
.empty-art { display: grid; place-items: center; margin-bottom: 12px; }
.empty-art img { width: 120px; height: auto; opacity: .95; }

/* ---------- Кнопки общего вида ---------- */

.btn {
  padding: 11px 16px;
  border-radius: 99px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: var(--cream); color: var(--ink); }
.btn.danger { background: #7a1010; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }

.row { display: flex; align-items: center; }
.row.gap { gap: 8px; flex-wrap: wrap; }

/* ---------- Админка и «О стенде»: кремовые листы на красном ---------- */

#tab-admin h3, #tab-about h3 {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
#tab-about p, #tab-about ul { color: #fff; font-size: 13.5px; }
#tab-about li { margin-bottom: 5px; }

.rule-row, .adm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 7px;
  font-size: 13px;
}
.rule-row span, .adm-row .adm-title { flex: 1; }
.adm-col { display: block; }
.adm-col .row { margin-top: 8px; }
.adm-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.adm-head svg { display: block; flex: none; }

input[type=number], select {
  padding: 8px;
  border-radius: 9px;
  border: 1px solid #ddd8cc;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
input[type=number] { width: 66px; }

.disclaimer {
  margin-top: 16px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  font-size: 12px;
  color: #fff;
}

pre {
  background: rgba(0,0,0,.35);
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  overflow: auto;
  max-height: 260px;
  color: #d7ffd7;
}

.foot {
  padding: 14px;
  text-align: center;
  font-size: 10.5px;
  color: rgba(255,255,255,.8);
  letter-spacing: .4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  z-index: 99;
}

/* Лёгкое покачивание статичного кадра маскота.
   Это НЕ анимация персонажа: см. комментарий в art.js о том, что для
   настоящей анимации нужна 3D-модель с ригом или спрайтовый атлас. */
@keyframes mascot-idle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-7px) rotate(1deg); }
}
.pr-mascot img { animation: mascot-idle 2.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .pr-mascot img { animation: none; }
}

/* ---------- Фильтр «Активные / Архив» в админке ---------- */

.adm-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.adm-section h3 { margin: 0; }

.filters { display: flex; gap: 6px; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.55);
  background: transparent;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.on {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
  font-weight: 700;
}
.fc-n {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.28);
}
.filter-chip.on .fc-n { background: rgba(0,0,0,.1); }

/* Счётчик матчей в кнопке дня: в один день их бывает несколько */
.dc-n {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255,255,255,.3);
  vertical-align: middle;
}
.datechip.active .dc-n { background: rgba(0,0,0,.12); }

/* Предупреждение о тестовом матче демоверсии */
.demo-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #fff4d6;
  border: 1px solid #e8cf8a;
  color: #6b5518;
  font-size: 12px;
  line-height: 1.4;
}

/* Селект в админке: на кремовой карточке тёмные переменные не годятся */
.adm-row select {
  padding: 8px;
  border-radius: 9px;
  border: 1px solid #ddd8cc;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
