:root{
  --navy:#0a2540; --navy2:#133a63; --green:#159a4c; --green2:#0e7a36;
  --bg:#f6f7f6; --card:#ffffff; --ink:#0f1f33; --muted:#6b7686; --line:#e4e9e4;
  --mint:#edf6f0; --red:#dc2626; --orange:#ea7c1e; --yellow:#eab308;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); font-size:16px; line-height:1.45;}

/* ---------- header + pill tabs (matches original app) ---------- */
.app-header{background:#fff; padding:14px 16px 10px; text-align:center;}
.app-logo{max-width:300px; width:72%; height:auto; display:block; margin:0 auto;}
.tabs{padding:10px 16px 12px; background:var(--bg); position:sticky; top:0; z-index:20;}
.tabs-inner{display:flex; background:#fff; border:1px solid var(--line); border-radius:999px;
  padding:4px; box-shadow:0 1px 3px rgba(10,37,64,.06);}
.tabs button{flex:1; padding:14px 0; border:0; background:transparent; color:#5b6675;
  font-size:17px; font-weight:700; border-radius:999px; min-height:52px; cursor:pointer;}
.tabs button.active{background:var(--navy); color:#fff; font-weight:700;
  box-shadow:0 2px 6px rgba(10,37,64,.25);}

.tab-panel{display:none; padding:6px 16px 110px; max-width:760px; margin:0 auto;}
.tab-panel.active{display:block;}

/* ---------- typography ---------- */
.page-title{font-size:34px; font-weight:800; letter-spacing:-.5px; margin:14px 0 4px; color:var(--ink);}
.page-sub{color:var(--muted); font-size:16px; margin:0 0 18px;}
.section-kicker{color:var(--green); font-size:14px; font-weight:700; letter-spacing:2.5px;
  text-transform:uppercase; margin:22px 0 2px;}
.section-title{font-size:24px; font-weight:700; margin:0 0 12px; color:var(--ink);}
h2{font-size:22px; margin:6px 0 10px;}
h3{font-size:18px; margin:16px 0 8px;}

/* ---------- cards & buttons ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:20px;
  padding:16px; margin-bottom:14px; box-shadow:0 1px 2px rgba(10,37,64,.04);}
.btn{display:block; width:100%; border:0; border-radius:999px; padding:16px 18px; font-size:18px;
  font-weight:700; cursor:pointer; background:var(--green); color:#fff; text-align:center;}
.btn.secondary{background:#fff; color:var(--green); border:2px solid var(--green);}
.btn.navy{background:var(--navy);}
.btn.danger{background:var(--red);}
.btn.ghost{background:#eef2f7; color:var(--ink); width:auto; display:inline-block; padding:13px 20px; font-size:16px; min-height:48px;}
.btn.small{padding:13px 20px; font-size:16px; width:auto; display:inline-block; min-height:48px;}
.btn.center{margin:12px auto;}
.btn-row{display:flex; flex-direction:column; gap:10px; margin-top:14px;}

input,select,textarea{font-size:16px; padding:12px 14px; border:1px solid var(--line);
  border-radius:14px; width:100%; margin:6px 0; background:#fff; color:var(--ink);}
label{font-weight:600; font-size:14px; color:var(--muted);}
.row{display:flex; gap:8px; align-items:center;}
.row>*{flex:1;}
.muted{color:var(--muted);} .small{font-size:13px;}

/* ---------- teams list (matches original) ---------- */
.team-group{background:#fff; border:1px solid var(--line); border-radius:20px;
  margin-bottom:12px; overflow:hidden;}
.team-group-head{display:flex; justify-content:space-between; align-items:center; width:100%;
  background:none; border:0; padding:16px; font-size:18px; font-weight:700; color:var(--ink);
  cursor:pointer; text-align:left;}
.team-group-head .chev{color:var(--muted); font-size:20px;}
.team-row{display:flex; align-items:center; gap:10px; width:100%; text-align:left; cursor:pointer;
  background:var(--mint); border:0; border-top:1px solid var(--line); padding:14px 16px;}
.team-row .nm{font-weight:700; font-size:17px;}
.team-row .sub{font-size:14px; color:var(--muted);}
.team-row .badge{margin-left:auto; background:var(--green); color:#fff; font-weight:800;
  min-width:44px; height:44px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:17px; padding:0 8px;}

.section-head{display:flex; justify-content:space-between; align-items:center;
  width:100%; background:none; border:0; padding:14px 4px; font-size:17px; font-weight:700;
  color:var(--ink); cursor:pointer; text-align:left; min-height:52px;}
.section-head .count{background:#eef2f7; border-radius:20px; padding:2px 10px; font-size:13px;}
.section-head .count.red-n{background:#c0392b; color:#fff; font-weight:800;}
.player-row{display:flex; align-items:flex-start; gap:10px; padding:15px 6px; border-top:1px solid var(--line); min-height:60px;}
.player-row img.face{width:44px; height:44px; border-radius:50%; object-fit:cover; background:#dbe4ee;}
.player-row .pc-left{flex:1; min-width:0; text-align:left;}
.player-row .pc-photo{display:flex; align-items:center; gap:8px; margin:2px 0;}
.player-row .pc-left .nm{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.player-row .pc-right{flex:none; text-align:right; white-space:nowrap;}
.player-row .pc-right .muted{font-variant-numeric:tabular-nums;}
.saves-box{margin-bottom:4px;}
.saves-head{display:flex; align-items:center; gap:6px;}
.saves-box b{font-size:18px; font-variant-numeric:tabular-nums;}
/* tappable photo placeholder (no photo yet) */
.photo-tap{display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:44px; border-radius:50%; background:#e7eef6;
  border:2px dashed #9fb3c8; color:#7a8ba0; font-size:22px; font-weight:700;
  cursor:pointer; flex:none;}
.photo-tap:active{transform:scale(.94);}
/* skip / overwrite toggle on the add-players compare screen */
.seg{display:inline-flex; gap:6px; flex:none;}
.player-row .nm{font-weight:700;}
.player-row .pos{font-size:13px; color:var(--muted);}
.goal-line{margin-top:4px; display:flex; justify-content:flex-end;}
.subq-tag{font-size:11px; font-weight:700; color:#8a5a00; background:#fdf0d5; border-radius:10px; padding:2px 8px; display:inline-block; margin-top:4px; white-space:nowrap;}
.subq-actions{display:flex; flex-direction:column; gap:6px;}

/* ---------- game tab ---------- */
.clock-big{font-size:30px; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:1px;}
.clock-big.warn-orange{color:var(--orange);} .clock-big.warn-red{color:var(--red);}
details.filterbox{margin-bottom:10px;}
details>summary{cursor:pointer; font-weight:700; padding:14px 4px; min-height:48px;}
dialog{border:1px solid var(--line); border-radius:20px; padding:16px; max-width:92vw; width:420px; max-height:calc(100dvh - 32px); overflow-y:auto;}
dialog::backdrop{background:rgba(10,37,64,.5);}
.zoomable{touch-action:none; user-select:none; -webkit-user-select:none;}
.pitch{position:relative; width:100%; aspect-ratio:68/105; background:#1d7a38;
  border-radius:16px; overflow:hidden;}
.pitch-lines{position:absolute; inset:5%; border:2px solid rgba(255,255,255,.85); pointer-events:none;}
.pitch-lines .halfway{position:absolute; left:0; right:0; top:50%; border-top:2px solid rgba(255,255,255,.85);}
.pitch-lines .center-circle{position:absolute; width:27%; aspect-ratio:1; border:2px solid rgba(255,255,255,.85);
  border-radius:50%; left:50%; top:50%; transform:translate(-50%,-50%);}
.pitch-lines .center-dot{position:absolute; width:5px; height:5px; background:rgba(255,255,255,.85);
  border-radius:50%; left:50%; top:50%; transform:translate(-50%,-50%);}
.pitch-lines .box{position:absolute; width:50%; height:17%; border:2px solid rgba(255,255,255,.85);
  left:50%; transform:translateX(-50%);}
.pitch-lines .box.top{top:-2px; border-top:0;}
.pitch-lines .box.bottom{bottom:-2px; border-bottom:0;}
.pitch-lines .box div{position:absolute; width:43%; height:40%; border:2px solid rgba(255,255,255,.85);
  left:50%; transform:translateX(-50%);}
.pitch-lines .box.top div{top:0; border-top:0;}
.pitch-lines .box.bottom div{bottom:0; border-bottom:0;}
.legend{font-size:13px; color:var(--muted); display:flex; flex-wrap:wrap; gap:10px; margin-top:6px;}

/* ---------- bottom sheet ---------- */
.sheet-backdrop{position:fixed; inset:0; background:rgba(10,37,64,.45); z-index:100;
  display:flex; align-items:flex-end; justify-content:center;
  opacity:0; transition:opacity .22s ease;}
.sheet-backdrop.open{opacity:1;}
.sheet{background:#fff; width:100%; max-width:640px; max-height:92vh; overflow:hidden;
  border-radius:28px 28px 0 0; display:flex; flex-direction:column;
  transform:translateY(40px); transition:transform .25s ease;}
.sheet-backdrop.open .sheet{transform:translateY(0);}
.sheet-handle{width:52px; height:5px; border-radius:3px; background:#d8ded8; margin:10px auto 0;}
.sheet-head{display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px 4px;}
.sheet-head h2{font-size:30px; font-weight:800; margin:0; letter-spacing:-.5px;}
.sheet-x{width:52px; height:52px; border-radius:50%; border:0; background:#fff; color:var(--ink);
  font-size:22px; cursor:pointer; box-shadow:0 2px 10px rgba(10,37,64,.12);}
.sheet-body{padding:8px 20px 28px; overflow-y:auto; -webkit-overflow-scrolling:touch;}

/* ---------- error dialog ---------- */
.err-backdrop{position:fixed; inset:0; background:rgba(10,37,64,.5); z-index:200;
  display:flex; align-items:center; justify-content:center; padding:24px;
  opacity:0; transition:opacity .2s ease;}
.err-backdrop.open{opacity:1;}
.err-dialog{background:#fff; border-radius:20px; max-width:420px; width:100%;
  padding:24px 22px; box-shadow:0 12px 40px rgba(10,37,64,.25);
  transform:scale(.96); transition:transform .2s ease;}
.err-backdrop.open .err-dialog{transform:scale(1);}
.err-dialog h3{margin:0 0 10px; font-size:22px;}
.err-dialog p{margin:0 0 14px; font-size:16px; line-height:1.45;}
.err-actions{display:flex; gap:10px; margin-top:6px;}
.err-actions .btn{flex:1; width:auto; margin:0; min-height:52px; padding:14px 10px; font-size:17px;}

/* back button hovers below the sticky tab bar on long screens */
.back-sticky{position:sticky; top:var(--tabs-h,84px); z-index:10; background:#fff;
  padding:8px 0; margin-top:-8px;}

/* fixed footer bar pinned below the sheet's scroll area */
.sheet-foot{padding:12px 20px calc(16px + env(safe-area-inset-bottom)); background:#fff;
  border-top:1px solid var(--line);}
.sheet-foot:empty{display:none;}
.sheet-foot .btn{margin:0;}

/* ---------- login gate ---------- */
body.gated .tabs, body.gated .tab-panel, body.gated .app-header{display:none;}
#login-gate{padding:32px 20px 48px;}
.login-card{background:#fff; border:1px solid var(--line); border-radius:24px;
  padding:28px 24px; max-width:400px; margin:0 auto;
  box-shadow:0 4px 18px rgba(10,37,64,.08); text-align:center;}
.login-card .app-logo{height:84px; width:auto; max-width:100%; margin-bottom:8px;}
.login-card h2{margin:6px 0 4px; font-size:26px;}
.login-card .muted{margin:0 0 16px;}
.login-card input{margin:8px 0;}
.login-err{color:var(--red); min-height:22px; font-size:14px; margin:6px 0;}
.login-link{background:none; border:0; color:var(--green); font-weight:700; font-size:16px;
  cursor:pointer; padding:12px; min-height:48px;}

/* ---------- import hub ---------- */
.import-card{display:flex; align-items:center; gap:14px; width:100%; text-align:left;
  background:#eef3f0; border:0; border-radius:20px; padding:20px 16px; margin-bottom:12px; cursor:pointer; min-height:96px;}
.import-card .chev{margin-left:auto; font-size:26px; color:var(--ink); font-weight:300;}
.import-text{display:flex; flex-direction:column; gap:2px;}
.import-text b{font-size:20px; font-weight:800; color:var(--ink);}
.import-text small{font-size:15px; color:var(--muted); line-height:1.35;}
.brand-logo{flex:0 0 auto; width:78px; height:78px; background:#fff; border-radius:18px;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  border:1px solid var(--line); padding:8px;}
.brand-logo img{max-width:100%; max-height:100%; object-fit:contain; display:block;}
.brand-logo sup{font-size:9px; color:#8a8f98; margin-left:1px;}
.brand-up{font-size:30px; color:var(--ink);}
.brand-cam{font-size:30px;}
.source-logo{display:flex; justify-content:center; margin:10px 0 16px;}
.source-logo .brand-logo{width:170px; height:96px; border-radius:20px; padding:12px;}
.center-title{text-align:center; font-size:32px; font-weight:800; margin:6px 0;}
.center-text{text-align:center; color:var(--muted); font-size:17px; line-height:1.5;}

/* ---------- export guide ---------- */
.guide-head{display:flex; gap:14px; align-items:center; padding:8px 0 14px;
  border-bottom:1px solid var(--line); margin-bottom:6px;}
.guide-head .brand-logo{width:120px; height:74px; border-radius:16px;}
.guide-title{font-size:22px; font-weight:800;}
.callout{background:#fdf3e0; border-radius:16px; padding:16px; margin:14px 0; font-size:16px;
  line-height:1.45; color:var(--ink);}
.guide-steps{list-style:none; margin:6px 0 0; padding:0;}
.guide-steps li{margin:0 0 6px;}
.guide-step{display:flex; gap:14px; margin:18px 0 10px;}
.guide-num{flex:0 0 auto; width:46px; height:46px; border-radius:50%; background:var(--green);
  color:#fff; font-weight:800; font-size:20px; display:flex; align-items:center; justify-content:center;}
.guide-step-t{font-size:20px; font-weight:800;}
.guide-step p{margin:4px 0 0;}
.guide-img{display:block; width:100%; border-radius:16px; border:1px solid var(--line); margin:2px 0 14px;}
.guide-import{display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px; margin-top:16px;}
.guide-import b{display:block; font-size:17px;}
.guide-import span{font-size:14px; color:var(--muted);}

.team-row-wrap{display:flex; align-items:center; gap:8px; margin-bottom:8px;}
.team-row-wrap .team-row{margin-bottom:0;}

/* ---------- import review ---------- */
.rv-row{border:1px solid var(--line); border-radius:16px; padding:12px; margin:10px 0; background:#fff;}
.rv-row-head{display:flex; align-items:center; gap:10px; margin-bottom:8px;}
.rv-num{font-weight:800; color:var(--muted); font-size:14px; min-width:28px;}
.rv-jersey{width:64px; flex:0 0 auto; text-align:center; font-size:20px; font-weight:800;
  padding:12px 6px; border:1px solid var(--line); border-radius:14px; background:#eef3f0; min-height:56px;}
.pos-chip{display:inline-block; font-size:16px; font-weight:400; padding:12px 14px 12px 10px;
  margin:4px 8px 4px 0; min-height:48px; cursor:pointer; border-radius:12px;}
.pos-chip input[type=checkbox]{width:24px; height:24px; vertical-align:-5px; margin-right:6px; accent-color:var(--green);}
.linklike{background:none; border:0; color:var(--green); font-size:16px; font-weight:700;
  padding:12px 4px; cursor:pointer; text-align:left; min-height:44px;}
.idcard-badge{font-size:20px; margin-left:auto; flex:0 0 auto;}
#idcard-overlay{position:fixed; inset:0; background:rgba(10,37,64,.75); z-index:200;
  display:flex; align-items:center; justify-content:center; padding:18px;}
.idcard-box{background:#fff; border-radius:20px; padding:16px; max-width:94vw; width:560px;
  max-height:92vh; overflow-y:auto;}
.idcard-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap:10px;}
.idcard-box img{width:100%; border-radius:12px; display:block;}

/* ---------- auth bar ---------- */
#auth-bar{position:fixed; bottom:0; left:0; right:0; background:#fff; color:var(--ink);
  border-top:1px solid var(--line); padding:10px 14px; font-size:14px; display:flex;
  flex-wrap:wrap; justify-content:space-between; align-items:center; z-index:30;
  box-shadow:0 -2px 10px rgba(10,37,64,.06);}
#auth-bar a{color:var(--green);}
#acct-menu{position:fixed; right:10px; bottom:64px; z-index:60; background:#fff;
  border:1px solid var(--line); border-radius:14px; box-shadow:0 8px 30px rgba(10,37,64,.18);
  padding:14px; width:250px;}
.cp-toast{position:fixed; left:50%; bottom:76px; transform:translateX(-50%) translateY(12px);
  background:#0a2540; color:#fff; padding:10px 18px; border-radius:24px; font-size:15px;
  font-weight:600; z-index:80; opacity:0; transition:opacity .3s, transform .3s;
  box-shadow:0 6px 24px rgba(10,37,64,.3); pointer-events:none; max-width:90vw; text-align:center;}
.cp-toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.goal-badge{width:30px;height:30px;border-radius:50%;background:var(--green);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;flex:none;}

/* ---------- practice tab: Drills / Sessions expanders ---------- */
.pr-sec{padding:0; overflow:hidden;}
.pr-sec-head{display:flex; justify-content:space-between; align-items:center; width:100%;
  background:none; border:0; padding:14px 16px; min-height:56px; cursor:pointer;
  font-size:18px; font-weight:800; color:inherit; text-align:left;}
.pr-sec-title{flex:1;}
.pr-chev{font-size:16px; color:#5b6b7c;}
#pr-drills-body, #pr-sessions-body{padding:0 16px 16px;}
.ps-block{margin:8px 0;}
.ps-pick{font-size:14px;}

/* ---------- practice wizards ---------- */
.wiz-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px;}
.wiz-grid.age-grid{grid-template-columns:repeat(3,1fr);}
.wiz-opt{flex-direction:column;align-items:flex-start;text-align:left;min-height:56px;padding:10px 12px;}
.wiz-t{font-weight:800;font-size:16px;}
.wiz-sub{font-weight:400;font-size:12px;opacity:.75;margin-top:2px;}
.wiz-opt.picked{outline:3px solid var(--green);outline-offset:-3px;}
.gear-q{margin:10px 0;}
.gear-q .row{margin-top:6px;}
.method-tag{display:inline-block;background:#e8f1fb;color:#0a2540;border-radius:12px;padding:2px 10px;font-size:12px;font-weight:600;}
