/* Foot Holics App — shell + screens (Matches / Schedule / Standings / More)
 * Loads after tokens.css. iOS-clean, solid surfaces. */

.app { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }

/* ── App loader (animated logo + spinner until content is ready) ─────────── */
.app-loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: #0A0B0F; transition: opacity .4s ease; }
.app-loader.hide { opacity: 0; pointer-events: none; }
.loader-logo { width: 92px; height: 92px; border-radius: 20px; }
.loader-spin { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: loaderSpin .75s linear infinite; }
@keyframes loaderSpin { to { transform: rotate(360deg); } }

/* ── Header ─────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-3);
  padding: calc(var(--safe-top) + var(--s-3)) var(--s-4) var(--s-3);
  background: rgba(10,11,15,.82); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; flex: 1; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-grid; place-items: center; color: var(--on-accent); }
.brand .dot svg { width: 15px; height: 15px; }
.brand-mark { height: 30px; width: auto; border-radius: 7px; display: block; }
.hicon { width: 38px; height: 38px; border-radius: var(--r-pill); border: none; background: var(--surface-2); color: var(--text-2); display: inline-grid; place-items: center; }
.hicon svg { width: 19px; height: 19px; }
.hicon:active { background: var(--surface-3); }

/* ── View container ─────────────────────────────────────────────────────── */
.view { flex: 1; padding: var(--s-4); }
.view-title { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; margin: var(--s-2) 0 var(--s-4); }

/* ── Segmented control (Live / Upcoming / Finished) ─────────────────────── */
.segment { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px; margin-bottom: var(--s-4); }
.segment button { flex: 1; border: none; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 9px 0; border-radius: 12px; transition: all var(--dur) var(--ease); }
.segment button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }

/* ── Match cards ────────────────────────────────────────────────────────── */
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); margin-bottom: var(--s-3); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.card:active { transform: scale(.985); background: var(--surface-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.chip-comp { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 4px 9px; border-radius: var(--r-pill); }
.badge-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--live); }
.badge-ft { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.badge-soon { font-size: 12px; font-weight: 600; color: var(--accent); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.65)} }

.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3); }
.t-side { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.t-side.away { flex-direction: row-reverse; text-align: right; }
.flag { width: 34px; height: 23px; border-radius: 4px; object-fit: cover; background: var(--surface-3); flex: 0 0 auto; }
.t-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-mid { text-align: center; min-width: 60px; }
.t-score { font-family: var(--font-display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; font-feature-settings: var(--num-feat); letter-spacing: .5px; }
.t-vs { color: var(--muted); font-size: 13px; font-weight: 600; }
.t-time { font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.t-min { color: var(--live); font-size: 12px; font-weight: 700; margin-top: 2px; }
.card-foot { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.card-foot .play { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }
.card-foot .play svg { width: 14px; height: 14px; }
.card-foot .watch-foot { display: inline-flex; align-items: center; gap: 5px; color: var(--live); font-weight: 600; }
.card-foot .watch-foot svg { width: 14px; height: 14px; }
.card-foot .nostream { color: var(--muted); font-weight: 600; }
.card-foot .foot-right { display: inline-flex; align-items: center; gap: 12px; }
.rem-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; transition: all .15s ease; }
.rem-btn svg { width: 16px; height: 16px; }
.rem-btn:active { transform: scale(.9); }
.rem-btn.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.card.nostream-card:active { transform: none; background: var(--surface); }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); padding: 18vh var(--s-5); text-align: center; color: var(--muted); }
.empty .ic { width: 54px; height: 54px; border-radius: var(--r-lg); background: var(--surface); display: grid; place-items: center; color: var(--text-2); }
.empty .ic svg { width: 26px; height: 26px; }
.empty p { font-size: 14px; }

/* ── Schedule ──────────────────────────────────────────────────────────── */
.sched-day { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; margin: var(--s-4) 0 var(--s-2); }
.sched-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-2); }
.sched-team { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.sched-team.right { flex-direction: row-reverse; text-align: right; }
.sched-team .flag { width: 26px; height: 18px; }
.sched-team span { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-time { text-align: center; min-width: 70px; padding: 0 var(--s-2); }
.sched-time .tt { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.sched-time .res { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.sched-time .lbl { font-size: 10px; color: var(--muted); }

/* Schedule v2 — full fixture list (roomy, not cramped) */
.sched-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; margin: var(--s-5) 0 var(--s-2); }
.fx-row { display: grid; grid-template-columns: 1fr 92px 1fr; align-items: center; gap: var(--s-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-2); transition: background var(--dur) var(--ease); }
.fx-row.tappable:active { background: var(--surface-2); }
.fx-team { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.fx-team.right { flex-direction: row-reverse; }
.fx-team span { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-flag { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; background: var(--surface-3); flex: 0 0 auto; }
.fx-center { text-align: center; }
.fx-score { font-family: var(--font-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.fx-time { font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.fx-state { font-size: 10px; color: var(--muted); margin-top: 2px; font-weight: 600; }

/* ── Standings ─────────────────────────────────────────────────────────── */
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-3) var(--s-2); margin-bottom: var(--s-4); }
.group h3 { margin: 4px 4px var(--s-2); font-size: 15px; font-weight: 700; color: var(--accent); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: center; padding: 6px 4px; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl td { text-align: center; padding: 9px 4px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tbl td.pts { font-weight: 700; color: var(--text); }
.tbl .team-cell { display: flex; align-items: center; gap: var(--s-2); }
.tbl .team-cell .flag { width: 22px; height: 15px; }
.tbl .team-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.tbl tr.qual td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl .rk { color: var(--muted); width: 18px; }

/* ── More ──────────────────────────────────────────────────────────────── */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--s-4); }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: 15px var(--s-4); border-top: 1px solid var(--border); font-size: 15px; color: var(--text); text-decoration: none; }
.list-item:link, .list-item:visited { color: var(--text); text-decoration: none; }
.list-item:first-child { border-top: none; }
.list-item .li-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }
.list-item .li-ic svg { width: 17px; height: 17px; }
.list-item .li-label { flex: 1; }
.list-item .li-val { color: var(--muted); font-size: 13px; }
.list-item .chev { color: var(--muted); width: 18px; height: 18px; }
.switch { width: 46px; height: 28px; border-radius: var(--r-pill); background: var(--surface-3); position: relative; transition: background var(--dur) var(--ease); flex: 0 0 auto; }
.switch.on { background: var(--accent); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); }
.switch.on::after { transform: translateX(18px); }
.more-foot { text-align: center; color: var(--muted); font-size: 12px; padding: var(--s-3); line-height: 1.6; }

/* ── Bottom nav ────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: flex; background: rgba(20,22,29,.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); background: none; border: none; font-size: 11px; font-weight: 600; transition: color var(--dur) var(--ease); }
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--accent); }

/* Skeleton shimmer */
.skel { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-md); height: 96px; margin-bottom: var(--s-3); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Notice banner (bot /appnotify) ────────────────────────────────────── */
.notice-bar { display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 500; }
.notice-bar span { flex: 1; }
.notice-x { background: none; border: none; color: var(--text-2); display: inline-grid; place-items: center; padding: 4px; }
.notice-x svg { width: 17px; height: 17px; }

/* ── Maintenance overlay ───────────────────────────────────────────────── */
.maint-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: var(--s-5); background: radial-gradient(120% 120% at 50% 30%, #11151f 0%, var(--bg) 100%); }
.maint-card { text-align: center; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.maint-ic { width: 60px; height: 60px; border-radius: var(--r-lg); background: var(--surface); display: grid; place-items: center; color: var(--accent); }
.maint-ic svg { width: 28px; height: 28px; }
.maint-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0; }
.maint-card p { color: var(--text-2); font-size: 14px; margin: 0; line-height: 1.6; }
.maint-retry { margin-top: var(--s-2); background: var(--accent); color: var(--on-accent); border: none; font-weight: 700; font-size: 14px; padding: 11px 26px; border-radius: var(--r-pill); }

/* ── Time-zone select (More) ───────────────────────────────────────────── */
.tz-select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 7px 8px; font-size: 13px; font-family: var(--font-ui); max-width: 52%; }

/* ── Community popup ───────────────────────────────────────────────────── */
.comm-overlay { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: var(--s-5); background: rgba(0,0,0,.62); backdrop-filter: blur(4px); }
.comm-overlay.show { display: flex; }
.comm-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6) var(--s-5); max-width: 340px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); box-shadow: var(--shadow-2); }
.comm-ic { width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.comm-ic svg { width: 28px; height: 28px; }
.comm-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 0; }
.comm-card p { color: var(--text-2); font-size: 14px; margin: 0 0 var(--s-2); line-height: 1.6; }
.comm-join { width: 100%; background: var(--accent); color: var(--on-accent); border: none; font-weight: 700; font-size: 15px; padding: 13px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.comm-join svg { width: 18px; height: 18px; }
.comm-later { width: 100%; background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px; }

/* ── Ad-block gate ─────────────────────────────────────────────────────── */
.block-overlay { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: var(--s-5); background: radial-gradient(120% 120% at 50% 30%, #1a1014 0%, var(--bg) 100%); }
.block-overlay.show { display: flex; }
.block-card { text-align: center; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.block-ic { width: 60px; height: 60px; border-radius: var(--r-lg); background: rgba(255,61,87,.14); color: var(--live); display: grid; place-items: center; }
.block-ic svg { width: 30px; height: 30px; }
.block-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0; }
.block-card p { color: var(--text-2); font-size: 14px; margin: 0; line-height: 1.6; }
.block-btn { margin-top: var(--s-3); background: var(--accent); color: var(--on-accent); border: none; font-weight: 700; font-size: 15px; padding: 13px 26px; border-radius: var(--r-pill); }

/* ── Onboarding walkthrough (first-run) ─────────────────────────────── */
.onb-overlay { position: fixed; inset: 0; z-index: 90; display: none; flex-direction: column;
  background: var(--bg); padding: calc(var(--safe-top, 0px) + 22px) 24px calc(var(--safe-bottom, 0px) + 26px); }
.onb-overlay.show { display: flex; }
.onb-skip { align-self: flex-end; background: none; border: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 8px 6px; cursor: pointer; }
.onb-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.onb-ic { width: 96px; height: 96px; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.onb-ic svg { width: 46px; height: 46px; }
.onb-body h2 { font-size: 24px; font-weight: 700; margin: 0; color: var(--text); }
.onb-body p { font-size: 16px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 320px; }
.onb-foot { display: flex; flex-direction: column; gap: 22px; }
.onb-dots { display: flex; justify-content: center; gap: 8px; }
.onb-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all .2s ease; }
.onb-dots span.on { background: var(--accent); width: 22px; border-radius: 4px; }
.onb-btns { display: flex; gap: 12px; }
.onb-back { padding: 14px 22px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; }
.onb-next { flex: 1; padding: 14px; border-radius: var(--r-pill); border: none; background: var(--accent);
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.onb-next:active, .onb-back:active { transform: scale(.97); }

/* ── Language sheet (search + collapsible regions) ──────────────────── */
.lang-sheet { position: fixed; inset: 0; z-index: 95; display: none; flex-direction: column; background: var(--bg); }
.lang-sheet.show { display: flex; }
.lang-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top, 0px) + 12px) 16px 12px; border-bottom: 1px solid var(--border); }
.lang-close { width: 38px; height: 38px; border: none; background: var(--surface-2); color: var(--text); border-radius: var(--r-pill); display: grid; place-items: center; cursor: pointer; }
.lang-close svg { width: 20px; height: 20px; }
.lang-head-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.lang-searchbar { display: flex; align-items: center; gap: 8px; margin: 12px 16px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--muted); }
.lang-searchbar svg { width: 18px; height: 18px; flex: 0 0 auto; }
.lang-searchbar input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 16px; }
.lang-body { flex: 1; overflow-y: auto; padding: 0 12px calc(var(--safe-bottom, 0px) + 24px); }
.lang-section { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 14px 8px 6px; }
.lang-group { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 8px; border: none; background: none; color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; border-top: 1px solid var(--border); }
.lang-group svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.lang-group > span:first-of-type { flex: 1; text-align: start; }
.lang-count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 9px; border-radius: var(--r-pill); }
.lang-sub { padding-left: 8px; }
.lang-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 10px; border: none; background: none; color: var(--text); cursor: pointer; border-radius: var(--r-md); text-align: start; }
.lang-row:active { background: var(--surface); }
.lang-native { font-size: 16px; font-weight: 600; }
.lang-en { flex: 1; font-size: 13px; color: var(--muted); text-align: start; }
.lang-row.sel { color: var(--accent); }
.lang-row.sel .lang-en { color: var(--accent); }
.lang-row svg { width: 19px; height: 19px; color: var(--accent); flex: 0 0 auto; }
.lang-empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
