/* Archivo, bundled for offline use (SIL Open Font License, see fonts/OFL.txt).
   One variable font per subset: width 62–125, weight 400–900. */
@font-face{font-family:'Archivo';font-style:normal;font-weight:400 900;font-stretch:62% 125%;font-display:swap;
  src:url(/static/fonts/archivo-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Archivo';font-style:normal;font-weight:400 900;font-stretch:62% 125%;font-display:swap;
  src:url(/static/fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cairo';font-style:normal;font-weight:400 900;font-display:swap;
  src:url(/static/fonts/cairo-arabic.woff2) format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}

/* The layout comes from the prototype (docs/prototype.html). */

/* ---- the colours: the website's palette (site.css; the user, 2026-10-09 and 2026-10-13):
   yellow, black, white and warm greys, with a little blue. The names are the app's own:
     --court / --court-deep   fills that carry white text: buttons, avatars, the selected
                              length (black; dark greys in dark mode)
     --court-ink              brand-coloured text and lines on the page: links, the active
                              tab, the save ring (black; yellow in dark mode)
     --ball / --ball-ink      the yellow (Save, banners, highlights) / text on it
     --team-2 / --team-2-ink  the second pair's avatars (yellow) / text on them
     --blue                   the little blue: the focus ring, as on the website
     --glass                  behind video and thumbnails; --scrim behind sheets ---- */
:root{
  --bg:#F2F2EF; --surface:#FFFFFF; --ink:#111111; --muted:#66666C; --line:#E0E0DB;
  --court:#111111; --court-deep:#2E2E33; --court-ink:#111111; --blue:#1F5FD6;
  --ball:#FFD21F; --ball-ink:#111111; --team-2:#FFD21F; --team-2-ink:#111111;
  --live:#DC2626; --ok:#16A34A; --glass:#0D0D0E; --scrim:rgba(0,0,0,.5);
  --font:'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B0B0C; --surface:#18181A; --ink:#F4F4F1; --muted:#A3A3A8; --line:#2C2C30;
    --court:#3A3A3F; --court-deep:#2E2E33; --court-ink:#FFD21F; --blue:#7AA7FF;
    --live:#F26B6B; --ok:#3CCB7F; --glass:#000000; --scrim:rgba(0,0,0,.7);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0B0B0C; --surface:#18181A; --ink:#F4F4F1; --muted:#A3A3A8; --line:#2C2C30;
  --court:#3A3A3F; --court-deep:#2E2E33; --court-ink:#FFD21F; --blue:#7AA7FF;
  --live:#F26B6B; --ok:#3CCB7F; --glass:#000000; --scrim:rgba(0,0,0,.7);
  color-scheme:dark;
}
:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
*,*::before,*::after{box-sizing:inherit}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--blue);outline-offset:2px;border-radius:6px}
.app{max-width:480px;margin:0 auto;min-height:100vh;padding:0 0 96px}
.display{font-stretch:72%;font-weight:800;letter-spacing:-.01em;line-height:1}

/* top bar */
.top{display:flex;align-items:center;justify-content:space-between;padding:14px 18px 10px}
.brand{display:flex;align-items:center;gap:8px;font-stretch:80%;font-weight:900;font-size:22px}
.brand svg{display:none}
.brand span{color:var(--ball);font-style:italic;letter-spacing:-.01em;text-shadow:-1.2px -1.2px 0 #111,1.2px -1.2px 0 #111,-1.2px 1.2px 0 #111,1.2px 1.2px 0 #111,0 -1.4px 0 #111,0 1.4px 0 #111,-1.4px 0 0 #111,1.4px 0 0 #111}
.club-name{font-size:13px;color:var(--muted);font-weight:500}
.icon-btn{border:0;background:transparent;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:var(--ink)}
.icon-btn:hover{background:var(--line)}

section.screen{display:none;padding:0 18px}
section.screen.active{display:block}

/* court screen */
.court-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px;margin:4px 0 12px}
/* the court's name and number on one line; the pill moves under it when both don't fit */
.court-head h1{font-size:54px;margin:0;white-space:nowrap}
.court-head .when{font-size:13px;color:var(--muted);margin-top:6px}
.status{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;background:var(--surface);border:1px solid var(--line);padding:6px 10px;border-radius:99px;white-space:nowrap}
.dot{width:8px;height:8px;border-radius:50%;background:var(--live);animation:pulse 1.6s infinite}
@keyframes pulse{50%{opacity:.55}} /* .35 all but vanished on dark (the walkthrough, C31) */
.live-wrap{position:relative;border-radius:22px;overflow:hidden;background:var(--glass);aspect-ratio:4/4.3}
.live-wrap canvas{width:100%;height:100%;display:block}
.live-tag{position:absolute;inset-inline-start:12px;top:12px;display:flex;align-items:center;gap:6px;background:rgba(0,0,0,.6);color:#fff;font-size:12px;font-weight:700;padding:6px 10px;border-radius:8px}
.buffer{position:absolute;inset-inline-end:12px;top:12px;color:#fff;background:rgba(0,0,0,.6);font-size:12px;padding:6px 10px;border-radius:8px}
.save-zone{display:flex;flex-direction:column;align-items:center;margin-top:-86px;position:relative;z-index:2}
.save-btn{position:relative;width:172px;height:172px;border-radius:50%;border:6px solid var(--bg);background:var(--ball);color:var(--ball-ink);display:grid;place-items:center;box-shadow:0 14px 30px -12px rgba(0,0,0,.45);transition:transform .12s}
.save-btn:active{transform:scale(.96)}
.save-btn .seam{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;opacity:.55}
.save-btn span{position:relative;font-stretch:70%;font-weight:900;font-size:25px;line-height:.95;text-align:center}
.save-btn .ring{position:absolute;inset:-6px;border-radius:50%;pointer-events:none;background:conic-gradient(var(--court-ink) var(--p,0%),transparent 0);-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 7px),#000 calc(100% - 6px));mask:radial-gradient(farthest-side,transparent calc(100% - 7px),#000 calc(100% - 6px))}
.save-hint{margin:14px 0 0;font-size:14px;color:var(--muted);text-align:center;max-width:30ch;min-height:2.6em}
.save-hint b{color:var(--ink)}
/* The step bars under Save (note 6): one thin bar per press on its way, ✓ Saved · ✓ Cut ·
   ● Sending; the button itself is free again at once. */
.save-steps{width:min(100%,260px);display:grid;gap:8px}
.step-bar{display:grid;gap:6px;margin-top:8px;animation:step-in .25s ease-out}
.steps-track{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.steps-track i{height:4px;border-radius:2px;background:var(--line)}
.steps-track i.done{background:var(--court-ink)}
.steps-track i.now{background:var(--court-ink);animation:step-now 1.2s ease-in-out infinite}
.steps-track i.bad{background:var(--live)}
.step-bar p{margin:0;font-size:12px;line-height:1.3;color:var(--muted);text-align:center}
.step-bar p .done{color:var(--ink)}
.step-bar p .now{color:var(--court-ink);font-weight:700}
.step-bar.slow p{color:var(--ink)}
.step-bar.failed p{color:var(--live)}
.steps-more{margin:6px 0 0;font-size:12px;color:var(--muted);text-align:center}
@keyframes step-now{50%{opacity:.35}}
@keyframes step-in{from{opacity:0;transform:translateY(-3px)}}
/* The clip length for this match (L5.4d): the tablet's three choices, phone sized. */
.len-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:340px;margin:16px auto 0}
.len{position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;padding:10px 4px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.len b{font-size:15px;font-weight:900}
.len span{font-size:13px;color:var(--muted);font-weight:700}
.len i{position:absolute;top:-8px;left:50%;transform:translateX(-50%);font-style:normal;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;background:var(--court-deep);color:#fff;padding:1px 6px;border-radius:99px}
.len.on{background:var(--court-deep);border-color:var(--court-deep);color:#fff}
.len.on span{color:var(--ball)}
.len.on i{background:var(--ball);color:var(--court-deep)}
.players{display:flex;align-items:center;gap:10px;margin:22px 0 8px}
.avatars{display:flex}
.av{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:800;color:#fff;background:var(--court);border:2px solid var(--bg);margin-inline-start:-8px}
.av:first-child{margin-inline-start:0}
.players p{margin:0;font-size:14px;color:var(--muted)}
.players p b{color:var(--ink)}
h2{font-stretch:78%;font-weight:800;font-size:24px;margin:26px 0 12px}
.strip{display:flex;gap:10px;overflow-x:auto;padding-bottom:6px;scroll-snap-type:x mandatory}
.strip:empty::after{content:attr(data-empty);color:var(--muted);font-size:14px;padding:18px;border:1.5px dashed var(--line);border-radius:16px;width:100%}
.clip{flex:0 0 118px;scroll-snap-align:start;border:0;padding:0;background:none;text-align:start}
.thumb{position:relative;aspect-ratio:9/16;border-radius:14px;overflow:hidden;background:var(--glass)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb .play{position:absolute;inset:0;display:grid;place-items:center}
.thumb .play i{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.9);display:grid;place-items:center}
.thumb .badge{position:absolute;left:6px;bottom:6px;right:6px;color:#fff;font-size:11px;font-weight:700;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.thumb .real{position:absolute;inset-inline-end:6px;top:6px;background:var(--ball);color:var(--ball-ink);font-size:10px;font-weight:800;padding:2px 6px;border-radius:6px}
.clip .meta{font-size:12px;color:var(--muted);margin-top:6px}
.new{animation:pop .5s cubic-bezier(.2,1.4,.4,1)}
@keyframes pop{from{transform:scale(.6);opacity:0}}

/* profile */
.prof-head{display:flex;gap:16px;align-items:center;margin:6px 0 18px}
.big-av{width:78px;height:78px;border-radius:50%;background:var(--court);color:#fff;display:grid;place-items:center;font-stretch:75%;font-weight:900;font-size:34px;flex:none;position:relative}
.big-av::after{content:"";position:absolute;inset-inline-end:-2px;bottom:-2px;width:22px;height:22px;border-radius:50%;background:var(--ball);border:3px solid var(--bg)}
.prof-head h1{font-size:40px;margin:0}
.prof-head p{margin:6px 0 0;color:var(--muted);font-size:14px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);background:var(--surface);border:1px solid var(--line);border-radius:18px}
.stats div{padding:14px 12px;text-align:center}
.stats div+div{border-inline-start:1px solid var(--line)}
.stats b{display:block;font-stretch:72%;font-weight:900;font-size:30px}
.stats span{font-size:12px;color:var(--muted)}
.chips{display:flex;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:var(--surface);padding:8px 14px;border-radius:99px;font-size:13px;font-weight:600}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.grid .clip{flex:none;width:auto}
.list{background:var(--surface);border:1px solid var(--line);border-radius:18px}
.row{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;gap:12px}
.row+.row{border-top:1px solid var(--line)}
.row .t{font-weight:700;font-size:15px}
.row .s{font-size:13px;color:var(--muted);margin-top:2px}
.win,.loss{white-space:nowrap}
.win{font-weight:800;font-size:13px;color:var(--ok)}
.loss{font-weight:800;font-size:13px;color:var(--muted)}

/* club */
.club-title{font-size:44px;margin:4px 0 4px}
.club-sub{color:var(--muted);font-size:13px;margin:0 0 16px}
.kpis{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px}
.kpi b{display:block;font-stretch:72%;font-weight:900;font-size:34px}
.kpi span{font-size:13px;color:var(--muted)}
.kpi.hero{grid-column:1/-1;background:var(--court);border-color:var(--court);color:#fff}
.kpi.hero span{color:rgba(255,255,255,.8)}
.chart{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;overflow-x:auto}
.chart svg{display:block;width:100%;height:auto;min-width:300px}
.on{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--ok)}
.on::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ok)}
.qr-box{background:#fff;padding:10px;border-radius:12px;flex:none;width:140px;height:140px;display:grid;place-items:center}
.qr-box img,.qr-box canvas{width:120px!important;height:120px!important}

/* tabs */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px)}
.tabs div{max-width:480px;margin:0 auto;display:grid;grid-auto-flow:column;grid-auto-columns:1fr} /* 2 tabs, or 3 with Club (admin) */
.tabs button{border:0;background:none;padding:10px 0 12px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;font-weight:600;color:var(--muted)}
.tabs button svg{width:24px;height:24px}
.tabs button[aria-current="page"]{color:var(--court-ink)}

/* viewer */
.viewer{position:fixed;inset:0;z-index:50;background:#000;display:none;flex-direction:column;align-items:center;justify-content:center;padding:calc(env(safe-area-inset-top,0px) + 12px) 12px calc(env(safe-area-inset-bottom,0px) + 12px)}
.viewer.open{display:flex}
/* The court camera films wide (16:9): the whole picture shows, never cropped (the sides
   of the court are where the play often is). Another shape is letterboxed. */
.stage{position:relative;width:min(100%,calc(74vh * 16 / 9));aspect-ratio:16/9;border-radius:18px;overflow:hidden;background:var(--glass)}
.stage canvas,.stage video{width:100%;height:100%;display:block;object-fit:contain}
/* the clip viewer's progress line; scoped, as other screens have a .bar of their own */
.stage>.bar{position:absolute;left:0;right:0;bottom:0;height:4px;background:rgba(255,255,255,.2)}
.stage>.bar i{display:block;height:100%;width:0;background:var(--ball)}
/* A clip loading (clipload.js): the thumbnail shows through, dimmed; never a blank box. */
.clip-load{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:20px;text-align:center;background:rgba(0,0,0,.55);color:#fff}
.clip-load[hidden]{display:none}
.clip-load p{margin:0;font-weight:700;font-size:15px;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.clip-load .spin{width:36px;height:36px;border-radius:50%;border:4px solid rgba(255,255,255,.25);border-top-color:var(--ball);animation:spin .9s linear infinite}
.clip-load.error .spin{display:none}
.clip-load button{font:inherit;font-weight:800;padding:10px 22px;border:0;border-radius:99px;background:var(--ball);color:var(--ball-ink);cursor:pointer}
@keyframes spin{to{transform:rotate(360deg)}}
.v-info{color:#fff;text-align:center;margin:12px 0 10px}
.v-info b{font-stretch:75%;font-weight:900;font-size:24px;display:block}
.v-info span{font-size:13px;opacity:.7}
.v-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:center}
.v-wait{color:rgba(255,255,255,.75);font-size:13px;font-weight:600}
.v-actions button{border:0;border-radius:99px;padding:12px 18px;font-weight:700;background:rgba(255,255,255,.12);color:#fff}
.v-actions button.primary{background:var(--ball);color:var(--ball-ink)}
.v-close{position:absolute;top:calc(env(safe-area-inset-top,0px) + 10px);inset-inline-end:12px;color:#fff}
.v-close:hover{background:rgba(255,255,255,.12)}

/* sheet */
.sheet{position:fixed;inset:0;top:var(--vv-top,0px);bottom:auto;height:var(--vv-h,100%);z-index:60;background:var(--scrim);display:none;align-items:flex-end;justify-content:center} /* --vv-*: the part above the keyboard (keyboard.js) */
.sheet.open{display:flex}
html.sheet-open,html.sheet-open body{overflow:hidden}
.sheet form{background:var(--surface);width:100%;max-width:480px;border-radius:22px 22px 0 0;padding:20px 18px calc(env(safe-area-inset-bottom,0px) + 20px);max-height:88vh;max-height:88dvh;max-height:min(88dvh,calc(var(--vv-h,100dvh) - 12px));overflow:auto;overscroll-behavior:contain} /* dvh: the height left by the browser's bars */
.sheet h3{margin:0 0 4px;font-stretch:75%;font-weight:900;font-size:26px}
.sheet .note{margin:0 0 14px;color:var(--muted);font-size:13px}
.field{display:block;margin:0 0 12px}
.field span{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.field input[type=text],.field input[type=number],.field input[type=url],.field input[type=email]{width:100%;padding:12px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
/* the padel level's two pickers (app.js levelPicker): "3 . 5" left to right in both languages */
.level-pick{display:flex;align-items:center;gap:8px;direction:ltr}
.level-pick select{flex:1;min-width:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:inherit;font:inherit;font-size:16px;font-variant-numeric:tabular-nums}
.level-pick select:disabled{color:var(--muted)}
.level-pick b{font-size:22px;font-weight:900}
.toggle{display:flex;gap:10px;align-items:flex-start;margin:4px 0 16px;font-size:14px}
.toggle input{width:20px;height:20px;margin-top:1px;accent-color:var(--court-ink)}
.sheet-actions{display:flex;gap:10px}
.sheet-actions button{flex:1;padding:12px;border-radius:12px;border:1px solid var(--line);background:var(--bg);font-weight:700}
.sheet-actions button.primary{background:var(--court);color:#fff;border-color:var(--court)}
.sheet-actions button.danger{background:var(--live);color:#fff;border-color:var(--live)}
/* tell.js: a typed reason in the question's sheet */
.tell-reason{display:block;margin:0 0 14px}
.tell-reason span{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.tell-reason textarea{width:100%;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:inherit;font:inherit;font-size:16px;resize:vertical}

.toast{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);transform:translateX(-50%) translateY(20px);background:var(--ink);color:var(--bg);padding:12px 16px;border-radius:12px;font-size:14px;font-weight:600;opacity:0;transition:.25s;z-index:70;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}

/* ---- additions for the live app ---- */
.players{justify-content:space-between}
.players .who{display:flex;align-items:center;gap:10px;min-width:0}
.link-btn{border:1px solid var(--line);background:var(--surface);padding:8px 12px;border-radius:99px;font-size:13px;font-weight:700;white-space:nowrap;flex:none}
.save-btn:disabled{cursor:default;filter:saturate(.4);opacity:.7}
.save-hint.error{color:var(--live)}
.save-hint.error b{color:var(--live)}
.conn{position:absolute;inset-inline-start:12px;bottom:12px;background:rgba(229,72,77,.9);color:#fff;font-size:12px;font-weight:700;padding:6px 10px;border-radius:8px}
.notice{margin:24px 0;padding:18px;border:1.5px dashed var(--line);border-radius:16px;color:var(--muted);font-size:15px;text-align:center}
.notice a{color:var(--court-ink);font-weight:700}
.notice b{display:block;color:var(--ink);font-stretch:78%;font-weight:800;font-size:24px;margin-bottom:6px}
.sheet .error{color:var(--live);font-size:13px;margin:-4px 0 12px;min-height:1em}
[hidden]{display:none!important}
.banner{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px;padding:10px 12px 10px 14px;border-radius:14px;background:var(--ball);color:var(--ball-ink);font-size:14px;font-weight:700}
.banner .link-btn{background:var(--ball-ink);color:var(--ball);border-color:var(--ball-ink)}
.field input.code-input{font-size:34px;font-weight:800;letter-spacing:.45em;text-align:center;padding:12px 0 12px .45em;font-variant-numeric:tabular-nums}
.sheet button[type=submit]:disabled{opacity:.6}
.prof-head .prof-id{flex:1;min-width:0}
.prof-head h1{overflow-wrap:anywhere}
.v-delete{margin-top:14px;border:0;background:none;color:rgba(255,255,255,.62);font-weight:600;font-size:14px;text-decoration:underline;padding:8px 12px}
.v-actions a{border:0;border-radius:99px;padding:12px 18px;font-weight:700;text-decoration:none;background:var(--ball);color:var(--ball-ink)}
/* Recording pill when the camera is not recording: muted, no pulse */
.status.off{color:var(--muted)}
.status.off .dot{background:var(--muted);animation:none}
.row .off{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap}
.row .off::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--muted)}
.club-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.club-head .chip{flex:none;margin-bottom:6px}
/* While the viewer is open the toast sits at the top, clear of the date line and the
   buttons at the bottom (and of the close button on the right). */
.sheet.open ~ .toast{top:calc(env(safe-area-inset-top,0px) + 14px);bottom:auto;transform:translateX(-50%) translateY(-20px)} /* never on a sheet's text (note 10) */
.sheet.open ~ .toast.show{transform:translateX(-50%) translateY(0)}
.viewer.open ~ .toast{top:calc(env(safe-area-inset-top,0px) + 14px);bottom:auto;max-width:calc(100vw - 128px);transform:translateX(-50%) translateY(-20px)}
.viewer.open ~ .toast.show{transform:translateX(-50%) translateY(0)}

/* ---- consent (L5.2): the name sheet's box and the privacy notice and terms ---- */
.consent{display:flex;gap:10px;align-items:flex-start;margin:0 0 12px;font-size:14px;line-height:1.4}
.consent input{width:22px;height:22px;margin:0;flex:none;accent-color:var(--court-ink)}
.consent a,.sheet .note a,.legal a,.legal-links a{color:var(--court-ink);font-weight:600}
.legal-links{display:flex;justify-content:center;gap:18px;padding:22px 18px;font-size:13px}
.legal main{padding:0 18px}
.legal h1{font-size:40px;margin:8px 0 4px}
.legal h2{font-size:18px;margin:24px 0 6px}
.legal p,.legal li{font-size:15px;line-height:1.55}
.legal ul{padding-inline-start:20px;margin:6px 0}
.legal .updated{color:var(--muted);font-size:13px;margin:0 0 8px}
.choice-list{display:flex;flex-direction:column;gap:8px}
.choice-list button{padding:14px 14px;border-radius:12px;border:1px solid var(--line);background:var(--bg);font-weight:700;text-align:start}
.skip-btn{display:block;margin:14px auto 0;border:0;background:none;color:var(--muted);font-size:14px;font-weight:600;padding:6px 12px}
/* L6: email login */
.email-card{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 0;padding:14px 16px;border-radius:18px;background:var(--ball);color:var(--ball-ink)}
.email-card b{display:block;font-weight:800;font-size:15px}
.email-card span{display:block;font-size:13px;margin-top:2px}
.email-card .link-btn{background:var(--ball-ink);color:var(--ball);border-color:var(--ball-ink)}
.account-actions{justify-content:flex-start;flex-wrap:wrap}
.notice-action{display:block;margin-top:12px;font-size:14px}
.sheet-alt{margin:14px 0 0;font-size:13px;color:var(--muted);display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.banner-actions{display:flex;gap:6px}
.banner .link-btn.quiet{background:none;color:var(--ball-ink);border-color:var(--ball-ink)}

/* The Court tab away from a court: "Ready to play?" and three steps */
.ready{margin:8px 0 24px}
.ready h1{font-size:54px;margin:4px 0 18px}
.steps{list-style:none;margin:0 0 22px;padding:0;display:flex;flex-direction:column;gap:10px;counter-reset:step}
.steps li{counter-increment:step;display:grid;grid-template-columns:40px 1fr;column-gap:12px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px}
.steps li::before{content:counter(step);grid-row:span 2;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--ball);color:var(--ball-ink);font-weight:900;font-size:18px}
.steps b{font-weight:800;font-size:16px}
.steps span{font-size:14px;color:var(--muted);margin-top:2px}
.ready-btn{width:100%;padding:14px;border-radius:14px;border:1px solid var(--court);background:var(--court);color:#fff;font-weight:800;font-size:16px}
/* The first-visit profile (joining from the website): the welcome card, the sport card,
   the Founding Player mark */
.founding{display:inline-block;margin-top:8px;background:var(--ball);color:var(--ball-ink);font-size:12px;font-weight:800;padding:4px 10px;border-radius:99px}
/* "Season 0" never splits: on a narrow screen (or a phone's larger text) the badge wraps
   between its two halves, never before the "0" */
.founding>span{white-space:nowrap}
/* the profile's header: the photo, the name (and level), Edit; the badge on a row of its
   own under the name, reaching to the header's right edge */
.prof-head{display:grid;grid-template-columns:auto 1fr auto;gap:0 16px}
.prof-head .founding{grid-column:2/4;justify-self:start;margin-top:6px}
.welcome{margin-top:6px}
.welcome .steps{margin-bottom:12px}
.season{margin:0 0 4px;font-size:14px;color:var(--muted)}
.sport-card{margin:18px 0 0;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:18px;display:flex;flex-direction:column;gap:10px}
.sport-card b{font-weight:800;font-size:16px}
.sport-card .chips{margin:0}
.sport-card .error{color:var(--live);font-size:13px;margin:0}
.sport-card .error:empty{display:none}
.ready-btn:disabled{opacity:.5;cursor:default}
.notice .ready-btn{width:auto;padding:12px 20px}
.legal a.notfound-btn{display:block;text-align:center;text-decoration:none;color:#fff}

/* Arabic (static/i18n.js, A): right to left, the website's Cairo for Arabic letters
   (Archivo for the rest); letter-spacing would break the joined letters; taller title
   lines. The layout mirrors by itself: margins and positions use start and end. */
html[lang=ar] body,html[lang=ar] button,html[lang=ar] input,html[lang=ar] select,html[lang=ar] textarea{font-family:'Cairo',var(--font)}
html[lang=ar] *{letter-spacing:0!important}
html[lang=ar] .display,html[lang=ar] h1,html[lang=ar] h2,html[lang=ar] h3{line-height:1.3}
.lang-chips{display:flex;gap:8px}
.lang-chips .chip[lang=ar]{font-family:'Cairo',var(--font)}
/* P1.1 "Complete your profile" and Edit (the detailsSheet) */
.sheet h4{margin:18px 0 10px;font-size:15px;font-weight:800;border-top:1px solid var(--line);padding-top:14px}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.field input[type=tel]{width:100%;padding:12px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.field .chips{margin:0}
/* choices beside a field as tall as it: the same text size, padding and border (one height in every sheet) */
.field .chip{padding:12px 16px;font-size:inherit;line-height:inherit}
.field-line{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;overflow-wrap:anywhere}
.field .handle-input{display:flex;align-items:center;margin:0;border:1px solid var(--line);border-radius:10px;background:var(--bg);padding-left:12px;font-size:inherit;font-weight:inherit}
.handle-input i{font-style:normal;color:var(--muted);font-weight:700}
.field .handle-input input[type=text]{flex:1;width:auto;min-width:0;border:0;background:none;padding:12px 12px 12px 2px}
.field .handle-input input:disabled{color:var(--muted)}
.field input[readonly],.chip:disabled{color:var(--muted);cursor:default}.chip:disabled[aria-pressed=false]{opacity:.55}
.field-hint{display:block;margin-top:6px;color:var(--muted);font-size:12px}
.locked-note{margin:-6px 0 12px;color:var(--ink);font-weight:600}
#privateFields.locked{opacity:.45}
.sport-part h5{margin:4px 0 10px;font-size:14px;font-weight:800}
.sport-part{padding:12px 0 0}

/* a player's card (P1.5): the sheet's top, centred */
.pcard{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;margin:4px 0 14px}
.pcard .big-av{margin-bottom:6px}
.pcard .big-av::after{content:none} /* the profile header's ball, not on a card */
.pcard h3{margin:0}
.pcard .handle{margin:0;color:var(--muted);font-weight:700}
.pcard .founding{margin-top:2px}
.pcard-level{margin:4px 0 0;font-weight:800}
.verified{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--blue);color:#fff;font-size:13px;font-weight:900;vertical-align:middle}
.name-link{font:inherit;font-weight:800;padding:0;text-decoration:underline;text-underline-offset:2px}
/* B2, late check-ins: a banner per late player (text above, choices below), the
   "Late arrivals" sheet's rows, and a dot on Profile while answers are waiting. */
.late-banner{flex-direction:column;align-items:stretch;gap:8px}
.late-banner .banner-actions{flex-wrap:wrap}
#lateBanners .late-banner{margin:14px 0 0} /* A4: under Save's hint, not touching it */
.late-row{align-items:flex-start;flex-wrap:wrap}
.late-row .banner-actions{flex-wrap:wrap}
.late-row .link-btn.quiet{color:var(--live);border-color:var(--line)}
.link-btn.late-waiting{background:var(--ball);color:var(--ball-ink);border-color:var(--ball)}
.row .s .link-btn{margin-top:6px}
.tabs button{position:relative}
.tabs button.has-dot::after{content:"";position:absolute;top:8px;inset-inline-start:calc(50% + 8px);width:9px;height:9px;border-radius:50%;background:var(--live);border:2px solid var(--surface)}
/* B2.1: the clips a late request offers (the first 4, then "+N"); the viewer above the
   sheets, so a clip opened from "Late arrivals" plays in front of it (under the toast). */
.late-thumbs{display:flex;gap:6px;align-items:center}
.late-thumb{border:0;padding:0;width:56px;height:56px;border-radius:10px;overflow:hidden;background:var(--line);flex:none}
.late-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.late-more{font-size:13px;font-weight:800;padding:0 4px}
.late-row .late-thumbs{margin:8px 0 2px}
.late-summary{width:100%;border:0;text-align:start;cursor:pointer}
.viewer{z-index:65}
#tellSheet{z-index:70} /* its question (Delete from my profile) opens over the viewer */
.late-match{margin:0 0 6px;font-weight:700;font-size:14px}

/* the photo (P1.3, static/photo.js): the field in the profile form and the square crop */
.photo-line{display:flex;align-items:center;gap:14px}
.photo-av,.field .photo-av{width:64px;height:64px;margin:0;border-radius:50%;flex:none;display:grid;place-items:center;overflow:hidden;
  background:var(--ball);color:var(--ball-ink);font-weight:900;font-size:22px} /* .field span would set block and a margin */
.photo-av img{width:100%;height:100%;object-fit:cover;display:block}
.field-hint.bad{color:var(--live)}
.photo-btns,.field .photo-btns{display:flex;gap:14px;flex-wrap:wrap;margin:0}
.photo-crop{position:relative;width:min(100%,320px);aspect-ratio:1;margin:6px auto 14px;overflow:hidden;border-radius:16px;
  background:#000;touch-action:none;cursor:grab;direction:ltr}
.photo-crop img{position:absolute;left:0;top:0;transform-origin:0 0;max-width:none;user-select:none;-webkit-user-drag:none;pointer-events:none}
.photo-crop i{position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 999px rgba(0,0,0,.45);outline:2px solid rgba(255,255,255,.8);pointer-events:none}
.photo-crop + .field input[type=range]{width:100%;accent-color:var(--ball)}

/* the cup sign-up (pilot-3 P3.2, static/cup.js) */
.cup-withdraw{text-align:center;margin:10px 0 0}
/* T2: the court in tickets. The box plays the last saved point on repeat; this match as
   a live ticket (the stub: today and the court; mine ringed); the late timeline. */
.live-wrap video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
.live-first{position:absolute;inset:56px 16px auto;margin:0;text-align:center;font-weight:800;font-size:14px;color:#fff;text-shadow:0 1px 6px rgba(0,0,0,.6)}
.live-first[hidden]{display:none}
.players.tk-court{display:grid;grid-template-columns:auto minmax(0,1fr) auto;background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;gap:0;padding:0;align-items:stretch}
.players.tk-court .stub{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:64px;padding:10px 4px;background:color-mix(in srgb,var(--ink) 4%,var(--surface));border-inline-end:2px dashed var(--line);text-align:center}
.players.tk-court .stub small{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.players.tk-court .stub b{font-size:28px;font-weight:900;font-stretch:68%;line-height:1}
.players.tk-court .stub span{font-size:11px;font-weight:700;color:var(--muted)}
.players.tk-court .stub{grid-row:1/span 2}
.players.tk-court .who{padding:12px;min-width:0;flex-wrap:wrap}
.players.tk-court .who p{flex:1 1 140px} /* beside the faces, or under them on a small phone */
.players.tk-court .tk-acts{display:flex;flex-wrap:wrap;gap:8px;align-self:center;margin-inline-end:12px}
.players.tk-court .tk-acts:not(:has(.link-btn:not([hidden]))){display:none}
/* two buttons (Start a friendly and New match): their own row under the faces and the line */
.players.tk-court:has(.tk-acts .link-btn:not([hidden]) ~ .link-btn:not([hidden])) .who{grid-column:2/span 2;padding-bottom:8px}
.players.tk-court:has(.tk-acts .link-btn:not([hidden]) ~ .link-btn:not([hidden])) .tk-acts{grid-column:2/span 2;grid-row:2;margin:0 12px 12px}
.avatars .av.me{box-shadow:0 0 0 2px var(--ball);position:relative;z-index:1}
.late-tl{position:relative;height:16px;margin:6px 0;border-radius:99px;background:var(--line)}
.late-tl .late-in{position:absolute;top:-3px;bottom:-3px;width:3px;border-radius:2px;background:var(--ball)}
.late-tl b{position:absolute;top:4px;width:8px;height:8px;margin-inline-start:-4px;border-radius:50%;background:var(--ink)}
/* Small buttons keep their look and get a finger-sized target: an invisible margin of
   touch around each, to 44 px tall (the full check, 2026-10-18) */
.chip,.link-btn,.ot-join,.ch-wa,.ch-add{position:relative}
.chip::after,.link-btn::after,.ot-join::after{content:"";position:absolute;inset:-6px -2px}
.ch-wa::after,.ch-add::after{content:"";position:absolute;inset:-8px -2px}
/* Where to play (V1.2): a club with replays, one row each (the design book's court row) */
.places-lbl{margin:18px 2px 8px}
.place-row{display:flex;align-items:center;gap:10px;margin-bottom:8px;padding:10px 12px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.place-row b{display:block;font-size:14px;font-weight:700}
.place-row small{display:block;font-size:12px;color:var(--muted)}
.place-ic{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--ball);color:var(--ball-ink);font-style:normal;font-weight:800;font-size:13px}
/* The check-in sheet's "first time here?" (V1.3) */
.first-q small{font-weight:400;color:var(--muted)}
.first-q #nameWhy{margin-top:4px}
