/* Player Records (read-only). Reuses the Live View look (live.css); only what is new lives here. */
.pstand main { max-width: 1000px; }
.pshero { grid-template-columns: minmax(0, 1fr); }
.pshero .hero-text { padding: 22px 24px; }
.pshero h1 { font-size: clamp(30px, 5vw, 46px); }
.pshero .evnote { max-width: 60ch; }
.notrating { margin: 14px 0 0; padding: 10px 14px; max-width: 60ch; border: 1px solid var(--line-2); border-left: 3px solid var(--cyan); border-radius: var(--r); background: #0b1424; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.notrating b { color: #fff; }
.psfacts { margin: 0 0 16px; padding: 14px 18px; border: 1px solid #25355a; border-radius: 3px; background: linear-gradient(180deg, rgba(14,22,40,.96), rgba(9,15,28,.96)); }

/* The record book carries the champion card's language, quietly: one Archive film band under the page title, a thin silver
   inset frame around an open history, gold only for championships (the count, the label and the small 8-ball seal), silver
   and slate for every other finish, blue only for controls. */
.pshero::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 8px; height: 4px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #1f2c47 0 10px, transparent 10px 21px); }
.ptable { table-layout: auto; }
.ptable th.num, .ptable td.num { white-space: nowrap; }
.ptable td.num.zero { color: var(--dim); }
.ptable td.ch.title { color: var(--gold); font-weight: 700; }
.seal { flex: none; display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; filter: drop-shadow(0 0 4px rgba(226,189,95,.3)); }
.ptable .pname { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 4px 6px 4px 0; text-align: left; background: none; border: 0; border-radius: 0; color: var(--ink); }
.ptable .pname:hover:not(:disabled) { background: none; border: 0; }
.ptable .pname:hover .nm { text-decoration: underline; text-decoration-color: var(--cyan); text-underline-offset: 4px; }
.ptable .pname .nm { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.ptable .pid { display: block; margin-top: -8px; padding-bottom: 4px; font-size: 13px; color: var(--muted); }
.ptable .nmplain, .ptable .hb { display: none; }
.chev { width: 8px; height: 8px; flex: none; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(45deg) translate(-2px, -2px); }
.isopen .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.ptable tr.hist td { padding: 2px 12px 16px; background: none; border-bottom: 1px solid var(--line); }
.ptable tr.hist[hidden] { display: none; }
/* the open history: the Archive's double frame, a dark edge with a thin silver line inside */
.hframe { padding: 14px 18px 6px; border: 1px solid #0a1120; border-radius: 2px; background: #08101f; box-shadow: inset 0 0 0 1px rgba(141,155,179,.24); }
.career { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.career .ct { display: inline-flex; align-items: center; }
.career .ct.title { color: var(--gold); }
.career .ct b { margin-left: 8px; font-size: 16px; letter-spacing: .02em; color: var(--ink); }
.career .ct.title b { color: var(--gold); }
.career .dot { width: 5px; height: 5px; background: var(--silver-lo); transform: rotate(45deg); }
.hlist { list-style: none; margin: 0; padding: 0; }
.hrow { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; grid-template-areas: "date name res" "date meta meta" "date as as" "date link link"; gap: 0 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.hrow:first-child { border-top: 0; }
.hdate { grid-area: date; font-size: 14px; color: var(--muted); white-space: nowrap; }
.hname { grid-area: name; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em; color: var(--ink); overflow-wrap: anywhere; }
.hres { grid-area: res; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.hrec { min-width: 3.2em; text-align: right; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink-2); }
.fin { display: inline-flex; align-items: center; padding: 2px 8px 1px; border: 1px solid var(--silver-lo); border-radius: 1px; font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.fin .seal { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.fin.title { color: var(--gold); border-color: var(--gold-dim); background: rgba(226,189,95,.07); }
.fin.plain { padding: 0; border: 0; font-family: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hmeta { grid-area: meta; margin-top: 2px; font-size: 13px; color: var(--muted); }
.hrow .as { grid-area: as; display: block; margin-top: 2px; font-size: 13px; color: var(--muted); font-style: italic; }
.hlink { grid-area: link; justify-self: start; display: inline-flex; align-items: center; min-height: 32px; margin-top: 2px; font-size: 14px; color: #8dbbff; text-decoration: none; }
.hlink:hover { color: #b8d5ff; text-decoration: underline; text-underline-offset: 3px; }
.ptable tbody tr:not(.hist):last-child td { border-bottom: 0; }

.howto h2 { font-size: 22px; }
.howto .rlist { list-style: none; margin: 10px 0 0; padding: 0; }
.howto .rlist li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--line); color: var(--ink-2); line-height: 1.5; }
.howto .rlist li:first-child { border-top: 0; }
.howto .rlist li::before { content: ""; position: absolute; left: 4px; top: 1.05em; width: 7px; height: 7px; background: var(--silver-hi); transform: rotate(45deg); }
.howto .rlist b { color: var(--ink); }
.howto .rnote { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* loading, empty, error */
.loading { display: flex; align-items: center; gap: 10px; margin: 0; }
.spin { width: 14px; height: 14px; border: 2px solid var(--silver-lo); border-top-color: var(--cyan); border-radius: 50%; }
.skel { margin-top: 14px; display: grid; gap: 10px; }
.skel i { display: block; height: 44px; border-radius: 2px; background: linear-gradient(90deg, #0f1830, #15203c, #0f1830); background-size: 200% 100%; }
.emptycard p, .errcard p { color: var(--ink-2); max-width: 60ch; }
.emptycard h2, .errcard h2 { margin-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .spin { animation: pspin .9s linear infinite; }
  .skel i { animation: pshimmer 1.4s ease-in-out infinite; }
  @keyframes pspin { to { transform: rotate(360deg); } }
  @keyframes pshimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
}

/* phones: one compact record card per player. Name and playing ID, then Events / W-L / Win %, then Championships (only when
   there is one), Runner-up and Semifinals, then a full-width "Event history" control. */
@media (max-width: 640px) {
  .pshero .hero-text { padding: 16px 16px 22px; }
  .pshero::after { left: 16px; right: 16px; }
  .ptable, .ptable tbody { display: block; }
  .ptable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ptable tr.psrow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-areas: "pl pl pl pl pl pl" "ev ev wl wl pc pc" "ru ru ru sf sf sf" "hb hb hb hb hb hb"; gap: 6px 8px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .ptable tr.psrow.has-title { grid-template-areas: "pl pl pl pl pl pl" "ev ev wl wl pc pc" "ch ch ru ru sf sf" "hb hb hb hb hb hb"; }
  .ptable tr.psrow td { display: block; border: 0; padding: 0; background: none; box-shadow: none; }
  .ptable td.pl { grid-area: pl; min-width: 0; }
  .ptable .pname { display: none; }
  .ptable .nmplain { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .02em; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
  .ptable .pid { margin-top: 2px; padding: 0; }
  .ptable td.num { text-align: left; font-size: 19px; }
  .ptable td.num::before { content: attr(data-label); display: block; margin-bottom: 1px; font: 700 11px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .ptable td.ev { grid-area: ev; }
  .ptable td.wl { grid-area: wl; }
  .ptable td.pc { grid-area: pc; }
  .ptable td.ch { grid-area: ch; }
  .ptable td.ch.zero { display: none; }
  .ptable td.ch.title::before { color: var(--gold-dim); letter-spacing: .04em; }
  .ptable td.ru { grid-area: ru; }
  .ptable td.sf { grid-area: sf; }
  .ptable td.hb { grid-area: hb; display: block; margin-top: 4px; }
  .ptable .hbtn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 2px; background: rgba(6,10,19,.55);
    font-family: var(--display); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: #8dbbff; }
  .ptable .hbtn:hover:not(:disabled) { color: #b8d5ff; border-color: var(--cyan-dim); background: rgba(47,134,255,.08); }
  .ptable tr.hist { display: block; }
  .ptable tr.hist[hidden] { display: none; }
  .ptable tr.hist td { display: block; padding: 0 0 14px; }
  .hframe { padding: 6px 12px 4px; }
  .career { display: none; } /* the card right above already shows the same three totals */
  /* date and record on one line, then the event, then its finish on a line of its own (a label never squeezes the date) */
  .hrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date rec" "name name" "fin fin" "meta meta" "as as" "link link"; gap: 3px 10px; }
  .hlink { min-height: 44px; margin-top: 0; }
  .hres { display: contents; }
  .hrec { grid-area: rec; }
  .fin { grid-area: fin; justify-self: start; margin-top: 3px; }
  .psfacts { padding: 12px 14px; }
}
