:root {
  --bg: #121213; --panel: #121213; --panel2: #1e1e20; --line: #3a3a3c; --ink: #f8f8f8; --muted: #818384;
  --chalk: #f8f8f8; --chalkY: #e2c96b; --gold: #c9b458; --green: #538d4e; --red: #c0504d; --amber: #c9873d; --blue: #5b8fd6;
  --wood: #3a3a3c; --wood2: #3a3a3c;
  --tier: var(--gold);
  --disp: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --marker: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Zilla Slab', Georgia, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
#app { max-width: 1120px; margin: 0 auto; padding: 10px 16px 28px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 4px 0 10px; }
.brandWrap { min-width: 0; }
.brand { display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1; color: var(--ink); white-space: nowrap; }

.career { grid-column: 1 / -1; margin-top: 2px; font-size: 11px; font-weight: 800;  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.career b { color: var(--tier); }
.topRight { display: flex; align-items: center; gap: 8px; flex: none; }
.streak { font-weight: 700; font-size: 15px; line-height: 1; padding: 8px 9px; border-radius: 4px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.streak.cold { background: var(--panel); color: var(--muted); border-color: var(--line); }
.iconBtn { width: 36px; height: 36px; border-radius: 4px; background: transparent; border: 1px solid var(--line); font-size: 16px; }
.modes { display: flex; background: transparent; border-radius: 6px; padding: 3px; border: 1px solid var(--line); }
.mode { background: transparent; padding: 6px 10px; border-radius: 4px; color: var(--muted); font-weight: 700; font-size: 13px; }
.mode.on { background: var(--line); color: var(--ink); }

/* ---------- broadcast score bug ---------- */
.bug { border-radius: 6px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.bugMain { display: grid; grid-template-columns: 1fr auto auto; align-items: stretch; background: var(--panel2); }
.teams { display: flex; flex-direction: column; justify-content: center; padding: 8px 12px; gap: 2px; }
.teamRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--disp); font-weight: 800; font-size: 16px; line-height: 1; }
.teamRow .nm { display: flex; align-items: center; gap: 8px; }
.teamRow .sw { width: 6px; height: 18px; border-radius: 2px; }
.teamRow .city { font-family: var(--disp); font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
@media (max-width: 420px) { .teamRow .city { display: none; } }
.teamRow .pts { font-size: 26px; }
.teamRow .ball { font-size: 12px; }
.clockBox { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 12px; background: #19191a; border-left: 1px solid var(--line); font-family: var(--disp); font-weight: 800; font-size: 15px; line-height: 1.05; color: #d5dde6; }
.clockBox small { font-size: 14px; color: var(--muted); }
.ddBox { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 14px; background: var(--gold); color: #111; font-family: var(--disp); font-weight: 800; }
.ddBox .dd { font-size: 30px; line-height: 1; }
.ddBox .need { font-family: var(--disp); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.stakes { display: flex; align-items: center; gap: 9px; padding: 8px 12px; background: var(--bg); border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.25; }
.stakes .stage { flex: none; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: transparent; color: var(--gold); padding: 0; max-width: 40%; }
.defStrip { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 7px 12px 8px; background: var(--bg); border-top: 1px solid var(--line); }
.defStrip .tag { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.defStrip .cov { font-family: var(--disp); font-weight: 800; font-size: 16px; color: #fff; }
.defStrip .short { font-size: 12px; font-weight: 600; color: var(--muted); }
.spotLine { padding: 6px 12px; background: var(--bg); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.spotLine b { color: var(--ink); }
/* one-line bug while the replay and the grade are on screen */
.bugMini { display: none; align-items: center; gap: 7px; padding: 7px 12px 6px; background: var(--panel2); border-left: 4px solid var(--gold); font-family: var(--disp); font-weight: 800; font-size: 13px; line-height: 1; color: #d5dde6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bugMini b { font-weight: 800; color: var(--gold); }
.bugMini .dot { color: var(--muted); }
body.watch .bug { margin-bottom: 8px; }
body.watch .bug > * { display: none; }
body.watch .bug > .bugMini { display: block; }

/* ---------- field ---------- */
.layout { display: grid; gap: 14px; }
.layout > *, .seg > *, .players > *, .routes .grid > *, .readRow > * { min-width: 0; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.fieldWrap { position: relative; width: 100%; margin-inline: auto; border-radius: 6px; overflow: hidden; background: #1d2b23; border: 1px solid var(--line); }
.fieldWrap.tv { border-color: var(--line); }
#field { display: block; width: 100%; height: auto; touch-action: manipulation; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fieldMsg { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: 12px; color: rgba(255,255,255,.75); pointer-events: none; }
.banner { position: absolute; left: 10px; right: 10px; bottom: 12px; display: flex; align-items: stretch; pointer-events: none; animation: slideIn .35s cubic-bezier(.2,1.4,.4,1); }
.banner .bb { white-space: nowrap; font-family: var(--disp); font-weight: 800; font-size: 22px; line-height: 1; padding: 9px 14px 6px; background: #121213; color: #fff; border-left: 5px solid var(--c, var(--gold)); }
.banner .bs { align-self: flex-end; font-size: 11px; font-weight: 800; padding: 5px 10px; background: var(--c, var(--gold)); color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.banner.good { --c: var(--green); } .banner.bad { --c: var(--red); } .banner.td { --c: var(--gold); }
@keyframes slideIn { from { transform: translateX(-110%); } to { transform: none; } }
.hut { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--disp); font-weight: 800; font-size: 81px; color: #fff; background: rgba(0,0,0,.35); pointer-events: none; animation: hut .5s ease-out forwards; }
@keyframes hut { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }
.skip { position: absolute; right: 8px; top: 8px; background: rgba(11,18,32,.75); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18,18,19,.7); font-family: var(--marker); font-weight: 600; font-size: 18px; color: var(--chalk); }
.shake { animation: shake .4s; }
@keyframes shake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 2px); } 40%, 60% { transform: translate(6px, -1px); } }

/* ---------- edit panel ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.step { margin-bottom: 14px; }
.stepLabel { display: flex; align-items: center; gap: 8px; font-family: var(--disp); font-weight: 800; font-size: 16px; margin-bottom: 8px; line-height: 1; }
.stepLabel .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #111; font-size: 17px; }
.stepLabel .muted { font-family: var(--disp); font-size: 12px; }
.press { transition: transform .06s; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.seg button, .chips button, .players button, .routes .grid button, .readRow button, .paBtn, .btn { background: var(--panel2); border: 1px solid var(--line); color: var(--ink); transition: transform .06s, border-color .15s, background .15s; }
.seg button:active, .chips button:active, .players button:active, .routes .grid button:active, .readRow button:active, .paBtn:active, .btn:active { transform: scale(.97); }
.seg button { border-radius: 6px; padding: 8px 6px 7px; font-family: var(--disp); font-weight: 800; font-size: 16px; line-height: 1; }
.seg button small { display: block; font-family: var(--disp); font-weight: 600; font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.seg button.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chips button { flex: none; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 800; }
.chips button.on { border-color: var(--gold); color: var(--gold); }
.players { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.players button { position: relative; border-radius: 6px; padding: 7px 2px 6px; min-height: 58px; }
.players button .who { font-family: var(--disp); font-weight: 800; font-size: 16px; line-height: 1; }
.players button .job { font-size: 10px; font-weight: 700; color: var(--chalkY); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.players button .job.none { color: var(--red); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.players button.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 16%, transparent); }
.players button .rd { position: absolute; top: -8px; right: -5px; background: var(--gold); color: #111; font-family: var(--disp); font-weight: 800; font-size: 11px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;  }
.routes { margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.routes .for { font-family: var(--marker); font-weight: 600; font-size: 12px; color: var(--chalk); margin-bottom: 8px; }
.routes .rgLabel { font-family: var(--disp); font-weight: 800; font-size: 11px; color: var(--muted); margin: 9px 0 5px; }
.routes .rgLabel:first-of-type { margin-top: 0; }
.routes .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.routes .grid button { border-radius: 6px; padding: 5px 2px 6px; font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--panel2); }
.routes .grid button .ri { width: 30px; height: 30px; fill: none; stroke: var(--chalkY); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.routes .grid button.run .ri { stroke: #86efac; }
.routes .grid button.on { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.routes .grid button.run { color: #86efac; }
.routes .readFor { margin-top: 12px; }
.readRow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.readRow button { border-radius: 6px; padding: 6px 2px 4px; font-family: var(--disp); font-weight: 800; font-size: 14px; background: var(--panel2); }
.readRow button.on { border-color: var(--gold); color: var(--gold); }
.paRow { margin-top: 10px; }
.paBtn { width: 100%; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; padding: 10px 12px; font-size: 14px; }
.paBtn b { font-family: var(--disp); font-size: 15px; font-weight: 800; }
.paBtn span { color: var(--muted); font-size: 13px; font-weight: 700; }
.paBtn.on { border-color: #f9a8d4; background: #3b1d33; }
.paBtn.on b, .paBtn.on span { color: #f9a8d4; }
.snap { width: 100%; margin-top: 4px; background: var(--green); color: #fff; font-family: var(--disp); font-weight: 800; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: 17px 10px; border-radius: 6px; transition: transform .06s, filter .15s; }
.snap:active { transform: scale(.98); }
.snap small { display: none; }
.snap:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.hint { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 9px; min-height: 18px; }

/* ---------- result reveal ---------- */
.result { position: relative; overflow: hidden; }
.reveal { text-align: center; padding: 6px 0 4px; }
.gradeBox { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.grade { font-family: var(--serif); font-weight: 700; font-size: 96px; line-height: .9; color: var(--ink); font-variant-numeric: tabular-nums; }
.gradeOf { font-weight: 600; font-size: 20px; color: var(--muted); }
.stampWrap { height: 44px; display: grid; place-items: center; margin-top: 10px; }
.stamp { font-weight: 800; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; line-height: 1; color: #fff; background: var(--tier); border-radius: 4px; padding: 10px 16px; opacity: 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stamp.in { animation: stamp .3s ease-out forwards; }
@keyframes stamp { 0% { transform: scale(.85); opacity: 0; } 100% { transform: none; opacity: 1; } }
.coachLine { font-size: 15px; font-weight: 500; color: #c8c8ca; min-height: 22px; margin-top: 10px; opacity: 0; transition: opacity .4s; }
.coachLine.in { opacity: 1; }
.after > * { opacity: 0; transform: translateY(8px); }
.after.in > * { animation: rise .35s ease-out forwards; }
.after.in > *:nth-child(2) { animation-delay: .06s; } .after.in > *:nth-child(3) { animation-delay: .12s; } .after.in > *:nth-child(4) { animation-delay: .18s; }
.after.in > *:nth-child(5) { animation-delay: .24s; } .after.in > *:nth-child(6) { animation-delay: .3s; } .after.in > *:nth-child(7) { animation-delay: .36s; } .after.in > *:nth-child(8) { animation-delay: .42s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.meter { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.meter i { height: 14px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--green); }
.worked { color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.stats div { background: var(--panel2); border-radius: 6px; padding: 7px 4px 5px; text-align: center; }
.stats b { display: block; font-family: var(--disp); font-size: 19px; font-weight: 800; line-height: 1; }
.stats span { font-size: 11px; font-weight: 700; color: var(--muted); }
.why { list-style: none; padding: 0; margin: 10px 0; }
.why li { padding: 8px 0 8px 28px; position: relative; border-top: 1px solid var(--line); font-size: 14px; }
.why li::before { position: absolute; left: 2px; top: 7px; font-weight: 800; font-size: 15px; }
.why li.good::before { content: '✓'; color: var(--green); }
.why li.bad::before { content: '✗'; color: var(--red); }
.book { font-size: 13px; color: var(--muted); background: var(--panel2); border-radius: 6px; padding: 9px 11px; margin-bottom: 12px; }
.book b { color: var(--ink); }
.nameRow { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin-bottom: 12px; }
.nameRow .nameLbl { grid-column: 1 / -1; font-family: var(--disp); font-weight: 800; font-size: 13px; color: var(--muted); }
.nameRow input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; color: var(--ink); font-weight: 600; font-size: 16px; }
.nameRow input:focus { outline: none; border-color: var(--gold); }
.nameRow .playId { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 4px; }
.btn { border-radius: 6px; padding: 14px 8px; font-weight: 800; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }

.btn.next { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn.sub { padding: 11px 6px; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); }
.tomorrow { margin-top: 10px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
/* stats, why and the book line fold away under the buttons */
.breakdown { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.breakdown summary { list-style: none; cursor: pointer; }
.breakdown summary::-webkit-details-marker { display: none; }
.bdHead { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--disp); font-weight: 800; font-size: 13px; color: var(--ink); }
.bdMore { font-size: 15px; color: var(--muted); }
.bdMore::after { content: ' ▾'; }
.breakdown[open] .bdMore::after { content: ' ▴'; }
.breakdown .stats { margin-top: 10px; }
.tomorrow b { color: var(--ink); font-family: var(--disp); font-size: 13px; font-weight: 800; }

.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 16px; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-weight: 700; padding: 13px 16px; border-radius: 4px; z-index: 9; }

@media (max-width: 420px) {
  .brand { font-size: 25px; }
  .mode { padding: 6px 7px; font-size: 12px; }
  .topRight { gap: 6px; }
  .iconBtn { width: 32px; height: 32px; }
  .streak { padding: 7px 7px; font-size: 14px; }
  .grade { font-size: 80px; }
  .banner .bb { font-size: 18px; } .banner .bs { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- step-by-step builder ---------- */
.stepTabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.stepTabs button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px 6px; border-radius: 6px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-family: var(--disp); font-weight: 800; font-size: 14px; line-height: 1; }
.stepTabs button .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 14px; }
.stepTabs button.on { border-color: var(--ink); color: var(--ink); background: transparent; }
.stepTabs button.on .num { background: var(--ink); color: var(--bg); }
.stepTabs button.done { color: var(--ink); }
.stepTabs button.done .num { background: var(--green); color: #fff; }
.stepBody { animation: pop .18s ease-out; }
.subLbl { font-family: var(--disp); font-weight: 800; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.rgTabs { display: flex; gap: 6px; margin-bottom: 8px; }
.rgTabs button { flex: 1; padding: 6px 4px 4px; border-radius: 6px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-family: var(--disp); font-weight: 800; font-size: 12px; }
.rgTabs button.on { border-color: var(--chalkY); color: var(--chalkY); }
.readsBox { min-height: 40px; }
.readsHelp { font-size: 14px; color: var(--muted); margin-bottom: 9px; }
.readsHelp b { color: var(--ink); }
.readChips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.readChips button { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 2px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line);  min-width: 0; }
.readChips button:active { transform: translateY(3px); box-shadow: none; }
.readChips .rn { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #111; font-family: var(--disp); font-weight: 800; font-size: 14px; margin-bottom: 3px; }
.readChips b { font-family: var(--disp); font-weight: 800; font-size: 14px; line-height: 1; }
.readChips small { font-size: 10px; font-weight: 700; color: var(--chalkY); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.readChips button.picked { border-color: var(--gold); }
.readOrder { margin-top: 9px; font-size: 13px; font-weight: 700; color: var(--chalkY); text-align: center; }
.linkBtn { display: block; margin: 8px auto 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; }
.stepNav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.stepNav .btn { font-size: 13px; padding: 13px 6px; }
.stepNav #stepNext { grid-column: 2; }
.stepNav #stepNext.ready { border-color: var(--ink); color: var(--ink); }
.layout .snap { margin-top: 0; }

.linkBtn.inline { display: inline; margin: 0 0 0 8px; font-size: 13px; }

/* ---------- coach: fix my play ---------- */
.coachFix { margin-top: 10px; }
.fixBtn { width: 100%; background: transparent; }
.fixList:empty { display: none; }
.fixList { margin-top: 8px; display: grid; gap: 7px; }
.fixWait { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px; }
.fixItem { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
.fixText { flex: 1; min-width: 0; font-size: 14px; }
.fixWhy { font-size: 13px; color: #c8c8ca; margin-top: 3px; line-height: 1.35; }
.fixNums { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fixNums b { font-family: var(--disp); font-size: 13px; font-weight: 800; }
.fixItem .btn { flex: none; font-size: 17px; padding: 8px 12px 6px; }

/* ---------- final: locked result + share text ---------- */
.final { margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: var(--panel2); }
.finalHead { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.finalText { margin: 0; white-space: pre-wrap; word-break: break-all; font: 500 14px/1.5 'Libre Franklin', sans-serif; color: var(--ink); user-select: text; -webkit-user-select: text; }
.bestNote { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.bestNote:empty { display: none; }

/* ---------- reads: drag to reorder ---------- */
.readList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.readItem { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px 6px 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform .15s ease; }
.readItem.drag { transition: none; z-index: 2; border-color: var(--ink); box-shadow: 0 8px 20px rgba(0,0,0,.55); cursor: grabbing; }
.readItem .grip { flex: none; width: 18px; text-align: center; color: var(--muted); font-size: 15px; letter-spacing: -3px; }
.readItem .rn { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 800; font-size: 14px; }
.readItem .rl { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.readItem .rl b { font-size: 15px; font-weight: 800; }
.readItem .rl small { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.readItem .rfirst { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); padding-right: 4px; }
.readItem .rup { flex: none; width: 38px; height: 34px; border-radius: 4px; background: transparent; border: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.readItem .rup:active { transform: scale(.94); }

/* ---------- sheets: rank, sign up, leaderboard ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.65); animation: fadeIn .15s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: 100%; max-width: 420px; max-height: 86vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 20px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: sheetIn .2s ease-out; }
@keyframes sheetIn { from { transform: translateY(12px); opacity: 0; } }
.shHead { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rankBig { font-family: var(--serif); font-weight: 700; font-size: 76px; line-height: 1; margin-top: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rankOf { font-size: 15px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.shText { font-size: 15px; color: #c8c8ca; margin: 16px 0; }
.shBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.authForm { display: grid; gap: 10px; text-align: left; margin-top: 14px; }
.authForm label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.authForm input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 12px; color: var(--ink); font: 600 16px 'Libre Franklin', sans-serif; }
.authForm input:focus { outline: none; border-color: var(--ink); }
.authErr { min-height: 18px; font-size: 13px; font-weight: 600; color: #e07a77; }
.lb { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; }
.lb li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 30px; gap: 8px; align-items: center; padding: 8px 6px; border-top: 1px solid var(--line); font-size: 14px; }
.lb li.me { background: color-mix(in srgb, var(--gold) 18%, transparent); border-radius: 4px; font-weight: 800; }
.lb li.gap { display: block; text-align: center; color: var(--muted); }
.lbR { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lbN { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbL { font-size: 11px; color: var(--muted); white-space: nowrap; }
.lbG { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.lbFoot { font-size: 12px; color: var(--muted); margin-top: 12px; }
.authFine { font-size: 12px; color: var(--muted); text-align: center; margin-top: -2px; }

/* ---------- phones: the whole challenge on one screen, no scrolling ---------- */
.bugDef { display: none; }
.shCareer { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.shCareer b { color: var(--tier); }
@media (max-width: 899px) {
  body:not(.watch) #app { padding: 6px 12px 8px; }
  .top { margin-bottom: 8px; padding: 0 0 8px; }
  .career { display: none; }
  .brand { font-size: 24px; }
  .foot { display: none; }
  .layout { gap: 8px; }
  /* score bug: one line while drawing too */
  .bug { margin-bottom: 8px; }
  .bug > * { display: none; }
  .bug > .bugMini { display: block; padding: 9px 12px 8px; font-size: 14px; }
  /* the defense, under the situation */
  body:not(.watch) .bugDef { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
  .bugDef b { color: #fff; text-transform: uppercase; font-weight: 800; }
  /* builder: same height on every step so the field never jumps */
  #editPanel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 8px; padding: 8px; }
  #editPanel > .stepTabs, #editPanel > .stepBody { grid-column: 1 / -1; }
  .stepTabs { margin-bottom: 8px; }
  .stepTabs button { padding: 7px 4px 5px; font-size: 13px; }
  .stepTabs button .num { width: 18px; height: 18px; font-size: 12px; }
  .stepBody { height: 214px; overflow-y: auto; margin-bottom: 8px; }
  .subLbl { margin: 10px 0 6px; }
  .players { gap: 5px; }
  .players button { min-height: 44px; padding: 5px 2px 4px; }
  .players button .who { font-size: 15px; }
  .routes { margin-top: 8px; padding: 0; border: 0; background: none; animation: none; }
  .rgTabs { margin-bottom: 6px; }
  .rgTabs button { padding: 5px 4px 3px; }
  .routes .grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .routes .grid button { padding: 3px 1px 4px; font-size: 10.5px; line-height: 1.1; }
  .routes .grid button .ri { width: 24px; height: 24px; }
  .readsHelp, .readsBox .linkBtn { display: none; }
  .readList { gap: 4px; }
  .readItem { min-height: 30px; padding: 1px 6px; gap: 8px; }
  .readItem .rn { width: 22px; height: 22px; font-size: 12px; }
  .readItem .rup { height: 24px; width: 34px; }
  .paRow { margin-top: 6px; }
  .paBtn { padding: 7px 10px; }
  .stepNav { grid-column: 1; grid-template-columns: 1fr; margin: 0; }
  .stepNav .btn { height: 100%; font-size: 12px; padding: 8px 4px; }
  .stepNav #stepNext { grid-column: 1; }
  #editPanel > .snap { grid-column: 2; padding: 10px 8px; font-size: 18px; min-height: 48px; }
  .snap small { display: block; margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .snap small:empty { display: none; }
  #editPanel > .hint { display: none; }
}
/* short phones (iPhone SE): squeeze a little more */
@media (max-width: 899px) and (max-height: 600px) {
  body:not(.watch) #app { padding-top: 4px; padding-bottom: 6px; }
  .top { margin-bottom: 5px; padding-bottom: 5px; }
  .iconBtn { width: 30px; height: 30px; }
  body:not(.watch) .bugDef { margin-top: 3px; }
  .bug { margin-bottom: 6px; }
  .bug > .bugMini { padding: 6px 12px 5px; font-size: 13px; }
  .layout { gap: 6px; }
  #editPanel { padding: 6px; }
  .stepTabs { margin-bottom: 6px; }
  .stepTabs button { padding: 5px 4px 3px; }
  .stepBody { height: 176px; margin-bottom: 6px; }
  .players button { min-height: 38px; padding: 4px 2px 3px; }
  .routes { margin-top: 6px; }
  .rgTabs { margin-bottom: 4px; }
  .routes .grid { gap: 4px; }
  .routes .grid button { padding: 2px 1px 3px; }
  .routes .grid button .ri { width: 18px; height: 18px; }
  .readList { gap: 3px; }
  .readItem { min-height: 25px; }
  .readItem .rn { width: 20px; height: 20px; }
  .readItem .rup { height: 20px; }
  .paBtn { padding: 5px 10px; }
  #editPanel > .snap { min-height: 42px; padding: 7px; }
}
