:root { --blue:#1d9bd1; --navy:#1e2a47; --green:#2e9e4f; --red:#d23b3b; --ink:#1b1b1b; --muted:#666; --bg:#f4f6f8; --card:#fff; }
* { box-sizing: border-box; }
html, body { margin:0; background:var(--bg); color:var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display:flex; align-items:center; gap:12px; padding:8px 14px; background:#fff; color:var(--navy); border-bottom:4px solid var(--blue); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.top .logo { height:48px; }
.top .title { font-weight:800; font-size:1.15rem; letter-spacing:.01em; flex:1; }
.linkbtn { background:none; border:0; color:inherit; text-decoration:underline; font-size:.9rem; cursor:pointer; }
/* Help and Log out are thumb-sized on a phone: 44px each way, as Apple asks. */
.top .linkbtn { padding:8px 4px; min-height:44px; min-width:44px; } #logout { margin-left:8px; }
/* A button reached with the keyboard (Tab, or focus moved by a dialog) shows a ring. */
button:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
#view { max-width:720px; margin:0 auto; padding:14px; }
.card { background:var(--card); border-radius:14px; box-shadow:0 2px 10px rgba(0,0,0,.08); padding:16px; margin-bottom:14px; }
h1 { font-size:1.4rem; margin:0 0 8px; } h2 { font-size:1.1rem; margin:0 0 10px; }
.notice { font-weight:600; }
.muted { color:var(--muted); } .hidden { display:none !important; } .err { color:var(--red); font-weight:600; } .ok { color:var(--green); font-weight:600; }
.big { font-size:3rem; font-weight:800; line-height:1; }
.gate-links { display:flex; gap:16px; justify-content:center; margin:14px 0 0; }
.gate-links .linkbtn { color:var(--muted); padding:8px 4px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline:none; }
input, select { width:100%; padding:12px; font-size:1rem; border:1px solid #ccc; border-radius:10px; margin:6px 0 10px; }
input[type=checkbox] { width:auto; margin-right:8px; }
input[aria-invalid=true] { border-color:var(--red); box-shadow:0 0 0 1px var(--red); }
button.primary, button.danger, button.ghost { padding:12px 16px; border:0; border-radius:10px; font-size:1rem; font-weight:600; cursor:pointer; }
button.primary { background:var(--blue); color:#fff; } button.danger { background:var(--red); color:#fff; } button.ghost { background:#e3e8ee; color:var(--ink); }
button.small { padding:7px 10px; font-size:.85rem; }
/* A filter (the coach's consent counter): outlined, so it reads as a button and not a label. */
button.filter { padding:12px 16px; border:0; border-radius:10px; font-size:1rem; font-weight:600; cursor:pointer; background:#fff; color:var(--navy); box-shadow:inset 0 0 0 2px var(--blue); }
button.filter.small { padding:7px 10px; font-size:.85rem; }
button:disabled { opacity:.5; cursor:default; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.row .apart { margin-left:auto; }
.row > .field { flex:1 1 140px; min-width:0; }
.count { display:block; margin:-6px 0 8px; font-size:.85rem; font-weight:normal; }
/* A count at its field's limit (ui.js countText) is said in red. */
.muted.limit { color:var(--red); font-weight:600; }
.rack { display:grid; grid-template-columns:repeat(11, 1fr); gap:4px; }
.rack-lg { grid-template-columns:repeat(6, 1fr); gap:8px; }
.chipwrap { position:relative; text-align:center; }
/* A rack's chips are only a picture: an arrow pointer, nothing that lights up or moves on a
   hover or press, and no text to select or tap highlight on a phone. */
.rack .chipwrap { cursor:default; user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; }
.chipwrap svg { width:100%; max-width:72px; display:block; margin:0 auto; }
.rack-sm .chipwrap svg { max-width:28px; }
.chipwrap.locked svg { filter:grayscale(1); opacity:.35; }
/* The small racks (coach and admin) keep an unearned chip's number readable. */
.rack-sm .chipwrap.locked svg, .rack-md .chipwrap.locked svg { opacity:.55; }
.chipwrap .owed { display:block; font-size:.6rem; color:var(--green); font-weight:700; }
.rack-sm .chipwrap .owed, .rack-md .chipwrap .owed { display:none; }
.rack-md { grid-template-columns:repeat(auto-fill, minmax(36px, 1fr)); gap:6px; }
.rack-md .chipwrap svg { width:36px; }
table { width:100%; border-collapse:collapse; font-size:.95rem; }
th, td { text-align:left; padding:8px 6px; border-bottom:1px solid #eee; vertical-align:middle; overflow-wrap:break-word; }
/* Headers and numbers never break mid-word; a name breaks anywhere only if it must (a
   40-letter name on a phone), and its column never gets narrower than a short name. */
th, td.num { white-space:nowrap; }
/* A long header (Verified of total) may wrap between its words, so the table fits a phone. */
th.wrap { white-space:normal; }
td.name { overflow-wrap:anywhere; min-width:6em; }
/* The day a best was set, small under the number (web/ui.js whenHtml). */
.when { display:block; font-size:.75rem; font-weight:400; color:var(--muted); }
/* The coach's list of a player's bests, oldest first (web/views/coach.js bestHtml). */
#bestHistoryTitle { font-size:1rem; margin:8px 0 4px; }
.history { margin:0 0 12px; padding-left:1.6em; }
h1, h2 { overflow-wrap:anywhere; }
/* A long unbroken word (a 100-letter parent name, an email, a note) wraps inside its card; a
   button keeps its words whole. */
.card p, .card li, .card label, .card summary { overflow-wrap:anywhere; } .card button { overflow-wrap:normal; }
/* The player panel's name wraps in its own area; Close stays at the top right. */
.panel-head { display:flex; align-items:flex-start; gap:8px; margin:0 0 10px; }
.panel-head h2 { flex:1; min-width:0; margin:0; }
.panel-head button { flex:none; }
tr.clickable { cursor:pointer; } tr.clickable:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; } tr.clickable:hover { background:#f0f4f8; }
tr.unverified td { color:var(--muted); background:#eceff2; }
#roster tr.fresh td { background:#d4ecf8; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:.75rem; font-weight:700; }
.badge.confirmed { background:#d9f2e0; color:#1c6b32; } .badge.revoked { background:#f8d7da; color:#842029; }
/* Pending and Not started tell apart at a glance: a strong amber fill against an outline on
   white. The line is an inset shadow, so neither takes more room than before. */
.badge.pending { background:#ffc53d; color:#3d2b00; box-shadow:inset 0 0 0 1px #b07d00; } .badge.none { background:#fff; color:#4b5563; box-shadow:inset 0 0 0 1px #8a94a3; }
.prize { display:flex; gap:10px; align-items:center; }
/* Just under the header (76px), above any dialog, never taking a tap; 12px clear of each side on a phone. */
/* Top: small, bottom right, over the page but under a dialog (.modal) and the toast. */
.toast { position:fixed; top:76px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 24px); background:#333; color:#fff; padding:12px 18px; border-radius:10px; box-shadow:0 4px 12px rgba(0,0,0,.2); z-index:30; pointer-events:none; }
.help { background:#eef6fb; border-left:4px solid var(--blue); }
.help ul, .help ol { padding-left:20px; } .help li { margin-bottom:6px; }
ul.log { list-style:none; font-size:.85rem; background:#f7f7f7; padding:10px; margin:0; border-radius:8px; }
ul.log li { margin-bottom:4px; }
.ptabs { display:flex; gap:6px; margin-bottom:12px; }
.ptabs button { flex:1 1 auto; min-width:0; padding:12px 8px; border:0; border-radius:10px; background:#e3e8ee; font-weight:600; font-size:1rem; cursor:pointer; }
.ptabs button.active { background:var(--blue); color:#fff; }
/* A narrow phone (320px): smaller tab words, so Achievements and Leaderboard fit side by side. */
@media (max-width:360px) { .ptabs button { font-size:.85rem; padding:12px 4px; } }
/* The admin's preview of a player's page. */
.preview-bar { display:flex; justify-content:space-between; align-items:center; gap:8px; background:#fff4d6; border-radius:10px; padding:8px 12px; margin:0 0 12px; }
.hero { display:flex; align-items:flex-end; justify-content:center; gap:24px; margin:14px 0 6px; }
.hero-current, .hero-next { text-align:center; }
.hero-current svg { width:140px; display:block; margin:0 auto; }
.hero-next svg { width:84px; display:block; margin:0 auto; }
.hero-next.alone svg { width:120px; }
.hero-label { display:block; font-weight:700; margin-top:6px; }
.hero-chip { display:block; margin:0 auto; padding:0; border:0; background:none; font:inherit; color:inherit; cursor:pointer; }
.hero .owed { color:var(--green); font-weight:700; font-size:.85rem; }
.bar { height:8px; width:84px; margin:6px auto 0; background:#e3e8ee; border-radius:999px; overflow:hidden; }
.hero-next.alone .bar { width:120px; }
.bar span { display:block; height:100%; background:var(--blue); }
.bar-label { display:block; font-size:.8rem; color:var(--muted); margin-top:4px; }
.latest { display:flex; align-items:center; gap:10px; width:100%; margin-top:12px; padding:10px 12px; border:0; border-radius:10px; background:#eef6fb; color:var(--ink); font-size:.95rem; text-align:left; cursor:pointer; }
.latest .award-art { width:36px; margin:0; }
.topchip svg { width:28px; display:block; }
/* As many columns as fit, each at least 88px: four tiles across overflowed a phone, because a
   long bold name (Leaderboard, Collector) will not shrink below its own width. minmax(0, 1fr)
   is not enough on its own for that reason, hence the floor and the wrap below. */
.awards { display:grid; grid-template-columns:repeat(auto-fill, minmax(88px, 1fr)); gap:10px; }
/* The leaderboards: the viewer's own row (or team) stands out; "You: 23rd" under a board. */
table.board tr.me td { background:#e7f4fb; font-weight:600; }
.you { font-weight:600; margin:8px 0 0; }
/* The leaderboard choices: age tabs that scroll sideways on a phone, then two small toggles. */
.choices { margin-bottom:12px; }
.choice { display:flex; gap:6px; }
.choice button { flex:1; min-height:44px; padding:8px 10px; border:0; border-radius:10px; background:#e3e8ee; color:var(--ink); font:inherit; font-weight:600; font-size:.9rem; cursor:pointer; white-space:nowrap; }
.choice button.on { background:var(--navy); color:#fff; }
.choice.age { position:relative; overflow-x:auto; padding-bottom:4px; margin-bottom:8px; }
.choice.age button { flex:0 0 auto; min-width:52px; }
.choice-row { display:flex; gap:12px; flex-wrap:wrap; }
.choice-row .choice { flex:1 1 160px; }
/* Said by a screen reader, not shown: whether a badge tile is earned. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.award { min-width:0; background:none; border:0; padding:4px; cursor:pointer; text-align:center; font:inherit; color:inherit; border-radius:10px; }
/* A chip or badge gives a little as it is pressed. */
.award { transition:transform .08s ease-out, background-color .08s ease-out; }
.award:active { transform:scale(.94); background:#e3e8ee; }
.award:focus-visible, .returned { outline:3px solid var(--blue); outline-offset:2px; }
.award > svg { width:100%; max-width:72px; display:block; margin:0 auto; }
.award.locked > svg { filter:grayscale(1); opacity:.35; }
.award .owed { display:block; font-size:.65rem; color:var(--green); font-weight:700; }
.award-name { display:block; font-size:.8rem; font-weight:700; margin-top:4px; overflow-wrap:anywhere; }
.award-level { display:block; font-size:.75rem; color:var(--muted); }
.award-art { position:relative; display:block; width:72px; max-width:100%; margin:0 auto; }
.award-art svg { width:100%; display:block; }
.award-art img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.award-art:has(img) svg { visibility:hidden; }
.award.locked .award-art { filter:grayscale(1); opacity:.35; }
.modal { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:20; }
.modal-card { position:relative; background:#fff; border-radius:14px; padding:20px 16px 16px; max-width:360px; width:100%; max-height:90vh; overflow:auto; }
.ask p { margin:0 0 12px; font-size:1rem; line-height:1.4; }
.ask .row { justify-content:flex-end; margin-top:4px; }
.ask .choices { border:0; padding:0; margin:0 0 12px; }
.ask .choices label { display:flex; align-items:center; min-height:44px; font-size:1rem; }
.modal-card #closeAward { position:absolute; top:4px; right:4px; width:44px; height:44px; padding:0; display:flex; align-items:center; justify-content:center; font-size:1.35rem; line-height:1; border-radius:50%; }
.modal-art { width:96px; margin:0 auto 8px; }
.modal-art .award-art { width:96px; max-width:100%; }
.modal-art > svg { width:96px; display:block; }
.modal-art.locked .award-art, .modal-art.locked > svg { filter:grayscale(1); opacity:.35; }
.levels { list-style:none; padding:0; margin:8px 0; } .levels li { padding:4px 0; } .levels li.done { font-weight:700; }
.progress { background:var(--bg); border-radius:8px; padding:8px 10px; }
/* On a phone every button is a full 44px tall tap target, small ones included. */
@media (max-width:480px) { .rack-lg { grid-template-columns:repeat(4, 1fr); } th.opt, td.opt { display:none; } button.primary, button.danger, button.ghost, button.filter { min-height:44px; } }
/* The club page: a table of teams per age group (a row opens the team), and the search's
   matches as full-width rows, each a 44px tap target. */
.agegroup { font-size:1rem; margin:14px 0 4px; }
.results { list-style:none; padding:0; margin:8px 0 0; }
.results button { display:block; width:100%; min-height:44px; text-align:left; background:none; border:0; border-bottom:1px solid #eee; padding:8px 6px; font-size:1rem; color:var(--ink); cursor:pointer; }
.results button:hover { background:#f0f4f8; }
.results button .muted { display:block; font-size:.85rem; }
/* View as: a small pill after a name on the admin pages; in a result list it sits beside the
   result's own button. The bar above the page while the admin views as a coach. */
button.viewas { display:inline-block; width:auto; min-height:32px; margin-left:4px; padding:4px 10px; font-size:.8rem; font-weight:600; color:var(--navy); background:#fff4d6; border:1px solid #ecd9a0; border-radius:999px; cursor:pointer; vertical-align:middle; white-space:nowrap; }
.results li:has(> .viewas) { display:flex; align-items:center; gap:6px; border-bottom:1px solid #eee; }
.results li:has(> .viewas) > button[data-team], .results li:has(> .viewas) > button[data-player] { flex:1; border-bottom:0; }
.results .viewas { min-height:44px; }
.viewas-wrap { max-width:720px; margin:0 auto; padding:14px 14px 0; }
.viewas-wrap .preview-bar { margin:0; }
/* The admin's chip status in a player's panel, and why Send coach email is off. */
table.chipstatus th, table.chipstatus td { padding:4px 6px; }
#noCoachEmail { font-size:.85rem; }
/* The page footer. Its bottom padding clears the floating Top button. The esl-it widget puts its
   "Report a bug" button in the data-esl-report span when the server is configured for it. */
.site-foot { max-width:640px; margin:24px auto 0; padding:16px 16px calc(72px + env(safe-area-inset-bottom, 0px)); text-align:center; color:var(--muted); font-size:.85rem; }
.site-foot [data-esl-report]:not(:empty)::before { content:"\00B7"; margin:0 6px; }

/* Sponsors (web/sponsors.js): a thank-you, not an ad. Small grey caption, logos 160px wide. */
.sponsors { text-align:center; }
.sponsors:not(.card) { padding:10px 14px 4px; }
.sponsors-caption { margin:0 0 8px; font-size:.75rem; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.sponsor-logos { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:12px 24px; }
.sponsor-logos a { display:block; }
.sponsor-logos img { display:block; width:160px; max-width:100%; height:auto; }
.sponsor-prizes-title { margin:14px 0 6px; font-weight:600; }
.sponsor-prizes { margin:0 auto; padding-left:1.2em; max-width:32rem; text-align:left; font-size:.9rem; }
.sponsor-prizes li { margin:4px 0; }

/* Announcement bar (web/announce.js): a slim line over the screen; tap to open the prizes. */
.announce { display:flex; align-items:flex-start; gap:8px; margin:0 0 12px; padding:8px 10px 8px 14px; border-radius:10px; background:#fff4d6; border:1px solid #f0d48a; font-size:.9rem; }
.announce details { flex:1; min-width:0; }
.announce summary { cursor:pointer; font-weight:600; }
.announce ul { margin:6px 0 2px; padding-left:1.2em; }
.announce li { margin:3px 0; }
.announce-close { flex:none; border:0; background:none; font-size:1.2rem; line-height:1; padding:2px 6px; cursor:pointer; color:inherit; }
#inviteText { width:100%; box-sizing:border-box; font:inherit; font-size:.9rem; resize:vertical; }

/* The coach's Specialty badges row in the player panel. */
.grants { list-style:none; padding:0; margin:4px 0 10px; } .grants li { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:4px 0; }
