/* BKP Pickleball — Bluehost build styles. Palette from the BKP logo:
   navy #122E4D, olive #687C32, ball lime #C6D92E. */
:root{
  color-scheme:light;
  --bg:#F5F6F0; --surface:#ffffff; --surface-alt:#E9EDDC;
  --text:#142A47; --dim:#5F6B5E; --border:#DDE2CF;
  --accent:#122E4D; --olive:#687C32; --lime:#C6D92E; --radius:16px;
}
@media (prefers-color-scheme:dark){
  :root{ color-scheme:dark; --bg:#0C1826; --surface:#15273C; --surface-alt:#21344C;
    --text:#F2F4E9; --dim:#A9B4A4; --border:#2E425C; --accent:#1D3D5F; --olive:#9AB54E; }
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text)}
button,[role="button"],select,input,summary{min-height:2.75rem;font:inherit}
button{cursor:pointer}
.loading{padding:2rem;text-align:center;color:var(--dim)}
.wrap{max-width:48rem;margin:0 auto;padding:0 1rem 6rem}
header.brand{background:#122E4D;color:#fff;padding:1.5rem 1rem;border-radius:0 0 28px 28px}
header.brand .row{display:flex;align-items:flex-start;gap:.75rem;max-width:48rem;margin:0 auto}
.logo-badge{width:88px;height:88px;border-radius:9999px;background:#fff;overflow:hidden;flex-shrink:0;box-shadow:0 10px 15px rgba(0,0,0,.25);outline:2px solid rgba(198,217,46,.7)}
.logo-badge img{width:100%;height:100%;object-fit:cover;display:block}
.brand-name{font-family:"Barlow Condensed",system-ui,sans-serif;font-size:34px;font-weight:700;letter-spacing:.02em;line-height:.9}
.brand-name .lime{color:var(--lime)}
.brand-sub{font-family:"Barlow Condensed",system-ui,sans-serif;font-size:13px;letter-spacing:.22em;text-transform:uppercase;opacity:.9;margin-top:6px}
.hero{font-family:"Barlow Condensed",system-ui,sans-serif;font-size:42px;font-weight:700;line-height:.95;margin:1.25rem 0 0}
.hero .lime{color:var(--lime)}
.lang-switch{margin-left:auto;display:flex;gap:.25rem}
.lang-switch button{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.35);border-radius:.6rem;padding:.35rem .7rem;min-height:2.25rem;font-weight:600;font-size:.85rem}
.lang-switch button[aria-pressed="true"]{background:var(--lime);color:#122E4D;border-color:var(--lime)}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;margin-top:1rem}
.card h2,.card h3{margin:0}
.display{font-family:"Barlow Condensed",system-ui,sans-serif;font-weight:700;line-height:1}
.dim{color:var(--dim)} .small{font-size:.875rem} .tiny{font-size:.75rem}
.err{color:#dc2626;font-size:.875rem}
.btn{display:inline-block;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:.75rem;padding:.55rem .9rem;font-weight:600;font-size:.9rem}
.btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn.olive{background:var(--olive);color:#fff;border-color:var(--olive)}
.btn.danger{border-color:#fca5a5;color:#b91c1c}
.btn.block{width:100%;text-align:center}
.btn.small{min-height:2.25rem;padding:.35rem .7rem;font-size:.82rem;border-radius:.6rem}
.btn:disabled{opacity:.6}
/* This selector must stay a bare `input`: most form fields in app.js are
   written as <input name="…"> with NO type attribute, and an attribute
   selector like input[type="text"] does not match those — they rendered
   at the browser's default narrow width, inline after their label,
   instead of full-width under it. The score-box rules below carry an
   attribute + class, so they still outrank this bare rule. */
input,select,textarea{
  width:100%;border:1px solid var(--border);border-radius:.75rem;padding:.6rem .75rem;background:var(--bg);color:var(--text)}
label{font-size:.875rem;font-weight:500;display:block}
label > input,label > select{margin-top:.25rem}
/* Field layout — the pattern the Add/Edit player forms use: the label
   sits on its OWN line on top of its box (label and input are siblings,
   the label no longer wraps the input), and the box fills the full
   width of its column, so every box in the white form area lines up
   edge to edge instead of starting wherever its label text ended. */
.field{display:block}
.field label{display:block;font-size:.875rem;font-weight:600;margin-bottom:.35rem}
.field input,.field select,.field textarea{display:block;width:100%}
/* Literal brand hexes (not var()) for the band and badge: they are the
   form's identity piece, and a literal value can never fall back to
   unstyled if a variable fails to resolve. */
.form-head{background:#122E4D;color:#fff;padding:.8rem 1rem;display:flex;align-items:center;gap:.75rem}
.plus-badge{width:2.25rem;height:2.25rem;border-radius:9999px;background:#C6D92E;color:#122E4D;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.4rem;line-height:1;flex-shrink:0}
.dupr-panel{background:var(--surface-alt);border-radius:.75rem;padding:.75rem}
.panel-title{font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.7;margin-bottom:.5rem}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--olive);outline-offset:1px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.75rem}
@media (max-width:560px){.grid3{grid-template-columns:1fr}}
.stack > * + *{margin-top:.75rem}
nav.tabs{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 95%,transparent);backdrop-filter:blur(6px);padding:.75rem 0;display:flex;gap:.5rem;overflow-x:auto}
nav.tabs button{white-space:nowrap;padding:.6rem 1rem;border-radius:9999px;font-weight:600;font-size:.875rem;border:1px solid var(--border);background:var(--surface);color:var(--text);min-height:2.5rem}
nav.tabs button.on{background:var(--text);color:var(--bg)}
/* align-self:flex-start matters: where a badge sits directly inside a
   flex row (the player view's session header), the row's default
   align-items:stretch would otherwise stretch the pill to the full
   height of the text block beside it — a tall pale oval. */
.badge{display:inline-block;align-self:flex-start;padding:.15rem .6rem;border-radius:9999px;font-size:.72rem;font-weight:700;background:var(--surface-alt)}
.badge.olive{background:var(--olive);color:#fff}
.badge.full{background:#fee2e2;color:#b91c1c}
.badge.spots{background:#E9EDDC;color:#3F4D1E}
.court-badge{display:inline-flex;align-items:center;gap:.4rem;background:var(--accent);color:#fff;border-radius:9999px;padding:.3rem .8rem;font-size:.875rem;font-weight:700}
.progress{height:.5rem;background:var(--surface-alt);border-radius:9999px;overflow:hidden;margin-top:.75rem}
.progress > div{height:100%;background:var(--olive)}
.chips{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}
/* Closed dropdown multi-select (both player pickers). The box shows a
   placeholder or a "N players selected" summary; the panel opens below
   it with one row per player. */
.msel{position:relative}
.msel-box{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;border:1px solid var(--border);border-radius:.75rem;padding:.6rem .75rem;background:var(--bg);color:var(--text);font-weight:500;text-align:left}
.msel-box .msel-caret{color:var(--dim);flex-shrink:0}
.msel-panel{position:absolute;left:0;right:0;top:calc(100% + .25rem);z-index:30;border:1px solid var(--border);border-radius:.75rem;background:var(--surface);box-shadow:0 10px 24px rgba(0,0,0,.18);overflow:hidden}
.msel-rows{max-height:11rem;overflow-y:auto}
.msel-row{display:flex;align-items:center;gap:.6rem;padding:.55rem .75rem;font-size:.95rem;font-weight:500;cursor:pointer;border-bottom:1px solid var(--border)}
.msel-row:last-child{border-bottom:0}
/* The checkbox MUST stay 16px: the generic input rules above set
   width:100% and min-height:2.75rem, so this selector has to outrank
   them — the class + attribute + element prefix gives it the
   specificity to win. Do not let a generic input rule size it up. */
.msel-row input[type="checkbox"]{width:16px;height:16px;min-height:16px;flex:0 0 auto;margin:0;padding:0;accent-color:var(--olive);cursor:pointer}
.msel-foot{display:flex;gap:.5rem;padding:.5rem .75rem;border-top:1px solid var(--border);background:var(--surface)}
.chip{display:inline-flex;align-items:center;gap:.4rem;background:var(--bg);border:1px solid var(--border);border-radius:9999px;padding:.3rem .8rem;font-size:.875rem;font-weight:500}
.chip button{min-height:1.5rem;width:1.5rem;border-radius:9999px;border:0;background:var(--surface-alt)}
.game{background:var(--bg);border:1px solid var(--border);border-radius:.75rem;padding:.75rem;margin-top:.5rem}
.game .teams{display:flex;align-items:center;gap:.5rem;margin-top:.5rem}
.game .team{flex:1;font-weight:600;font-size:.875rem;line-height:1.25}
.game .team.right{text-align:right}
/* Score boxes stay compact: scores are 0–99, so the box only needs room
   for two digits. These selectors must outrank the generic
   input{width:100%} rule above — the input[type="number"] prefix plus
   the class gives them the specificity to win. Keep that prefix. */
input[type="number"].score-in{width:2.5rem;flex:0 0 auto;padding:.3rem .1rem;min-height:2.25rem;text-align:center;font-weight:700}
input[type="number"].score-in-sm{width:2.25rem}
table.rank{width:100%;border-collapse:collapse}
table.rank td,table.rank th{padding:.6rem .5rem;border-bottom:1px solid var(--border);font-size:.9rem;text-align:left}
.pwrow{display:flex;align-items:center;gap:.5rem;background:var(--bg);border:1px solid var(--border);border-radius:.75rem;padding:.5rem .75rem;margin-top:.75rem}
.pwrow code{flex:1;word-break:break-all}
.icon-btn{width:2.75rem;height:2.75rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.6rem;border:1px solid var(--border);background:var(--surface);color:var(--text);flex-shrink:0}
footer.site{max-width:48rem;margin:2.5rem auto 0;padding:1rem;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:center;gap:.75rem;flex-wrap:wrap}
footer.site .logo-badge{width:40px;height:40px;outline:none;box-shadow:none;border:1px solid var(--border)}
a{color:inherit}
.confirm{border:1px solid #fca5a5;border-radius:.75rem;padding:.75rem;margin-top:.75rem}
.confirm.amber{border-color:#fcd34d;background:#fffbeb}
@media (prefers-color-scheme:dark){.confirm.amber{background:#2a2113}}
