/* Aliev53 Football — Telegram Mini App (test build). Fonts and colours match the shop site. */
:root {
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --accent: #1f63d6; --brand: #0a2a66; --brand-2: #123f99;
  --ok: #1fa855; --warn: #e8a31a; --bad: #e0483e;
  --r: 18px; --r-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-b: env(safe-area-inset-bottom);
}
/* light */
html[data-theme="light"], html[data-theme="tg"] {
  --bg: #f2f4f8; --card: #ffffff; --ink: #0b1530; --muted: #67708a; --line: #e3e7ef; --chip: #eef1f6;
}
html[data-theme="dark"] {
  --bg: #0d1119; --card: #171c27; --ink: #eef2fb; --muted: #8b93a7; --line: #262d3b; --chip: #212837; --accent: #4f8bff;
}
html[data-theme="brand"] {
  --bg: #0a2a66; --card: #12397f; --ink: #ffffff; --muted: #a9bde6; --line: #1d4a98; --chip: #18438f; --accent: #8fb6ff; --brand: #061c46; --brand-2: #1f63d6;
}
/* follow Telegram's own colours */
html[data-theme="tg"] {
  --bg: var(--tg-theme-secondary-bg-color, #f2f4f8);
  --card: var(--tg-theme-bg-color, #fff);
  --ink: var(--tg-theme-text-color, #0b1530);
  --muted: var(--tg-theme-hint-color, #67708a);
  --accent: var(--tg-theme-button-color, #1f63d6);
  --line: color-mix(in srgb, var(--tg-theme-hint-color, #67708a) 22%, transparent);
  --chip: color-mix(in srgb, var(--tg-theme-hint-color, #67708a) 12%, transparent);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font-text); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overscroll-behavior-y: none; transition: background-color .3s; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
p { margin: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* splash */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 5; }
.splash img { width: 84px; animation: pulse .6s var(--ease) 4 alternate; }
@keyframes pulse { from { transform: scale(.94); opacity: .7; } to { transform: scale(1.04); opacity: 1; } }

/* registration */
.reg { min-height: 100vh; padding: 28px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 28px; }
.reg__top { display: grid; justify-items: center; text-align: center; gap: 12px; padding-top: 12px; }
.reg__logo { width: 72px; animation: drop .9s var(--ease) both; }
.reg h1 { font-size: 24px; animation: up .7s var(--ease) .1s both; }
.reg__top p { color: var(--muted); max-width: 30ch; animation: up .7s var(--ease) .18s both; }
.form { display: grid; gap: 14px; animation: up .7s var(--ease) .26s both; }
.field { display: grid; gap: 6px; }
.field span { font-weight: 600; font-size: 14px; }
.field input { height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field em { display: none; font-style: normal; font-size: 13px; color: var(--bad); }
.field.is-bad input { border-color: var(--bad); }
.field.is-bad em { display: block; }
.form__note { font-size: 13px; color: var(--muted); text-align: center; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(.9) rotate(-8deg); } }

.btn { height: 52px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; font-weight: 600; font-size: 16px; transition: transform .12s, filter .2s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
html[data-theme="brand"] .btn--primary { background: #fff; color: var(--brand); }
html[data-theme="tg"] .btn--primary { color: var(--tg-theme-button-text-color, #fff); }

/* main */
.main { padding-bottom: calc(84px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.top__who { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.top__hi { font: 700 17px/1.2 var(--font-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__sub { font-size: 13px; color: var(--muted); }
.ava { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font: 700 15px/1 var(--font-display); }
.ava--xl { width: 84px; height: 84px; font-size: 28px; }
.demo-badge { flex: none; padding: 6px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; }

.screens { padding: 4px 16px 0; }
.screen { display: grid; gap: 14px; animation: screenIn .45s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
.screen__title { font-size: 26px; padding: 6px 2px 2px; }
.screen > * { animation: up .55s var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: .04s; } .screen > *:nth-child(3) { animation-delay: .08s; }
.screen > *:nth-child(4) { animation-delay: .12s; } .screen > *:nth-child(5) { animation-delay: .16s; }

.card { background: var(--card); border-radius: var(--r); padding: 16px; }
.card--brand { background: linear-gradient(140deg, var(--brand-2) 0%, var(--brand) 70%); color: #fff; position: relative; overflow: hidden; }
.card--brand::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; border: 28px solid rgba(255,255,255,.07); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.eyebrow--light { color: #a9c6ff; }
.next h2 { font-size: 22px; margin-bottom: 6px; }
.next__meta { color: rgba(255,255,255,.78); font-size: 14px; }
.next__count { display: flex; gap: 8px; margin-top: 16px; }
.next__count div { min-width: 58px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.12); text-align: center; }
.next__count b { display: block; font: 700 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.next__count span { font-size: 11px; color: rgba(255,255,255,.7); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tile { background: var(--card); border-radius: 16px; padding: 12px 8px; text-align: center; display: grid; gap: 2px; }
.tile b { font: 700 20px/1.15 var(--font-display); letter-spacing: -.02em; }
.tile span { font-size: 11.5px; color: var(--muted); }

.block { display: grid; gap: 10px; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.block__head h3 { font-size: 17px; }
.more { color: var(--accent); font-weight: 600; font-size: 14px; padding: 4px; }

.list { list-style: none; margin: 0; padding: 4px 16px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.li__main { flex: 1; min-width: 0; }
.li__t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li__s { font-size: 13px; color: var(--muted); }
.date { flex: none; width: 46px; text-align: center; border-radius: 12px; background: var(--chip); padding: 6px 0; }
.date b { display: block; font: 700 17px/1.1 var(--font-display); }
.date span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.score { font: 700 16px/1 var(--font-display); white-space: nowrap; }
.res { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 12px/1 var(--font-text); color: #fff; }
.res--w { background: var(--ok); } .res--d { background: var(--warn); } .res--l { background: var(--bad); }
.st { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.st--p { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.st--a { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.st--e { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); margin-right: 6px; }
.tag--match { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

.last-tr { display: flex; gap: 12px; align-items: center; }
.last-tr .li__main p + p { margin-top: 2px; }
.stars { color: var(--warn); letter-spacing: 1px; font-size: 13px; }

.ach-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.ach-row::-webkit-scrollbar { display: none; }
.ach { flex: none; width: 104px; background: var(--card); border-radius: 16px; padding: 14px 10px; text-align: center; display: grid; justify-items: center; gap: 6px; }
.ach__ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #ffd25c, #f29a1f); color: #5b3200; }
.ach__ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ach b { font-size: 12.5px; line-height: 1.2; }
.ach small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.ach.is-locked .ach__ic { background: var(--chip); color: var(--muted); }
.ach.is-locked b { color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach-grid .ach { width: auto; }

.ring-card { display: flex; gap: 16px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring__bg { stroke: var(--chip); }
.ring__fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .9s var(--ease); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 24px/1 var(--font-display); }
.ring-card__txt { display: grid; gap: 6px; min-width: 0; }
.ring-card__txt h3 { font-size: 17px; }
.ring-card__txt p { font-size: 13px; color: var(--muted); }
.dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--ok); }
.dots i.a { background: var(--bad); } .dots i.e { background: var(--warn); }

.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--chip); border-radius: 999px; }
.seg button { height: 40px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background-color .2s, color .2s; }
.seg button.is-on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.day { font: 600 13px/1 var(--font-text); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 10px 2px 8px; }

.profile { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 24px 16px; }
.profile h2 { font-size: 22px; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.themes button { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); font-weight: 600; font-size: 14px; border: 2px solid transparent; transition: border-color .2s, transform .12s; text-align: left; }
.themes button:active { transform: scale(.97); }
.themes button.is-on { border-color: var(--accent); }
.sw { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); }
.sw--tg { background: conic-gradient(#2aabee 0 50%, #fff 0); }
.sw--light { background: #f2f4f8; }
.sw--dark { background: #0d1119; }
.sw--brand { background: linear-gradient(135deg, #1f63d6, #0a2a66); }
.share { display: grid; gap: 12px; }
.share p { color: var(--muted); font-size: 14px; }
.links { padding: 4px 16px; display: grid; }
.links a, .links button { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; text-align: left; }
.links > :last-child { border-bottom: 0; }
.links span { color: var(--muted); font-size: 20px; line-height: 1; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 4px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabs button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.tabs button.is-on { color: var(--accent); }
.tabs button.is-on svg { transform: translateY(-2px) scale(1.08); }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 9; translate: -50% 16px; opacity: 0; padding: 12px 18px; border-radius: 999px; background: #0b1530; color: #fff; font-size: 14px; font-weight: 500; pointer-events: none; transition: opacity .25s, translate .35s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; translate: -50% 0; }

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