/* SharpLab HQ — Poké Hoops. Builds on hqstyle.css tokens; "ph" prefix. Mobile-first. */

.phhead { text-align: center; margin: 4px 0 18px; }
.phhead h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: .3px; }
.phhead p { color: var(--muted); margin: 0; font-size: 14px; }
.btn.big { font-size: 16px; padding: 12px 20px; }
.phuser { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phstep { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent2); font-weight: 700; }
.phmuted { color: var(--muted); font-size: 13px; }
img { image-rendering: pixelated; }

/* ── Intro ── */
.phintro { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 22px 20px; }
.phlegends { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; max-width: 420px; }
.phlegends img { width: 56px; height: 56px; filter: drop-shadow(0 4px 10px rgba(187,154,247,.35)); }
.phrules { text-align: left; color: var(--fg-2); font-size: 14px; line-height: 1.55; margin: 0; padding-left: 20px; }
.phrules b { color: var(--fg); }
.phfine { color: var(--faint); font-size: 12px; margin: 0; }

/* ── Draft ── */
.phdraft { max-width: 940px; margin: 0 auto; }
.phdrafthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.phprompt { font-size: 20px; font-weight: 800; margin-top: 2px; }
.phslots { display: flex; gap: 5px; flex-wrap: wrap; }
.phslot { width: 40px; height: 40px; border-radius: 10px; border: 1px dashed var(--line-strong); display: grid; place-items: center;
  color: var(--faint); font-weight: 800; font-size: 14px; background: var(--panel); }
.phslot.next { border: 1px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.phslot.full { border: 1px solid var(--line); background: var(--panel2); }
.phslot img { width: 36px; height: 36px; }

.phpack { display: grid; gap: 12px; grid-template-columns: 1fr; }
.phcard { display: grid; grid-template-columns: 88px 1fr; gap: 12px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-sm);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t); animation: ph-in .35s ease both; animation-delay: var(--d, 0ms); }
.phcard:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.phcard:active { transform: translateY(0) scale(.99); }
.phcard.legend { border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 9%, var(--panel)), var(--panel) 55%); }
.phcard.legend:hover { border-color: var(--gold); }
@keyframes ph-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.phspr { display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, var(--panel2), transparent 70%); border-radius: 12px; align-self: start; }
.phspr img { width: 88px; height: 88px; }
.phinfo { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.phtop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.phname { font-size: 18px; font-weight: 800; }
.phplays { font-family: var(--font-mono); font-size: 12px; font-weight: 800; color: var(--accent2); letter-spacing: .05em; white-space: nowrap; }
.phtypes { display: flex; gap: 5px; flex-wrap: wrap; }
.phtype { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  color: color-mix(in srgb, var(--tc) 80%, white); background: color-mix(in srgb, var(--tc) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); }
.pharch { color: var(--fg-2); font-size: 13px; font-style: italic; }
.phmove { font-size: 13px; }
.phmove b { color: var(--fg); }
.phfx { color: var(--accent); font-weight: 700; }
.phfxd { color: var(--muted); font-size: 12px; margin-top: 1px; }
.phbars { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.phbar { display: grid; grid-template-columns: 42px 1fr 22px; align-items: center; gap: 6px; font-size: 10.5px; font-family: var(--font-mono); color: var(--muted); }
.phbar i { height: 5px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.phbar i b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }
.phbar em { font-style: normal; text-align: right; color: var(--fg-2); }
.phblurb { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

@media (min-width: 760px) {
  .phpack { grid-template-columns: repeat(3, 1fr); }
  .phcard { grid-template-columns: 1fr; }
  .phspr { justify-self: stretch; }
  .phspr img { width: 120px; height: 120px; }
}

/* ── Lineup ── */
.phlineup, .phseason { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.phlineup .btn, .phseason > .btn { align-self: center; }
.phgroup { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); margin-bottom: -6px; }
.phgroup small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 6px; }
.phrows { display: flex; flex-direction: column; gap: 6px; }
.phcrow { display: grid; grid-template-columns: 30px 52px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px 6px 6px; cursor: pointer; user-select: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.phcrow:hover { border-color: var(--accent); }
.phcrow:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.phcrow.sel { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); transform: scale(1.01); }
.phcrow.bench { background: var(--panel); }
.phcrow img { width: 52px; height: 52px; }
.phrpos { font-family: var(--font-mono); font-weight: 800; color: var(--accent2); font-size: 13px; text-align: center; }
.phcrow.bench .phrpos { color: var(--muted); }
.phrmain { min-width: 0; }
.phrname { font-weight: 800; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.phrsub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.phrsub b { color: var(--fg-2); }
.phrsub .fit { color: var(--green); font-weight: 700; }
.phrsub .off { color: var(--orange, var(--warn)); font-weight: 700; }
.phmini { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.phmini span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 22px; gap: 2px; }
.phmini i { display: block; width: 8px; border-radius: 3px 3px 1px 1px; background: linear-gradient(0deg, var(--accent), var(--accent2)); }
.phmini small { font-size: 8.5px; font-family: var(--font-mono); color: var(--faint); line-height: 1; }
.phbacks { grid-column: 2 / -1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.phbacks > span { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-right: 2px; }
.phbk { font: inherit; font-family: var(--font-mono); font-size: 12px; font-weight: 800; min-width: 38px; padding: 5px 6px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel2); color: var(--fg-2); }
.phbk:hover { border-color: var(--accent); }
.phbk.on { background: var(--accent); border-color: var(--accent); color: var(--bg, var(--bg)); }

/* ── Season reveal ── */
.phseason { text-align: center; align-items: stretch; }
.phrec { font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -1px; }
.phrec i { font-style: normal; color: var(--faint); margin: 0 6px; }
.phticker { font-size: 14px; color: var(--fg-2); min-height: 22px; font-variant-numeric: tabular-nums; }
.phticker.hot { color: var(--gold); }
.phhot { color: var(--gold); font-weight: 800; }
.phstrip { display: grid; grid-template-columns: repeat(41, 1fr); gap: 2px; }
.phstrip b { aspect-ratio: 1; border-radius: 2px; background: var(--panel2); transition: background .15s; }
.phstrip b.w { background: var(--green); }
.phstrip b.l { background: var(--red); }
.phstrip b.w, .phstrip b.l { cursor: pointer; } .phstrip b.on { outline: 2px solid var(--fg); outline-offset: 1px; }
.phfive, .phbench { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.phfive figure, .phbench figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.phfive img { width: 56px; height: 56px; }
.phbench img { width: 40px; height: 40px; opacity: .9; }
.phfive figcaption { font-family: var(--font-mono); font-size: 11px; font-weight: 800; color: var(--accent2); }
.phbench figcaption { font-size: 11px; color: var(--muted); max-width: 120px; text-align: center; }
.phbench { gap: 10px; margin-top: -6px; }

.phgrade { font-size: clamp(32px, 9vw, 54px); font-weight: 900; line-height: 1.1; margin: 6px 0 2px; }
.phgrade.perfect { background: linear-gradient(90deg, var(--gold), var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phgrade.great { color: var(--gold); }
.phgrade.good { color: var(--green); }
.phgrade.meh { color: var(--accent); }
.phgrade.bad { color: var(--red); }
.phnew { color: var(--gold); font-weight: 800; }
.phrank { color: var(--accent2); font-weight: 700; font-size: 13px; }
.phcoins { color: var(--gold); font-weight: 800; }
@keyframes ph-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.pop { animation: ph-pop .55s ease both; }
.phstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; text-align: left; }
.phstat { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.phstat > span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.phstat > b { font-size: 18px; font-variant-numeric: tabular-nums; }
.phstat small { color: var(--muted); font-size: 12px; }
.phstat:first-child { grid-column: 1 / -1; }
.phts { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.phts img { width: 48px; height: 48px; }
.phts b { color: var(--fg); font-size: 15px; }
.phactions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ── Leaderboard ── */
.phlb { max-width: 620px; margin: 24px auto 0; }
.phlbhead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent2); text-align: center; margin-bottom: 10px; }
.phlbempty { text-align: center; color: var(--muted); font-size: 13px; }
.phlblist { display: flex; flex-direction: column; gap: 6px; }
.phlbrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 52px 46px; align-items: center; gap: 8px; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; font-size: 14px; transition: border-color var(--t); }
.phlbrow:hover { border-color: var(--accent); text-decoration: none; }
.phlbrow.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.phlbrank { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phlbname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phlbfive { display: flex; }
.phlbfive img { width: 28px; height: 28px; margin-left: -4px; }
.phlbrec { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; text-align: right; }
.phlbgrade { font-size: 12px; font-weight: 800; color: var(--accent); text-align: right; }

@media (max-width: 480px) {
  header { padding: 12px 16px; }
  .phrec { font-size: 52px; }
  .phlbfive img { width: 22px; height: 22px; margin-left: -5px; }
  .phlbrow { grid-template-columns: 26px minmax(0, 1fr) auto 46px 40px; gap: 6px; font-size: 13px; }
  .phfive img { width: 48px; height: 48px; }
  .phcrow { grid-template-columns: 26px 44px minmax(0, 1fr); gap: 4px 8px; }
  .phcrow img { width: 44px; height: 44px; }
  .phmini { grid-column: 2 / -1; height: 36px; gap: 6px; }
  .phmini span { width: auto; flex: 1; }
  .phmini i { width: 100%; max-width: 16px; }
  .phbk { flex: 1; min-width: 0; }
  .phbacks > span { width: 100%; }
}

.cardtoast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300; background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 18px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

@media (prefers-reduced-motion: reduce) {
  .phcard, .pop { animation: none; }
  .phcrow { transition: none; }
}
.phlbtabs { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.phlbtab { font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border, #333); background: none; color: var(--muted, #888); cursor: pointer; }
.phlbtab.on { color: var(--fg); border-color: var(--accent); }

/* ── head-to-head ── */
.phvs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; }
.phvs > i { font-style: normal; font-weight: 800; opacity: .6; }
.phvs .phfive { flex-wrap: wrap; justify-content: center; }
.phvs .phfive img { width: 40px; height: 40px; }
.phbenchfig { opacity: .7; }
.phgames { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.phgame { border-radius: 10px; padding: 8px 10px; background: var(--panel2); border-left: 4px solid; animation: phin .35s ease-out; }
.phgame.w { border-color: var(--green, var(--ok)); } .phgame.l { border-color: var(--red, var(--bad)); }
.phgame span { font-size: 12px; opacity: .7; margin-right: 6px; } .phgame b { font-size: 18px; }
.phgame small { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.phchals { display: flex; flex-wrap: wrap; gap: 6px; }
.phchal { padding: 4px 10px; border-radius: 999px; background: var(--panel2); font-size: 13px; text-decoration: none; }
@keyframes phin { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 560px) { .phvs { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .phgame { animation: none; } }

/* ── live duel ── */
.phduelcta { display: grid; gap: 10px; margin-top: 14px; }
.phinput { background: var(--panel2); border: 1px solid var(--line-strong); color: var(--fg); border-radius: var(--r); padding: 10px 12px; font: inherit; min-width: 0; }
.phinput.code { width: 92px; text-transform: uppercase; letter-spacing: .2em; font-family: var(--font-mono); text-align: center; }
.phlobby { display: grid; gap: 12px; text-align: center; justify-items: center; }
.phcodebig { font-family: var(--font-mono); font-size: 64px; font-weight: 800; letter-spacing: .25em; color: var(--accent); }
.phwait { color: var(--muted); } .phok { color: var(--green); }
.phdots::after { content: "…"; animation: phdots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; }
@keyframes phdots { 0% { width: 0 } 100% { width: 1.2em } }
.phduelslots { display: grid; gap: 4px; } .phduelslots small { color: var(--muted); font-size: 11px; }
.phduelslots .phslot { width: 32px; height: 32px; }
.phlocked { display: flex; gap: 16px; align-items: center; justify-content: center; padding: 24px; background: var(--panel); border-radius: var(--r-lg); }
.phline { background: var(--panel2); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 10px; text-align: left; }
.phlinehead { font-weight: 800; } .phlinehead small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.phodds { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 14px; }
.phodds th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: right; } .phodds th:first-child { text-align: left; }
.phodds td { padding: 6px 0; text-align: right; border-top: 1px solid var(--line); } .phodds td:first-child { text-align: left; font-family: inherit; }
.phodds .phbook { color: var(--gold); font-weight: 800; }
.phlinemeta { color: var(--fg-2); font-size: 13px; }
.phlinecols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.phex { display: grid; grid-template-columns: 34px 1fr 38px; gap: 6px; align-items: center; font-size: 12px; font-family: var(--font-mono); }
.phex i { height: 8px; background: var(--panel); border-radius: 4px; overflow: hidden; } .phex b { display: block; height: 100%; }
.phex.a b { background: var(--accent); } .phex.b b { background: var(--accent2); } .phex em { font-style: normal; text-align: right; color: var(--muted); }
.phmvp { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; align-items: center; font-size: 13px; }
.phmvp img { width: 30px; height: 30px; image-rendering: pixelated; } .phmvp small { color: var(--muted); } .phmvp em { font-style: normal; font-family: var(--font-mono); }
.phbetbox { display: grid; gap: 10px; }
.phsides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.phside { background: var(--panel2); border: 2px solid var(--line); border-radius: var(--r); padding: 10px; color: var(--fg); display: grid; gap: 2px; cursor: pointer; font: inherit; }
.phside span { font-family: var(--font-mono); font-size: 20px; color: var(--gold); font-weight: 800; } .phside.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.phlinewrap summary { cursor: pointer; color: var(--fg-2); font-size: 14px; padding: 6px 0; }
.phyou { background: var(--accent-soft); color: var(--accent); border-radius: var(--r-pill); padding: 1px 8px; font-size: 11px; }
.phbet { font-size: 14px; } .phbet.pos { color: var(--green); } .phbet.neg { color: var(--red); }
button.phgame { color: var(--fg); font: inherit; text-align: left; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; }
.phgame em { display: block; font-style: normal; font-size: 11px; color: var(--accent); margin-top: 4px; }
.phgame.on { box-shadow: 0 0 0 2px var(--accent); }
.phdetail { background: var(--panel2); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 12px; text-align: left; scroll-margin-top: 12px; }
.phdetailhead { display: flex; align-items: center; gap: 8px; } .phdetailhead button { margin-left: auto; padding: 4px 10px; }
.phflow { width: 100%; height: 150px; background: var(--panel); border-radius: var(--r); }
.phflow .z { stroke: var(--line-strong); stroke-width: 1; } .phflow .q { stroke: var(--line); stroke-dasharray: 3 4; }
.phflow .a { fill: color-mix(in srgb, var(--accent) 55%, transparent); } .phflow .b { fill: color-mix(in srgb, var(--accent2) 55%, transparent); }
.phflowkey { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); } .phflowkey .a { color: var(--accent); } .phflowkey .b { color: var(--accent2); }
.phboxscroll { overflow-x: auto; }
.phbox table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--font-mono); white-space: nowrap; }
.phbox th { color: var(--muted); font-size: 11px; font-weight: 600; text-align: right; padding: 4px 6px; }
.phbox td { text-align: right; padding: 4px 6px; border-top: 1px solid var(--line); }
.phbox td:first-child { text-align: left; font-family: system-ui, sans-serif; display: flex; align-items: center; gap: 4px; }
.phbox td img { width: 24px; height: 24px; image-rendering: pixelated; } .phbox td small { color: var(--muted); } .phbox tr.bn td { color: var(--fg-2); }
.phplays { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.phplays li { display: grid; grid-template-columns: 34px 28px 1fr auto; gap: 6px; align-items: center; font-size: 13px; padding: 4px 8px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 6px; }
.phplays li.s1 { border-color: var(--accent2); } .phplays img { width: 28px; height: 28px; image-rendering: pixelated; }
.phplays li > span:first-child { color: var(--muted); font-family: var(--font-mono); font-size: 11px; } .phplays em { font-style: normal; font-family: var(--font-mono); color: var(--muted); }
@media (max-width: 560px) { .phlinecols { grid-template-columns: 1fr; } .phcodebig { font-size: 48px; } }
/* keep the drill-down inside the card on phones: grid children default to min-width:auto and stretch to the table */
.phseries > *, .phdetail, .phdetail > *, .phbox { min-width: 0; max-width: 100%; }
.phdetail { overflow: hidden; }
.phplays li span { font-family: system-ui, sans-serif; white-space: normal; }
.phplays li > span:first-child { font-family: var(--font-mono); }
.phvs .phfive, .phtip .phfive, .phlobby .phfive { gap: 3px; flex-wrap: nowrap; }
.phvs .phfive img, .phtip .phfive img, .phlobby .phfive img { width: 34px; height: 34px; }
.phvs .phfive figure, .phlobby .phfive figure { margin: 0; min-width: 0; }

/* ── draft: your picks so far ── */
.phroster { margin-top: 14px; } .phroster summary { cursor: pointer; color: var(--fg-2); padding: 8px 0; }
.phpick { cursor: default; grid-template-columns: 44px 1fr auto; }
.phcover { margin-left: auto; display: inline-flex; gap: 4px; font-family: var(--font-mono); font-size: 11px; }
.phcover span { padding: 1px 5px; border-radius: 4px; } .phcover .fit { background: var(--green-soft); color: var(--green); } .phcover .off { background: var(--panel2); color: var(--faint); }
.phroster .phgroup { display: flex; align-items: center; gap: 8px; }
/* ── one game vs a bot ── */
.phlevels { display: flex; flex-wrap: wrap; gap: 8px; }
.phlive { display: grid; gap: 12px; }
.phsb { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; background: var(--panel2); border-radius: var(--r-lg); padding: 10px; position: sticky; top: 0; z-index: 60; }
.phsb b { display: block; font-size: 40px; font-weight: 800; font-family: var(--font-mono); } .phsb small { color: var(--muted); font-size: 12px; }
.phclock { font-family: var(--font-mono); font-weight: 800; color: var(--accent); } .phclock small { display: block; font-weight: 400; font-size: 10px; margin-top: 4px; }
.phfloor { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .phfloor > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; align-items: center; }
.phfloor img { width: 34px; height: 34px; image-rendering: pixelated; }
.phact { flex-basis: 100%; text-align: center; font-size: 11px; color: var(--gold); }
.phbook { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.phcall { display: grid; grid-template-columns: 36px 1fr; gap: 6px; align-items: center; text-align: left; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 6px; color: var(--fg); font: inherit; cursor: pointer; }
.phcall img { width: 36px; height: 36px; image-rendering: pixelated; } .phcall b { display: block; font-size: 13px; } .phcall small { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; }
.phcall.off { opacity: .45; cursor: default; } .phcall.q { border-color: var(--gold); opacity: 1; }
.phcall:not(.off):hover { border-color: var(--accent); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.warn { border-color: var(--gold); color: var(--gold); }
.phfeed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow-y: auto; }
.phfeed li { font-size: 14px; padding: 4px 8px; border-radius: 6px; } .phfeed li span { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.phfeed li.dim { color: var(--muted); } .phfeed li.big { background: var(--accent-soft); } .phfeed li.call { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.phfeed li.s0, .phfeed li.s1 { border-left: 3px solid var(--accent); } .phfeed li.s1 { border-left-color: var(--accent2); }
.phsb .s0 small { color: var(--accent); } .phsb .s1 small { color: var(--accent2); }
.phfeed li.to { color: var(--accent2); } .phfeed li.q { text-align: center; color: var(--accent); font-weight: 700; }
@media (max-width: 400px) { .phbook { grid-template-columns: 1fr; } }

/* ── battle (beta) ── */
.pbcta { border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); }
.pbexit { justify-self: start; padding: 4px 14px; font-size: 13px; min-height: 40px; }
.pbmoves { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.pbmv { display: inline-grid; padding: 2px 7px; border-radius: 6px; border-left: 3px solid var(--tc); background: var(--panel2); line-height: 1.15; }
.pbmv b { font-size: 12px; } .pbmv small { font-size: 10px; color: var(--muted); }
.pbroster { display: grid; gap: 6px; }
.pbmini { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; color: var(--fg); font: inherit; }
.pbmini img { width: 44px; height: 44px; image-rendering: pixelated; } .pbmini small { color: var(--muted); }
.pbmini.pick { cursor: pointer; } .pbmini.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.pbsetup, .pbbattle { display: grid; gap: 12px; }
.pbhint { font-size: 14px; display: flex; gap: 8px; align-items: center; } .pbhint small { color: var(--muted); }
.pbclock { display: flex; gap: 3px; justify-content: center; margin-top: 4px; } .pbclock i { width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-strong); }
.pbclock i.on { background: var(--gold); border-color: var(--gold); }
.pbwx { text-align: center; }
.pbcourt { display: grid; gap: 10px; background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%), var(--panel2); border-radius: var(--r-lg); padding: 10px 6px; }
.pbrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pbp { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); min-width: 0; text-align: center; }
.pbp.ball { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }
.pbp.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); } .pbp[data-bcourtslot] { cursor: pointer; }
.pbp img { width: 48px; height: 48px; image-rendering: pixelated; }
.pbball { position: absolute; top: 2px; right: 4px; font-size: 14px; }
.pbpn { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pbtypes { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; } .pbtypes .phtype { font-size: 9px; padding: 0 4px; }
.pbstam { width: 100%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; } .pbstam i { display: block; height: 100%; background: var(--green); }
.pbstg { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; font-size: 9px; font-family: var(--font-mono); }
.pbstg .up { color: var(--green); } .pbstg .dn { color: var(--red); }
.pbopen { font-size: 10px; color: var(--gold); letter-spacing: 1px; } .pbguard { font-size: 9px; color: var(--faint); }
.pblast { display: grid; gap: 3px; font-size: 14px; background: var(--panel2); border-radius: var(--r); padding: 8px 10px; }
.pblast .big, .pblog .big { color: var(--green); } .pblast .neg, .pblog .neg { color: var(--red); } .pblast .call, .pblog .call { color: var(--gold); }
.pblast .dim, .pblog .dim { color: var(--muted); } .pblast .q, .pblog .q { color: var(--accent); font-weight: 700; } .pblast .pick { color: var(--fg-2); font-size: 13px; }
.pbo { color: var(--accent); font-weight: 700; } .pbd { color: var(--accent2); font-weight: 700; }
.pbchoose { display: grid; gap: 10px; } .pbgrp { display: grid; gap: 6px; }
.pbopts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pbopt { text-align: left; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 10px; color: var(--fg); font: inherit; cursor: pointer; display: grid; gap: 2px; }
.pbopt.mv { border-left: 4px solid var(--tc); } .pbopt b { font-size: 14px; } .pbopt small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.pbopt em { font-style: normal; font-size: 11px; font-weight: 700; } .pbopt:hover { border-color: var(--accent); }
.pbsubs { display: grid; gap: 8px; }
.pblog summary, .pbhelp summary, .pbsubs summary { cursor: pointer; color: var(--fg-2); padding: 10px 0; min-height: 24px; }
.pblog { font-size: 13px; } .pbturn { padding: 4px 0; border-bottom: 1px solid var(--line); display: grid; gap: 1px; }
.pbhelp ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--fg-2); line-height: 1.5; }
@media (max-width: 380px) { .pbopts { grid-template-columns: 1fr; } }
/* header scrolls away on game screens so the scoreboard can stick */
body:has(.phsb) header { position: static; }
.pbhint input { width: 20px; height: 20px; accent-color: var(--accent); }
.pbbadge { font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--accent); color: #11121a; border-radius: 4px; padding: 1px 5px; }
.pbside { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding-left: 4px; }
.pblegend { font-size: 12px; }
.phclock > small + .pbclock + small, .phclock .pbclock + small { display: block; font-size: 10px; }
.pbrecap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pbscorer { display: flex; align-items: center; gap: 6px; font-size: 14px; } .pbscorer img { width: 28px; height: 28px; image-rendering: pixelated; } .pbscorer b { margin-left: auto; font-family: var(--font-mono); }
.phfive.named { gap: 6px; } .phfive.named figure { width: 58px; }
.phfive.named figcaption { text-align: center; line-height: 1.15; max-width: 58px; }
.phfive.named figcaption small { display: block; font-family: system-ui, sans-serif; font-weight: 600; font-size: 10px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phvsline { margin: 4px 0; }
.phduelleave { margin-top: 14px; font-size: 13px; }
.phnet { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 5px 12px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--gold); color: var(--gold); font-size: 12px; pointer-events: none; }
.phnet[hidden] { display: none; }
.pbmini:disabled { opacity: .45; cursor: not-allowed; } .pbopt.iso { border-left: 4px solid var(--accent2); }
.pbcode { font: 800 44px/1 var(--font-mono); letter-spacing: 6px; text-align: center; color: var(--gold); }
.pbwait { text-align: center; padding: 18px; background: var(--panel2); border-radius: var(--r); color: var(--fg-2); }
.pbready { color: var(--green); font-weight: 600; text-transform: none; letter-spacing: 0; }
/* turn replay */
.pbcourt { position: relative; overflow: visible; }
.pbfly { position: absolute; left: 0; top: 0; font-size: 22px; pointer-events: none; z-index: 5; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.pbplaying .pbball { visibility: hidden; }
.pbfloat { position: absolute; z-index: 6; pointer-events: none; white-space: nowrap; font-weight: 800; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); opacity: 0; }
.pbfloat.mv { background: var(--tc); color: #11121a; border: 0; }
.pbfloat.sch { color: var(--accent); } .pbfloat.good { color: var(--green); } .pbfloat.bad { color: var(--red); } .pbfloat.up { color: var(--accent); } .pbfloat.dim { color: var(--muted); }
.pbfloat.big { font-size: 20px; background: none; border: 0; }
.pbin { animation: pbin .25s ease-out; } @keyframes pbin { from { opacity: 0; transform: translateY(4px); } }
.pbskip { justify-self: end; padding: 4px 14px; min-height: 36px; font-size: 13px; }
/* the floor: top-down half court */
.pbfloor { position: relative; aspect-ratio: 10 / 9; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, #8a6236, #a8773f 60%, #8a6236); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); touch-action: manipulation; }
.pbfloor svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(255,255,255,.6); stroke-width: .6; }
.pbfloor svg .paint { fill: rgba(122,162,247,.22); } .pbfloor svg .board { stroke: #fff; stroke-width: 1.2; }
.pbhoop { position: absolute; width: 26px; height: 14px; border: 3px solid var(--warn); border-radius: 50%; transform: translate(-50%, -50%); }
.pbtok { position: absolute; width: 48px; display: grid; justify-items: center; transform: translate(-50%, -50%); z-index: 2; }
.pbtok img { width: 44px; height: 44px; image-rendering: pixelated; border-radius: 50%; background: rgba(17,18,26,.55); box-shadow: 0 0 0 3px var(--ring-c), 0 3px 6px rgba(0,0,0,.4); }
.pbtok.me { --ring-c: var(--accent); } .pbtok.op { --ring-c: var(--bad); }
.pbtok b { font-size: 10px; line-height: 1.1; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; margin-top: 2px; }
.pbtok .pbball { position: absolute; right: -6px; top: 26px; font-size: 18px; } .pbtok .pbst { position: absolute; left: -4px; top: -4px; font-style: normal; font-size: 14px; }
.pbtok.ball img { box-shadow: 0 0 0 3px var(--ring-c), 0 0 0 6px var(--warn), 0 3px 6px rgba(0,0,0,.4); }
.pbtag { position: absolute; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.pbplaying .pbtok .pbball { visibility: hidden; }
.pbtok em { font-style: normal; font-size: 9px; font-weight: 800; line-height: 1.2; padding: 0 3px; border-radius: 3px; margin-top: 1px; white-space: nowrap; }
.pbtok em.up { background: var(--accent); color: #11121a; } .pbtok em.dn { background: var(--bad); color: #11121a; }
.pbcards > summary { cursor: pointer; color: var(--fg-2); padding: 8px 0; }
.pblast .read, .pblog .read { font-size: 13px; } .pblast .pos, .pblog .pos { color: var(--green); } .pblast .neg.read, .pblog .neg.read { color: var(--red); }
.pbodds { color: var(--muted); font-weight: 400; }
.pbtok { cursor: pointer; } .pbtok.peek img { box-shadow: 0 0 0 3px var(--ring-c), 0 0 0 6px #fff, 0 3px 6px rgba(0,0,0,.4); }
.pbpeekhint { font-size: 12px; text-align: center; }
.pbpeek { position: relative; display: grid; gap: 8px; background: var(--panel2); border-radius: var(--r); padding: 10px; border-left: 4px solid var(--accent); }
.pbpeek.op { border-left-color: var(--bad); } .pbpeek .phtop { display: flex; gap: 10px; align-items: center; justify-content: start; }
.pbpeek img { width: 56px; height: 56px; image-rendering: pixelated; } .pbpeekx { position: absolute; right: 6px; top: 6px; padding: 2px 10px; min-height: 32px; }
.pbpeek .up { color: var(--accent); } .pbpeek .dn { color: var(--bad); }
