/* Стрик: iOS-like look. Light and dark follow Telegram's color scheme. */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --card-2: #F7F7FA;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .32);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .07);
  --blue: #007AFF;
  --purple: #AF52DE;
  --indigo: #5856D6;
  --green: #34C759;
  --red: #FF3B30;
  --orange: #FF9500;
  --gold: #FFB340;
  --accent: var(--blue);
  --accent-tint: rgba(0, 122, 255, .1);
  --accent-grad: linear-gradient(135deg, #2F7BF6 0%, #6E5BFA 100%);
  --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 6px 24px rgba(15, 20, 40, .06);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B0B0E;
  --card: #1A1A1E;
  --card-2: #232328;
  --label: #FFFFFF;
  --label-2: rgba(235, 235, 245, .62);
  --label-3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .45);
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .14);
  --blue: #0A84FF;
  --purple: #BF5AF2;
  --indigo: #5E5CE6;
  --green: #30D158;
  --red: #FF453A;
  --orange: #FF9F0A;
  --gold: #FFC24D;
  --accent-tint: rgba(10, 132, 255, .16);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body {
  font: 17px/1.29 var(--font);
  letter-spacing: -.41px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button { font: inherit; letter-spacing: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }
[hidden] { display: none !important; }

.screen {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px) + 14px) 16px
           calc(var(--tg-safe-area-inset-bottom, 0px) + 40px);
}

/* Header */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: -.08px; text-transform: uppercase; color: var(--label-2); }
.title { margin: 2px 0 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--accent-grad);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

/* Streak */
.streak-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.streak-count { font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.streak-count b { font-size: 28px; line-height: 1; font-weight: 700; color: var(--label); letter-spacing: .3px; margin-right: 2px; }
.streak-hint { font-size: 15px; color: var(--label-2); text-align: right; }
.streak-hint.red { color: var(--red); font-weight: 600; }
.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.dot {
  aspect-ratio: 1; border-radius: 50%; background: var(--fill);
  display: grid; place-items: center; position: relative;
  transition: background .3s ease, transform .3s ease;
}
.dot svg { width: 56%; height: 56%; }
.dot.win { background: var(--green); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); }
.dot.win svg { color: #fff; }
.dot.red { background: var(--red); }
.dot.red svg { color: #fff; }
.dot.gift svg { color: var(--label-3); width: 62%; height: 62%; }
.dot.gift.win { background: linear-gradient(135deg, #FFC56B, #FF8F57); }
.dot.gift.win svg { color: #fff; }
.dot.pop { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.dot.pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--red); opacity: .5; animation: ring 1.6s ease-out infinite;
}
@keyframes ring { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.35); opacity: 0; } }

/* Match */
.match-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  background: var(--fill-2); color: var(--label-2); font-size: 13px; font-weight: 600; letter-spacing: -.08px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}
.when { font-size: 15px; color: var(--label-2); white-space: nowrap; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin-bottom: 18px; }
.team { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.crest {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--card-2); overflow: hidden; flex: none;
}
.crest img { width: 76%; height: 76%; object-fit: contain; }
.crest .mono {
  width: 100%; height: 100%; display: grid; place-items: center; color: #fff;
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
}
.team-name { font-size: 17px; font-weight: 600; line-height: 22px; word-break: break-word; }
.team-role { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.center { min-width: 76px; padding-top: 14px; text-align: center; }
.kick { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .35px; }
.kick-sub { font-size: 13px; color: var(--label-2); margin-top: 3px; }
.score { font-size: 34px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; line-height: 1; }
.live {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--red);
}
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.choice {
  position: relative; min-height: 68px; padding: 10px 6px; border-radius: 16px;
  background: var(--fill-2); border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: background .2s ease, border-color .2s ease, transform .12s ease, opacity .2s ease;
}
.choice:not(:disabled):active { transform: scale(.97); }
.choice-k { font-size: 13px; font-weight: 700; color: var(--label-2); letter-spacing: .2px; }
.choice-l { font-size: 15px; font-weight: 600; line-height: 19px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.choice.selected { background: var(--accent-tint); border-color: var(--accent); }
.choice.selected .choice-k, .choice.selected .choice-l { color: var(--accent); }
.choice.mine { background: var(--accent); border-color: var(--accent); }
.choice.mine .choice-k, .choice.mine .choice-l { color: #fff; }
.choice.mine.won { background: var(--green); border-color: var(--green); }
.choice.mine.lost { background: var(--red); border-color: var(--red); }
.choice.actual:not(.mine) { border-color: var(--green); }
.choice.dim { opacity: .45; }
.choice .tick {
  position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
.choice .tick svg { width: 11px; height: 11px; }
.choice.mine .tick { background: rgba(255, 255, 255, .28); }

.primary {
  width: 100%; height: 52px; border-radius: 14px; background: var(--accent-grad); color: #fff;
  font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s ease, transform .12s ease, filter .2s ease;
}
.primary:not(:disabled):active { transform: scale(.985); filter: brightness(.95); }
.primary:disabled { background: var(--fill); color: var(--label-3); }
.primary.red { background: var(--red); }
.primary.gold { background: linear-gradient(135deg, #FFB45E, #FF7A59); }
.secondary {
  width: 100%; height: 50px; border-radius: 14px; background: var(--fill-2); color: var(--accent);
  font-size: 17px; font-weight: 600; margin-top: 10px;
}
.plain { width: 100%; height: 44px; color: var(--accent); font-size: 17px; margin-top: 6px; }
.plain.danger { color: var(--red); }
.footnote { font-size: 13px; line-height: 18px; color: var(--label-2); text-align: center; margin: 10px 8px 0; }

.status {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fill-2);
}
.status-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); }
.status-icon svg { width: 18px; height: 18px; }
.status-title { font-size: 15px; font-weight: 600; }
.status-sub { font-size: 13px; color: var(--label-2); margin-top: 1px; font-variant-numeric: tabular-nums; }

.crowd { margin-top: 14px; }
.crowd-title { font-size: 13px; color: var(--label-2); margin-bottom: 8px; }
.crowd-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill); gap: 2px; }
.crowd-bar span { display: block; height: 100%; transition: flex-grow .6s ease; }
.crowd-bar .c-home { background: var(--blue); }
.crowd-bar .c-draw { background: var(--label-3); }
.crowd-bar .c-away { background: var(--purple); }
.crowd-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.crowd-legend b { color: var(--label); font-weight: 600; }

.next {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--sep);
  font-size: 13px; color: var(--label-2);
}
.next svg { width: 16px; height: 16px; flex: none; }

.empty { text-align: center; padding: 18px 8px 6px; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--fill-2); color: var(--label-2); }
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: .38px; }
.empty p { margin: 0; font-size: 15px; color: var(--label-2); }

/* Alerts */
.alert { border: 0; }
.alert.red-state { background: linear-gradient(180deg, rgba(255, 59, 48, .1), rgba(255, 59, 48, .03)), var(--card); }
.alert.prize-state { background: linear-gradient(180deg, rgba(122, 92, 250, .14), rgba(255, 179, 64, .06)), var(--card); }
.alert-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.alert-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--red); flex: none; }
.alert-icon svg { width: 22px; height: 22px; }
.alert h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .38px; }
.alert p { margin: 0 0 16px; font-size: 15px; line-height: 20px; color: var(--label-2); }
.alert .gift-img { width: 120px; height: 120px; margin: -4px auto 4px; animation: float 3s ease-in-out infinite; }

/* Grouped lists */
.section-title { font-size: 13px; text-transform: uppercase; color: var(--label-2); margin: 24px 16px 8px; letter-spacing: -.08px; }
.group { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; position: relative; width: 100%; text-align: left;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.row.with-icon + .row::before, .row + .row.with-icon::before { left: 58px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--label-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-value { font-size: 17px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.row-action { color: var(--accent); }
.row-action .row-title { color: var(--accent); }
.badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.badge svg { width: 15px; height: 15px; }
.badge.win { background: var(--green); }
.badge.loss { background: var(--red); }
.badge.void { background: var(--label-3); }
.badge.pending { background: var(--fill); color: var(--label-2); }
.icon-tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.icon-tile svg { width: 17px; height: 17px; }
.icon-tile.blue { background: var(--blue); }
.icon-tile.purple { background: var(--purple); }
.icon-tile.indigo { background: var(--indigo); }
.icon-tile.orange { background: var(--orange); }

.rules { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 10px 16px 0; }
.rules p { margin: 0 0 6px; }

/* Bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .3s ease; }
.sheet {
  position: relative; width: 100%; max-width: 520px; background: var(--card);
  border-radius: 14px 14px 0 0; padding: 8px 20px calc(var(--tg-safe-area-inset-bottom, 0px) + 22px);
  transform: translateY(100%); transition: transform .42s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 14px; }
.sheet-body { text-align: center; }
.sheet-body h2 { margin: 8px 0 8px; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: .36px; }
.sheet-body p { margin: 0 0 22px; font-size: 17px; line-height: 22px; color: var(--label-2); }
.big-icon { width: 92px; height: 92px; border-radius: 50%; margin: 10px auto 8px; display: grid; place-items: center; color: #fff; }
.big-icon svg { width: 46px; height: 46px; }
.big-icon.green { background: var(--green); box-shadow: 0 12px 30px rgba(52, 199, 89, .35); }
.big-icon.red { background: var(--red); box-shadow: 0 12px 30px rgba(255, 59, 48, .3); }
.big-icon.blue { background: var(--accent-grad); box-shadow: 0 12px 30px rgba(80, 100, 250, .35); }
.big-icon.gray { background: var(--label-3); }
.big-icon { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.check-draw path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .25s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sheet-gift { width: 200px; height: 200px; margin: 0 auto -4px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.sheet-dots { display: flex; gap: 5px; justify-content: center; margin: -6px 0 18px; }
.sheet-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--green); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%);
  z-index: 40; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: rgba(30, 30, 34, .92); color: #fff; font-size: 15px; text-align: center;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toast .3s ease both;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Loading skeleton */
.skeleton { background: var(--card); border-radius: var(--radius); margin-bottom: 14px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--fill-2), transparent);
  animation: shimmer 1.3s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-title { height: 44px; width: 46%; border-radius: 12px; background: var(--fill); margin: 26px 4px 18px; }
.sk-card { height: 110px; }
.sk-card.tall { height: 300px; }

/* Outside Telegram */
.gate { text-align: center; padding: 60px 12px; }
.gate img { width: 160px; height: 160px; margin: 0 auto 10px; }
.gate h1 { font-size: 28px; margin: 0 0 8px; }
.gate p { color: var(--label-2); margin: 0 0 22px; }

/* Developer panel, local mode only */
.devbar { margin-top: 28px; padding: 14px; border-radius: 14px; border: 1px dashed var(--label-3); font-size: 13px; color: var(--label-2); }
.devbar .row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.devbar button { padding: 7px 10px; border-radius: 9px; background: var(--fill-2); color: var(--label); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
