/* Санрайз Прогноз — dark sports theme with a sunrise accent */
:root {
  --bg: #0b1020;
  --bg-2: #0f1529;
  --card: #151c31;
  --card-2: #1c2541;
  --line: rgba(255, 255, 255, .07);
  --text: #f3f5fb;
  --muted: #8d95b0;
  /* brand orange taken from the Sunrise logo (#D97700) */
  --accent: #f08c00;
  --accent-2: #ffc14d;
  --grad: linear-gradient(135deg, #d97700 0%, #f39200 50%, #ffbe45 100%);
  --grad-soft: linear-gradient(135deg, rgba(217, 119, 0, .20), rgba(255, 190, 69, .10));
  --ok: #34d399;
  --bad: #f87171;
  --info: #60a5fa;
  --radius: 18px;
  --radius-s: 12px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
a { color: var(--accent-2); }
[hidden] { display: none !important; }

.view { padding: 16px 16px calc(var(--tabbar-h) + 24px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.view.no-tabs { padding-bottom: calc(96px + var(--safe-b)); }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.2px; }
.brand-logo { height: 30px; width: auto; display: block; filter: drop-shadow(0 4px 14px rgba(217, 119, 0, .35)); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.page-title { font-size: 22px; font-weight: 800; margin: 4px 0 14px; letter-spacing: -.3px; }
.subtle { color: var(--muted); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 22px 4px 10px; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.pts-badge { flex: none; font-size: 12px; font-weight: 700; color: var(--accent-2); background: rgba(255, 193, 77, .1); border-radius: 999px; padding: 4px 9px; white-space: nowrap; }

.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 18px; background: var(--grad); color: #1a0f05; margin-bottom: 12px; box-shadow: 0 14px 40px rgba(255, 110, 61, .25); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.hero .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .75; }
.hero .teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 12px; position: relative; z-index: 1; }
.team { flex: 1; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.15; }
.team .crest { width: 60px; height: 60px; margin: 0 auto 8px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: #fff; box-shadow: 0 6px 16px rgba(80, 40, 0, .25); overflow: hidden; }
.team .crest img { max-width: 80%; max-height: 80%; object-fit: contain; }
.mini-logo { width: 28px; height: 28px; flex: none; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; font-size: 15px; }
.mini-logo img { max-width: 82%; max-height: 82%; object-fit: contain; }
.vs { font-weight: 900; font-size: 14px; opacity: .6; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.hero .meta span { background: rgba(0, 0, 0, .12); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 11.5px; color: var(--muted); }

.progress-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-chip { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); }
.q-chip.done { background: rgba(52, 211, 153, .12); color: var(--ok); }
.q-chip.new { background: rgba(255, 193, 77, .14); color: var(--accent-2); }

.banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-s); background: var(--grad-soft); border: 1px solid rgba(255, 150, 70, .25); margin-bottom: 12px; font-size: 14px; }
.banner .ico { font-size: 22px; }
.banner.lock { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.banner.ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .25); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 16px; border-radius: 14px; font-weight: 700; font-size: 15.5px; background: var(--card-2); transition: transform .08s ease, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #1a0f05; box-shadow: 0 8px 24px rgba(255, 122, 61, .3); }
.btn.dark { background: #1a0f05; color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: rgba(248, 113, 113, .12); color: var(--bad); }
.btn.small { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, rgba(11, 16, 32, 0)); z-index: 20; }
.sticky-bar .inner { max-width: 560px; margin: 0 auto; }

/* ---------- choice controls ---------- */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.choice { padding: 14px 8px; border-radius: 14px; background: var(--card-2); border: 2px solid transparent; font-weight: 700; text-align: center; transition: all .12s ease; }
.choice small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.choice.on { border-color: var(--accent); background: rgba(255, 122, 61, .14); color: #fff; }
.choice[disabled] { opacity: .6; }

.score-picker { display: flex; align-items: center; justify-content: center; gap: 12px; }
.stepper { flex: 1; text-align: center; }
.stepper .name { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; }
.stepper .num { font-size: 40px; font-weight: 900; min-width: 44px; font-variant-numeric: tabular-nums; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); font-size: 22px; font-weight: 700; }
.score-sep { font-size: 32px; font-weight: 900; color: var(--muted); padding-top: 22px; }

.players { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.player { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card-2); border: 2px solid transparent; text-align: left; font-weight: 600; font-size: 14px; }
.player .no { width: 30px; height: 30px; flex: none; border-radius: 9px; background: rgba(255, 255, 255, .06); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.player.on { border-color: var(--accent); background: rgba(255, 122, 61, .14); }
.player.on .no { background: var(--grad); color: #1a0f05; }
.player[disabled] { opacity: .5; }

/* ---------- tabs / segmented ---------- */
.segmented { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; border: 1px solid var(--line); }
.segmented button { flex: 1; padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.segmented button.on { background: var(--card-2); color: var(--text); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: rgba(15, 21, 41, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 30; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabbar a .i { font-size: 21px; filter: grayscale(1) opacity(.7); }
.tabbar a.on { color: var(--text); }
.tabbar a.on .i { filter: none; }

/* ---------- rating ---------- */
.me-card { display: flex; align-items: center; gap: 14px; }
.me-card .place { font-size: 34px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 64px; }
.rows { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.me { background: rgba(255, 122, 61, .1); }
.row .rk { width: 30px; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .nm { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.row .pt { font-weight: 800; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--muted); }
.ava { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-weight: 800; font-size: 14px; overflow: hidden; color: var(--accent-2); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.big { width: 64px; height: 64px; font-size: 24px; }

/* ---------- result ---------- */
.big-score { text-align: center; padding: 20px 10px; }
.big-score .sc { font-size: 54px; font-weight: 900; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.big-score .tm { display: flex; justify-content: space-between; font-weight: 700; color: var(--muted); font-size: 13px; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .t { font-weight: 700; }
.line .e { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.line .p { font-weight: 800; font-size: 16px; white-space: nowrap; }
.line .p.plus { color: var(--ok); }
.line .p.zero { color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-weight: 900; padding-top: 12px; }
.perfect { text-align: center; padding: 18px; border-radius: var(--radius); background: var(--grad); color: #1a0f05; font-weight: 900; font-size: 20px; margin-bottom: 12px; }
.rank-move { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 18px; font-weight: 800; }
.rank-move .up { color: var(--ok); }
.rank-move .down { color: var(--bad); }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head .name { font-size: 20px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.acc-row { margin-bottom: 12px; }
.acc-row .top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.ach { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.ach .em { font-size: 28px; }
.ach .tt { font-size: 12px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.ach.off { opacity: .35; filter: grayscale(1); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--card-2); transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invite-link { font-size: 12.5px; color: var(--muted); word-break: break-all; background: var(--bg-2); padding: 10px; border-radius: 10px; margin: 10px 0; }

/* ---------- forms (admin) ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); outline: none; }
.input:focus { border-color: var(--accent); }
.checkline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.checkline:last-child { border-bottom: 0; }
.checkline input { width: 20px; height: 20px; accent-color: var(--accent); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--card-2); color: var(--muted); }
.pill.open { background: rgba(52, 211, 153, .14); color: var(--ok); }
.pill.closed { background: rgba(255, 193, 77, .14); color: var(--accent-2); }
.pill.done { background: rgba(96, 165, 250, .14); color: var(--info); }
.pill.warn { background: rgba(248, 113, 113, .14); color: var(--bad); }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .em { font-size: 48px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin: 6px 0; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; height: 120px; margin-bottom: 12px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #262f4d; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: tin .2s ease; max-width: 520px; }
.toast.ok { background: #13624a; }
.toast.err { background: #7c2432; }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: fin .15s; }
.modal { background: var(--card); border-radius: 20px; padding: 20px; width: 100%; max-width: 480px; margin-bottom: var(--safe-b); }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 18px; white-space: pre-line; }
@keyframes fin { from { opacity: 0; } }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.pop { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* ---------- onboarding ---------- */
.onb { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.onb-logo { width: 150px; margin: 0 auto 4px; display: block; filter: drop-shadow(0 10px 30px rgba(217, 119, 0, .35)); }
.onb h1 { font-size: 24px; font-weight: 900; text-align: center; margin: 0; letter-spacing: -.3px; text-wrap: balance; }
.onb .lead { text-align: center; color: var(--muted); margin: 0; }
.name-status { min-height: 18px; font-size: 13px; margin-top: 6px; }
.name-status.ok { color: var(--ok); }
.name-status.bad { color: var(--bad); }
.logo-pick { display: flex; align-items: center; gap: 12px; }
.logo-pick .prev { width: 56px; height: 56px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; font-size: 24px; }
.logo-pick .prev img { max-width: 82%; max-height: 82%; object-fit: contain; }
.logo-pick input[type=file] { display: none; }

/* ---------- avatars without photo / photo choice ---------- */
.ava-icon { width: 62%; height: 62%; fill: var(--accent); opacity: .9; }
.ava img + .ava-icon { display: none; }
.photo-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-choice .choice { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-choice .ava.big { width: 56px; height: 56px; }
.contact-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.segmented.scroll { overflow-x: auto; scrollbar-width: none; }
.segmented.scroll::-webkit-scrollbar { display: none; }
.segmented.scroll button { flex: 0 0 auto; padding: 9px 12px; }
