/* ════════════════════════════════════════════════════════════════════════════
   Vamos Draws — стили оболочки приложения.

   🔴 ВЫНЕСЕНЫ ИЗ `static/index.html` 22.08.2026 (блок ltatdraw-unify-and-harden, п.6).
   Оболочка весила 192 КБ, из них 89% — код, и отдавалась с `no-cache`: 303 живых отдачи
   в сутки, 21 МБ трафика, НИ ОДНОГО 304. Байт стилей скачивался заново на каждом заходе,
   потому что был частью уникального документа и кэшировать его браузеру было нечем.
   Тот же ход уже сделан для серверных страниц (`app._CSS_BUNDLES` → `/css/<имя>.<хэш>.css`),
   и этот файл едет тем же маршрутом: адрес несёт хэш содержимого, ответ живёт год как
   `immutable`. Правка файла меняет хэш — значит и адрес, — поэтому залипнуть не может.

   🔴 Отдельный <link> блокирует отрисовку ровно так же, как блокировал inline-<style>:
   мигания нестилизованным текстом не появляется, каскад не меняется.
   ════════════════════════════════════════════════════════════════════════════ */
  :root{
    --bg:#f3f6f5; --card:#ffffff; --ink:#13211d; --muted:#6a7b76;
    --line:#e6ecea; --brand:#0b8f6a; --brand-2:#10b981; --brand-deep:#076c50;
    --accent:#0ea5e9; --won:#16a34a; --lost:#e11d48; --bye:#94a3b8; --soon:#0ea5e9;
    --shadow:0 6px 22px rgba(16,40,34,.08); --shadow-sm:0 2px 8px rgba(16,40,34,.06);
    --r:16px;
    color-scheme:light;
  }
  /* Night theme — flip the palette; the brand greens stay so the header/nav keep matching. */
  html[data-theme="dark"]{
    --bg:#0e1714; --card:#17211d; --ink:#e7efea; --muted:#92a79f;
    --line:#27332e; --brand-deep:#2bbd8a;
    --shadow:0 8px 26px rgba(0,0,0,.5); --shadow-sm:0 2px 10px rgba(0,0,0,.45);
    color-scheme:dark;
  }
  *{box-sizing:border-box}
  html{height:100%}
  html,body{margin:0;padding:0}
  /* App-shell: body fills the viewport and does NOT scroll — the inner #scroller scrolls instead.
     This stops the mobile browser from moving the viewport on scroll (URL-bar hide/show, overscroll
     bounce), which is what made the fixed minibar / bottom nav drift off-screen and snap back. */
  body{
    height:100%; display:flex; flex-direction:column; overflow:hidden;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans Thai",Helvetica,Arial,sans-serif;
    background:var(--bg); color:var(--ink); line-height:1.45;
    -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  }
  .scroller{flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain; padding-bottom:76px}
  a{color:var(--brand-deep)}
  input, textarea{color:var(--ink)}
  input::placeholder, textarea::placeholder{color:var(--muted); opacity:.85}
  .wrap{max-width:760px; margin:0 auto; padding:0 16px 56px}

  /* Header */
  header.hero{
    background:linear-gradient(135deg,var(--brand-deep),var(--brand) 55%,var(--brand-2));
    color:#fff; padding:11px 0 30px; box-shadow:var(--shadow);
  }
  .hero .wrap{padding-bottom:0}
  /* A4 header — brand on the left, control cluster on the right, a meta row (tagline + online),
     and a floating white search card that straddles the green/content seam. Same on every page. */
  .hero-top{display:flex; align-items:center; justify-content:space-between; gap:10px}
  .hbrand{display:flex; align-items:center; gap:11px; min-width:0; text-decoration:none; color:#fff}
  .hbrand h1{font-size:20px; margin:0; font-weight:800; letter-spacing:.2px; line-height:1.1; white-space:nowrap}
  /* control cluster: wraps as a safety net so it can never push the row off-screen on narrow phones */
  .utilbtns{display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; flex:0 1 auto}
  .hero-meta{display:flex; align-items:center; gap:12px; margin-top:12px}
  .hero-meta .tag{margin:0; flex:1; min-width:0; opacity:.92; font-size:13px; font-weight:500; line-height:1.35;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
  .hero-meta .online-pill{margin-top:0; flex:0 0 auto}
  /* install & share collapse to icon-only circles in the cluster, matching theme/fav */
  .utilbtns .install-btn{padding:0; width:34px; height:34px; border-radius:50%; gap:0; justify-content:center;
    background:rgba(255,255,255,.16);
    color:#fff; border:1px solid rgba(255,255,255,.35); box-shadow:none;
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px)}
  .utilbtns .install-btn:hover{background:rgba(255,255,255,.28); transform:none; box-shadow:none}
  .utilbtns .install-btn span{display:none}
  .utilbtns .share-btn{padding:0; width:34px; height:34px; border-radius:50%; justify-content:center}
  .utilbtns .share-btn span{display:none}
  .utilbtns .theme-btn{width:34px; height:34px}
  .utilbtns .fav-btn{width:34px; height:34px}
  /* floating search card — pulled up so it sits half on the green hero, half on the content */
  .hero-search{position:relative; z-index:2; margin-top:-22px}
  .hero-search .wrap{padding-bottom:0}
  .hsearch{display:flex; align-items:center; gap:11px; width:100%; cursor:pointer; text-align:left;
    background:var(--card); border:0; border-radius:14px; padding:14px 16px; font:inherit;
    box-shadow:0 12px 28px rgba(8,40,30,.28); transition:box-shadow .15s, transform .12s}
  .hsearch:hover{box-shadow:0 16px 34px rgba(8,40,30,.34); transform:translateY(-1px)}
  .hsearch .mg{font-size:17px; flex:0 0 auto; line-height:1}
  .hsearch .htxt{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    color:var(--muted); font-size:15px; font-weight:500}
  .ball{width:34px;height:34px;border-radius:50%;
    background:radial-gradient(circle at 32% 30%,#eafff6,#caf7e6 40%,#0b8f6a 41%,#076c50);
    box-shadow:inset 0 0 0 3px rgba(255,255,255,.35), 0 3px 8px rgba(0,0,0,.18);
    position:relative; flex:0 0 auto}
  .ball::after{content:"";position:absolute;inset:0;border-radius:50%;
    background:
      radial-gradient(8px 16px at 6px 17px,transparent 9px,rgba(255,255,255,.9) 10px 11px,transparent 12px),
      radial-gradient(8px 16px at 28px 17px,transparent 9px,rgba(255,255,255,.9) 10px 11px,transparent 12px)}
  .brand h1{font-size:22px; margin:0; font-weight:800; letter-spacing:.2px}
  .brand .tag{margin:6px 0 0; opacity:.92; font-size:13.5px; font-weight:500}
  .topbar{display:flex; align-items:flex-start; justify-content:space-between; gap:12px}
  .share-btn{flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; cursor:pointer;
    background:rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.35);
    padding:8px 13px; border-radius:999px; font:inherit; font-size:13.5px; font-weight:700;
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); transition:background .15s}
  .share-btn:hover{background:rgba(255,255,255,.28)}
  @media(max-width:430px){ .share-btn span{display:none} .share-btn{padding:9px;border-radius:50%} }
  /* Day/night toggle — a round glassy button on the header, matching share/install */
  .theme-btn{flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
    width:36px; height:36px; border-radius:50%; font-size:17px; line-height:1;
    background:rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.35);
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); transition:background .15s}
  .theme-btn:hover{background:rgba(255,255,255,.28)}
  .topbtns{flex:0 0 auto; display:flex; align-items:center; gap:8px}
  /* TH/EN language switcher */
  .langsw{flex:0 0 auto; display:inline-flex; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.35);
    border-radius:999px; padding:2px; -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px)}
  .langsw button{border:none; background:none; color:rgba(255,255,255,.85); font:inherit; font-weight:800;
    font-size:12.5px; padding:6px 11px; border-radius:999px; cursor:pointer; line-height:1; transition:background .15s, color .15s}
  .langsw button.active{background:#fff; color:var(--brand-deep); box-shadow:0 1px 3px rgba(0,0,0,.25)}
  /* thin black mourning ribbon across the very top of the app, honouring HM Queen Sirikit */
  .mournbar{display:flex; align-items:center; gap:9px; background:#0c0c0d; color:#e9e9e9; text-decoration:none;
    padding:5px 14px; font-size:11.5px; border-bottom:1px solid #2a2a2a}
  .mournbar img{width:22px; height:22px; border-radius:50%; object-fit:cover; filter:grayscale(1); flex:0 0 auto;
    box-shadow:0 0 0 1px rgba(255,255,255,.25)}
  .mournbar .mtext{font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
  .mournbar .mview{margin-left:auto; opacity:.85; flex:0 0 auto}
  .mournbar:hover .mview{opacity:1; text-decoration:underline}
  /* fixed bottom tab bar (Find / Live / Top / Install) — matches the header gradient
     (bottom clearance lives on .scroller now, since the body no longer scrolls) */
  /* Pinned bottom bar. Centre with margin auto (no translateX), and force it onto its OWN compositor
     layer (translateZ(0) + backface-visibility) so threaded/momentum scroll on mobile keeps it
     glued — without a GPU layer the compositor scrolls the page but repaints the fixed bar a frame
     late, so it drifts a few % off-screen and snaps back. */
  .bottomnav{position:fixed; left:0; right:0; bottom:0; width:100%; max-width:760px; margin:0 auto;
    transform:translateZ(0); -webkit-transform:translateZ(0); backface-visibility:hidden; -webkit-backface-visibility:hidden;
    display:flex; background:linear-gradient(135deg,var(--brand-deep),var(--brand) 55%,var(--brand-2));
    box-shadow:0 -4px 18px rgba(8,40,30,.22); z-index:60}
  .bottomnav .bi{flex:1; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:3px; padding:10px 0 calc(10px + env(safe-area-inset-bottom,0px)); text-decoration:none; color:rgba(255,255,255,.82); font-size:12px; font-weight:800; cursor:pointer; transition:color .15s}
  .bottomnav .bi:hover{color:#fff}
  .bottomnav .bi .ic{font-size:21px; line-height:1}
  .bottomnav .bi .lb{font-size:11px; letter-spacing:.2px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .bottomnav .bi.on{color:#fff}
  .bottomnav .bi.on::before{content:""; position:absolute; top:0; width:36px; height:3px; border-radius:0 0 3px 3px; background:#fff; box-shadow:0 0 8px rgba(255,255,255,.6)}
  /* unified menu: Find/Live/New/Chat always visible; .fold items collapse into the «more» sheet
     on narrow screens (keep in sync with app.py _NAV_CSS) */
  .bottomnav .bi.fold{display:none}
  .bottomnav .morebtn{background:none; border:0; font:inherit; cursor:pointer}
  .bottomnav .morepanel{position:absolute; right:10px; bottom:calc(100% + 10px); display:none; flex-direction:column; min-width:190px;
    background:#fff; color:#13211d; border-radius:14px; box-shadow:0 14px 40px rgba(8,28,22,.35); overflow:hidden; z-index:60}
  .bottomnav .morepanel.open{display:flex}
  .bottomnav .morepanel a{display:flex; align-items:center; gap:11px; padding:13px 18px; color:#13211d; text-decoration:none;
    font-weight:700; font-size:14px; border-top:1px solid #eef3f1}
  .bottomnav .morepanel a:first-child{border-top:0}
  .bottomnav .morepanel .mic{font-size:18px; line-height:1}
  html[data-theme=dark] .bottomnav .morepanel{background:#17211d; color:#e7efea}
  html[data-theme=dark] .bottomnav .morepanel a{color:#e7efea; border-top-color:#22302a}
  @media(min-width:600px){ .bottomnav .bi.fold{display:flex} .bottomnav .morebtn{display:none} }
  .install-btn{flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; cursor:pointer;
    background:var(--card); color:var(--brand-deep); border:0;
    padding:8px 14px; border-radius:999px; font:inherit; font-size:13.5px; font-weight:800;
    box-shadow:0 2px 10px rgba(0,0,0,.20); transition:transform .12s, box-shadow .15s}
  .install-btn:hover{transform:translateY(-1px); box-shadow:0 5px 16px rgba(0,0,0,.26)}
  .install-btn svg{flex:0 0 auto}
  [hidden]{display:none !important}

  /* Condensed sticky bar — slides the logo (or, on a player profile, the open player's name) +
     online count back in once the hero scrolls away. Mirrors the SSR minibar so the pinned chrome
     is identical across the whole site (home, tournament, player, career, coach). */
  .minibar{position:fixed; top:0; left:0; right:0; z-index:45;
    background:linear-gradient(135deg,var(--brand-deep),var(--brand) 55%,var(--brand-2));
    box-shadow:0 3px 14px rgba(8,40,30,.28); color:#fff;
    transform:translate3d(0,-100%,0); -webkit-transform:translate3d(0,-100%,0); opacity:0;
    transition:transform .34s cubic-bezier(.22,.61,.36,1), opacity .3s ease;
    will-change:transform,opacity; backface-visibility:hidden; -webkit-backface-visibility:hidden; pointer-events:none}
  .minibar.show{transform:translate3d(0,0,0); -webkit-transform:translate3d(0,0,0); opacity:1; pointer-events:auto}
  .minibar>div{max-width:760px; margin:0 auto; display:flex; align-items:center; gap:10px;
    padding:9px 16px; padding-top:calc(9px + env(safe-area-inset-top,0px))}
  .minibar .brand{display:flex; align-items:center; gap:8px; color:#fff; font-weight:800; font-size:15px;
    text-decoration:none; flex:0 0 auto; min-width:0}
  .minibar .brand .ball{width:24px; height:24px}
  .minibar .mbrand-tx{white-space:nowrap}
  .minibar .mname{font-weight:800; font-size:15.5px; color:#fff; white-space:nowrap; overflow:hidden;
    text-overflow:ellipsis; min-width:0; display:none}
  .minibar .mspace{flex:1}
  .minibar .online-pill{margin-top:0; flex:0 0 auto}
  /* B5 — on a player profile the name is centred, with the ball on the left and online on the right */
  .minibar.hasname .mbrand-tx{display:none}
  .minibar.hasname .mname{display:block; flex:1; text-align:center}
  .minibar.hasname .mspace{display:none}
  /* the player's name making its entrance once the bar pins: slide up + fade + a hair of tracking */
  @keyframes mnameIn{0%{opacity:0; transform:translateY(10px); letter-spacing:.05em}
    55%{opacity:1} 100%{opacity:1; transform:none; letter-spacing:normal}}
  .minibar.show.hasname .mname{animation:mnameIn .44s cubic-bezier(.22,.61,.36,1)}
  @media (prefers-reduced-motion:reduce){
    .minibar{transition:opacity .2s ease}
    .minibar.show.hasname .mname{animation:none}}

  /* Share modal */
  .overlay{position:fixed; inset:0; background:rgba(8,28,22,.55); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
    display:none; align-items:center; justify-content:center; padding:18px; z-index:50}
  .overlay.open{display:flex; animation:fade .15s ease}
  @keyframes fade{from{opacity:0}to{opacity:1}}
  .sheet{background:var(--card); border-radius:20px; box-shadow:0 24px 60px rgba(8,28,22,.35); width:100%; max-width:360px;
    padding:22px 20px 20px; position:relative; text-align:center; animation:pop .18s ease}
  @keyframes pop{from{transform:translateY(12px) scale(.98);opacity:.6}to{transform:none;opacity:1}}
  .sheet-x{position:absolute; top:10px; right:12px; background:none; border:none; font-size:26px; line-height:1;
    color:var(--muted); cursor:pointer; padding:4px}
  .sheet-title{margin:2px 0 4px; font-size:19px; font-weight:800}
  .sheet-sub{margin:0 0 16px; color:var(--muted); font-size:13px}
  .qrbox{background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px; width:222px; height:222px;
    margin:0 auto 16px; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm)}
  .qrbox img{width:100%; height:100%}
  .linkrow{display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:12px;
    padding:7px 7px 7px 13px; margin-bottom:14px; background:#f8faf9}
  .linkurl{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; color:var(--ink); text-align:left}
  .copybtn{flex:0 0 auto; background:var(--brand); color:#fff; border:none; border-radius:9px; padding:8px 14px;
    font-weight:700; font-size:13px; cursor:pointer}
  .copybtn.done{background:var(--won)}
  /* Big native-share button — the OS picker, one tap, above the per-app grid */
  .bigshare{display:flex; align-items:center; justify-content:center; gap:8px; width:100%; cursor:pointer;
    background:var(--brand); color:#fff; border:none; border-radius:12px; padding:12px 14px; margin-bottom:14px;
    font:inherit; font-size:14px; font-weight:700; box-shadow:var(--shadow-sm); transition:filter .15s}
  .bigshare:hover{filter:brightness(1.08)}
  .sharegrid{display:grid; grid-template-columns:repeat(4,1fr); gap:10px}
  .sharegrid a, .sharegrid button{display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer;
    text-decoration:none; color:var(--ink); font-size:11px; font-weight:600; background:none; border:none; font-family:inherit}
  .sicon{width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center; color:#fff; box-shadow:var(--shadow-sm)}

  /* Big quick player-search (Find tab) — a tall, top-anchored sheet */
  .overlay.top{align-items:flex-start}
  .findsheet{background:var(--card); border-radius:20px; box-shadow:0 24px 60px rgba(8,28,22,.35); width:100%; max-width:560px;
    margin-top:max(30px,env(safe-area-inset-top,0px)); padding:20px 18px 16px; position:relative;
    display:flex; flex-direction:column; max-height:calc(100vh - 56px); animation:pop .18s ease}
  .findsheet .find-ttl{margin:2px 30px 3px 2px; font-size:21px; font-weight:800; color:var(--ink)}
  .findsheet .find-sub{margin:0 0 14px; color:var(--muted); font-size:13px}
  .findsearch{position:relative; flex:0 0 auto}
  .findsearch svg{position:absolute; left:15px; top:50%; transform:translateY(-50%); opacity:.5}
  .findsearch input{width:100%; padding:15px 15px 15px 46px; border:2px solid var(--line); border-radius:14px;
    font:inherit; font-size:17px; font-weight:600; background:#f8faf9; outline:none; transition:border-color .15s, background .15s}
  .findsearch input:focus{border-color:var(--brand); background:var(--card)}
  .findres{margin-top:12px; overflow-y:auto; -webkit-overflow-scrolling:touch}
  .findhint{padding:22px 8px; text-align:center; color:var(--muted); font-size:13.5px}

  /* Feedback form */
  .fbsheet{max-width:430px; text-align:left}
  .fbsheet .sheet-title, .fbsheet .sheet-sub{text-align:center}
  .fbform{display:flex; flex-direction:column}
  .fblabel{font-size:12px; font-weight:800; color:var(--muted); margin:11px 2px 4px}
  .fbinput{width:100%; border:1px solid var(--line); border-radius:11px; padding:11px 12px; font:inherit;
    font-size:14px; background:var(--card); color:var(--ink); outline:none; transition:border-color .15s}
  .fbinput:focus{border-color:var(--brand)}
  .fbtext{resize:vertical; min-height:88px; line-height:1.4}
  .fbsend{margin-top:16px; width:100%; background:linear-gradient(135deg,var(--brand),var(--brand-2));
    color:#fff; border:none; border-radius:12px; padding:13px; font:inherit; font-weight:800; font-size:15px;
    cursor:pointer; box-shadow:0 4px 14px rgba(11,143,106,.3); transition:transform .12s, box-shadow .15s}
  .fbsend:hover{transform:translateY(-1px)}
  .fbsend:disabled{opacity:.6; cursor:default; transform:none}
  .offbar{position:sticky; top:0; z-index:40; background:#3a2a00; color:#ffe9a8; text-align:center;
    font-size:13px; font-weight:700; padding:7px 12px}
  .toast{position:fixed; left:50%; bottom:28px; transform:translateX(-50%) translateY(20px); background:#13211d; color:#fff;
    padding:11px 18px; border-radius:999px; font-size:13.5px; font-weight:600; opacity:0; pointer-events:none;
    transition:opacity .2s, transform .2s; z-index:60}
  .toast.show{opacity:1; transform:translateX(-50%) translateY(0)}

  /* Breadcrumb — card "buttons" (Tournaments › Tournament › Player) with breathing room */
  .crumbs{display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:22px 0 14px}
  .crumbs .arrow{color:#bcd0c9; font-size:18px; font-weight:700; margin:0 -4px}
  .crumbs .crd{display:inline-flex; flex-direction:column; align-items:flex-start; gap:2px; font:inherit;
    background:var(--card); border:1px solid var(--line); border-radius:14px; padding:9px 15px; cursor:pointer;
    box-shadow:0 2px 10px rgba(16,40,34,.07); transition:border-color .15s, transform .13s, box-shadow .15s}
  .crumbs .crd:hover{border-color:var(--brand); transform:translateY(-2px); box-shadow:0 10px 22px rgba(11,143,106,.18)}
  .crumbs .crd:active{transform:translateY(-1px)}
  .crumbs .kl{font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; color:#9aa9a4; font-weight:800; white-space:nowrap}
  .crumbs .kv{font-size:15px; font-weight:800; color:var(--brand-deep); display:flex; align-items:center; gap:7px;
    white-space:nowrap; max-width:62vw; overflow:hidden; text-overflow:ellipsis}
  .crumbs .go{color:#c4d4ce; font-size:13px; transition:color .15s, transform .15s}
  .crumbs .crd:hover .go{color:var(--brand); transform:translate(2px,-2px)}
  .crumbs .here{display:inline-flex; flex-direction:column; align-items:flex-start; gap:2px; padding:9px 15px;
    border-radius:14px; background:var(--brand-deep); color:#fff; box-shadow:0 4px 14px rgba(7,108,80,.25)}
  .crumbs .here .kl{color:rgba(255,255,255,.78)}
  .crumbs .here .kv{color:#fff; max-width:62vw; overflow:hidden; text-overflow:ellipsis}
  /* bright "full profile" button on the player card */
  .profilebtn{display:inline-flex; align-items:center; gap:8px; background:linear-gradient(135deg,var(--brand-deep),var(--brand-2));
    color:#fff; border:0; border-radius:12px; padding:11px 18px; font:inherit; font-weight:800; font-size:14px; cursor:pointer;
    text-decoration:none; box-shadow:0 6px 16px rgba(11,143,106,.30); transition:transform .12s, box-shadow .15s; margin:4px 0 2px}
  .profilebtn:hover{transform:translateY(-2px); box-shadow:0 10px 24px rgba(11,143,106,.38)}
  .coachbtn{display:flex; align-items:center; gap:11px; width:100%; margin:8px 0 2px; padding:12px 14px; border-radius:14px; text-decoration:none; color:#fff; background:linear-gradient(135deg,#076c50,#0b8f6a 55%,#10b981); box-shadow:0 8px 22px rgba(11,107,79,.30); transition:transform .12s, box-shadow .15s}
  .coachbtn:hover{transform:translateY(-2px); box-shadow:0 12px 26px rgba(11,107,79,.40)}
  .coachbtn .cr-ic{font-size:23px; line-height:1}
  .coachbtn .cr-tx{display:flex; flex-direction:column; line-height:1.2; flex:1; min-width:0}
  .coachbtn .cr-tx b{font-size:15px; font-weight:800}
  .coachbtn .cr-tx small{font-size:11.5px; opacity:.92}
  .coachbtn .cr-arr{font-size:21px; opacity:.85}

  .section-title{font-size:15px; font-weight:800; color:var(--ink); margin:8px 2px 12px; display:flex; align-items:center; gap:8px}
  /* Tournament header (name + dates + venue) shown above the player picker */
  .tourhead{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:13px 15px; margin:2px 2px 14px; box-shadow:var(--shadow-sm)}
  .tourhead .th-name{font-size:16px; font-weight:800; color:var(--ink); line-height:1.3}
  .tourhead .th-meta{display:flex; gap:14px; flex-wrap:wrap; margin-top:6px; color:var(--muted); font-size:12.5px}
  .tourhead .th-meta b{color:var(--brand-deep)}
  /* link out to the tournament's own site (regulations / entry) — neutral, so the green stays
     for our own actions */
  .th-src{display:inline-flex; align-items:center; gap:7px; margin-top:10px; padding:7px 12px;
    border-radius:999px; background:var(--chip, #eef2f1); border:1px solid var(--line);
    color:var(--ink); text-decoration:none; font-weight:800; font-size:12.5px}
  .th-src-k{font-size:9.5px; font-weight:900; letter-spacing:.06em; padding:2px 6px; border-radius:5px;
    background:#334155; color:#fff}
  .card.state .th-src{margin-top:14px}
  .drawbtn{margin-left:auto; flex:0 0 auto; display:inline-flex; align-items:center; gap:6px;
    background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; text-decoration:none; font-weight:800;
    font-size:13.5px; padding:9px 17px; border-radius:999px; box-shadow:0 4px 14px rgba(16,185,129,.45);
    transition:transform .12s, box-shadow .15s; animation:drawpulse 2.4s ease-in-out infinite}
  .drawbtn:hover{transform:translateY(-2px) scale(1.03); box-shadow:0 8px 22px rgba(16,185,129,.6); animation:none}
  @keyframes drawpulse{0%,100%{box-shadow:0 4px 14px rgba(16,185,129,.42)} 50%{box-shadow:0 4px 24px rgba(16,185,129,.78)}}
  .pill-live{display:inline-flex;align-items:center;gap:6px;background:#e8fff5;color:var(--brand-deep);
    border:1px solid #bdf0dc; padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700}
  .dot{width:8px;height:8px;border-radius:50%;background:var(--brand-2);box-shadow:0 0 0 0 rgba(16,185,129,.6);animation:pulse 1.8s infinite}
  @keyframes pulse{0%{box-shadow:0 0 0 0 rgba(16,185,129,.55)}70%{box-shadow:0 0 0 9px rgba(16,185,129,0)}100%{box-shadow:0 0 0 0 rgba(16,185,129,0)}}

  /* Cards */
  .card{background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-sm); padding:16px; margin-bottom:14px}
  .tcard{cursor:pointer; transition:transform .12s ease, box-shadow .12s ease, border-color .12s}
  .tcard:hover{transform:translateY(-2px); box-shadow:var(--shadow); border-color:#cfe9df}
  .tcard h3{margin:0 0 4px; font-size:16.5px; font-weight:800}
  .tcard .venue{color:var(--muted); font-size:13.5px; margin:0 0 10px}
  .meta{display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:12.5px; margin-bottom:10px}
  .meta b{color:var(--ink); font-weight:700}
  .chips{display:flex; gap:6px; flex-wrap:wrap}
  .chip{background:#eef5f2;border:1px solid #e0ece7;color:#3f5650;border-radius:999px;padding:2px 9px;font-size:11.5px;font-weight:600}
  .go{margin-top:12px; color:var(--brand-deep); font-weight:700; font-size:13.5px; display:flex; align-items:center; gap:6px}

  /* Home → season calendar call-to-action (the home list only covers a rolling 30 days) */
  .calcta{display:block;margin:2px 0 12px;padding:11px 13px;border-radius:13px;text-decoration:none;
    background:linear-gradient(135deg,#0b8f6a,#10b981);color:#fff;font-weight:800;font-size:13.5px;
    box-shadow:0 4px 14px rgba(11,143,106,.28)}
  /* Home: per-tournament status badge + phase group headers */
  .tstatus{display:inline-flex; align-items:center; gap:5px; padding:2px 10px; border-radius:999px;
    font-size:11.5px; font-weight:800; margin-bottom:7px}
  .tstatus.live{background:#e8fff5; color:var(--brand-deep); border:1px solid #bdf0dc}
  .tstatus.future{background:#e6f6ff; color:#0284c7; border:1px solid #bfe6fb}
  .tstatus.past{background:#eef1f4; color:#54655f; border:1px solid #e1e7ec}
  .tstatus .dot{width:7px; height:7px}
  .phase-head{font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.5px;
    color:var(--muted); margin:20px 2px 11px; display:flex; align-items:center; gap:7px}
  .subnote{color:var(--muted); font-size:12.5px; margin:0 2px 14px}

  /* Search */
  .search{position:relative; margin-bottom:14px}
  .search input{width:100%; padding:13px 14px 13px 42px; border:1px solid var(--line); border-radius:12px;
    font-size:16px; background:var(--card); box-shadow:var(--shadow-sm); outline:none}
  .search input:focus{border-color:var(--brand)}
  .search svg{position:absolute; left:14px; top:50%; transform:translateY(-50%); opacity:.5}
  .count{color:var(--muted); font-size:12.5px; margin:0 2px 10px}

  /* Filter chips */
  .filters{display:flex; flex-wrap:wrap; gap:14px; margin:2px 0 12px}
  .fgroup{display:flex; align-items:center; gap:6px; flex-wrap:wrap}
  .flabel{font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); margin-right:2px}
  .fchip{cursor:pointer; font:inherit; font-size:13px; font-weight:700; color:var(--brand-deep);
    background:var(--card); border:1.5px solid var(--line); border-radius:999px; padding:6px 13px; transition:all .12s}
  .fchip:hover{border-color:#bdf0dc}
  .fchip.active{background:var(--brand); border-color:var(--brand); color:#fff; box-shadow:var(--shadow-sm)}

  /* Home: "New players" preview rail */
  .newstrip{margin:2px 0 16px}
  .newstrip:empty{display:none}
  .ns-head{display:flex; align-items:baseline; justify-content:space-between; text-decoration:none; color:var(--ink); margin:0 2px 9px}
  .ns-title{font-weight:800; font-size:15px}
  .ns-more{font-size:12.5px; font-weight:800; color:var(--brand)}
  .ns-rail{display:flex; gap:12px; overflow-x:auto; padding:2px 2px 6px; -webkit-overflow-scrolling:touch; scrollbar-width:none}
  .ns-rail::-webkit-scrollbar{display:none}
  .ns-item{flex:0 0 auto; width:68px; display:flex; flex-direction:column; align-items:center; gap:5px; text-decoration:none; color:var(--ink)}
  .ns-item .avatar{width:60px; height:60px; font-size:24px; box-shadow:0 0 0 2px var(--brand-2),0 4px 12px rgba(11,143,106,.25)}
  .ns-nm{font-size:11px; font-weight:700; text-align:center; line-height:1.15; max-width:68px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .ns-ago{font-size:9.5px; font-weight:700; color:var(--muted)}

  /* ============ 🏠 Home showcase deck (block 184) ============
     Each hidden section becomes a rail with real content instead of a menu item. No animation
     anywhere in here on purpose — the owner browses with "reduce motion" on. */
  /* scale strip: four tappable proofs of size, straight under the search card */
  .dscale{display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin:2px 0 14px}
  .dscale a{background:var(--card); border:1px solid var(--line); border-radius:13px; padding:9px 5px 8px;
    text-align:center; box-shadow:var(--shadow-sm); text-decoration:none; color:var(--ink)}
  .dscale b{display:block; font-size:17px; font-weight:900; letter-spacing:-.3px; line-height:1.15; color:var(--brand-deep)}
  .dscale span{display:block; font-size:10.5px; font-weight:700; color:var(--muted); margin-top:1px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  @media (max-width:400px){ .dscale b{font-size:15px} .dscale span{font-size:9.5px} }
  /* 🔴 live tile */
  .dlive{margin:0 0 4px; border-radius:var(--r); overflow:hidden; cursor:pointer;
    color:var(--ink); background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow)}
  .dlive .dlh{display:flex; align-items:center; gap:8px; padding:9px 14px; color:#fff; font-weight:900;
    font-size:12px; letter-spacing:.6px; text-transform:uppercase;
    background:linear-gradient(120deg,#c11f3d,#e11d48 60%,#f0447a)}
  .dlive .dlh .dld{width:9px; height:9px; border-radius:50%; background:#fff; box-shadow:0 0 0 4px rgba(255,255,255,.32)}
  .dlive .dlh .dlc{margin-left:auto; text-transform:none; letter-spacing:0; font-size:11.5px; font-weight:700; opacity:.95}
  .dlive .dlb{padding:12px 14px 13px}
  .dlive .dlb h3{margin:0 0 5px; font-size:16px; font-weight:800; line-height:1.25}
  .dlive .dlm{display:flex; flex-wrap:wrap; gap:4px 13px; font-size:12.5px; color:var(--muted); font-weight:600}
  .dlive .dlgo{margin-top:11px; padding:10px; border-radius:12px; text-align:center; font-weight:800; font-size:13.5px;
    color:#fff; background:linear-gradient(135deg,var(--brand-deep),var(--brand) 55%,var(--brand-2))}
  /* section frame shared by every rail */
  .dsect{margin:22px 0 0}
  .dhead{display:flex; align-items:baseline; gap:10px; margin:0 2px 9px}
  .dhead .dt{flex:1; min-width:0; font-size:15.5px; font-weight:900; letter-spacing:-.2px}
  .dhead .ds{display:block; font-size:11.5px; font-weight:600; color:var(--muted)}
  .dhead .da{flex:0 0 auto; font-size:12.5px; font-weight:800; color:var(--brand); text-decoration:none; white-space:nowrap}
  /* 🏅 rankings rail: group → category → top 3 */
  .dgrp{display:flex; gap:6px; margin-bottom:8px}
  .dgrp button{flex:1; min-width:0; cursor:pointer; font:inherit; font-size:12.5px; font-weight:800; padding:7px 4px;
    border-radius:11px; border:1px solid var(--line); background:var(--card); color:var(--muted);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .dgrp button.on{background:var(--brand-deep); border-color:var(--brand-deep); color:#fff}
  .dcats{display:flex; gap:6px; overflow-x:auto; padding:0 2px 7px; scrollbar-width:none; -webkit-overflow-scrolling:touch}
  .dcats::-webkit-scrollbar{display:none}
  .dcats button{flex:0 0 auto; cursor:pointer; font:inherit; font-size:12px; font-weight:800; line-height:1.15;
    padding:6px 12px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--ink)}
  .dcats button.on{background:#d99b1a; border-color:#d99b1a; color:#2a1d02}
  .dcats button small{display:block; font-size:9.5px; font-weight:700; opacity:.62}
  /* row avatar in a deck list — the shared .avatar span, sized down for a table row */
  .drow .avatar{width:34px; height:34px; font-size:14px}
  .dlist{background:var(--card); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow-sm)}
  .drow{display:flex; align-items:center; gap:10px; padding:9px 12px; text-decoration:none; color:var(--ink)}
  .drow + .drow{border-top:1px solid var(--line)}
  .drow .drk{flex:0 0 22px; text-align:center; font-weight:900; font-size:13px; color:var(--muted)}
  .drow .drk.p1{color:#d99b1a}
  .drow .dnm{flex:1; min-width:0; display:flex; flex-direction:column; font-weight:700; font-size:13.5px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .drow .dnm i{font-style:normal; font-size:10.5px; font-weight:600; color:var(--muted)}
  .drow .dmt{flex:0 0 auto; text-align:right; font-size:12px; font-weight:800; white-space:nowrap}
  .drow .dpts{font-size:14px; font-weight:900}
  .drow .dpts em{font-style:normal; font-size:10px; font-weight:700; color:var(--muted)}
  .dintl{display:inline-block; font-size:10.5px; font-weight:900; padding:2px 7px; border-radius:999px;
    background:rgba(14,165,233,.12); color:#0369a1; border:1px solid rgba(14,165,233,.25)}
  html[data-theme="dark"] .dintl{color:#7dd3fc; background:rgba(14,165,233,.16); border-color:rgba(14,165,233,.32)}
  .dmore{display:block; text-align:center; padding:10px; font-size:12.5px; font-weight:800;
    border-top:1px solid var(--line); text-decoration:none; color:var(--brand)}
  /* entry cards (calendar · coach room · voting) */
  .dcta{display:flex; align-items:center; gap:12px; background:var(--card); border:1px solid var(--line);
    border-radius:14px; padding:12px 14px; box-shadow:var(--shadow-sm); text-decoration:none; color:var(--ink);
    cursor:pointer; width:100%; font:inherit; text-align:left}
  .dcta + .dcta{margin-top:10px}
  .dcta .dci{flex:0 0 auto; width:40px; height:40px; border-radius:12px; display:flex; align-items:center;
    justify-content:center; font-size:20px; background:rgba(11,143,106,.10)}
  html[data-theme="dark"] .dcta .dci{background:rgba(16,185,129,.13)}
  .dcta.love .dci{background:rgba(225,29,72,.10)}
  .dcta.gold .dci{background:rgba(217,155,26,.14)}
  .dcta .dct{flex:1; min-width:0}
  .dcta .dct b{display:block; font-size:14px; font-weight:800}
  .dcta .dct span{display:block; font-size:12px; color:var(--muted); font-weight:600}
  .dcta .dca{flex:0 0 auto; color:var(--brand); font-weight:900}
  /* 📰 news cards */
  .dnews{display:grid; gap:10px}
  .dncard{display:flex; gap:11px; background:var(--card); border:1px solid var(--line); border-radius:14px;
    overflow:hidden; box-shadow:var(--shadow-sm); text-decoration:none; color:var(--ink)}
  .dncard img{width:96px; height:74px; object-fit:cover; background:var(--line); flex:0 0 auto}
  .dncard .dnt{flex:1; min-width:0; padding:9px 12px 9px 0; font-size:13px; font-weight:700; line-height:1.35;
    display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}

  /* Entry list notice — the board below is who SIGNED UP, not a draw */
  .entrynote{margin:0 2px 10px; padding:9px 12px; border-radius:11px; background:#fdf3e3; color:#8a5a12;
    font-size:12.5px; font-weight:800}
  html[data-theme=dark] .entrynote{background:#2f2718; color:#e8c383}

  /* Player list — tournament Board table */
  .board{background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-sm); overflow:hidden; margin-bottom:6px}
  .board .thead, .prow{display:grid; grid-template-columns:26px 1fr auto 46px 34px; align-items:center; gap:8px; padding:10px 12px}
  .board .thead{font-size:10px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--muted);
    border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--card); z-index:6}
  .col-c{text-align:center} .col-r{text-align:right}
  .plist{display:block}
  .prow{cursor:pointer; border-top:1px solid var(--line); transition:background .12s}
  .prow:hover{background:rgba(11,143,106,.06)}
  .prow.zebra{background:rgba(11,143,106,.035)}
  .prow.zebra:hover{background:rgba(11,143,106,.09)}
  .t-idx{font-size:12px; font-weight:800; color:var(--muted); text-align:center; font-variant-numeric:tabular-nums}
  .t-player{display:flex; align-items:center; gap:10px; min-width:0}
  .t-who{min-width:0}
  .pname{font-weight:700; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  /* nationality flag (ATF/international events only — domestic LTAT has no country data) */
  .pflag{flex:0 0 auto; width:22px; height:15px; object-fit:cover; border-radius:2px;
    box-shadow:0 0 0 1px rgba(0,0,0,.08); background:var(--line)}
  .psub{color:var(--muted); font-size:12px; margin-top:2px; display:flex; gap:8px; flex-wrap:wrap; align-items:center}
  .t-cat{display:flex; gap:4px; flex-wrap:wrap; justify-content:center}
  .t-rnk{text-align:right; font-weight:800; font-size:13.5px; font-variant-numeric:tabular-nums}
  .t-rnk small{color:var(--muted); font-weight:700; font-size:10px}
  .t-seed{text-align:center; font-variant-numeric:tabular-nums}
  .nr{color:var(--muted); font-weight:600}
  .seed{background:var(--brand);color:#fff;border-radius:999px;padding:1px 7px;font-size:11px;font-weight:800}
  .catbadge{background:#eef5f2;border:1px solid #e0ece7;color:#3f5650;border-radius:6px;padding:2px 7px;font-size:10.5px;font-weight:700}
  .catbadge.boys{background:rgba(14,165,233,.10);border-color:rgba(14,165,233,.30);color:#0a6fa5}
  .catbadge.girls{background:rgba(225,29,72,.09);border-color:rgba(225,29,72,.28);color:#bb1140}
  html[data-theme="dark"] .catbadge{background:#1f2a25;border-color:#2c3a33;color:#bcd}
  html[data-theme="dark"] .catbadge.boys{color:#7cc6ee} html[data-theme="dark"] .catbadge.girls{color:#f2889f}
  @media (max-width:380px){ .board .thead, .prow{grid-template-columns:22px 1fr auto 40px} .t-seed,.col-seed{display:none} }
  /* Favorite star (list): only favourites show it; non-favs get a same-width spacer so
     avatars stay aligned. Tapping the star removes the player from favourites. */
  .favstar,.favstar-spacer{flex:0 0 auto; width:20px; text-align:center}
  .favstar{background:none; border:none; padding:0; margin:0; cursor:pointer; line-height:1;
    font-size:18px; color:#f5b301; transition:transform .1s ease, color .12s}
  .favstar:hover{transform:scale(1.15); color:#e89c00}
  .favstar:active{transform:scale(.9)}

  /* Favorite toggle in the player-profile header */
  .favtoggle{flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; cursor:pointer;
    background:var(--card); border:1.5px solid var(--line); color:var(--muted); white-space:nowrap;
    padding:7px 13px; border-radius:999px; font:inherit; font-size:13px; font-weight:700; transition:all .12s}
  .favtoggle .fstar{font-size:15px; line-height:1}
  .favtoggle:hover{border-color:#f0d98a}
  .favtoggle.on{background:#fff8e6; border-color:#f3d479; color:#9a6b00}
  .favtoggle.on .fstar{color:#f5b301}
  @media(max-width:430px){ .favtoggle .ftxt{display:none} .favtoggle{padding:8px} }

  /* Favorites button in the hero header (with count badge) */
  .fav-btn{flex:0 0 auto; position:relative; display:inline-flex; align-items:center; justify-content:center;
    width:38px; height:38px; cursor:pointer; background:rgba(255,255,255,.16); color:#fff;
    border:1px solid rgba(255,255,255,.35); border-radius:50%;
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); transition:background .15s}
  .fav-btn:hover{background:rgba(255,255,255,.28)}
  .fav-btn .fav-count{position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 4px;
    background:#f5b301; color:#3a2a00; border-radius:999px; font-size:11px; font-weight:800;
    display:flex; align-items:center; justify-content:center; box-shadow:0 1px 3px rgba(0,0,0,.3)}

  /* Favorites editor sheet (reuses .overlay/.sheet) */
  .favlist{display:flex; flex-direction:column; gap:8px; max-height:52vh; overflow:auto; margin:6px 0 14px; text-align:left}
  .favitem{display:flex; align-items:center; gap:11px; padding:8px 9px; border:1px solid var(--line); border-radius:12px; background:var(--card)}
  .favitem .fname{font-weight:700; font-size:14.5px; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .favitem .frm{flex:0 0 auto; width:30px; height:30px; border:none; background:#f5f7f6; color:var(--muted);
    border-radius:50%; cursor:pointer; font-size:19px; line-height:1; display:flex; align-items:center; justify-content:center; transition:background .12s, color .12s}
  .favitem .frm:hover{background:#ffe9ee; color:var(--lost)}
  html[data-theme=dark] .favitem .frm{background:#232f2a; color:var(--muted)}
  .favempty{text-align:center; color:var(--muted); padding:18px 8px; font-size:13.5px; line-height:1.5}
  .favclear{display:block; width:100%; background:var(--card); border:1px solid var(--line); color:var(--lost);
    border-radius:10px; padding:9px; font:inherit; font-weight:700; font-size:13px; cursor:pointer; transition:all .12s}
  .favclear:hover{background:#fff5f6; border-color:#ffd4dd}
  .favclear.arm{background:#fff5f6; border-color:var(--lost)}

  /* Push (match alerts) toggle inside the favorites sheet */
  .pushbox{display:flex; align-items:center; gap:12px; text-align:left; background:#f8faf9;
    border:1px solid var(--line); border-radius:14px; padding:11px 13px; margin:4px 0 14px}
  .pushinfo{flex:1; min-width:0}
  .pushh{font-weight:800; font-size:14px}
  .pushs{color:var(--muted); font-size:11.5px; margin-top:2px; line-height:1.35}
  .pushtoggle{flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; cursor:pointer;
    background:var(--card); border:1.5px solid var(--line); color:var(--muted); border-radius:999px;
    padding:5px 13px 5px 6px; font:inherit; font-size:12.5px; font-weight:800; transition:all .15s}
  .pushtoggle .pushknob{width:16px; height:16px; border-radius:50%; background:var(--bye);
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.06); transition:background .15s, transform .15s}
  .pushtoggle.on{background:#e8fff5; border-color:#bdf0dc; color:var(--brand-deep)}
  .pushtoggle.on .pushknob{background:var(--brand-2); transform:translateX(1px)}
  .avatar{flex:0 0 auto; position:relative; width:42px; height:42px; border-radius:50%; overflow:hidden;
    display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:17px;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
    -webkit-touch-callout:none; -webkit-user-select:none; user-select:none}
  .avatar img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none}
  .avatar.lg{width:82px; height:82px; font-size:34px; cursor:zoom-in; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08), 0 3px 12px rgba(0,0,0,.16)}
  .avatar.holding{transform:scale(.92); transition:transform .12s ease}

  /* Full-screen photo preview (long-press a player photo) */
  #photoZoom{position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center;
    background:rgba(8,15,13,.93); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); touch-action:none}
  #photoZoom.show{display:flex}
  /* source photos are only 200×200 thumbnails — cap the blow-up so it stays sharp */
  #photoZoom img{width:min(82vw,82vh); height:min(82vw,82vh); object-fit:cover; border-radius:20px;
    box-shadow:0 14px 48px rgba(0,0,0,.55); animation:pzIn .15s ease-out}
  #photoZoom .pz-name{position:absolute; left:0; right:0; bottom:calc(26px + env(safe-area-inset-bottom));
    text-align:center; color:#fff; font-weight:700; font-size:15px; padding:0 24px; text-shadow:0 1px 6px rgba(0,0,0,.6)}
  @keyframes pzIn{from{transform:scale(.7); opacity:0} to{transform:scale(1); opacity:1}}

  /* Schedule */
  /* ❤️ weekly hearts — minimal inline PILL (clearly tappable; tap to support; count resets weekly) */
  .heartrow{display:inline-flex; align-items:center; gap:8px; margin-top:11px; cursor:pointer; user-select:none;
    background:var(--card); border:1px solid #f3c6d4; border-radius:999px; padding:7px 14px; box-shadow:var(--shadow-sm)}
  html[data-theme="dark"] .heartrow{border-color:#5a2740}
  .heartrow .hh{font-size:24px; line-height:1; color:#cdb6bf; transition:transform .12s, color .12s}
  .heartrow .hh.on{color:#e5275a}
  .heartrow .hc{font-size:16px; font-weight:800; color:var(--ink)}
  .heartrow .hl{font-size:12px; color:var(--muted); font-weight:600}
  @keyframes hpop{0%{transform:scale(1)} 40%{transform:scale(1.42)} 100%{transform:scale(1)}}
  .heartrow .hh.pop{animation:hpop .35s ease}
  /* 🏆 champion name — gold gradient (TITLES colour), set when a player has ≥1 title */
  .champ{background:linear-gradient(180deg,#f7e08a,#d4a017 60%,#9c7400); -webkit-background-clip:text; background-clip:text; color:transparent}
  /* 🎖️ reached ≥1 final/semi but no title — GREEN gradient name (same treatment as champ, green) */
  .medalist{background:linear-gradient(180deg,#3ddc97,#0b8f6a 55%,#076c50); -webkit-background-clip:text; background-clip:text; color:transparent}
  /* Player profile header — a card; the name spans full width (no side buttons squeezing it),
     and actions sit in their own rows below so nothing collapses into tall boxes on narrow screens. */
  .phead{display:block; background:var(--card); border:1px solid var(--line); border-radius:18px;
    padding:15px; box-shadow:var(--shadow-sm); margin-bottom:8px}
  .phead-top{display:flex; align-items:center; gap:13px}
  .phead-id{flex:1; min-width:0}
  .phead h2{margin:0;font-size:20px;font-weight:800; line-height:1.2}
  .phead .psub{font-size:13px;margin-top:4px}
  .phead .profilebtn{display:flex; justify-content:center; width:100%; margin-top:14px}
  .phead-acts{display:flex; gap:8px; margin-top:8px}
  .phead-acts .favtoggle{flex:1; justify-content:center}
  .phead .heartrow{margin-top:10px}
  .phead-bday{margin-top:8px}
  .phead-bday:empty{display:none}
  .catsec{margin-top:18px}
  .catsec h3{font-size:14.5px;font-weight:800;margin:0 0 10px;display:flex;align-items:center;gap:8px}
  .sched-note{display:flex;gap:8px;align-items:flex-start;background:#e8fff5;border:1px solid #c4f0df;
    color:var(--brand-deep);border-radius:12px;padding:10px 12px;margin-top:14px;font-size:12.5px;line-height:1.45}
  .sched-note b{font-weight:800}
  .match{display:flex; gap:12px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--card); margin-bottom:9px; position:relative}
  /* Colour-coded by OUTCOME: played matches get a left stripe + soft tint so the result reads
     instantly; not-yet-played stays neutral (no colour — colour would imply a finished stage). */
  .match.m-won{border-left:4px solid var(--won); background:#f3fbf6}
  .match.m-lost{border-left:4px solid var(--lost); background:#fff5f7}
  .match.m-upcoming{border-left:4px solid var(--bye)}
  .match.m-bye{border-left:4px solid var(--bye)}
  .match.m-won .when{border-right-color:#bbe9cd}
  .match.m-lost .when{border-right-color:#f7c3d2}
  /* the single NEXT match is found via a soft neutral lift, not a colour */
  .match.next{box-shadow:0 4px 14px rgba(16,40,34,.12)}
  html[data-theme="dark"] .match.m-won{background:rgba(22,163,74,.12)}
  html[data-theme="dark"] .match.m-lost{background:rgba(225,29,72,.13)}
  .when{flex:0 0 84px; text-align:center; border-right:1px dashed var(--line); padding-right:10px}
  .when .day{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px}
  .when .time{font-size:19px;font-weight:800;line-height:1.1;margin-top:2px}
  .when .date{font-size:11px;color:var(--muted);margin-top:2px}
  .when .notime{font-size:12px;color:var(--muted);margin-top:6px}
  .mbody{flex:1; min-width:0}
  .round{font-size:11.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--brand-deep)}
  .vs{margin-top:3px;font-size:15px;font-weight:700;word-break:break-word}
  .vs .lbl{color:var(--muted);font-weight:600;font-size:13px}
  .oppseed{font-size:11px}
  .cands{margin-top:3px;color:var(--muted);font-size:12.5px}
  /* Mini rounded-square avatar next to opponent / candidate names */
  .mini-av{flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; position:relative;
    width:22px; height:22px; border-radius:6px; overflow:hidden; color:#fff; font-weight:800; font-size:10.5px;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); -webkit-user-select:none; user-select:none}
  .mini-av img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none}
  .oppwrap{display:inline-flex; align-items:center; gap:6px; vertical-align:-6px}
  a.opplink{cursor:pointer; text-decoration:none; color:inherit; border-radius:7px}
  a.opplink:hover .oppname{color:var(--brand-deep); text-decoration:underline}
  a.opplink:active{opacity:.7}
  .candchip{display:inline-flex; align-items:center; gap:5px; margin:3px 5px 0 0; padding:2px 9px 2px 3px;
    border-radius:999px; background:#f1f6f4; border:1px solid var(--line); color:var(--ink); font-weight:600; font-size:12px}
  a.candchip{cursor:pointer; text-decoration:none}
  a.candchip:hover{border-color:#bdf0dc; background:#e8fff5}
  html[data-theme=dark] .candchip{background:#1f2a25; border-color:#2f3d37; color:var(--ink)}
  html[data-theme=dark] a.candchip:hover{border-color:var(--brand-deep); background:#243330}
  .candchip .mini-av{width:18px; height:18px; border-radius:5px; font-size:9px}
  .vs-sep{color:var(--muted); font-weight:700; margin:0 2px}
  /* Doubles: format tag + partner in the category header */
  .catfmt{display:inline-block; background:#eef5f2; border:1px solid #e0ece7; color:#3f5650;
    border-radius:6px; padding:1px 7px; font-size:11px; font-weight:700; vertical-align:2px}
  .qbadge{background:#fef3c7; border-color:#fcd34d; color:#92400e}
  html[data-theme=dark] .catfmt{background:#22302a; border-color:#2f3d37; color:var(--ink)}
  html[data-theme=dark] .qbadge{background:#3a3216; border-color:#5c4d1c; color:#f5d98a}
  .partner{font-weight:600; color:var(--muted); font-size:13px}
  .partner .oppname{font-weight:700}
  /* "Your players" panel (favorites' next/last match in this tournament) + history */
  .today{background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-sm); padding:10px 12px; margin-bottom:14px}
  .today-h{font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); margin:2px 2px 8px}
  .today-row{display:flex; align-items:center; gap:11px; padding:8px 6px; border-radius:10px; cursor:pointer}
  .today-row:hover{background:#f6faf9}
  .today-row .arrow{margin-left:auto; color:var(--brand); opacity:.7}
  .today-name{font-weight:700; font-size:14.5px}
  .today-sub{color:var(--muted); font-size:12.5px; margin-top:2px}
  .today-row .mini-av{width:34px; height:34px; border-radius:9px; font-size:15px}
  .hist{margin-top:22px}
  .hist .today-h{font-size:14.5px; text-transform:none; color:var(--ink)}
  /* Career regalia card — roomy, so the badges / recon line / link don't crowd together */
  .regcard{padding:16px 16px 15px; border:1px solid var(--line); border-radius:16px; background:var(--card); box-shadow:var(--shadow-sm)}
  .regcard .today-h{margin:0 0 12px}
  .reg-badges{display:flex; gap:10px; flex-wrap:wrap; margin:0 0 13px}
  .reg-recon{font-size:12.5px; color:var(--muted); line-height:1.45; margin:0 0 14px}
  .reg-full{display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--brand-deep); font-weight:700; text-decoration:none}
  .reg-full:hover{text-decoration:underline}
  .badge{position:absolute;top:10px;right:10px;font-size:10.5px;font-weight:800;padding:3px 9px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px}
  .b-won{background:#e8f9ee;color:var(--won)}
  .b-lost{background:#ffe9ee;color:var(--lost)}
  .b-bye{background:#eef1f4;color:#475569}
  .b-soon{background:#eef1f4;color:#54655f}
  .b-next{background:#fef3c7;color:#92400e}
  .score{font-size:12.5px;color:var(--muted);margin-top:4px}
  .courtline{font-size:11.5px;color:var(--muted);margin-top:4px}
  /* Quick fade when jumping to another player's schedule (instant cached re-render) */
  #view.vfade{animation:vfade .15s ease-out}
  @keyframes vfade{from{opacity:.45; transform:translateY(5px)} to{opacity:1; transform:none}}

  /* States */
  .state{text-align:center; padding:40px 16px; color:var(--muted)}
  .spinner{width:34px;height:34px;border:3px solid #d7e6e0;border-top-color:var(--brand);border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 14px}
  @keyframes spin{to{transform:rotate(360deg)}}
  .empty-emoji{font-size:34px;margin-bottom:8px}

  /* Thin top loading bar (eases toward ~90% while the request is in flight, snaps to 100%) */
  #nprog{position:fixed; top:0; left:0; right:0; height:3px; z-index:100; opacity:0;
    transition:opacity .25s; pointer-events:none}
  #nprog.on{opacity:1}
  #nprog .bar{height:100%; width:0; border-radius:0 3px 3px 0;
    background:linear-gradient(90deg,var(--brand),var(--brand-2));
    box-shadow:0 0 8px rgba(16,185,129,.65); transition:width .35s cubic-bezier(.2,.8,.2,1)}
  #nprog.done .bar{transition:width .2s ease}

  /* Skeleton placeholders so the page never looks empty/broken on slow networks */
  .sk{position:relative; overflow:hidden; background:#e6ecea; border-radius:8px}
  .sk::after{content:""; position:absolute; inset:0; transform:translateX(-100%);
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent); animation:shimmer 1.25s infinite}
  @keyframes shimmer{100%{transform:translateX(100%)}}
  .sk-line{height:12px; margin:9px 0; display:block}

  /* Prominent in-content loader (lives in the loading zone, clearly animating) */
  .loadbox{background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-sm);
    padding:16px 16px 18px; margin-bottom:14px; display:flex; gap:14px; align-items:flex-start}
  .loadball{flex:0 0 auto; width:30px; height:30px; border-radius:50%; margin-top:1px;
    background:radial-gradient(circle at 32% 30%,#eafff6,#caf7e6 40%,#0b8f6a 41%,#076c50);
    box-shadow:inset 0 0 0 2px rgba(255,255,255,.4), 0 2px 6px rgba(0,0,0,.18); animation:lbounce 1s infinite}
  .loadball::after{content:""; position:absolute}
  @keyframes lbounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
  .loadbox .lt{font-weight:800; font-size:15.5px}
  .loadbox .ls{color:var(--muted); font-size:12.5px; margin-top:3px}
  .loadbar{height:9px; background:#e6ecea; border-radius:999px; overflow:hidden; margin-top:12px; position:relative}
  .loadbar > i{display:block; height:100%; width:6%; border-radius:999px;
    background:linear-gradient(90deg,var(--brand),var(--brand-2)); box-shadow:0 0 8px rgba(16,185,129,.5);
    transition:width .45s cubic-bezier(.2,.8,.2,1)}
  .loadbar.indet > i{width:38%; animation:indet 1.1s infinite ease-in-out}
  @keyframes indet{0%{margin-left:-40%}100%{margin-left:102%}}
  @media (prefers-reduced-motion: reduce){ .sk::after,.loadball,.loadbar.indet > i{animation:none} #nprog .bar,.loadbar > i{transition:none} }
  .btn{display:inline-block;background:var(--brand);color:#fff;border:none;border-radius:10px;padding:10px 16px;font-weight:700;font-size:14px;cursor:pointer}
  .btn.ghost{background:var(--card);border:1px solid var(--line);color:var(--brand-deep)}

  /* Advanced / paste */
  details.adv{margin-top:10px;border:1px dashed var(--line);border-radius:12px;padding:10px 14px;background:var(--card)}
  details.adv summary{cursor:pointer;color:var(--muted);font-size:13px;font-weight:600}
  details.adv .row{display:flex;gap:8px;margin-top:10px}
  details.adv input{flex:1;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-size:14px}

  /* "online now" pill in the hero */
  .online-pill{display:inline-flex; align-items:center; gap:7px; margin-top:9px; background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.32); color:#fff; font-size:12.5px; font-weight:700; padding:4px 11px; border-radius:999px;
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px)}
  .online-pill b{font-weight:800}
  .online-dot{width:8px; height:8px; border-radius:50%; background:#6ee7b7; box-shadow:0 0 0 0 rgba(110,231,183,.7); animation:onpulse 1.9s infinite}
  @keyframes onpulse{0%{box-shadow:0 0 0 0 rgba(110,231,183,.6)} 70%{box-shadow:0 0 0 7px rgba(110,231,183,0)} 100%{box-shadow:0 0 0 0 rgba(110,231,183,0)}}

  /* Footer — light & uniform across all pages */
  .sitefooter{margin-top:34px;padding:18px 12px 26px;text-align:center;color:#9aa9a4;font-size:12px;border-top:1px solid var(--line)}
  .sitefooter a{color:var(--muted);font-weight:700;text-decoration:none}
  .sitefooter a:hover{color:var(--brand-deep)}
  .sitefooter .fsep{margin:0 8px;opacity:.5}
  .sitefooter .fine{margin-top:7px;opacity:.9;font-size:11px}
  /* home-window tournaments (server-injected into the footer) — mirrors _SSR_CSS/_DRAW_CSS in app.py.
     NB: do NOT write the injection marker in this comment — the server replaces EVERY occurrence. */
  .ftours{margin-top:14px}
  .ftours>b{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;opacity:.75;margin-bottom:7px;font-weight:800}
  .ftl{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-width:640px;margin:0 auto}
  .ftl a{display:inline-block;padding:4px 11px;border:1px solid var(--line);border-radius:999px;background:var(--card,#fff);font-size:11.5px;font-weight:700;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ftl a:hover{border-color:var(--brand);background:var(--bg-soft,#f5faf8)}
  .ftl a .fd{opacity:.62;font-weight:800;margin-right:6px;font-variant-numeric:tabular-nums}
