:root{
    --pitch-dark:#07211a;
    --pitch:#0d3b2b;
    --lime:#c8ff3d;
    --lime-dark:#8fd400;
    --amber:#ffc531;
    --white:#f4fff6;
    --ink:#04150f;
  }
  *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
  html,body{height:100%;margin:0;overscroll-behavior:none}
  body{
    font-family:Nunito,system-ui,-apple-system,sans-serif;font-weight:800;
    color:var(--white);background:var(--pitch-dark);
    overflow:hidden;user-select:none;-webkit-user-select:none;
  }
  .screen{
    position:absolute;inset:0;max-width:520px;margin:0 auto;
    display:none;flex-direction:column;overflow-y:auto;
    overscroll-behavior-y:contain;
    background:radial-gradient(120% 60% at 50% 0%,#14513a 0%,var(--pitch) 45%,var(--pitch-dark) 100%);
  }
  .screen.active{display:flex;animation:fade .25s ease}
  @keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
  .pad{padding:0 18px 108px;flex:1 1 auto;display:flex;flex-direction:column}
  .padc{padding:max(14px,env(safe-area-inset-top)) 18px 108px;flex:1 1 auto;display:flex;flex-direction:column}

  /* ---------- banner ---------- */
  .banner{
    flex:0 0 auto;padding:max(16px,env(safe-area-inset-top)) 18px 18px;
    background:
      repeating-linear-gradient(115deg,rgba(255,255,255,.05) 0 26px,transparent 26px 52px),
      linear-gradient(135deg,#1d7a52,#0b3527);
    border-bottom-left-radius:30px;border-bottom-right-radius:30px;
    box-shadow:0 14px 34px rgba(0,0,0,.35);
  }
  .banner-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
  .club{display:flex;align-items:center;gap:12px;min-width:0}
  .crest{
    width:50px;height:50px;flex:0 0 auto;border-radius:14px;
    background:linear-gradient(160deg,var(--lime),var(--lime-dark));color:var(--ink);
    display:grid;place-items:center;font-size:19px;font-weight:1000;
    box-shadow:0 4px 14px rgba(200,255,61,.3);
  }
  .club .team{font-size:18px;line-height:1.15}
  .club .age{font-size:13px;opacity:.6;font-weight:700;letter-spacing:.08em}
  .chip{
    display:flex;align-items:center;gap:6px;flex:0 0 auto;
    background:rgba(4,21,15,.4);border:2px solid rgba(200,255,61,.3);
    padding:7px 14px;border-radius:999px;font-size:17px;color:var(--lime);
  }
  button,.next,.task,.presence[data-action],.clipframe,.pthumb,.slot,.shelf-item,.bonus{touch-action:manipulation}
  .hello{font-size:27px;font-weight:1000;margin-top:16px;line-height:1.15}
  .hello small{display:block;font-size:16px;font-weight:700;opacity:.65;margin-top:3px}

  /* ---------- generic ---------- */
  .card{background:rgba(255,255,255,.08);border:2px solid rgba(255,255,255,.07);border-radius:26px;padding:18px;margin-top:14px}
  .card-title{font-size:14px;letter-spacing:.1em;text-transform:uppercase;opacity:.55;font-weight:800}
  .back{
    width:52px;height:52px;border-radius:50%;border:none;flex:0 0 auto;
    background:rgba(255,255,255,.1);color:var(--white);font-size:24px;
    display:grid;place-items:center;cursor:pointer;
  }
  .topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto}
  h1{font-size:29px;font-weight:1000;margin:16px 0 4px;line-height:1.12}
  .sub{font-size:16px;opacity:.68;margin:0;font-weight:700}

  /* ---------- home: next exercise ---------- */
  .next{margin-top:18px;border-radius:30px;padding:20px;
    background:linear-gradient(150deg,rgba(200,255,61,.2),rgba(200,255,61,.06));
    border:2px solid rgba(200,255,61,.35);cursor:pointer}
  .next .row{display:flex;align-items:center;gap:16px}
  .tile{width:74px;height:74px;flex:0 0 auto;border-radius:22px;
    background:linear-gradient(150deg,#1d6b4c,#092a1f);display:grid;place-items:center;font-size:38px}
  .next .name{font-size:23px;line-height:1.15}
  .next .meta{font-size:15px;opacity:.7;font-weight:700;margin-top:4px}

  /*
   * The one button. Every action button is a .btn so that size, shape and press
   * feel the same wherever it appears:
   *   .btn          primary action (lime, raised)
   *   .btn.ghost    secondary action beside a primary one (outlined)
   *   .btn.sm       the same two, compact, for tight rows such as the pause sheet
   * Sizing lives in the three variables so a size is never restated per screen.
   */
  .btn{
    --bf:26px;--bp:16px;--br:22px;--bs:6px;
    width:100%;border:none;cursor:pointer;font-family:inherit;font-weight:1000;line-height:1.15;
    background:linear-gradient(180deg,var(--lime),var(--lime-dark));color:var(--ink);
    font-size:var(--bf);padding:var(--bp) 18px;border-radius:var(--br);box-shadow:0 var(--bs) 0 #5f9200;
  }
  .btn:active{transform:translateY(calc(var(--bs) - 2px));box-shadow:0 2px 0 #5f9200}
  .btn.ghost{
    --bf:20px;--bp:13px;
    background:none;box-shadow:none;border:2px solid rgba(255,255,255,.18);color:var(--white);
  }
  .btn.ghost:active{transform:none;background:rgba(255,255,255,.06)}
  .btn.sm{--bf:19px;--bp:11px;--br:18px;--bs:4px}
  .btn.sm.ghost{--bf:17px}
  .btn .nx-k{display:block;font-size:13px;letter-spacing:.1em;text-transform:uppercase;opacity:.65;margin-bottom:2px}
  .mt{margin-top:14px}

  /* ---------- coach note ---------- */
  .coachnote{display:none;gap:12px;align-items:flex-start;margin-top:16px;
    background:rgba(200,255,61,.1);border:1px solid rgba(200,255,61,.3);
    border-radius:18px;padding:14px 16px}
  .coachnote.on{display:flex}
  .coachnote .badge{flex:0 0 auto;font-size:10px;letter-spacing:.09em;font-weight:1000;
    background:rgba(200,255,61,.22);color:var(--lime);padding:5px 9px;border-radius:8px;margin-top:2px}
  .coachnote .txt{flex:1 1 auto;font-size:16px;font-weight:700;line-height:1.45}

  /* ---------- personal best ---------- */
  .best-pill{
    display:none;margin-top:12px;align-self:flex-start;
    background:rgba(255,197,49,.16);border:2px solid rgba(255,197,49,.4);
    color:var(--amber);border-radius:999px;padding:8px 16px;font-size:15px;
  }
  .best-pill.on{display:block}

  /* ---------- plan ---------- */
  .plan{margin-top:18px;background:rgba(4,21,15,.3);border-radius:22px;padding:6px 18px 14px}
  .prow{display:flex;align-items:center;gap:14px;padding:11px 0;border-bottom:1px solid rgba(255,255,255,.07)}
  .prow .dur{width:62px;flex:0 0 auto;text-align:right;font-size:19px;color:var(--lime);font-variant-numeric:tabular-nums}
  .prow .what{flex:1 1 auto;font-size:17px;min-width:0}
  .prow.rest{opacity:.45}
  .prow.rest .dur{color:var(--white);font-size:16px}
  .prow.rest .what{font-size:15px;font-weight:700}
  .ptotal{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding-top:13px}
  .ptotal .k{font-size:14px;letter-spacing:.08em;text-transform:uppercase;opacity:.5}
  .ptotal .v{font-size:19px;color:var(--lime)}
  .pnote{margin-top:9px;font-size:13px;font-weight:700;opacity:.4}

  /* ---------- why ---------- */
  .why-btn{
    margin-top:14px;display:inline-flex;align-items:center;gap:7px;
    background:rgba(4,21,15,.35);border:none;color:rgba(255,255,255,.78);
    font-family:inherit;font-weight:800;font-size:15px;padding:9px 16px;border-radius:999px;cursor:pointer;
  }
  .why-btn[hidden]{display:none}
  .why-text{
    display:none;margin-top:12px;background:rgba(4,21,15,.35);
    border-left:4px solid var(--lime);border-radius:0 16px 16px 0;
    padding:14px 16px;font-size:16px;font-weight:700;line-height:1.45;opacity:.92;
  }
  .why-text.open{display:block}
  .why-text b{display:block;color:var(--lime);font-size:14px;letter-spacing:.04em;margin-bottom:4px}
  /* The start button stays on screen however long the page above it runs. */
  #screen-ready .startbar{position:sticky;bottom:0;z-index:5;margin:22px -18px 0;
    padding:14px 18px max(16px,env(safe-area-inset-bottom));
    background:linear-gradient(180deg,rgba(7,38,28,0) 0,var(--pitch-dark) 22%)}

  /* ---------- pool ---------- */
  .challenge-card .presence{margin-top:18px;padding-top:16px;border-top:1px solid rgba(255,255,255,.08)}
  .pool .head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
  .pool .goal{font-size:17px}
  .pool .num{font-size:21px;color:var(--lime);white-space:nowrap}
  .track{height:16px;border-radius:999px;background:rgba(0,0,0,.4);margin-top:11px;overflow:hidden}
  .fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--lime-dark),var(--lime));
    box-shadow:0 0 16px rgba(200,255,61,.45);transition:width .9s cubic-bezier(.2,.9,.25,1)}
  .pool .nudge{margin-top:11px;font-size:16px;color:var(--amber);font-weight:800}

  /* ---------- week list ---------- */
  .task{display:flex;align-items:center;gap:14px;background:rgba(255,255,255,.06);
    border-radius:20px;padding:13px 15px;margin-top:10px;cursor:pointer}
  .task .ic{width:48px;height:48px;flex:0 0 auto;border-radius:15px;
    background:linear-gradient(150deg,#1d6b4c,#092a1f);display:grid;place-items:center;font-size:24px}
  .task .tx{flex:1 1 auto;min-width:0}
  .task .tn{font-size:17px;line-height:1.2}
  .task .td{font-size:14px;opacity:.6;font-weight:700;margin-top:2px}
  .task.done{opacity:.5}
  .task .tick{font-size:24px;color:var(--lime)}
  .task .go{font-size:24px;opacity:.5}

  /* ---------- presence ---------- */
  .presence-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
  .presence-head .card-title{font-size:13px;letter-spacing:.05em;white-space:nowrap}
  .presence-head .big{font-size:24px;color:var(--lime);white-space:nowrap}
  .presence-head .deadline{font-size:13px;font-weight:800;opacity:.5;white-space:nowrap}
  .grid{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
  .dot{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;
    background:rgba(0,0,0,.32);border:2px solid rgba(255,255,255,.06);
    font-size:19px;font-weight:1000;color:transparent}
  .dot.on{background:linear-gradient(160deg,var(--lime),var(--lime-dark));
    border-color:transparent;color:var(--ink);box-shadow:0 0 12px rgba(200,255,61,.35)}
  .you{margin-top:14px;font-size:15px;font-weight:800;color:var(--lime)}

  /* ---------- all done ---------- */
  .celebrate{text-align:center;padding:26px 18px 6px}
  .celebrate .mark{font-size:76px;line-height:1}
  .celebrate h1{font-size:34px;margin:10px 0 4px}
  .celebrate p{font-size:17px;font-weight:700;opacity:.7;margin:0;line-height:1.5;max-width:34ch;margin-inline:auto}
  .tallies{display:flex;gap:12px;margin-top:18px}
  .tally{flex:1 1 0;background:rgba(255,255,255,.08);border-radius:22px;padding:15px 10px;text-align:center}
  .tally .v{font-size:27px;color:var(--lime);line-height:1}
  .tally .k{font-size:13px;font-weight:700;opacity:.6;margin-top:6px}
  .bonus{width:100%;margin-top:14px;border:2px dashed rgba(200,255,61,.45);cursor:pointer;
    background:rgba(200,255,61,.08);color:var(--lime);font-family:inherit;font-weight:1000;
    font-size:22px;padding:18px;border-radius:24px}
  .bonus small{display:block;font-size:14px;font-weight:700;opacity:.75;color:var(--white);margin-top:5px}
  .nextdrop{margin-top:16px;text-align:center;font-size:15px;font-weight:700;opacity:.5}

  /* ---------- run ---------- */
  /* A control is always one of two: ✕ top right leaves what is running or
     opened on top, ← top left steps back to where you came from. */
  .xbtn{position:absolute;z-index:3;right:max(14px,env(safe-area-inset-right));top:var(--top);
    width:52px;height:52px;border-radius:50%;border:none;cursor:pointer;color:var(--white);
    background:rgba(4,21,15,.6);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
    display:grid;place-items:center;padding:0}
  .xbtn:active{background:rgba(255,255,255,.16)}

  /* ---------- run: the clock is the pause button, the exercise sits at the bottom ---------- */
  .runbox{--top:max(14px,env(safe-area-inset-top));--tb:clamp(88px,26vw,112px);
    position:relative;flex:1 1 auto;min-height:0}
  .ribbon:not([hidden]) + .runbox{--top:14px}
  .timerbtn{position:absolute;z-index:3;left:calc(50% - var(--tb) / 2);top:var(--top);width:var(--tb);height:var(--tb);
    border-radius:50%;display:grid;place-items:center;align-content:center;gap:3px;padding:0;cursor:pointer;
    color:var(--white);font-family:inherit;background:rgba(4,21,15,.6);
    backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);
    border:3px solid rgba(200,255,61,.75);box-shadow:0 0 18px rgba(200,255,61,.32),inset 0 0 14px rgba(200,255,61,.12);
    transition:transform .12s ease,border-color .2s,box-shadow .2s}
  .timerbtn:active{transform:scale(.93)}
  .timerbtn:disabled{cursor:default;transform:none}
  .tsecs{font-size:calc(var(--tb) * .36);font-weight:1000;line-height:1;font-variant-numeric:tabular-nums;
    text-shadow:0 2px 10px rgba(0,0,0,.55)}
  .tico{display:flex;align-items:center;gap:4px;height:15px}
  .tico i{width:5px;height:15px;border-radius:2px;background:var(--lime)}
  .tunit{font-size:11px;letter-spacing:.14em;opacity:.75;font-weight:800}
  .tunit:empty{display:none}
  .timerbtn:disabled .tico{display:none}
  #screen-run.hurry .tsecs{color:var(--amber)}
  #screen-run.hurry .edge i{background:var(--amber)}
  /* Paused: the same button turns amber and offers to carry on. */
  body.is-paused .timerbtn{border-color:var(--amber);box-shadow:0 0 0 4px rgba(255,197,49,.3),0 0 18px rgba(255,197,49,.4);
    animation:breathe 1.6s ease-in-out infinite}
  body.is-paused .tico i{display:none}
  body.is-paused .tico::after{content:'';margin-left:3px;border-left:14px solid var(--amber);
    border-top:8px solid transparent;border-bottom:8px solid transparent}
  body.is-paused .edge i{background:var(--amber);box-shadow:0 0 8px rgba(255,197,49,.7)}
  @keyframes breathe{50%{box-shadow:0 0 0 9px rgba(255,197,49,.12),0 0 18px rgba(255,197,49,.4)}}
  .edge{position:absolute;z-index:1;left:max(7px,env(safe-area-inset-left));top:calc(var(--top) + var(--tb) + 40px);
    bottom:150px;width:6px;border-radius:99px;background:rgba(255,255,255,.2);overflow:hidden}
  .edge i{position:absolute;inset:0;background:var(--lime);box-shadow:0 0 8px rgba(200,255,61,.7);
    transform-origin:bottom;transition:background .2s}
  #restEdge{transition:transform 1s linear,background .2s}
  .stagebox{position:absolute;left:50%;top:50%;width:112px;height:112px;margin:-56px 0 0 -56px;border-radius:24px;
    background:linear-gradient(160deg,#1a6349,#0a2c20);display:grid;place-items:center;font-size:44px}
  .runinfo{position:absolute;left:0;right:0;bottom:max(22px,env(safe-area-inset-bottom));text-align:center;
    padding:0 28px;text-shadow:0 2px 12px rgba(0,0,0,.65)}
  /* Rest is cool blue where work is lime, with the word itself large in the middle. */
  #screen-rest{--rest:#6fd3ff;
    background:radial-gradient(120% 60% at 50% 0%,#17506b 0%,#0d3348 50%,#071c2a 100%)}
  #screen-rest .timerbtn{border-color:rgba(111,211,255,.8);box-shadow:0 0 18px rgba(111,211,255,.35),inset 0 0 14px rgba(111,211,255,.14)}
  #screen-rest .tico i{background:var(--rest)}
  #screen-rest .edge i{background:var(--rest);box-shadow:0 0 8px rgba(111,211,255,.7)}
  #screen-rest .rnext b{color:var(--rest)}
  .resthero{position:absolute;z-index:2;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;
    pointer-events:none;text-shadow:0 3px 18px rgba(0,0,0,.7)}
  .resthero b{display:block;font-size:clamp(64px,22vw,92px);letter-spacing:.08em;line-height:1;color:var(--rest,#6fd3ff);font-weight:1000}
  .resthero span{display:block;margin-top:8px;font-size:20px;font-weight:800;opacity:.9}
  .rname{font-size:22px;color:var(--lime);font-weight:1000;line-height:1.12}
  .rsub{font-size:15px;opacity:.85;margin-top:4px;font-weight:700}
  .rnext{font-size:20px;font-weight:700;line-height:1.2;margin-top:6px;opacity:.9}
  .rnext b{display:block;font-size:24px;color:var(--lime);margin-top:3px;font-weight:1000}
  .runinfo .count-done{width:min(100%,360px);margin:0 auto 18px;text-shadow:none}
  .runinfo .devskip{margin:10px auto 0}
  .quit{flex:0 0 auto;margin-top:8px;background:none;border:none;color:rgba(255,255,255,.4);
    font-family:inherit;font-weight:700;font-size:16px;padding:12px;cursor:pointer}

  /* ---------- paused: a sheet over a clear picture ---------- */
  #paused{position:fixed;inset:0;z-index:45;display:none;flex-direction:column;justify-content:flex-end;
    pointer-events:none;padding:0 14px max(14px,env(safe-area-inset-bottom));max-width:520px;margin:0 auto}
  #paused.active{display:flex;animation:fade .2s ease}
  #paused .psheet{pointer-events:auto;display:grid;gap:6px;padding:12px 16px 14px;border-radius:24px;
    background:rgba(4,21,15,.8);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
    border:2px solid rgba(255,255,255,.16)}
  #paused .phead{display:flex;align-items:baseline;gap:10px}
  #paused .pname{font-size:19px;font-weight:1000;color:var(--lime);line-height:1.12}
  #paused .psubl{font-size:14px;opacity:.7;font-weight:700}
  #paused .pcue{font-size:15px;font-weight:700;line-height:1.38;margin-top:2px;opacity:.95}
  #paused .pcue:empty{display:none}
  #paused .pq{font-size:21px;font-weight:1000;color:var(--lime)}
  #paused .pbtns{display:flex;gap:10px;margin-top:6px}
  #paused .pbtns .btn{flex:1;width:auto;padding-inline:10px}
  #paused .pbtns .btn.ghost{flex:.8}
  #paused .ask,#paused.asking .noask{display:none}
  #paused.asking .ask{display:block}

  /* ---------- countdown ---------- */
  #countdown{position:absolute;inset:0;z-index:40;display:none;place-items:center;background:rgba(4,21,15,.94)}
  #countdown.active{display:grid}
  #countdown .num{font-size:170px;font-weight:1000;color:var(--lime);line-height:1}

  /* ---------- stepper / attempts ---------- */
  .stepper{display:flex;align-items:center;justify-content:center;gap:16px;margin:10px 0 2px}
  .step-btn{width:86px;height:86px;border-radius:50%;border:none;cursor:pointer;
    background:rgba(255,255,255,.12);color:var(--white);
    font-family:inherit;font-size:44px;font-weight:1000;line-height:1}
  .step-btn:active{transform:scale(.92);background:rgba(200,255,61,.25)}
  .repv{font-size:80px;font-weight:1000;min-width:130px;text-align:center;
    font-variant-numeric:tabular-nums;color:var(--lime)}
  .chips{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:4px}
  .chipbtn{background:rgba(255,255,255,.1);border:none;color:var(--white);
    font-family:inherit;font-weight:800;font-size:18px;padding:11px 19px;border-radius:999px;cursor:pointer}
  .chipbtn:active{background:rgba(200,255,61,.25)}
  .attempts{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;justify-content:center}
  .att{background:rgba(255,255,255,.09);border-radius:14px;padding:8px 14px;font-size:18px}
  .att.best{background:rgba(255,197,49,.2);color:var(--amber);border:2px solid rgba(255,197,49,.45)}
  .att-stats{display:flex;gap:12px;margin-top:14px}
  .att-stats .tally{margin:0}

  /* ---------- done ---------- */
  .trophy{font-size:88px;text-align:center}
  .earned{text-align:center;font-size:48px;font-weight:1000;color:var(--lime)}
  .pb{text-align:center;background:rgba(255,197,49,.16);border:2px solid rgba(255,197,49,.4);
    color:var(--amber);border-radius:20px;padding:12px;font-size:19px;margin-top:12px;display:none}
  .pb.show{display:block}
  .center-col{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:0}
  #confetti{position:fixed;inset:0;pointer-events:none;z-index:60}

  /* ---------- dev bar ---------- */
  #dev{position:fixed;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));
    z-index:99;display:flex;align-items:center;gap:10px;background:rgba(0,0,0,.6);
    padding:7px 8px 7px 16px;border-radius:999px;backdrop-filter:blur(8px)}
  #dev span{font-size:12px;font-weight:800;color:rgba(255,255,255,.5);letter-spacing:.04em;white-space:nowrap}
  #dev button{border:none;background:rgba(255,255,255,.14);color:var(--white);
    font-family:inherit;font-weight:800;font-size:13px;padding:8px 14px;border-radius:999px;cursor:pointer}
  #dev a{text-decoration:none;background:rgba(255,255,255,.14);color:var(--white);
    font-weight:800;font-size:13px;padding:8px 14px;border-radius:999px;white-space:nowrap}

  .pool .goal-go{margin-top:14px;font-size:20px;padding:14px}

  /* ---------- the challenge card on the home page ---------- */
  .challenge-card{margin-top:18px}
  .next.in-card{margin-top:12px;padding:16px;border-radius:24px}

  /* ---------- the goal on an exercise's start screen ---------- */
  .team-pill{display:none;margin-top:10px;align-self:flex-start;
    background:rgba(200,255,61,.12);border:2px solid rgba(200,255,61,.35);
    color:var(--lime);border-radius:999px;padding:8px 16px;font-size:15px}
  .team-pill.on{display:block}
  .again-pill{display:none;margin-top:10px;align-self:flex-start;
    background:rgba(255,255,255,.07);border-radius:999px;padding:8px 16px;font-size:15px;opacity:.8}
  .again-pill.on{display:block}

  /* ---------- the shelf: everything the team has been given ---------- */
  .shelf{padding-bottom:14px}
  .shelf-row{display:flex;gap:12px;overflow-x:auto;margin:12px -18px 0;padding:0 18px 4px;
    scroll-snap-type:x proximity;scrollbar-width:none}
  .shelf-row::-webkit-scrollbar{display:none}
  .shelf-item{flex:0 0 78px;min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px;
    background:none;border:none;padding:0;color:inherit;font-family:inherit;cursor:pointer;scroll-snap-align:start}
  .shelf-ic{position:relative;width:60px;height:60px;border-radius:18px;display:grid;place-items:center;
    font-size:30px;background:linear-gradient(150deg,#1d6b4c,#092a1f)}
  .shelf-n{position:absolute;right:-6px;bottom:-6px;min-width:26px;padding:2px 6px;border-radius:999px;
    background:var(--lime);color:var(--ink);font-size:12px;font-weight:1000;line-height:1.3}
  .shelf-name{max-width:100%;font-size:12px;font-weight:800;opacity:.75;text-align:center;line-height:1.2;overflow-wrap:anywhere;hyphens:auto;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

  /* ---------- own progress on the done screen ---------- */
  .done-own{margin-bottom:14px}
  .own-line{text-align:center;font-size:18px;color:var(--lime);padding:12px}
  .hint-line{font-size:14px;font-weight:700;opacity:.6;margin-top:4px}

  /* ---------- counted blocks ---------- */
  .count-done{display:none;flex:0 0 auto;margin-top:6px}

  /* ---------- development: skip the running block ---------- */
  .devskip{display:none;flex:0 0 auto;align-self:center;margin-top:6px;cursor:pointer;
    background:rgba(4,21,15,.6);border:1px dashed rgba(200,255,61,.5);color:var(--lime);
    font-family:inherit;font-weight:800;font-size:14px;padding:9px 16px;border-radius:999px}
  body.dev .devskip{display:block}

  /* ---------- exercise clip ---------- */
  body>.clip{display:none}
  .clip{display:block;width:100%;height:100%;object-fit:cover;background:#000}
  .clip.mirror{transform:scaleX(-1)}

  /* On the ready screen: a portrait frame, tapped to fill the screen. */
  .clipframe{display:none;position:relative;flex:0 0 auto;align-self:center;margin-top:16px;
    height:min(46vh,400px);aspect-ratio:9/16;border-radius:22px;overflow:hidden;cursor:pointer;
    background:linear-gradient(160deg,#1a6349,#0a2c20);box-shadow:0 10px 30px rgba(0,0,0,.35)}
  .clipframe.on{display:block}
  .clipframe::after{content:'⤢';position:absolute;right:10px;bottom:10px;width:34px;height:34px;
    border-radius:50%;display:grid;place-items:center;font-size:18px;
    background:rgba(4,21,15,.55);color:var(--white)}
  body:not(.clip-on) .clipframe .clip{opacity:0}
  .clipframe.big{position:fixed;inset:0;z-index:50;height:auto;margin:0;border-radius:0;align-self:stretch;
    aspect-ratio:auto;background:#000}
  .clipframe.big::after{content:'✕';top:max(14px,env(safe-area-inset-top));bottom:auto;right:14px;
    width:52px;height:52px;font-size:22px}
  .clipframe.big .clip{object-fit:contain}
  /* Needs the extra specificity: `body.parts .clipframe` sets a height that kept the clip small. */
  body.clip-big .clipframe.big{height:auto;width:auto;aspect-ratio:auto;cursor:default}
  .clipframe.big::after{display:none}

  /* Full-screen controls. */
  .clipfs{display:none}
  body.clip-big .clipfs{display:block}
  .clipfs button{position:fixed;z-index:60;border:none;cursor:pointer;color:var(--white);font-family:inherit;
    background:rgba(4,21,15,.7);border:2px solid rgba(255,255,255,.3);display:grid;place-items:center;padding:0}
  .fs-close{top:max(14px,env(safe-area-inset-top));right:14px;width:56px;height:56px;border-radius:50%;font-size:24px}
  .fs-nav{display:none!important;bottom:max(28px,env(safe-area-inset-bottom));width:64px;height:64px;border-radius:50%;font-size:40px;line-height:1}
  body.parts .fs-nav{display:grid!important}
  .fs-nav:disabled{opacity:.25}
  .fs-prev{left:16px}
  .fs-next{right:16px}
  .fs-name{position:fixed;z-index:60;left:96px;right:96px;bottom:max(28px,env(safe-area-inset-bottom));
    min-height:64px;display:flex;align-items:center;justify-content:center;text-align:center;
    font-size:18px;line-height:1.25;text-shadow:0 1px 6px #000;pointer-events:none}

  /* An exercise built from parts: arrows beside the clip, the parts beneath. */
  .cliprow{display:flex;align-items:center;justify-content:center;gap:10px}
  .pnav{display:none;flex:0 0 auto;width:48px;height:48px;border-radius:50%;cursor:pointer;
    border:2px solid rgba(255,255,255,.22);background:rgba(4,21,15,.35);color:var(--white);
    place-items:center;padding:0}
  .pnav:disabled{opacity:.25;cursor:default}
  body.parts .pnav{display:grid}
  body.parts .clipframe{height:min(40vh,360px)}
  .partname{display:none;text-align:center;font-size:17px;margin-top:10px}
  .partname small{display:block;font-size:13px;opacity:.6;font-weight:700;margin-bottom:2px}
  body.parts .partname{display:block}
  .partname .pcue{display:block;font-size:15px;font-weight:700;opacity:.75;margin:4px auto 0;max-width:34ch;line-height:1.35}
  .partstrip{display:none;gap:6px;margin-top:10px;overflow-x:auto;scrollbar-width:none;
    scroll-snap-type:x proximity;padding-bottom:2px}
  .partstrip::-webkit-scrollbar{display:none}
  body.parts .partstrip{display:flex}
  /* A few parts share the width; many scroll sideways at a size a thumb can still hit. */
  .pthumb{flex:1 0 58px;min-width:0;background:none;border:none;padding:0;color:inherit;font-family:inherit;cursor:pointer}
  .pthumb video,.pthumb .none{display:block;width:100%;aspect-ratio:9/16;object-fit:cover;border-radius:10px;
    border:2px solid transparent;background:#0a2c20}
  .pthumb video.mirror{transform:scaleX(-1)}
  .pthumb.on video,.pthumb.on .none{border-color:var(--lime)}
  .pthumb span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
    font-size:11px;font-weight:800;line-height:1.2;margin-top:4px;opacity:.65;text-align:center}
  .pthumb.on span{color:var(--lime);opacity:1}

  /* ---------- the player's own pick of parts, outside a challenge ---------- */
  .pthumb{position:relative}
  .pthumb .pk{position:absolute;top:5px;right:5px;width:20px;height:20px;border-radius:50%;
    display:grid;place-items:center;font-style:normal;font-size:12px;font-weight:1000;
    background:var(--lime);color:var(--ink);border:2px solid var(--lime)}
  .pthumb.out video,.pthumb.out .none{opacity:.3}
  .pthumb.out .pk{background:rgba(4,21,15,.6);color:transparent;border-color:rgba(244,255,246,.5)}
  .pthumb.out span{opacity:.35}
  .pick-btn{display:block;margin:8px auto 0;border:2px solid rgba(244,255,246,.3);background:none;color:var(--white);
    font-family:inherit;font-weight:1000;font-size:15px;padding:7px 18px;border-radius:999px;cursor:pointer}
  .pick-btn.on{background:var(--lime);border-color:var(--lime);color:var(--ink)}
  .pick-btn:disabled{opacity:.6;cursor:default}

  /* Behind the runner: the clip fills the screen and the timer sits on it. */
  #stage{position:absolute;inset:0;max-width:520px;margin:0 auto;display:none;background:#000}
  body.clip-on:has(#screen-run.active) #stage,
  body.clip-on:has(#screen-rest.active) #stage{display:block}
  body.clip-on #screen-run{background:linear-gradient(180deg,rgba(4,21,15,.7) 0%,rgba(4,21,15,.15) 30%,
    rgba(4,21,15,.15) 55%,rgba(4,21,15,.85) 100%)}
  /* The next part's clip plays during rest so it can be studied: the middle stays
     clear, and the blue frame and the word at the top say that this is rest. */
  body.clip-on #screen-rest{box-shadow:inset 0 0 0 5px var(--rest);
    background:linear-gradient(180deg,rgba(7,28,42,.82) 0%,rgba(7,28,42,.55) 26%,rgba(7,28,42,0) 40%,rgba(7,28,42,0) 68%,rgba(7,28,42,.88) 100%)}
  body.clip-on .resthero{top:calc(var(--top) + var(--tb) + 12px);transform:none}
  body.clip-on .resthero b{font-size:44px}
  body.clip-on .resthero span{display:none}
  body.clip-on #screen-run .stagebox{display:none}
  /* While paused the picture is the point: only the edges keep a little shade. */
  body.is-paused.clip-on #screen-run,
  body.is-paused.clip-on #screen-rest{background:linear-gradient(180deg,rgba(4,21,15,.45) 0%,rgba(4,21,15,0) 22%,
    rgba(4,21,15,0) 62%,rgba(4,21,15,.3) 100%)}

  /* ---------- whose training this is: the challenge's or the player's own ---------- */
  .ribbon{flex:0 0 auto;position:relative;z-index:3;display:flex;align-items:center;gap:8px;
    padding:max(9px,env(safe-area-inset-top)) 18px 9px;background:var(--lime);color:var(--ink);
    font-size:13px;font-weight:1000;letter-spacing:.07em;text-transform:uppercase}
  .ribbon[hidden]{display:none}
  .ribbon .rb-n{opacity:.65}
  .ribbon .rb-dots{margin-left:auto;display:flex;gap:6px}
  .ribbon .rb-dots i{width:13px;height:13px;border-radius:50%;border:2.5px solid var(--ink)}
  .ribbon .rb-dots i.d{background:var(--ink)}
  .ribbon.free{background:rgba(4,21,15,.75);color:rgba(244,255,246,.8)}
  .ribbon + .padc{padding-top:14px}

  /* ---------- the challenge's slots on the done screen ---------- */
  .slots{display:flex;justify-content:center;gap:12px;margin-top:4px}
  .slot{width:56px;height:56px;border-radius:17px;display:grid;place-items:center;font-size:27px;
    border:2.5px dashed rgba(244,255,246,.3);background:none;color:inherit;font-family:inherit;padding:0;cursor:pointer}
  .slot.d{border:2.5px solid var(--lime);background:rgba(200,255,61,.16);cursor:default}
  .slot.new{animation:slot-in .7s cubic-bezier(.3,1.6,.5,1) .35s both}
  @keyframes slot-in{from{transform:scale(.3);opacity:0}to{transform:none;opacity:1}}
  .slots-line{text-align:center;font-size:16px;color:var(--lime);margin:10px 0 14px}

  /* ---------- everything done: praise above the challenge, which stays ---------- */
  .alldone{display:flex;align-items:center;gap:14px;margin-top:16px;padding:14px 16px;border-radius:22px;
    background:rgba(200,255,61,.12);border:2px solid rgba(200,255,61,.35)}
  .alldone .mark{font-size:40px;line-height:1}
  .alldone b{display:block;font-size:20px;color:var(--lime)}
  .alldone span{display:block;font-size:14px;font-weight:700;opacity:.7;margin-top:2px}

  /* ---------- the challenge's standing ---------- */
  .presence[data-action]{cursor:pointer}
  .presence-foot{display:flex;justify-content:space-between;align-items:center;margin-top:14px}
  .presence-foot .you{margin-top:0}
  .to-status{font-size:15px;color:var(--lime);opacity:.85}
  #screen-status h1{margin:14px 0 2px}
  .slots.st{justify-content:flex-start;margin-top:12px}
  .slots.st .slot.d{cursor:pointer}
  .slots.st + .slots-line{text-align:left;margin-bottom:0}
  .spread{display:flex;align-items:flex-end;gap:5px;height:140px;margin-top:16px;
    border-bottom:2px solid rgba(244,255,246,.15)}
  .sp{flex:1 1 0;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center}
  .sp i{display:block;width:100%;border-radius:6px 6px 0 0;background:rgba(244,255,246,.3)}
  .sp.me i{background:var(--lime)}
  .spn{font-size:12px;opacity:.55;margin-bottom:4px;line-height:1}
  .sp.me .spn{color:var(--lime);opacity:1}
  .spread-foot{margin-top:12px;font-size:15px;font-weight:700;opacity:.75}
