/* Serve IQ v6. Light sports-media look: white page, navy header band, one bright blue accent, Archivo
   (Google Fonts) for type. The court is the one big picture: the visitor calls the serve on it, and the
   result and scouting card sit beside it like a broadcast stats box. method.css adds the method page. */

:root {
  --navy: #0b1d42;
  --navy-2: #12295c;
  --blue: #0a62d6;
  --sky: #19a4ec;
  --red: #d7263d;
  --green: #1f8a4c;
  --ink: #0e1726;
  --muted: #5b6577;
  --rule: #e3e7ee;
  --track: #edf0f5;
  --paper: #ffffff;
  --page: #f4f6f9;
  --deuce: #ffd23f;
  --ad: #ffffff;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, p, ol, ul { margin: 0; }
a { color: var(--blue); }
img { max-width: 100%; }
button { font: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.tnum, [data-h], [data-b] { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: #fff; color: var(--ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------ top bar and header band */
.topbar { background: var(--navy); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: #fff; font-weight: 900; font-style: italic; font-size: 22px; font-stretch: 88%; text-decoration: none; letter-spacing: -0.01em; }
.brand b { color: var(--sky); font-weight: 900; }
.topbar nav a { color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; margin-left: 24px; opacity: .85; }
.topbar nav a:hover, .topbar nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }

.status { margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: #fff3f4; color: var(--ink); border: 1px solid #f3c2c9; }

.head { background: var(--navy); color: #fff; padding: 26px 0 34px; border-top: 1px solid rgba(255, 255, 255, .08); }
.head h1 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.04; font-weight: 850; font-stretch: 86%; letter-spacing: -0.015em; max-width: 1000px; }
.head h1 em { font-style: italic; color: var(--sky); }
.sub { margin-top: 12px; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.4; max-width: 760px; color: #dbe5f5; }
.src { margin-top: 10px; font-size: 13px; color: #9fb0cc; }
.src a { color: #cfe0ff; }

/* ------------------------------------------------------------ picker bar */
.picker { background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.picker-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.picks { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 10px 0; }
.picks::-webkit-scrollbar { display: none; }
.pick {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; flex: none; cursor: pointer;
  border: 1.5px solid var(--rule); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 14px 4px 4px;
  font-weight: 800; font-size: 15px;
}
.pick img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--track); flex: none; }
.pick small { font-weight: 600; font-size: 12px; color: var(--muted); }
.pick:hover { border-color: var(--blue); }
.pick[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.pick[aria-pressed="true"] small { color: #c6d2e6; }
.find { position: relative; }
.find input {
  width: 200px; height: 36px; border: 1.5px solid var(--rule); border-radius: 6px; padding: 0 10px 0 32px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--page);
}
.find input:focus { border-color: var(--blue); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(10, 98, 214, .18); }
.find svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.find-msg { position: absolute; right: 0; top: 40px; font-size: 12px; color: var(--red); white-space: nowrap; }
.find-msg:empty { display: none; }
.seg { display: flex; flex: none; }
.seg button { appearance: none; font-weight: 700; font-size: 14px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); padding: 7px 14px; cursor: pointer; }
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ------------------------------------------------------------ main grid: court + stats */
.tool { padding: 28px 0 8px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel-h { font-size: 13px; font-weight: 700; color: var(--muted); }

.courtbox { padding: 16px 18px 14px; }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.ctrls .seg button { padding: 6px 12px; font-size: 13.5px; }
.prompt { margin-top: 14px; font-size: clamp(18px, 1.7vw, 21px); font-weight: 800; line-height: 1.3; min-height: 2.6em; }
#court { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: 4px; }
#court .lane-hit { pointer-events: none; }
#court .lane-hit.on { pointer-events: auto; cursor: pointer; }
#court .lane-hit.on { fill: rgba(232, 248, 74, .06); animation: lanepulse 1.3s ease-in-out infinite alternate; }
#court .lane-hit.on:hover { fill: rgba(232, 248, 74, .26); animation: none; }
#court text.q { fill: #e8f84a; font-size: 26px; }
@keyframes lanepulse { to { fill: rgba(232, 248, 74, .18); } }
.lanebtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.lanebtn {
  appearance: none; border: 2px solid var(--navy); background: #fff; color: var(--navy); border-radius: 8px;
  padding: 11px 6px; font-weight: 800; font-size: 15px; cursor: pointer;
}
.lanebtn:hover:not(:disabled) { background: #eef5ff; }
.lanebtn:disabled { cursor: default; opacity: .45; }
.lanebtn[aria-pressed="true"] { opacity: 1; background: var(--navy); color: #fff; }
.cap { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.side-col { display: grid; gap: 16px; align-content: start; }
.result { padding: 18px 20px; border-top: 4px solid var(--blue); }
.result .big { font-size: 15px; font-weight: 700; color: var(--muted); }
.result .big b { font-size: 64px; font-weight: 900; font-stretch: 86%; line-height: 1; color: var(--ink); margin-right: 6px; }
.result .lead { margin-top: 6px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.rbars { margin-top: 14px; display: grid; gap: 8px; }
.rb { display: grid; grid-template-columns: 132px 1fr 36px; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; }
.rt { height: 14px; background: var(--track); border-radius: 4px; position: relative; overflow: hidden; }
.rt b { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.rb.you .rt b { background: var(--blue); }
.rb.typ .rt b { background: var(--sky); }
.rb.rnd .rt b { background: #b7c1d1; }
.rv { text-align: right; font-weight: 800; font-size: 16px; }
.result .note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.result .line { margin-top: 10px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.result .line.good { color: var(--green); font-weight: 800; }
.result .line.chip { display: block; background: #fff4d1; border-left: 4px solid var(--deuce); padding: 8px 10px; border-radius: 4px; font-weight: 800; }
.ractions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  appearance: none; border: 2px solid var(--navy); background: #fff; color: var(--navy); border-radius: 8px;
  padding: 9px 14px; font-weight: 800; font-size: 14.5px; cursor: pointer;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn:hover { border-color: var(--blue); }
.gloss { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.card { padding: 18px 20px 16px; }
.card .wait { margin-top: 14px; font-size: 15px; color: var(--muted); }
.scout h3 { margin-top: 14px; font-size: 15px; font-weight: 800; }
.scout dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(0, 150px) 1fr; gap: 0 14px; font-size: 14.5px; }
.scout dt { color: var(--muted); font-weight: 700; padding: 7px 0; border-top: 1px solid var(--rule); }
.scout dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--rule); font-weight: 600; }
.scout .win { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.who { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 3px solid var(--navy); }
.who img, .who .ball { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--track); }
.who .ball { display: block; background: var(--deuce); border: 3px solid var(--navy); }
.who h2 { font-size: 24px; font-weight: 850; font-stretch: 88%; line-height: 1.08; }
.who p { margin-top: 3px; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------ explorer */
.explore { padding: 8px 0 48px; }
.explore-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scatter-box { margin-top: 16px; padding: 14px 16px; }
#scatter { display: block; width: 100%; height: auto; }
#scatter .dot.live { cursor: pointer; }
#scatter .dot.live:hover, #scatter .dot.on { stroke-width: 3.5; }
#scatter .dot.live:focus { outline: none; }
#scatter .dot.live:focus-visible { stroke: var(--sky); stroke-width: 4.5; }
@media (max-width: 600px) {
  #scatter .dot { r: 6px; }
  #scatter .dot.live { r: 13px; }
}
.scatter-read { margin-top: 8px; font-size: 15px; font-weight: 700; min-height: 1.5em; }
.scatter-cap { margin-top: 6px; font-size: 13px; color: var(--muted); }
.scatter-cap .k { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 0 5px 0 10px; vertical-align: -1px; }
.scatter-cap .k:first-child { margin-left: 0; }
.k-fill { background: var(--blue); }
.k-ring { background: #fff; border: 2.5px solid var(--red); }
.k-hollow { border: 1.5px solid #aab4c4; }

/* ------------------------------------------------------------ match model */
.video { padding: 36px 0 28px; }
.sec-h { font-size: clamp(26px, 3vw, 34px); font-weight: 850; font-stretch: 86%; line-height: 1.1; letter-spacing: -0.01em; }
.video .lede { margin-top: 8px; max-width: 760px; font-size: 16px; color: var(--muted); }
.pipe { display: block; width: 100%; height: auto; margin-top: 18px; max-width: 1000px; }
.pipe-list { display: none; list-style: none; counter-reset: step; padding: 0; margin: 16px 0 0; gap: 6px; }
.pipe-list li { counter-increment: step; display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; color: var(--muted); }
.pipe-list li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.pipe-list li:last-child::before { background: #e8f84a; color: var(--navy); }
.pipe-list b { color: var(--ink); }
@media (max-width: 600px) { .pipe { display: none; } .pipe-list { display: grid; } }
.claim { margin-top: 18px; max-width: 860px; display: grid; gap: 10px; font-size: 16.5px; line-height: 1.5; }
.claim b { font-weight: 850; }
.pts { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pt { background: #fff; border: 1px solid var(--rule); border-top: 4px solid var(--rule); border-radius: 6px; padding: 8px 10px; display: grid; gap: 2px; font-size: 13px; }
.pt.same { border-top-color: var(--green); }
.pt.blank { border-top-color: #b7c1d1; }
.pt.diff { border-top-color: var(--red); }
.pn { font-weight: 800; }
.ps { color: var(--muted); font-weight: 600; }
.pl { color: var(--muted); font-weight: 600; }
.pl b { color: var(--ink); font-weight: 800; }
.pt-tag { margin-top: 4px; font-size: 11.5px; font-weight: 800; }
.pt.same .pt-tag { color: var(--green); }
.pt.blank .pt-tag { color: var(--muted); }
.pt.diff .pt-tag { color: var(--red); }
.limits { margin-top: 16px; font-size: 13.5px; color: var(--muted); max-width: 860px; }

/* ------------------------------------------------------------ footer */
.site-footer { background: var(--navy); color: #c6d2e6; padding: 22px 0 26px; font-size: 13px; }
.site-footer a { color: #fff; }
.footer-links { margin-top: 6px; }
.footer-links a { margin-right: 16px; }

/* no data: hide the parts that need it */
.no-data .needs-data { display: none; }

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .picker-in { flex-direction: column; align-items: stretch; gap: 0; }
  .find { padding: 0 0 10px; }
  .pts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .find { flex: 1; }
  .find input { width: 100%; }
  .find-msg { left: 0; right: auto; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .head { padding: 20px 0 24px; }
  .courtbox, .result, .card { padding: 14px; }
  .pick { font-size: 14px; }
  .lanebtn { font-size: 14px; padding: 11px 4px; }
  .rb { grid-template-columns: 112px 1fr 30px; }
  .result .big b { font-size: 52px; }
  .scout dl { grid-template-columns: minmax(0, 118px) 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .rt b { transition: none; }
  #court .lane-hit.on { animation: none; fill: rgba(232, 248, 74, .14); }
}
