/* Battle of the Boots — 2026 World Cup goal leaderboard. Dark theme, zero deps. */

:root {
  --bg: #0a0e14;
  --bg2: #0f1520;
  --card: #131b28;
  --card2: #182233;
  --line: #24324a;
  --ink: #eaf0fb;
  --ink-dim: #93a2bd;
  --ink-faint: #61708c;
  --accent: #2dd4bf;
  --accent2: #38bdf8;
  --gold: #ffcc47;
  --goal: #34d399;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --maxw: 640px;
  --f50: #6ea8fe;
  --predator: #ff5d73;
  --copa: #d7dae0;
  --crazyfast: #d6ee4c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -8%, #16233a 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #10202a 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}

.topbar { max-width: var(--maxw); margin: 0 auto; padding: 22px clamp(14px,4vw,24px) 6px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.title-wrap { min-width: 0; }

/* hamburger "more apps" menu */
.appnav { position: relative; flex: 0 0 auto; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink-dim);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); background: var(--card2); }
.app-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; width: 268px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.app-menu[hidden] { display: none; }
.app-menu-title { margin: 4px 8px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); }
.app-menu-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink); transition: background .15s; }
.app-menu-item:hover { background: var(--card2); }
.ami-emoji { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.ami-txt { display: flex; flex-direction: column; min-width: 0; }
.ami-name { font-size: 14px; font-weight: 700; }
.ami-sub { font-size: 11.5px; color: var(--ink-dim); }
.title-wrap h1 {
  margin: 0; font-size: clamp(22px, 5vw, 34px); font-weight: 900; letter-spacing: -0.02em;
  /* base colour gradient (like the sibling app) + a moving white glare on top */
  background-image:
    linear-gradient(100deg, transparent 42%, rgba(255,255,255,0.92) 50%, transparent 58%),
    linear-gradient(90deg, #ffffff, #9fb4ff 55%, #ff8a5c);
  background-size: 250% 100%, 100% 100%;
  background-position: 220% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: sheen 5s linear infinite;
}
@keyframes sheen {
  0%   { background-position: 220% 0, 0 0; }
  100% { background-position: -120% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .title-wrap h1 { animation: none; } }
.subtitle { margin: 4px 0 0; color: var(--ink-dim); font-size: 13px; }

.stage { max-width: var(--maxw); margin: 0 auto; padding: 8px clamp(14px,4vw,24px) 60px; }

/* ---------- battle of the boots ---------- */
.battle {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 16px 0 26px; padding: 18px 12px 14px;
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative;
}
.battle::before {
  content: "⚔ BATTLE OF THE BOOTS"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--gold);
  background: var(--bg2); padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}
.boot-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 6px 10px; border-radius: 12px; background: rgba(255,255,255,0.02);
  border: 1px solid transparent; position: relative; cursor: pointer;
  transition: transform .1s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
}
.boot-card:hover { background: rgba(255,255,255,0.05); transform: translateY(-2px); }
.boot-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot-card.sel { border-color: var(--accent); background: rgba(45,212,191,0.10); }
.battle.filtering .boot-card:not(.sel) { opacity: .4; }
.battle.filtering .boot-card.sel { opacity: 1; }
.boot-card.leader { border-color: var(--gold); background: rgba(255,204,71,0.06); }
.boot-card.leader::after {
  content: "👑"; position: absolute; top: -22px; right: 6px; font-size: 36px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.boot-card img { height: 62px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.boot-card .bc-goals { font-size: 26px; font-weight: 900; line-height: 1; margin-top: 8px; }
.boot-card .bc-label { font-size: 11px; color: var(--ink-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }
.boot-card .bc-bar { width: 100%; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.07); margin-top: 9px; overflow: hidden; }
.boot-card .bc-bar span { display: block; height: 100%; border-radius: 999px; }
.boot-card.f50 .bc-goals { color: var(--f50); }
.boot-card.predator .bc-goals { color: var(--predator); }
.boot-card.copa .bc-goals { color: var(--copa); }
.boot-card.crazyfast .bc-goals { color: var(--crazyfast); }
.boot-card.f50 .bc-bar span { background-color: var(--f50); }
.boot-card.predator .bc-bar span { background-color: var(--predator); }
.boot-card.copa .bc-bar span { background-color: var(--copa); }
.boot-card.crazyfast .bc-bar span { background-color: var(--crazyfast); }

/* ---------- leaderboard head ---------- */
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 8px; }
.filter-wrap { position: relative; flex: 0 0 auto; }
.filter-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-dim); font-weight: 700; font-size: 13px; cursor: pointer; }
.filter-btn svg { width: 14px; height: 14px; fill: currentColor; }
.filter-btn:hover { color: var(--ink); border-color: var(--accent); }
.filter-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(45,212,191,0.08); }
.filter-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 236px;
  background: linear-gradient(180deg, rgba(24,34,51,0.92), rgba(15,21,32,0.92));
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  padding: 13px; display: flex; flex-direction: column; gap: 11px; animation: pop .14s ease; }
.filter-panel[hidden] { display: none; }
.fp-label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fp-label select, .fp-label input { width: 100%; padding: 9px 10px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fp-label select:focus, .fp-label input:focus { outline: none; border-color: var(--accent); }
.fp-clear { margin-top: 2px; padding: 8px; border-radius: 8px; background: transparent; border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 12px; font-weight: 700; cursor: pointer; }
.fp-clear:hover { border-color: var(--accent); color: var(--accent); }
.fp-close { padding: 8px; border-radius: 8px; border: none; background: rgba(255,255,255,0.09);
  color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.fp-close:hover { background: rgba(255,255,255,0.16); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg-btn {
  border: none; background: transparent; color: var(--ink-dim); cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 8px 20px; border-radius: 999px; transition: all .14s ease;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #06231f; box-shadow: 0 2px 8px rgba(45,212,191,0.3); }
.lb-sub { color: var(--ink-faint); font-size: 11.5px; text-align: center; margin: 0 2px 12px; }
.mode-note { text-align: center; color: var(--gold); font-size: 12px; margin: -4px 2px 12px; opacity: .85; }
.filter-note { text-align: center; color: var(--ink-dim); font-size: 15px; margin: -2px 2px 14px; }
.filter-note b { color: var(--ink); }
.filter-note #clearFilter { margin-left: 8px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim); font-size: 12.5px; font-weight: 700; }
.filter-note #clearFilter:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- board rows ---------- */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: grid; grid-template-columns: 30px 46px 1fr auto 70px; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  cursor: pointer; transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.lb-row:hover { background: var(--card2); border-color: var(--accent); }
.lb-row:active { transform: scale(0.995); }
.lb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lb-row.top1 { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,204,71,0.10), var(--card) 40%); }
.lb-row.top2 { border-color: #c9d2e0; }
.lb-row.top3 { border-color: #cd7f45; }

.rank { text-align: center; font-weight: 800; font-size: 15px; color: var(--ink-faint); }
.lb-row.top1 .rank, .lb-row.top2 .rank, .lb-row.top3 .rank { color: var(--gold); font-size: 17px; }

.rphoto { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 30%, #24344d, #10161f); border: 1.5px solid var(--line); flex: 0 0 auto; }
.rphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rphoto .silho { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-faint); }
.rphoto .silho svg { width: 26px; height: 26px; opacity: .5; }

.rmain { min-width: 0; }
.rname { font-weight: 700; font-size: 14.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta { font-size: 12px; color: var(--ink-dim); margin-top: 2px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta .nflag { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.rmeta .nname { font-weight: 600; color: var(--ink); }
.rmeta .pos { color: var(--accent); font-weight: 700; }
.rmeta .dot { color: var(--ink-faint); }

.rgoals { text-align: center; min-width: 40px; }
.rgoals .g { font-size: 22px; font-weight: 900; color: var(--goal); line-height: 1; }
.rgoals.zero .g { color: var(--ink-faint); }
.rgoals .gl { font-size: 9px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }

.rea { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 13px;
  background: linear-gradient(150deg, #f4d67a, #caa53a); color: #1a1405; }
.rea.unconf { background: #2b3546; color: var(--ink-faint); }
.rea.none { background: transparent; color: var(--ink-faint); font-weight: 700; }

.rboot { display: flex; align-items: center; justify-content: flex-end; }
.rboot img { height: 40px; width: auto; max-width: 70px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
.rboot .chip { font-size: 9.5px; color: var(--ink-faint); text-align: right; line-height: 1.15; }
.rboot .chip .bdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }

/* ---------- loader / footer ---------- */
.loader { display: grid; place-items: center; gap: 14px; padding: 50px 0; color: var(--ink-dim); }
body:not(.is-loading) .loader { display: none; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.is-loading .battle, body.is-loading .lb-head, body.is-loading .board { display: none; }
.sentinel { height: 1px; }
.board-end { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 18px 0 4px; }

.footer { max-width: var(--maxw); margin: 0 auto; padding: 20px clamp(14px,4vw,24px) 30px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-faint); font-size: 11px; border-top: 1px solid var(--line); }
.foot-right { display: inline-flex; align-items: center; gap: 10px; }
.ldot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: var(--ink-faint); }
.ldot.live { background: #ff4d5e; animation: pulse 1.6s infinite; }
.ldot.warm { background: var(--gold); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,94,.5); } 70% { box-shadow: 0 0 0 6px rgba(255,77,94,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,94,0); } }

@media (max-width: 440px) {
  .lb-row { grid-template-columns: 24px 40px 1fr auto 58px; gap: 8px; padding-left: 6px; }
  .rphoto { width: 40px; height: 40px; }
  .rboot img { height: 34px; max-width: 56px; }
  .battle { grid-template-columns: repeat(2, 1fr); }
  .boot-card img { height: 58px; }
  .boot-card .bc-goals { font-size: 26px; }
}

/* ---------- disclaimer ---------- */
.disclaimer {
  position: fixed; left: 10px; bottom: 10px; z-index: 40; max-width: 210px;
  font-size: 10px; line-height: 1.35; color: #4e5766;
  background: rgba(9, 12, 18, 0.9); border: 1px solid #1b2432;
  border-radius: 8px; padding: 6px 9px;
}
@media (max-width: 480px) { .disclaimer { max-width: 160px; font-size: 9px; } }

/* ---------- today's scorers tray ---------- */
.tray {
  position: fixed; right: 14px; bottom: 14px; z-index: 60; width: 272px; max-width: calc(100vw - 28px);
  background: linear-gradient(180deg, var(--card2), var(--bg2)); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.55); overflow: hidden; animation: pop .18s ease;
}
.tray-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: linear-gradient(150deg, var(--accent), var(--accent2)); }
.tray-title { font-size: 14px; font-weight: 800; letter-spacing: .02em; color: #06231f; }
.tray-min { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,0.2); background: transparent;
  color: #06231f; font-size: 18px; line-height: 1; cursor: pointer; }
.tray-min:hover { background: rgba(0,0,0,0.12); }
.tray-body { max-height: 44vh; overflow-y: auto; padding: 6px; }
.tray-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 6px; border-radius: 9px; }
.tray-row + .tray-row { border-top: 1px solid rgba(255,255,255,0.04); }
.tray-photo { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  background: radial-gradient(circle at 50% 30%, #24344d, #10161f); border: 1.5px solid var(--line); }
.tray-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-photo .silho { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-faint); }
.tray-photo .silho svg { width: 20px; height: 20px; opacity: .5; }
.tray-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-nat { font-size: 10.5px; color: var(--ink-dim); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.tray-nat .nflag { width: 15px; height: 11px; border-radius: 2px; object-fit: cover; }
.tray-goals { font-weight: 900; color: var(--goal); font-size: 15px; display: inline-flex; align-items: center; gap: 3px; }
.tray-goals .ball { font-size: 12px; }
.tray-pill {
  position: fixed; right: 14px; bottom: 14px; z-index: 60; cursor: pointer;
  background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #06231f;
  border: none; border-radius: 999px; padding: 10px 16px; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(45,212,191,.35);
}
.tray-pill:hover { filter: brightness(1.05); }
@media (max-width: 480px) { .tray { width: 228px; } }

/* ---------- player modal ---------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,7,12,0.72); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1; width: min(380px, 100%); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--card2), var(--bg2)); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.6); padding: 26px 22px 22px; text-align: center;
  animation: pop .16s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-x {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--ink-dim);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: rgba(255,255,255,0.12); color: var(--ink); }

.mp-photo {
  width: 128px; height: 128px; border-radius: 50%; margin: 0 auto 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #24344d, #10161f); border: 3px solid var(--line);
}
.mp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-photo .silho { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-faint); }
.mp-photo .silho svg { width: 60px; height: 60px; opacity: .5; }
.mp-name { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.mp-nation { margin-top: 5px; color: var(--ink-dim); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.mp-nation .nflag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.mp-nation .dot { color: var(--ink-faint); }

.mp-statline { display: flex; justify-content: center; gap: 30px; margin: 16px 0 4px; }
.mp-stat { display: flex; flex-direction: column; align-items: center; }
.mp-stat .n { font-size: 34px; font-weight: 900; color: var(--goal); line-height: 1; }
.mp-stat:nth-child(2) .n { color: var(--accent2); }
.mp-stat .l { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }

.mp-info { margin: 18px 0 0; padding: 4px 0 0; border-top: 1px solid var(--line); text-align: left; }
.mp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.mp-row:last-child { border-bottom: none; }
.mp-row dt { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.mp-row dd { margin: 0; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-align: right; }
.mp-row dd .cflag { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.mp-none { color: var(--ink-faint); font-weight: 500; }
.mp-boot-img { height: 40px; width: auto; max-width: 96px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
.mp-boot-chip { font-size: 12px; color: var(--ink-dim); }
.mp-boot-chip .bdot, .mp-row .bdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.mp-info .rea { width: 32px; height: 32px; }
