/* App UI (Pal portal + Admin) — builds on styles.css tokens */
.app-body { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; padding: 28px 0 96px; }
.app-main h1 { font-size: clamp(30px, 4.6vw, 44px); margin: 6px 0 6px; }
.subtle { color: var(--ink-soft); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.app-nav .wrap { gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--court); color: var(--ball); display: grid; place-items: center; font: 800 15px var(--display); flex: none; }
.link-btn { background: none; border: 0; padding: 8px 6px; font: 600 14px var(--body); color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

/* tabs: top on desktop, bottom bar on phones */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 12px 14px; font: 600 15px var(--body); color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ball); }
.tab .ico { font-size: 18px; }
/* a page's main button stays in reach while its list scrolls (Open games: Join N games) */
.sticky-cta { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; }
@media (max-width: 700px) {
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); border-bottom: 0; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tab { flex-direction: column; gap: 2px; font-size: 11px; padding: 8px 4px; border-bottom: 0; border-top: 3px solid transparent; flex: 1; }
  .tab[aria-selected="true"] { border-top-color: var(--ball); }
  /* the phone bar keeps five tabs; the others are reached from Home */
  .tab-extra { display: none; }
  .sticky-cta { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* home hub: one big button per section */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hub a { display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 96px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.hub a:hover, .hub a:focus-visible { border-color: var(--court); }
.hub .ico { font-size: 24px; }
.hub b { font-weight: 700; }
.hub span.d { color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.club-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.toggle input { width: 22px; height: 22px; flex: none; accent-color: var(--court); }
.toggle .grow { flex: 1; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h2, .card h3 { margin-top: 0; }
.card h3 { font: 700 20px/1.25 var(--display); margin-bottom: 4px; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { font: 800 24px var(--display); margin: 0; letter-spacing: -0.02em; }

/* level card */
.level-card { background: var(--court); color: #eaf3ee; border: 0; position: relative; overflow: hidden; }
.level-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--ball); opacity: .9; }
.level-card .sport { font-weight: 600; color: #b9d0c5; position: relative; z-index: 1; }
.level-card .big { font: 800 64px/1 var(--display); color: #fff; margin: 10px 0 6px; position: relative; z-index: 1; letter-spacing: -0.03em; }
.level-card .meta { color: #b9d0c5; font-size: 15px; position: relative; z-index: 1; }
.level-card .rank { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(200, 245, 66, .14); color: var(--ball); font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font: 700 12px var(--body); background: #eef7d6; color: #3c5410; }
.badge.grey { background: #eef0ea; color: var(--ink-soft); }
.badge.green { background: #dff5e6; color: #1b6b3a; }
.badge.red { background: #fde8e6; color: #9b2c1f; }
.level-card .badge { background: rgba(255,255,255,.12); color: #fff; }

/* stat tiles */
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tile .label { color: var(--ink-soft); font-size: 14px; }
.tile .value { font: 800 30px/1.1 var(--display); margin-top: 4px; letter-spacing: -0.02em; }
.tile .hint { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .desc { color: var(--ink-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }

/* games */
.game { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; }
.date-box { background: #eef7d6; border-radius: 14px; text-align: center; padding: 8px 4px; color: #2f430b; }
.date-box .d { font: 800 24px/1 var(--display); }
.date-box .m { font: 700 12px var(--body); text-transform: uppercase; letter-spacing: .06em; }
.game.past .date-box { background: #eef0ea; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-sm { padding: 4px 10px; border-radius: 999px; background: #f2f3ee; font-size: 13px; font-weight: 600; }
.chip-sm.me { background: var(--ball); color: var(--ball-ink); }
.delta { font: 800 15px var(--display); white-space: nowrap; }
.delta.up { color: #1b6b3a; }
.delta.down { color: #9b2c1f; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.input, select.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: 400 17px var(--body); background: #fff; color: var(--ink); }
.input:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 4px rgba(14, 59, 46, .12); }
.input[aria-invalid="true"] { border-color: #c0392b; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; margin-bottom: 0; }
.otp { letter-spacing: .5em; text-align: center; font: 800 28px var(--display); }
.err { color: #9b2c1f; font-size: 14px; min-height: 20px; }
.btn-primary { background: var(--court); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(14, 59, 46, .25); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-sm { padding: 9px 14px; font-size: 14px; min-height: 40px; }
.btn-danger { background: transparent; color: #9b2c1f; border: 1.5px solid #e4b4ae; }
.btn-block { width: 100%; justify-content: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 18px; color: var(--ink-soft); }
.icon-btn:hover { color: #9b2c1f; border-color: #e4b4ae; }

/* availability week */
.week { display: grid; gap: 10px; }
.day { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.day .name { font-weight: 700; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slot { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: #eef7d6; color: #2f430b; font-weight: 700; font-size: 14px; }
.slot button { border: 0; background: rgba(0,0,0,.06); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 14px; color: inherit; }
.add-slot { border: 1.5px dashed var(--line); background: none; border-radius: 999px; padding: 6px 12px; font: 600 14px var(--body); color: var(--ink-soft); cursor: pointer; }
.add-slot:hover { border-color: var(--court); color: var(--court); }
@media (max-width: 560px) { .day { grid-template-columns: 1fr; } }

/* login */
.auth { max-width: 440px; margin: 24px auto; }
.auth .card { padding: 28px; box-shadow: var(--shadow); }
.country { flex: 0 0 120px !important; }

/* empty & loading */
.empty { text-align: center; padding: 34px 18px; color: var(--ink-soft); }
.empty .big-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, #eef0ea 25%, #f6f7f2 37%, #eef0ea 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 12px; min-height: 18px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: #9b2c1f; }

/* dialog */
dialog { border: 0; border-radius: 20px; padding: 24px; max-width: 420px; width: calc(100% - 32px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11, 31, 25, .45); }
dialog h3 { font: 800 22px var(--display); margin: 0 0 8px; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 13px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #f8f8f3; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.bar { height: 8px; border-radius: 4px; background: var(--ball); display: inline-block; vertical-align: middle; }

/* the marketing site's section spacing doesn't apply inside the app */
.app-main section { padding: 0; }
.app-main section.card { padding: 22px; }
.link-btn { white-space: nowrap; }
@media (max-width: 560px) {
  .app-nav .logo { font-size: 18px; }
  .app-nav .logo svg { width: 30px; height: 30px; }
  .app-nav .lang button { padding: 5px 7px; font-size: 12px; }
  .user-chip .avatar { display: none; }
}

/* six language buttons and the log-out link fit a phone header */
@media (max-width: 560px) { .app-nav .wrap { gap: 8px; } .app-nav .nav-links { gap: 10px; } .app-nav .lang button { padding: 5px; font-size: 11px; } .app-nav .logo { font-size: 16px; gap: 6px; } .app-nav .logo svg { width: 28px; height: 28px; } }

/* ── My padel (Home tab stats; player.js statsHtml) ── */
.stats { display: grid; gap: 12px; margin: 4px 0 8px; }
.st-unlock { margin: 4px 2px; color: var(--ink-soft); font-size: 15px; }
.st-head { background: var(--court); color: #fff; border-radius: var(--radius); padding: 16px 18px; }
.st-head small { opacity: .7; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.st-me { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.st-me b { font: 800 18px var(--display); display: block; overflow-wrap: anywhere; }
.st-chips span { display: inline-block; background: rgba(255,255,255,.14); border-radius: 10px; padding: 2px 8px; margin: 4px 4px 0 0; font-size: 12px; }
.st-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: linear-gradient(135deg, #f5b942, #e0662f); color: #fff; font: 700 12px var(--body); object-fit: cover; }
.st-av.l { width: 54px; height: 54px; font-size: 20px; border: 2px solid #fff; }
.st-av.s { width: 24px; height: 24px; font-size: 11px; }
.st-new { background: #fff4d6; border: 1px solid #f2d27a; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #5c4300; }
.st-new b { color: #9a6a00; }
.st-link { background: none; border: 0; padding: 0; font: inherit; color: #7a5200; text-decoration: underline; cursor: pointer; }
.st-perf-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; }
.st-perf-row .fd-card { max-width: 210px; }
.st-radar { margin: 0; flex: 1 1 220px; max-width: 280px; background: #111623; border-radius: 16px; padding: 8px; display: grid; justify-items: center; }
.st-perf .st-note { margin: 12px 2px 0; color: var(--ink-soft); font-size: 13px; }
.st-cardlock { margin: 0; }
.st-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.st-card h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; text-align: center; }
.st-kpis div { background: rgba(0,0,0,.04); border-radius: 10px; padding: 10px 4px; font-size: 13px; }
.st-kpis b { display: block; font: 800 22px var(--display); }
.st-spark { display: block; width: 100%; height: 40px; margin-top: 10px; }
.st-note, .st-legend { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.st-legend span { margin-right: 10px; }
.st-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.st-row:last-child { border-bottom: 0; }
.st-val { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; text-align: right; }
.st-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.st-who.former { color: var(--ink-soft); font-style: italic; }
.st-tag { font-size: 10px; border-radius: 8px; padding: 1px 6px; background: #eef2ff; color: #4338ca; }
.st-tag.t { background: #ecfdf5; color: #047857; }

/* Log the sets of a casual game */
.list li.game { flex-wrap: wrap; }
.sets-panel { flex: 0 0 100%; grid-column: 1 / -1; min-width: 0; box-sizing: border-box; margin-top: 4px; padding: 12px; border-radius: 12px; background: #f7f8f3; }
.set-panel-title { font: 700 14px var(--body); margin-bottom: 8px; }
.set-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.set-line { padding: 8px 0; border-top: 1px solid #e6e8e0; }
.set-line:first-child { border-top: 0; }
.set-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.set-no { font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.set-result { padding: 0 4px; }
.set-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.set-chip { padding: 8px 14px; border-radius: 999px; border: 2px solid transparent; background: #eef0ea; font: 600 14px var(--body); cursor: pointer; }
.set-chip.a { background: var(--ball); color: var(--ball-ink); }
.set-teams { font-size: 14px; }
.set-scores { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.set-scores input { width: 64px; padding: 8px; font: 700 18px var(--body); text-align: center; border: 1px solid #d5d8cc; border-radius: 10px; }
.set-editor { margin-top: 8px; }
.muted { color: var(--ink-soft); }
.sets-panel[hidden] { display: none; }
.set-list, .set-line, .set-main, .set-editor { min-width: 0; }
.set-pick { display: grid; grid-template-columns: 1fr 1fr; }
.set-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-teams { overflow-wrap: anywhere; margin-top: 4px; }
.set-scores { flex-wrap: wrap; }
/* each set row is a vertical stack, full panel width (.list li would make it a flex row) */
.sets-panel .set-line { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0; border-bottom: 0; border-top: 1px solid #e6e8e0; }
.sets-panel .set-line:first-child { border-top: 0; }
.sets-panel .set-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; width: 100%; }
.sets-panel .set-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; width: 100%; }
.sets-panel .set-chip { width: 100%; min-width: 0; padding: 8px 10px; text-align: center; }
.sets-panel .muted.small { width: 100%; white-space: normal; margin: 0; }
.sets-panel .set-teams { width: 100%; margin: 0; }
.sets-panel .set-scores { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
.sets-panel .set-scores input { flex: 0 0 64px; width: 64px; }
.sets-panel .set-editor { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.sets-panel .actions-row { margin-top: 0; }

/* ── Season feeds (player.js renderFeed): the dark scoreboard look, scoped to .feed. cardHtml (.fd-card) and radarSvg
   (.fd-radar) carry the same tokens so they can be shown outside a feed (My padel). ── */
.feed, .fd-card, .fd-radar {
  --fd-bg: #05070C; --fd-panel: #111623; --fd-line: #2A3350; --fd-ink: #EAF0FF; --fd-muted: #A7B4D6;
  --fd-accent: #FFC220; --fd-pos: #22E58C; --fd-neg: #FF5470; --fd-info: #5FB8FF;
  --fd-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fd-cond: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", system-ui, sans-serif;
}
.feed { background: var(--fd-bg); color: var(--fd-ink); font-family: var(--fd-font); border-radius: 18px; padding: 14px 12px 18px; min-width: 0; overflow: hidden; }
.feed * { box-sizing: border-box; }
.feed button { font-family: inherit; }
.fd-sponsor { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--fd-line); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--fd-muted); }
.fd-sponsor small { text-transform: uppercase; letter-spacing: .1em; font: 800 11px var(--fd-font); }
.fd-sponsor a, .fd-sponsor span { display: inline-flex; align-items: center; gap: 8px; color: var(--fd-ink); text-decoration: none; }
.fd-sponsor b { font: 800 14px var(--fd-font); overflow-wrap: anywhere; }
.fd-sp-logo { max-height: 36px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.fd-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fd-back { background: none; border: 0; color: var(--fd-muted); font: 700 14px var(--fd-font); padding: 8px 0; cursor: pointer; }
.fd-back:hover { color: var(--fd-ink); }
.fd-btn { background: var(--fd-panel); color: var(--fd-ink); border: 1px solid var(--fd-line); border-radius: 999px; padding: 8px 14px; font: 700 13px var(--fd-font); cursor: pointer; min-height: 40px; }
.fd-btn.primary { background: var(--fd-accent); color: #1a1300; border-color: var(--fd-accent); }
.fd-btn[disabled] { opacity: .55; cursor: not-allowed; }
.fd-head small { color: var(--fd-muted); text-transform: uppercase; letter-spacing: .1em; font: 800 11px var(--fd-font); }
.fd-head h2 { font: 900 clamp(26px, 7vw, 38px)/1.02 var(--fd-cond); text-transform: uppercase; letter-spacing: -0.01em; margin: 4px 0 6px; color: var(--fd-ink); overflow-wrap: anywhere; }
.fd-season-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; color: var(--fd-muted); }
.fd-season-line b { color: var(--fd-accent); text-transform: uppercase; letter-spacing: .06em; font-weight: 900; font-size: 13px; }
.fd-season { margin-top: 10px; }
.fd-bio-head { display: flex; gap: 12px; align-items: center; }
.fd-bio-head > div { min-width: 0; }

/* pills: the only sideways scroll besides head-to-head */
.fd-pills { display: flex; gap: 8px; overflow-x: auto; margin: 14px -12px 12px; padding: 2px 12px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fd-pills::-webkit-scrollbar { display: none; }
.fd-pill { flex: none; background: var(--fd-panel); color: var(--fd-muted); border: 1px solid var(--fd-line); border-radius: 999px; padding: 8px 14px; font: 800 12px var(--fd-font); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; white-space: nowrap; min-height: 36px; }
.fd-pill[aria-selected="true"] { background: var(--fd-accent); border-color: var(--fd-accent); color: #1a1300; }

.fd-h { font: 900 13px var(--fd-font); text-transform: uppercase; letter-spacing: .1em; color: var(--fd-muted); margin: 18px 0 8px; }
.fd-body > .fd-h:first-child, .fd-round-head .fd-h { margin-top: 4px; }
.fd-round-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.fd-round-head .fd-h { color: var(--fd-ink); font-size: 16px; }
.fd-panel { background: var(--fd-panel); border: 1px solid var(--fd-line); border-radius: 14px; padding: 4px 12px; min-width: 0; }
.fd-panel.fd-flush { padding: 0; overflow: hidden; }
.fd-empty { text-align: center; padding: 28px 14px; color: var(--fd-muted); }
.fd-empty span { display: block; font-size: 34px; margin-bottom: 8px; }
.fd-note { color: var(--fd-muted); font-size: 13px; line-height: 1.45; margin: 8px 2px; }
.fd-muted { color: var(--fd-muted); }
.fd-accent { color: var(--fd-accent); font-weight: 800; }
.feed .fd-good { color: var(--fd-pos); }
.feed .fd-bad { color: var(--fd-neg); }
.fd-line { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--fd-line); font-size: 14px; min-width: 0; flex-wrap: wrap; }
.fd-line:last-child, .fd-res:last-child, .fd-hist:last-child, .fd-chem:last-child { border-bottom: 0; }
.fd-end { margin-left: auto; text-align: right; }

/* people */
.fd-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; background: none; border: 0; padding: 0; color: inherit; font: 700 14px var(--fd-font); cursor: pointer; text-align: left; }
.fd-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-who.me > span:not(.st-av) { color: var(--fd-accent); }
.fd-who.former { color: var(--fd-muted); font-style: italic; }
.feed .st-av { width: 26px; height: 26px; font-size: 11px; }
.feed .st-av.s { width: 24px; height: 24px; }
.feed .st-av.l { width: 56px; height: 56px; font-size: 22px; border: 2px solid var(--fd-accent); }
.fd-new { display: inline-block; background: #FFC220; color: #1a1300; border-radius: 999px; padding: 1px 7px; font: 800 10px var(--body, system-ui); text-transform: uppercase; letter-spacing: .06em; vertical-align: middle; }

/* results */
.fd-res { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--fd-line); }
.fd-team { display: grid; gap: 2px; font-size: 13px; color: var(--fd-muted); min-width: 0; }
.fd-team span { overflow-wrap: anywhere; }
.fd-team.r { text-align: right; }
.fd-team.win { color: var(--fd-ink); font-weight: 700; }
.fd-team span.me { text-decoration: underline; text-decoration-color: var(--fd-accent); text-underline-offset: 3px; }
.fd-score { display: flex; align-items: center; gap: 6px; font: 900 26px/1 var(--fd-cond); color: var(--fd-muted); font-variant-numeric: tabular-nums; }
.fd-score b.win { color: var(--fd-accent); }
.fd-score i { font-style: normal; font-size: 16px; }
.fd-hist-date { font-size: 12px; margin-top: 8px; }

/* tiles */
.fd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fd-tile { background: var(--fd-panel); border: 1px solid var(--fd-line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.fd-tile-top { display: flex; gap: 6px; align-items: center; }
.fd-tile-top small { color: var(--fd-muted); text-transform: uppercase; letter-spacing: .08em; font: 800 11px var(--fd-font); }
.fd-big { font: 900 30px/1 var(--fd-cond); color: var(--fd-accent); }
.fd-big small { font: 700 12px var(--fd-font); color: var(--fd-muted); }
.fd-tile > .fd-accent { font-size: 14px; }
.fd-tile-who { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; display: grid; gap: 4px; }
.fd-chg { font: 900 12px var(--fd-font); white-space: nowrap; color: var(--fd-muted); }
.fd-chg.up { color: var(--fd-pos); }
.fd-chg.down { color: var(--fd-neg); }
.fd-chg.info { color: var(--fd-info); }

/* standings */
.fd-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.fd-table th { color: var(--fd-muted); font: 800 10px var(--fd-font); text-transform: uppercase; letter-spacing: .06em; padding: 9px 4px; text-align: left; border-bottom: 1px solid var(--fd-line); }
.fd-table td { padding: 8px 4px; border-bottom: 1px solid var(--fd-line); vertical-align: middle; }
.fd-table tr:last-child td { border-bottom: 0; }
.fd-table .n { text-align: right; width: 1%; white-space: nowrap; }
.fd-table .pos { width: 1%; text-align: center; white-space: nowrap; padding-left: 8px; }
.fd-table .pos b { display: block; font: 900 16px/1 var(--fd-cond); }
.fd-table .pl { max-width: 0; width: 100%; }
.fd-table .pl .fd-who { display: flex; }
.fd-table .key { color: var(--fd-accent); font-weight: 900; font-size: 14px; padding-right: 10px; }
.fd-table tr.me td { background: rgba(255, 194, 32, .1); }
.fd-table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--fd-accent); }
.fd-table tr.fd-div td { color: var(--fd-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; padding: 10px 10px 6px; background: var(--fd-bg); }
@media (max-width: 420px) { .fd-table .gp { display: none; } }
.fd-dots { display: inline-flex; gap: 3px; margin: 4px 0 0 34px; }
.fd-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--fd-muted); }
.fd-dots i.o-w { background: var(--fd-pos); }
.fd-dots i.o-l { background: var(--fd-neg); }
.fd-kpi .fd-dots { margin: 0; }

/* the player card */
.fd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fd-card { display: grid; gap: 6px; width: 100%; padding: 10px 10px 12px; border-radius: 16px 16px 22px 22px; border: 2px solid var(--fd-accent); color: var(--fd-ink); text-align: left; font-family: var(--fd-font); cursor: default;
  background: radial-gradient(120% 80% at 80% 0%, rgba(255, 194, 32, .28), transparent 60%), linear-gradient(160deg, #1b2236, #0b0f1a 70%); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); min-width: 0; }
button.fd-card { cursor: pointer; }
button.fd-card:hover, button.fd-card:focus-visible { transform: translateY(-2px); }
.fd-card.me { border-color: var(--fd-pos); }
.fd-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.fd-ovr b { display: block; font: 900 40px/0.9 var(--fd-cond); color: var(--fd-accent); letter-spacing: -0.02em; }
.fd-ovr span { display: block; font: 800 10px var(--fd-font); text-transform: uppercase; letter-spacing: .08em; color: var(--fd-muted); margin-top: 4px; }
.fd-photo img, .fd-ini { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, #f5b942, #e0662f); color: #fff; font: 900 24px var(--fd-cond); border: 2px solid rgba(255, 255, 255, .15); }
.fd-card-name { font: 900 15px/1.1 var(--fd-cond); text-transform: uppercase; letter-spacing: .02em; border-top: 1px solid rgba(255, 194, 32, .35); padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-card-axes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; }
.fd-card-axes div { display: flex; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.fd-card-axes b { font: 900 15px var(--fd-cond); min-width: 22px; }
.fd-card-axes span { font: 800 10px var(--fd-font); color: var(--fd-muted); letter-spacing: .06em; }
.fd-card-sub { font-size: 11px; color: var(--fd-muted); }
.fd-card.big { max-width: 230px; padding: 14px 14px 16px; }
.fd-card.big .fd-ovr b { font-size: 56px; }
.fd-card.big .fd-photo img, .fd-card.big .fd-ini { width: 76px; height: 76px; font-size: 30px; }
.fd-card.big .fd-card-name { font-size: 18px; }
.fd-card.big .fd-card-axes b { font-size: 18px; }

/* the radar */
.fd-bio-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; margin-top: 14px; }
.fd-radar-box { margin: 0; display: grid; justify-items: center; gap: 4px; flex: 1 1 220px; min-width: 0; max-width: 300px; }
.fd-radar { width: 100%; max-width: 260px; height: auto; display: block; }
.fd-radar .g { fill: none; stroke: var(--fd-line); stroke-width: 1; }
.fd-radar .avg { fill: none; stroke: var(--fd-muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fd-radar .me { fill: var(--fd-accent); fill-opacity: .35; stroke: var(--fd-accent); stroke-width: 2; stroke-linejoin: round; }
.fd-radar text { fill: var(--fd-muted); font: 800 10px var(--fd-font); letter-spacing: .06em; }
.fd-radar text .v { fill: var(--fd-ink); font-size: 12px; font-weight: 900; }
.fd-radar-box figcaption { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.fd-dash { display: inline-block; width: 18px; border-top: 2px dashed var(--fd-muted); }
.fd-axes { margin: 0; padding: 4px 12px; }
.fd-axes div { padding: 7px 0; border-bottom: 1px solid var(--fd-line); }
.fd-axes div:last-child { border-bottom: 0; }
.fd-axes dt { font: 900 12px var(--fd-font); text-transform: uppercase; letter-spacing: .06em; color: var(--fd-accent); }
.fd-axes dd { margin: 2px 0 0; font-size: 13px; color: var(--fd-muted); }
.fd-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.fd-kpi { background: var(--fd-panel); border: 1px solid var(--fd-line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.fd-kpi small { color: var(--fd-muted); font: 800 10px var(--fd-font); text-transform: uppercase; letter-spacing: .08em; }
.fd-kpi b { font: 900 28px/1 var(--fd-cond); font-variant-numeric: tabular-nums; }
.fd-kpi span { font-size: 12px; color: var(--fd-muted); }

/* head-to-head: scrolls sideways inside its box, the name column stays put */
.fd-h2h { overflow-x: auto; border: 1px solid var(--fd-line); border-radius: 14px; background: var(--fd-panel); -webkit-overflow-scrolling: touch; }
.fd-h2h table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.fd-h2h th, .fd-h2h td { padding: 7px 6px; border-bottom: 1px solid var(--fd-line); border-right: 1px solid var(--fd-line); text-align: center; white-space: nowrap; min-width: 40px; }
.fd-h2h thead th { padding: 8px 6px; }
.fd-h2h thead th .st-av { margin: 0 auto; }
.fd-h2h .rh { position: sticky; left: 0; z-index: 1; background: var(--fd-panel); text-align: left; min-width: 0; max-width: 130px; }
.fd-h2h .rh .fd-who { max-width: 118px; font-size: 12px; }
.fd-h2h tr.me th, .fd-h2h tr.me td { background: #2a2410; }
.fd-h2h td.self { background: var(--fd-bg); }
.fd-h2h td.nil { color: var(--fd-line); }
.fd-h2h td.fd-good, .fd-h2h td.fd-bad { font-weight: 900; }

/* chemistry, history */
.fd-chem { padding: 10px 0; border-bottom: 1px solid var(--fd-line); display: grid; gap: 6px; }
.fd-chem.me .fd-pair { color: var(--fd-accent); }
.fd-pair { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.fd-chem-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; }
.fd-sq { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.fd-sq i { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font: 900 10px var(--fd-font); font-style: normal; color: #05070C; background: var(--fd-muted); }
.fd-sq i.o-w { background: var(--fd-pos); }
.fd-sq i.o-l { background: var(--fd-neg); }
.fd-hist { display: grid; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--fd-line); font-size: 13px; }
.fd-hist b { font-size: 14px; text-transform: capitalize; }
.fd-barbox { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.fd-bar { width: 70px; height: 6px; border-radius: 3px; background: var(--fd-line); overflow: hidden; display: inline-block; }
.fd-bar i { display: block; height: 100%; background: var(--fd-accent); }

/* forms inside the feed */
.fd-form { display: grid; gap: 10px; padding: 12px; margin-top: 10px; }
.fd-field { display: grid; gap: 4px; font-size: 13px; color: var(--fd-muted); font-weight: 700; }
.fd-select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--fd-line); background: var(--fd-bg); color: var(--fd-ink); font: 600 15px var(--fd-font); color-scheme: dark; }
.fd-check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.fd-check input { width: 22px; height: 22px; accent-color: var(--fd-accent); }
.fd-err { color: var(--fd-neg); font-size: 13px; min-height: 18px; margin: 0; }
[data-fd-settings][hidden] { display: none; }

/* Home: the feeds strip */
.fd-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fd-strip a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #05070C; color: #EAF0FF; text-decoration: none; border: 1px solid #2A3350; min-width: 0; }
.fd-strip a:hover, .fd-strip a:focus-visible { border-color: #FFC220; }
.fd-strip .grow { flex: 1; min-width: 0; display: grid; }
.fd-strip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-strip small { color: #A7B4D6; font-size: 12px; }

/* The commentator: model text shown as plain text; line breaks via white-space only */
.cmt-panel { padding: 10px 12px 12px; margin: 10px 0; }
.cmt-panel .fd-h { margin: 0 0 8px; }
.cmt-head { font-size: 14px; line-height: 1.45; padding: 6px 0; border-bottom: 1px solid var(--fd-line); overflow-wrap: anywhere; }
.cmt-head b { color: var(--fd-accent); }
.cmt-text { margin: 8px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.cmt-warm { margin: 4px 0; font-size: 13px; color: var(--fd-muted); font-style: italic; }
.cmt-tip { margin: 0; font-size: 13px; line-height: 1.4; color: var(--fd-muted); white-space: pre-line; overflow-wrap: anywhere; }
.st-week { min-width: 0; }
.st-week:empty { display: none; }
.st-weekcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.st-weekcard .cmt-text { color: var(--ink); margin-top: 0; }
.st-weekcard .cmt-warm { color: var(--ink-soft); }
.st-weekcard h5 { margin: 12px 0 4px; font-size: 13px; }
.cmt-tips { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cmt-tips li { margin: 2px 0; }

/* lists.js: search box and pager under every long list */
.lv-top { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.lv-search { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; min-width: 0; }
.lv-pager-top { display: flex; gap: 6px; align-items: center; margin-left: auto; font-size: 14px; }
.lv-pager-top button[disabled] { opacity: .4; cursor: default; }
.lv-top:not(:has(> :not(.hidden))) { display: none; }
.lv-search .lv-q { flex: 1 1 auto; min-width: 0; max-width: 420px; min-height: 42px; padding: 9px 12px; font-size: 15px; }
.lv-pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; font-size: 14px; }
.lv-pager button[disabled] { opacity: .4; cursor: default; }
.lv-none { margin: 8px 0; }
@media (max-width: 480px) { .lv-pager > .muted { flex-basis: 100%; } }
