/* FootballIQ Mini App — темний преміум. Колір завжди щось означає:
   neon = впевнений сигнал / бренд, amber = ризикованіший, blue = господарі, pink = гості. */

@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-ExtraBold.otf") format("opentype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }

:root {
  --night: #070A12;
  --deep: #0D1321;
  --panel: #121A2B;
  --raise: #1A2540;
  --line: #24314D;
  --text: #F4F7FC;
  --muted: #8B98B2;
  --faint: #56647F;
  --neon: #2EF2A0;
  --amber: #FFB547;
  --home: #4DA3FF;
  --draw: #7E8AA6;
  --away: #FF4D8D;
  --win: #2EF2A0; --dr: #FFD65C; --loss: #FF5C6E;
  --r-lg: 22px; --r-md: 14px; --r-sm: 9px;
  --pad: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--night); color: var(--text); }
body {
  font: 400 15px/1.45 "Inter", system-ui, sans-serif;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
/* рівні цифри стовпчиками — лише там, де самі числа: у шрифті Inter «tnum» розширює і дефіс */
.mtime, .fav-pct strong, .board strong, .kick, .tile strong, .verdict strong, .srow .pct, .line b, .substat b,
.cmp .v, .rbar b, .latest .p, .h2h .tally strong, .h2h .game .sc, .h2h .game time, .xgline b, .chips small,
.day-title { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; border-radius: 6px; }

#view { padding: 0 var(--pad) calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; outline: none; }

/* ---------- шапка */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 50%; }
.brand b { color: var(--neon); font-weight: 900; }

.seg { display: inline-flex; background: var(--deep); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--text); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { border-color: var(--text); color: var(--text); }
.chip small { color: var(--faint); font-weight: 600; margin-left: 4px; }

.day-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; }
.day-sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }

/* ---------- картка матчу у списку */
.group { color: var(--muted); font-size: 13px; font-weight: 600; margin: 18px 0 8px; display: flex; justify-content: space-between; }
.mcard { display: block; background: var(--panel); border-radius: var(--r-lg); padding: 14px 16px 14px; margin-bottom: 10px; position: relative; transition: transform .12s ease; }
.mcard:active { transform: scale(.985); }
.mrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.mtime { font-weight: 700; font-size: 15px; color: var(--text); }
.mtime small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; margin-top: 2px; }
.mteams div { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.6; }
.mteams .fav { font-weight: 800; }
.fav-pct { text-align: right; }
.fav-pct strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.fav-pct span { font-size: 11px; color: var(--muted); font-weight: 600; }

.crest { width: 20px; height: 20px; border-radius: 6px; flex: none; object-fit: contain; display: inline-grid; place-items: center; font-size: 8px; font-weight: 800; color: var(--night); }
.crest.big { width: 54px; height: 54px; border-radius: 16px; font-size: 15px; }

/* смуга розподілу 1/X/2 — головний візуальний елемент */
.split { display: flex; gap: 3px; height: 6px; margin-top: 12px; }
.split i { display: block; border-radius: 3px; height: 100%; transition: flex-grow .9s cubic-bezier(.2,.8,.2,1); }
.split .h { background: var(--home); } .split .d { background: var(--draw); } .split .a { background: var(--away); }
.split.big { height: 12px; gap: 4px; margin-top: 16px; }
.split.big i { border-radius: 6px; }

.sig { display: inline-flex; align-items: center; gap: 7px; margin-top: 11px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sig::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sig.safe { color: var(--neon); } .sig.risky { color: var(--amber); }
.sig b { color: var(--text); font-weight: 700; }

/* ---------- сторінка матчу */
.hero { position: relative; margin: 0 calc(-1 * var(--pad)); padding: 22px var(--pad) 22px; overflow: hidden;
        background: linear-gradient(180deg, #101A2E 0%, var(--night) 100%); }
.hero svg.pitch { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.hero > * { position: relative; }
.meta { text-align: center; color: var(--muted); font-size: 13px; font-weight: 500; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; margin-top: 18px; }
.side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.side .name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; line-height: 1.15; }
.kick { align-self: center; text-align: center; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.kick small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }

.board { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 22px; text-align: center; }
.board div strong { display: block; font-size: 38px; font-weight: 900; letter-spacing: -0.045em; line-height: 1; color: var(--muted); }
.board div.is-fav strong { color: var(--text); }
.board div span { font-size: 12px; font-weight: 700; }
.board .h span { color: var(--home); } .board .d span { color: var(--draw); } .board .a span { color: var(--away); }
.xgline { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.xgline span { white-space: nowrap; }
.xgline b { color: var(--text); font-weight: 700; }

.section { margin-top: 26px; }
.section h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.section h2 small { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; letter-spacing: 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--panel); border-radius: var(--r-md); padding: 12px 12px 11px; }
.tile strong { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.tile span { color: var(--muted); font-size: 12px; font-weight: 500; }

.signals { background: var(--panel); border-radius: var(--r-lg); padding: 6px 16px; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .lbl { font-weight: 600; }
.srow .pct { font-weight: 800; font-size: 17px; }
.srow .meter { grid-column: 1 / -1; height: 4px; background: var(--deep); border-radius: 2px; overflow: hidden; }
.srow .meter i { display: block; height: 100%; border-radius: 2px; }
.srow.safe .pct { color: var(--neon); } .srow.safe .meter i { background: var(--neon); }
.srow.risky .pct { color: var(--amber); } .srow.risky .meter i { background: var(--amber); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin: -4px 0 10px; }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--neon); }
.legend span.r::before { background: var(--amber); }
.note { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }

.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 74px 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
.line .bar { height: 8px; background: var(--deep); border-radius: 4px; overflow: hidden; }
.line .bar i { display: block; height: 100%; background: var(--text); opacity: .85; border-radius: 4px; }
.line b { text-align: right; font-weight: 700; }
.substat { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin: 14px 0 8px; }
.substat b { color: var(--text); }

/* дзеркальне порівняння сезонної статистики */
.cmp { display: grid; grid-template-columns: 38px 1fr 92px 1fr 38px; align-items: center; gap: 8px; margin: 9px 0; font-size: 13px; }
.cmp .lab { text-align: center; color: var(--muted); font-size: 12px; }
.cmp .v { font-weight: 700; }
.cmp .v.r { text-align: right; }
.cmp .bl, .cmp .br { height: 6px; background: var(--deep); border-radius: 3px; position: relative; overflow: hidden; }
.cmp .bl i { position: absolute; right: 0; top: 0; bottom: 0; background: var(--home); border-radius: 3px; }
.cmp .br i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--away); border-radius: 3px; }

.form { display: flex; gap: 5px; }
.form i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: var(--night); }
.form .W { background: var(--win); } .form .D { background: var(--dr); } .form .L { background: var(--loss); }
.formrow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.formrow .who { font-weight: 600; }
.formrow .who small { color: var(--muted); font-weight: 500; margin-left: 6px; }

.h2h { background: var(--panel); border-radius: var(--r-lg); padding: 14px 16px; }
.h2h .tally { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; margin-bottom: 10px; }
.h2h .tally strong { display: block; font-size: 24px; font-weight: 800; }
.h2h .tally span { color: var(--muted); font-size: 12px; }
.h2h .game { display: grid; grid-template-columns: 64px 1fr auto 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.h2h .game time { color: var(--muted); }
.h2h .game .sc { font-weight: 800; }
.h2h .game .r { text-align: right; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 26px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-md); padding: 13px 14px; font-weight: 700; cursor: pointer; text-align: center; }
.btn.primary { background: var(--neon); border-color: var(--neon); color: var(--night); }
.btn.wide { grid-column: 1 / -1; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; }

/* ---------- статистика бота */
.verdict { margin: 8px 0 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verdict div { background: var(--panel); border-radius: var(--r-lg); padding: 16px; }
.verdict strong { display: block; font-size: 40px; font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.verdict .hit strong { color: var(--neon); }
.verdict span { color: var(--muted); font-size: 13px; }
.lead { color: var(--muted); font-size: 14px; margin: 14px 0 0; max-width: 60ch; }
.chart { background: var(--panel); border-radius: var(--r-lg); padding: 14px 12px 8px; }
.chart svg { width: 100%; height: 150px; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .exp { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.chart .hitl { stroke: var(--neon); stroke-width: 2.5; fill: none; }
.chart .area { fill: url(#g); }
.chart .lbl { fill: var(--faint); font-size: 10px; }
.chart-keys { display: flex; gap: 14px; color: var(--muted); font-size: 12px; padding: 4px 4px 2px; }
.chart-keys i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--neon); }
.chart-keys i.e { background: none; border-top: 2px dashed var(--faint); }

.rbar { display: grid; grid-template-columns: 1fr 56px; gap: 4px 10px; margin: 12px 0; font-size: 14px; }
.rbar .t { font-weight: 600; }
.rbar .t small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.rbar b { text-align: right; }
.rbar .track { grid-column: 1 / -1; position: relative; height: 8px; background: var(--deep); border-radius: 4px; }
.rbar .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--text); }
.rbar .track u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); }
.rbar.safe .track i { background: var(--neon); } .rbar.risky .track i { background: var(--amber); }

.latest .lrow { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.latest .lrow:last-child { border: 0; }
.latest .lrow .res { font-size: 15px; }
.latest .lrow .m { color: var(--muted); font-size: 12px; }
.latest .lrow .p { font-weight: 700; }
.latest .lrow .p.safe { color: var(--neon); } .latest .lrow .p.risky { color: var(--amber); }

/* ---------- моє */
.list { background: var(--panel); border-radius: var(--r-lg); padding: 4px 16px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border: 0; }
.li .grow { flex: 1; font-weight: 600; }
.li button.x { border: 0; background: var(--deep); color: var(--muted); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1; }
.li button.add { border: 0; background: var(--neon); color: var(--night); padding: 7px 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.search { width: 100%; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px; outline: none; margin-bottom: 8px; }
.search:focus { border-color: var(--neon); }
.toggle { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--deep); border: 1px solid var(--line); flex: none; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--faint); transition: transform .18s ease, background .18s; }
.toggle[aria-checked="true"] { background: rgba(46,242,160,.16); border-color: var(--neon); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); background: var(--neon); }

.empty { text-align: center; color: var(--muted); padding: 46px 12px; }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--raise) 50%, var(--panel) 100%); background-size: 200% 100%;
            animation: sh 1.3s linear infinite; border-radius: var(--r-lg); height: 92px; margin-bottom: 10px; }
@keyframes sh { to { background-position: -200% 0; } }
.foot { color: var(--faint); font-size: 12px; text-align: center; margin: 28px 0 0; }

/* ---------- нижні вкладки */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
        padding: 8px 10px calc(8px + var(--safe-b)); background: rgba(7,10,18,.92); backdrop-filter: blur(14px);
        border-top: 1px solid var(--line); z-index: 10; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 600; padding: 4px 0; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"] svg { stroke: var(--neon); }

.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); background: var(--raise);
         border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 20; }

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