/*
 * LikeStream, dark: the Match Center of the game webview (app.css + Tailwind there) as plain
 * CSS. Tokens are the app-group's own (`app.likestream` theme.dark), mobile first; from
 * 1024px the page becomes a three-column desktop layout (sports · schedule · the app).
 */

@font-face {
    font-family: 'Sora';
    src: url('/fonts/Sora-Variable.woff2') format('woff2-variations'), url('/fonts/Sora-Variable.woff2') format('woff2');
    font-weight: 300 800;
    font-display: swap;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    src: url('/fonts/BeVietnamPro-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    src: url('/fonts/BeVietnamPro-SemiBold.woff2') format('woff2');
    font-weight: 600 700;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #110E0D;
    --surface: #191514;
    --surface-2: #231E1C;
    --text: #F7F3EF;
    --text-2: #A89F96;
    --text-3: #6E665E;
    --stroke: rgba(255, 255, 255, 0.06);
    --stroke-strong: rgba(255, 255, 255, 0.12);
    --accent: #E03E3E;
    --accent-2: #FF7B6B;
    --grad: linear-gradient(135deg, #E03E3E, #FF7B6B);
    --tint: rgba(224, 62, 62, 0.12);
    --glow: rgba(224, 62, 62, 0.32);
    --live: #F04848;
    --r: 18px;
    --r-sm: 13px;
    --r-lg: 24px;
    --fd: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fb: 'Be Vietnam Pro', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { overscroll-behavior-y: none; }
html.lock { overflow: hidden; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font: 400 14px/1.5 var(--fb);
    -webkit-font-smoothing: antialiased;
}

/* The faint red sky over the page (the dark shells' radial). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(120% 60% at 50% -10%, var(--tint), transparent 60%),
        radial-gradient(80% 40% at 100% 0%, var(--tint), transparent 70%);
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; }
.ic { flex-shrink: 0; display: block; }
.accent { color: var(--accent); }
.muted { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.trunc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lift { text-shadow: 0 1px 2px var(--surface-2), 0 0 12px var(--surface-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ── Motion ─────────────────────────────────────────────────────────────────── */

@keyframes drift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes ambient { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.14); opacity: 1; } }
@keyframes flash { 0% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px var(--glow); } 100% { box-shadow: none; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }

.blink { animation: blink 1.2s ease-in-out infinite; }
.flash { animation: flash 1.4s ease-out; }

/* ── Header ─────────────────────────────────────────────────────────────────── */

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(17, 14, 13, 0.82);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--stroke);
    padding-top: env(safe-area-inset-top, 0px);
}

.top-in {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px));
    max-width: 1360px;
    margin: 0 auto;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--fd); letter-spacing: -0.03em; }
.top-in .brand { margin-right: auto; }
.brand i { font-style: normal; font-weight: 700; color: var(--accent-2); }
.top-tag { display: none; flex: 1; min-width: 0; color: var(--text-3); font: 600 11.5px/1 var(--fd); letter-spacing: 0.04em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.layout { max-width: 1360px; margin: 0 auto; }
.main { padding: 4px max(var(--gutter), env(safe-area-inset-right, 0px)) 24px max(var(--gutter), env(safe-area-inset-left, 0px)); min-width: 0; }
.side { display: none; }

.sec { margin-top: 16px; }
.sec:empty { display: none; }

.sec-head { display: flex; align-items: center; gap: 8px; padding: 0 2px; margin-bottom: 8px; }
.sec-head h2 { flex: 1; min-width: 0; font: 700 18px/1.3 var(--fd); letter-spacing: -0.01em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tz-note { color: var(--text-3); font: 600 10px/1 var(--fd); letter-spacing: 0.04em; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex-shrink: 0; }
.dot-w { width: 6px; height: 6px; border-radius: 50%; background: #fff; flex-shrink: 0; }

.scroll-x {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 4px;
}

.strip { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 8px; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; }
.strip.two { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; }

/* ── Buttons & chips ────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: var(--r-sm);
    font: 700 16px/1 var(--fd);
    transition: transform 0.12s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); background-size: 200% 200%; animation: drift 5.5s ease-in-out infinite; color: #fff; box-shadow: 0 6px 18px var(--glow); }
.btn.ghost { border: 1px solid var(--stroke-strong); background: var(--surface); color: var(--text); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.btn.more { display: flex; margin: 16px auto 0; min-width: 160px; }

.chips { margin-top: 10px; gap: 6px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    flex-shrink: 0;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: var(--surface-2);
    color: var(--text-2);
    font: 600 14px/1 var(--fd);
    transition: color 0.15s, background 0.15s;
}
.chip .n { font-size: 10px; font-weight: 700; color: var(--text-3); }
.chip.on { border-color: transparent; background: var(--grad); background-size: 200% 200%; animation: drift 5.5s ease-in-out infinite; color: #fff; box-shadow: 0 6px 18px var(--glow); }
.chip.on .n { color: rgba(255, 255, 255, 0.8); }
.ic.down { transform: rotate(90deg); }
.ic.up { transform: rotate(-90deg); }

.pill-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--live);
    color: #fff;
    font: 700 10px/1.3 var(--fd);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.pill-live.sm { gap: 4px; padding: 2px 6px; letter-spacing: 0; }
.pill-live.sm .dot-w { width: 4px; height: 4px; }
.pill-live.xs { position: absolute; right: 8px; top: 8px; z-index: 1; gap: 4px; padding: 2px 6px; letter-spacing: 0.1em; }
.pill-live.xs .dot-w { width: 4px; height: 4px; }

.progress { position: relative; height: 4px; border-radius: 999px; background: var(--stroke-strong); overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--grad); background-size: 200% 200%; animation: drift 5.5s ease-in-out infinite; transition: width 1s ease; }

/* ── Crests & badges ────────────────────────────────────────────────────────── */

.crest, .badge {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    font-family: var(--fd);
    font-weight: 700;
    line-height: 1;
}
.crest { background: #fff; color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.18); }
.crest img, .badge img { width: 100%; height: 100%; object-fit: contain; }
.crest.broken { background: linear-gradient(135deg, hsl(var(--h, 10) 62% 58%), hsl(calc(var(--h, 10) + 40) 58% 34%)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
.crest.broken::after, .badge.broken::after { content: attr(data-i); }
.badge { color: var(--text-2); }
.badge.plate { background: #fff; color: #1b1b1f; box-shadow: 0 2px 10px var(--glow); }
.badge.plate img { object-fit: cover; border-radius: 50%; }

/* ── Photographs under the cards ────────────────────────────────────────────── */

.glow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.glow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, var(--surface-2) 100%);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--surface-2) 22%, transparent) 0%,
        color-mix(in srgb, var(--surface-2) 18%, transparent) 38%,
        color-mix(in srgb, var(--surface-2) 62%, transparent) 68%,
        color-mix(in srgb, var(--surface-2) 92%, transparent) 100%);
}
.photo-tint { position: absolute; inset: 0; mix-blend-mode: multiply; opacity: 0.6; background: linear-gradient(135deg, var(--tint), transparent 40%); }
.flood { position: absolute; border-radius: 50%; filter: blur(40px); animation: ambient 3.4s ease-in-out infinite; }
.flood.l { left: -40px; top: -64px; width: 192px; height: 192px; background: radial-gradient(circle, var(--glow), transparent 62%); }
.flood.r { right: -48px; top: -40px; width: 176px; height: 176px; background: radial-gradient(circle, var(--tint), transparent 60%); animation-delay: -4s; }
.tint { position: absolute; inset: 0; pointer-events: none; }

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border-radius: var(--r);
    border: 1px solid var(--accent);
    background: var(--surface-2);
    cursor: pointer;
}
.hero > :not(.glow):not(.tint) { position: relative; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-league {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--surface-2);
    font: 600 10px/1.3 var(--fd);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hero-league .muted { flex-shrink: 0; }
.hero-teams { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 16px; }
.hero-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-side > span:last-child { width: 100%; text-align: center; font: 700 14px/1.25 var(--fd); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px var(--surface-2), 0 0 12px var(--surface-2); }
.hero-score { flex-shrink: 0; font: 700 40px/1 var(--fd); letter-spacing: -0.02em; text-shadow: 0 1px 2px var(--surface-2), 0 0 12px var(--surface-2); border-radius: 12px; padding: 0 4px; }
.hero-score i, .card-score i, .mini-score i { font-style: normal; margin: 0 6px; font-size: 0.45em; font-weight: 500; color: var(--text-3); vertical-align: middle; }
.hero-headline { margin-top: 16px; text-align: center; font: 700 20px/1.3 var(--fd); }
.hero .progress { margin-top: 12px; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; }
.hero-actions .primary { flex: 1; }

/* ── Fixture cards ──────────────────────────────────────────────────────────── */

.card {
    position: relative;
    overflow: hidden;
    border-radius: var(--r);
    border: 1px solid var(--stroke);
    background: var(--surface-2);
    transition: transform 0.12s ease, border-color 0.15s;
}
.card:active { transform: scale(0.98); }
.fixture { width: 196px; flex-shrink: 0; padding: 12px; text-align: left; }
.fixture > :not(.tint):not(.card-glow) { position: relative; }
.card-glow { position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; filter: blur(24px); background: radial-gradient(circle, var(--glow), transparent 60%); pointer-events: none; }
.card-top { display: flex; align-items: center; gap: 6px; }
.card-league { flex: 1; color: var(--text-2); font: 600 10px/1.3 var(--fd); letter-spacing: 0.06em; text-transform: uppercase; }
.card-when { flex-shrink: 0; font: 700 10px/1.3 var(--fd); }
.card-teams { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 10px; }
.card-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.card-side > span:last-child { max-width: 100%; font: 600 10px/1.3 var(--fd); }
.card-score { flex-shrink: 0; font: 700 18px/1 var(--fd); border-radius: 8px; padding: 2px; }
.card-vs { flex-shrink: 0; color: var(--text-3); font: 700 10px/1 var(--fd); text-transform: uppercase; }
.card-headline { margin-top: 10px; font: 700 16px/1.3 var(--fd); }

/* ── Posters & club tiles ───────────────────────────────────────────────────── */

.poster { width: 136px; height: 150px; flex-shrink: 0; padding: 12px; text-align: left; background: linear-gradient(160deg, var(--tint), var(--surface-2) 70%); }
.poster-body { position: relative; display: flex; flex-direction: column; height: 100%; }
.poster-sport { margin-top: auto; color: var(--text-2); font: 600 10px/1.3 var(--fb); letter-spacing: 0.04em; text-transform: uppercase; }
.poster-title { font: 700 14px/1.2 var(--fd); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-title.push { margin-top: auto; }
.poster-count { margin-top: 4px; color: var(--text-3); font: 600 10px/1.3 var(--fd); }
.poster-count.accent { color: var(--accent); }

.club { position: relative; overflow: hidden; width: 100px; height: 124px; flex-shrink: 0; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); text-align: center; transition: transform 0.12s ease; }
.club:active { transform: scale(0.97); }
.club-bg { position: absolute; inset: 0; opacity: 0.9; }
.club-body { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; padding: 0 8px 10px; }
.club-name { width: 100%; height: 2.6em; font: 700 10px/1.3 var(--fd); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.club-sport { margin-top: -4px; color: var(--text-3); font: 600 10px/1.3 var(--fb); }

/* ── All matches ────────────────────────────────────────────────────────────── */

.all { margin-top: 20px; }
.rail { gap: 6px; }
.day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
    background: var(--surface-2);
    color: var(--text-2);
}
.day b { font: 700 14px/1 var(--fd); color: var(--text); }
.day span { margin-top: 4px; font: 600 10px/1 var(--fd); letter-spacing: 0.04em; color: var(--text-3); }
.day.on { border-color: transparent; background: var(--grad); background-size: 200% 200%; animation: drift 5.5s ease-in-out infinite; box-shadow: 0 6px 18px var(--glow); }
.day.on b { color: #fff; }
.day.on span { color: rgba(255, 255, 255, 0.8); }

#s-list, #s-more { transition: opacity 0.2s; }
.busy #s-list, .busy #s-more { opacity: 0.5; }

.day-group { margin-top: 12px; }
.day-title { display: flex; align-items: baseline; gap: 6px; padding: 0 2px; font: 700 16px/1.3 var(--fd); letter-spacing: -0.01em; }
.day-title span { color: var(--text-3); font: 600 11.5px/1.3 var(--fd); }

.group { margin-top: 6px; overflow: hidden; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); }

.row { display: flex; align-items: stretch; gap: 10px; width: 100%; min-height: 44px; padding: 14px; text-align: left; transition: background 0.15s; }
.row + .row { border-top: 1px solid var(--stroke); }
.row.is-live { background: linear-gradient(135deg, var(--tint), var(--surface-2) 70%); }
.row-time { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; flex-shrink: 0; padding-right: 8px; border-right: 1px solid var(--stroke); }
.row-time .dot { width: 6px; height: 6px; margin-bottom: 4px; }
.row-time span { text-align: center; font: 700 11.5px/1.2 var(--fd); }
.row-time .live { color: var(--live); }
.row-main { flex: 1; min-width: 0; padding: 2px 0; }
.row-league { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 10px; letter-spacing: 0.03em; }
.feat { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 1px 4px; border-radius: 999px; background: var(--tint); color: var(--accent); font: 700 10px/1.2 var(--fd); }
.row-teams { margin-top: 6px; }
.row-side { display: flex; align-items: center; gap: 8px; }
.row-side + .row-side { margin-top: 4px; }
.row-side > span.trunc { font: 600 14px/1.2 var(--fd); }
.row-side b { margin-left: auto; width: 24px; flex-shrink: 0; text-align: center; font: 700 14px/1.2 var(--fd); }
.row-side.lost { color: var(--text-2); }
.row-headline { margin-top: 6px; font: 700 14px/1.25 var(--fd); }
.row-headline.solo { display: flex; align-items: center; min-height: 2.4rem; margin: 0; }
.row-watch { display: none; }
.row-chev { display: flex; align-items: center; flex-shrink: 0; color: var(--text-3); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--text-3); }
.empty h3 { color: var(--text); font: 700 16px/1.3 var(--fd); }
.empty p { max-width: 320px; color: var(--text-2); }
.empty .btn { margin-top: 8px; }

/* ── The app: badge, steps, stores ──────────────────────────────────────────── */

.app-badge { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--grad); color: #fff; box-shadow: 0 6px 18px var(--glow); }
.app-icon .ic { margin-left: 2px; }
.app-badge > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.app-badge b { font: 700 15px/1.2 var(--fd); }
.app-badge small { color: var(--text-3); font: 600 11px/1.3 var(--fd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.steps li { display: flex; gap: 12px; min-width: 0; }
.steps li > div { flex: 1; min-width: 0; }
.step-n { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--tint); color: var(--accent-2); font: 700 13px/1 var(--fd); border: 1px solid rgba(224, 62, 62, 0.35); }
.steps b { display: block; font: 700 15px/1.3 var(--fd); margin-top: 3px; }
.steps p { margin-top: 4px; color: var(--text-2); font-size: 13.5px; }
.steps em { font-style: normal; color: var(--text); font-weight: 600; }
.live-word { color: var(--live); font-weight: 700; }

.stores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 14px 6px 10px;
    border-radius: 12px;
    border: 1px solid var(--stroke-strong);
    background: #000;
    color: #fff;
    text-decoration: none;
    font: 700 14px/1.1 var(--fd);
}
.store span { display: flex; flex-direction: column; }
.store small { font: 600 9px/1.2 var(--fb); letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.7); }
.store.pri { border-color: transparent; background: var(--grad); box-shadow: 0 6px 18px var(--glow); }
.store.pri small { color: rgba(255, 255, 255, 0.85); }

.copy { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 6px 6px 12px; border-radius: 12px; border: 1px dashed var(--stroke-strong); background: var(--bg); }
.copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-2); font: 500 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.btn-copy { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 0 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--stroke-strong); font: 700 12.5px/1 var(--fd); }
.btn-copy.done { background: var(--grad); border-color: transparent; color: #fff; }

.qr-box { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--stroke); }
.qr { width: 96px; height: 96px; flex-shrink: 0; border-radius: 10px; background: #fff; overflow: hidden; }
.qr:empty { background: var(--surface-2); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-box p { color: var(--text-2); font-size: 12.5px; }
.qr-box b { display: block; color: var(--text); font: 700 13.5px/1.3 var(--fd); }

/* ── The sheet ──────────────────────────────────────────────────────────────── */

.sheet-wrap {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: fade 0.2s ease;
}
.sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-bottom: 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    animation: rise 0.32s cubic-bezier(0.34, 1.1, 0.62, 1);
}
.grab { display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: var(--stroke-strong); flex-shrink: 0; }
.sheet-x { position: absolute; right: 12px; top: 12px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.sheet-scroll { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-scroll > .app-badge { margin-top: 16px; }
.sheet h2 { margin-top: 12px; font: 700 21px/1.25 var(--fd); letter-spacing: -0.01em; padding-right: 32px; }
.sheet-lead { margin-top: 6px; color: var(--text-2); }

.mini { position: relative; overflow: hidden; margin: 8px 36px 0 0; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--stroke); }
.mini > :not(.tint) { position: relative; }
.mini-league { display: flex; align-items: center; gap: 6px; color: var(--text-2); font: 600 10px/1.3 var(--fd); letter-spacing: 0.06em; text-transform: uppercase; }
.mini-league .trunc { flex: 1; }
.mini-teams { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.mini-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mini-side > span:last-child { width: 100%; text-align: center; font: 700 12.5px/1.25 var(--fd); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-score { font: 700 26px/1 var(--fd); }
.mini-time { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-time b { font: 700 20px/1 var(--fd); }
.mini-time small { color: var(--text-3); font: 600 10px/1 var(--fd); }
.mini-headline { margin-top: 8px; font: 700 16px/1.3 var(--fd); }

/* ── Footer & the mobile dock ───────────────────────────────────────────────── */

.foot { max-width: 1360px; margin: 0 auto; padding: 8px var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); color: var(--text-3); font-size: 12px; display: grid; gap: 4px; }
.foot a { color: var(--text-2); }

.dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    border-radius: 20px;
    background: rgba(35, 30, 28, 0.9);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border: 1px solid var(--stroke-strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.dock .app-icon { width: 36px; height: 36px; border-radius: 10px; }
.dock .app-badge b { font-size: 14px; }

/* ── Tablet ─────────────────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .top-in { padding: 0 24px; }
    .top-tag { display: block; }
    .main { max-width: 860px; margin: 0 auto; padding: 4px 24px 32px; }
    .scroll-x, .strip { margin: 0 -24px; padding: 0 24px 4px; }
    .hero { padding: 22px; }
    .hero-score { font-size: 52px; }
    .hero-side > span:last-child { font-size: 16px; }
    .dock { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
    .sheet-wrap { align-items: center; padding: 24px; }
    .sheet { border-radius: var(--r-lg); border-bottom: 1px solid var(--stroke); animation: pop 0.24s ease; }
    .grab { display: none; }
    .sheet-scroll { padding: 22px 24px 24px; }
}

/* ── Desktop: sports · schedule · the app ───────────────────────────────────── */

@media (min-width: 1024px) {
    :root { --gutter: 0px; }
    body { font-size: 14.5px; }

    .top-in { height: 64px; padding: 0 28px; }
    .brand { font-size: 21px; }

    .layout {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr) 320px;
        gap: 28px;
        padding: 0 28px;
        align-items: start;
    }
    .main { max-width: none; margin: 0; padding: 20px 0 48px; }
    .scroll-x, .strip { margin: 0; padding: 0 0 4px; }

    .side { display: block; position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: none; margin-top: 20px; }
    .side-title { padding: 0 12px 8px; color: var(--text-3); font: 700 11px/1 var(--fd); letter-spacing: 0.12em; text-transform: uppercase; }
    .side-list { display: grid; gap: 2px; }
    .side-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font: 600 14px/1 var(--fd); transition: background 0.15s, color 0.15s; }
    .side-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .side-item .n { color: var(--text-3); font-size: 11px; font-weight: 700; }
    .side-item .ic { color: var(--accent); }
    .side-item:hover { background: var(--surface-2); color: var(--text); }
    .side-item.on { background: var(--grad); color: #fff; box-shadow: 0 6px 18px var(--glow); }
    .side-item.on .ic, .side-item.on .n { color: rgba(255, 255, 255, 0.9); }

    .promo { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--stroke); position: relative; overflow: hidden; }
    .promo::before { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 62%); filter: blur(30px); pointer-events: none; }
    .promo > * { position: relative; }
    .promo h2 { margin-top: 16px; font: 700 20px/1.25 var(--fd); letter-spacing: -0.01em; }
    .promo-lead { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
    .promo .stores { flex-direction: column; }
    .promo .store { width: 100%; }

    .chips { display: none; }
    .sec { margin-top: 24px; }
    .sec:first-of-type, #s-chips + .sec { margin-top: 0; }

    .hero { padding: 28px 32px; }
    .hero .crest { width: 84px !important; height: 84px !important; font-size: 26px !important; }
    .hero-teams { margin-top: 20px; }
    .hero-side > span:last-child { font-size: 18px; }
    .hero-score { font-size: 60px; }
    .hero-actions { justify-content: center; }
    .hero-actions .primary { flex: 0 1 260px; }

    .strip.two, .strip.cards, .strip.live-strip {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        grid-auto-flow: row;
        grid-template-rows: none;
        grid-auto-columns: auto;
        overflow: visible;
    }
    .strip .fixture { width: auto; }
    .strip.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow: visible; }
    .strip.posters .poster { width: auto; }
    .strip.clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); overflow: visible; }
    .strip.clubs .club { width: auto; }

    .card:hover, .club:hover { border-color: var(--stroke-strong); transform: translateY(-2px); }
    .hero:hover { box-shadow: 0 10px 40px var(--glow); }

    .rail { flex-wrap: wrap; overflow: visible; }

    .row { padding: 12px 16px; align-items: center; }
    .row:hover { background: rgba(255, 255, 255, 0.03); }
    .row.is-live:hover { background: linear-gradient(135deg, rgba(224, 62, 62, 0.18), var(--surface-2) 70%); }
    .row-time { width: 56px; align-self: stretch; }
    .row-time span { font-size: 13px; }
    .row-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); align-items: center; gap: 16px; }
    .row-league { order: 2; font-size: 11.5px; }
    .row-teams, .row-headline { order: 1; margin-top: 0; }
    .row-headline.solo { min-height: 0; }
    .row-watch {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        min-height: 30px;
        padding: 0 12px;
        border-radius: 999px;
        background: var(--grad);
        background-size: 200% 200%;
        animation: drift 5.5s ease-in-out infinite;
        color: #fff;
        font: 700 11.5px/1 var(--fd);
        box-shadow: 0 6px 18px var(--glow);
    }

    .foot { padding: 24px 28px 40px; }
    .dock { display: none; }

    .sheet { max-width: 640px; }
    .sheet-scroll { padding: 28px 32px 32px; }
    .sheet .stores { flex-wrap: nowrap; }
}

@media (min-width: 1280px) {
    .layout { grid-template-columns: 240px minmax(0, 1fr) 340px; gap: 32px; }
}

/* ── Competition & club pages ───────────────────────────────────────────────── */

a.card, a.club, a.row, a.t-row, a.side-item, .back, .league-link { text-decoration: none; color: inherit; }
.ic.flip { transform: rotate(180deg); }

.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin-top: 4px; color: var(--text-2); font: 600 13px/1 var(--fd); }
.back:hover { color: var(--text); }

.sub-head { position: relative; overflow: hidden; padding: 16px; border-radius: var(--r); border: 1px solid var(--stroke-strong); background: var(--surface-2); }
.sub-head-in { position: relative; display: flex; align-items: center; gap: 14px; }
.sub-head-in .grow { flex: 1; min-width: 0; }
.sub-head .label { color: var(--text-3); font: 600 11.5px/1.3 var(--fd); letter-spacing: 0.12em; text-transform: uppercase; }
.sub-head h1 { margin-top: 2px; font: 700 20px/1.25 var(--fd); letter-spacing: -0.01em; text-shadow: 0 1px 2px var(--surface-2), 0 0 12px var(--surface-2); }
.sub-line { margin-top: 4px; color: var(--text-2); font: 600 11.5px/1.35 var(--fb); }
.league-link { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: #fff; box-shadow: 0 3px 12px var(--glow); }

.stats { display: grid; margin-top: 10px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); overflow: hidden; }
.stats > div { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 12px 8px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--stroke); }
.stats b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 18px/1.25 var(--fd); }
.stats b.long { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stats small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 10px; }
.stats small.sub { color: var(--text-2); font-weight: 600; }

.tabs { gap: 0; margin-top: 12px; border-bottom: 1px solid var(--stroke); padding-bottom: 0; }
.tab { position: relative; min-height: 44px; flex-shrink: 0; padding: 0 12px; color: var(--text-3); font: 700 16px/1 var(--fd); }
.tab.on { color: var(--text); }
.tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 999px; background: var(--grad); }

#s-body > .rail { margin-top: 12px; }
.sub-sec { margin-top: 16px; }
.sub-list { transition: opacity 0.2s; }
.sub-list.busy { opacity: 0.5; }
.note { margin-top: 12px; padding: 22px 16px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); text-align: center; color: var(--text-3); font-size: 14px; }
.note.bare { margin: 0; padding: 8px 0; border: 0; background: none; }
.skeleton { margin-top: 12px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); animation: blink 1.4s ease-in-out infinite; }
.card.pad { padding: 12px; }

/* The table */
.table { border-radius: var(--r); border: 1px solid var(--stroke); background: var(--surface-2); overflow: hidden; }
.t-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 26px 34px 34px 58px; align-items: center; gap: 4px; padding: 8px 12px; color: var(--text-2); font-size: 11.5px; }
.t-row + .t-row { border-top: 1px solid var(--stroke); }
.t-row > span, .t-row > b { text-align: center; }
.t-row > span:first-child { font: 700 11.5px/1 var(--fd); color: var(--text-2); }
.t-row .wide { display: none; }
.t-row b { font: 700 14px/1 var(--fd); color: var(--text); }
.t-head { color: var(--text-3); font: 700 10px/1 var(--fd); letter-spacing: 0.06em; text-transform: uppercase; }
.t-head > span:nth-child(2) { text-align: left; }
.t-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-team .trunc { color: var(--text); font: 600 14px/1.2 var(--fd); text-align: left; }
.t-row.me { background: var(--tint); }
a.t-row:hover { background: rgba(255, 255, 255, 0.03); }
.t-form { display: flex; justify-content: center; gap: 2px; }
.t-form i { width: 8px; height: 8px; border-radius: 50%; background: var(--stroke-strong); }
.t-form i.f-w { background: #2DE28C; }
.t-form i.f-l { background: var(--live); }
.t-form i.f-d { background: var(--text-3); }

/* Players */
#s-body > .strip.cards-sm { margin-top: 12px; }
.player { width: 124px; flex-shrink: 0; text-align: center; }
.player-top { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 132px; padding: 8px 8px 8px; background: linear-gradient(180deg, var(--tint), var(--surface-2)); }
.player-top .crest { box-shadow: 0 4px 14px var(--glow); }
.crest.avatar img { object-fit: cover; padding: 0 !important; }
.player-name { width: 100%; font: 700 11.5px/1.25 var(--fd); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player-num { padding: 10px 8px; }
.player-num b { display: block; font: 700 20px/1 var(--fd); }
.player-num small { display: block; margin-top: 4px; color: var(--text-3); font-size: 10px; }

.row.plain { align-items: center; gap: 12px; padding: 10px 14px; }
.row.plain .rank { width: 24px; flex-shrink: 0; text-align: center; color: var(--text-3); font: 700 14px/1 var(--fd); }
.row.plain .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row.plain .grow b { font: 600 14px/1.25 var(--fd); }
.row.plain .grow small { color: var(--text-3); font-size: 10px; }
.row.plain > small { color: var(--text-3); font-size: 11.5px; }
.score-col { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.score-col b { font: 700 16px/1.1 var(--fd); }
.score-col small { color: var(--text-3); font-size: 10px; }
a.row.plain:hover { background: rgba(255, 255, 255, 0.03); }

/* Next match & last five */
.card.next { display: block; width: 100%; padding: 16px; text-align: left; }
.next-league { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-2); font: 600 10px/1.3 var(--fd); letter-spacing: 0.08em; text-transform: uppercase; }
.next-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.next-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.next-side > span:last-child { max-width: 100%; font: 700 14px/1.25 var(--fd); }
.next-when { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.next-when small { color: var(--text-3); font: 600 10px/1.3 var(--fd); }
.next-when b { font: 700 22px/1.2 var(--fd); }

.form { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.form-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border-radius: var(--r-sm); }
.form-score { padding: 2px 8px; border-radius: 6px; font: 700 11.5px/1.3 var(--fd); background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.form-score.r-w { background: #2DE28C; color: #0b1a12; box-shadow: none; }
.form-score.r-l { background: var(--live); color: #fff; box-shadow: none; }

@media (min-width: 640px) {
    .sub-head { padding: 22px; }
    .sub-head h1 { font-size: 24px; }
}

@media (min-width: 1024px) {
    .sub { padding-top: 0; }
    .back { margin-top: 0; }
    .sub-head { padding: 28px 32px; }
    .sub-head h1 { font-size: 28px; }
    .t-row { grid-template-columns: 28px minmax(0, 1fr) 34px 30px 30px 30px 34px 34px 40px 40px 80px; padding: 10px 16px; font-size: 13px; }
    .t-row .wide { display: block; }
    .strip.cards-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); overflow: visible; }
    .strip.cards-sm .player { width: auto; }
    .card.next { padding: 22px; }
    .card.next:hover, .form-item:hover { border-color: var(--stroke-strong); }
}

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