/* 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)); }

/* ── 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; }
.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; }

/* ── 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); }

/* ── 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; }
.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); }
