/* =============================================================================
   /play — the Fanbase Game hub (design_handoff_play_hub option 1a "Game
   Desk"). LIGHT-first spec via --ph-* tokens with a dark base underneath.
   Cards outline-only; team colors appear only as data ink (map dots,
   matchup bars); blue reserved for category pills + contested rings.
   ============================================================================= */

.ph {
  --ph-ink: #fff;
  --ph-t8: rgba(255, 255, 255, 0.8);
  --ph-t2: rgba(255, 255, 255, 0.72);
  --ph-t3: rgba(255, 255, 255, 0.65);
  --ph-quiet: rgba(255, 255, 255, 0.55);
  --ph-ghost: rgba(255, 255, 255, 0.35);
  --ph-hair: rgba(255, 255, 255, 0.25);    /* card outline (.38 light) */
  --ph-row: rgba(255, 255, 255, 0.1);      /* row hairline (.16 light) */
  --ph-div: rgba(255, 255, 255, 0.14);     /* strip divider (.2 light) */
  --ph-chrome: rgba(255, 255, 255, 0.3);   /* pill borders (.3 light) */
  --ph-fill: rgba(255, 255, 255, 0.06);    /* subtle fills (.04-.08 light) */
  --ph-dot: rgba(255, 255, 255, 0.1);      /* unclaimed map dot (.14 light) */
  --ph-solid: #e9edf2;                     /* CTA fill (ink in light) */
  --ph-solid-text: #0b0d10;
  --ph-type: #00a8ff;                      /* category pill text */
  --ph-type-line: rgba(0, 168, 255, 0.45);
  --ph-live: #16a34a;
  --ph-down: #dc2626;
  color: var(--ph-ink);
  padding-bottom: 56px;
}

.ph .si-shead { margin-bottom: 18px; }
.ph-subhead.si-shead { margin-bottom: 14px; }
.ph-head-right {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--ph-t3); white-space: nowrap;
}

.ph-h2 { margin: 0 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; color: var(--ph-ink); }
.ph-dek { margin: 0 0 20px; max-width: 640px; font-size: 14px; line-height: 1.45; color: var(--ph-t2); }

/* team logo spans (background-image so broken URLs stay invisible) */
.ph-logo { display: inline-block; flex: none; background-size: contain; background-position: center; background-repeat: no-repeat; }
.ph-logo-30 { width: 30px; height: 30px; }
.ph-logo-26 { width: 26px; height: 26px; }
.ph-logo-22 { width: 22px; height: 22px; }
.ph-logo-18 { width: 18px; height: 18px; }
.ph-logo-16 { width: 16px; height: 16px; }

/* ---- CTA pill --------------------------------------------------------------- */
.ph-cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--ph-solid);
  color: var(--ph-solid-text) !important; font-size: 13px; font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.ph-cta:hover { filter: brightness(1.08); }
.ph-cta-sm { height: 34px; padding: 0 18px; }

/* ---- status strip ------------------------------------------------------------ */
.ph-strip {
  display: flex; align-items: center; gap: 26px; padding: 16px 22px;
  border: 1px solid var(--ph-hair); border-radius: 14px; margin: 0 0 32px;
}
.ph-strip-id { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }
.ph-strip-id:hover .ph-strip-name { text-decoration: underline; text-underline-offset: 2px; }
.ph-strip-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ph-strip-name { font-size: 13.5px; font-weight: 800; letter-spacing: 0.2px; color: var(--ph-ink); }
.ph-strip-sub { font-size: 10.5px; font-weight: 600; color: var(--ph-t3); }
.ph-strip-div { width: 1px; align-self: stretch; background: var(--ph-div); }
.ph-stat { display: flex; flex-direction: column; gap: 1px; }
.ph-stat b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-stat span { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ph-t3); }
.ph-strip .ph-cta { margin-left: auto; }

.ph-strip-plant { padding: 18px 22px; }
.ph-plant-title { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.ph-plant-sub { font-size: 12.5px; line-height: 1.45; color: var(--ph-t2); max-width: 560px; }
.ph-plant-logos { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ph-strip-plant .ph-plant-logos + .ph-cta { margin-left: 0; }

/* ---- slate + matchup band ------------------------------------------------------ */
.ph-band {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px;
  align-items: start; margin: 0 0 36px;
}
.ph-card { border: 1px solid var(--ph-hair); border-radius: 16px; }
.ph-empty { padding: 26px 22px; font-size: 13px; line-height: 1.5; color: var(--ph-t2); }

.ph-slate-card { padding: 6px 22px; }
.ph-q { display: flex; flex-direction: column; gap: 9px; padding: 16px 0; border-bottom: 1px solid var(--ph-row); }
.ph-q-more { display: none; }
.ph-slate-card.is-open .ph-q-more { display: flex; }
.ph-q-top { display: flex; align-items: center; gap: 8px; }
.ph-q-cat {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--ph-type-line);
  border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ph-type); white-space: nowrap;
}
.ph-q-pts { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px; color: var(--ph-quiet); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.ph-q-text { font-size: 15.5px; font-weight: 700; letter-spacing: -0.1px; line-height: 1.3; }
.ph-q-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-opt {
  display: inline-flex !important; align-items: center; width: auto !important;
  height: 32px; margin: 0 !important; padding: 0 16px !important;
  border: 1px solid var(--ph-chrome) !important; border-radius: 999px !important;
  background: transparent !important; color: var(--ph-t2) !important;
  font-size: 12.5px !important; font-weight: 700; white-space: nowrap;
  cursor: pointer; font-family: inherit; line-height: 1; box-shadow: none !important;
}
.ph-opt:hover:not(:disabled) { border-color: var(--ph-ink) !important; }
.ph-opt.is-on {
  background: var(--ph-solid) !important; color: var(--ph-solid-text) !important;
  border-color: var(--ph-solid) !important;
}
.ph-opt:disabled { cursor: default; opacity: 0.75; }
.ph-opt.is-right::after { content: ' ✓'; color: var(--ph-live); font-weight: 900; }
.ph-opt.is-on.is-right::after { color: inherit; }
.ph-slate-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.ph-more-link {
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  width: auto !important; background: none !important; box-shadow: none !important;
  color: var(--ph-ink) !important; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ph-more-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---- matchup card ---------------------------------------------------------------- */
.ph-matchup { padding: 20px 22px; }
.ph-mu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.ph-mu-team { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 800; min-width: 0; }
.ph-mu-vs { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ph-quiet); }
.ph-mu-row { display: flex; flex-direction: column; gap: 5px; padding: 9px 0; }
.ph-mu-label { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ph-t3); }
.ph-mu-label i { font-style: normal; opacity: 0.62; }
.ph-mu-bar-row { display: flex; align-items: center; gap: 10px; }
.ph-mu-bar-row b { font-size: 13px; font-weight: 800; min-width: 34px; font-variant-numeric: tabular-nums; }
.ph-mu-bar-row b.is-right { text-align: right; }
.ph-mu-bar { display: flex; flex: 1; height: 7px; border-radius: 4px; overflow: hidden; background: var(--ph-fill); }
.ph-mu-bar span:first-child { display: block; height: 100%; }
.ph-mu-bar span:last-child { display: block; flex: 1; height: 100%; }
.ph-mu-caption { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--ph-t2); }

.ph-allmu { margin-top: 16px; }
.ph-allmu .ph-subhead { margin-bottom: 6px; }
.ph-mu-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ph-row); }
.ph-mu-line a { font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--ph-ink); text-decoration: none; }
.ph-mu-line a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ph-mu-line-vs { font-size: 9.5px; font-weight: 800; letter-spacing: 0.8px; color: var(--ph-ghost); }
.ph-mu-status { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--ph-quiet); white-space: nowrap; }
.ph-mu-status.is-live { color: var(--ph-live); }

/* ---- the map band ------------------------------------------------------------------ */
.ph-mapband {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px;
  align-items: center; margin: 0 0 40px;
}
.ph-map { position: relative; margin: 0 auto; max-width: 100%; }
/* Pico styles [role=button] (padding/border/line-height) — pin the dots
   back to bare circles. */
.ph-dot {
  position: absolute; border-radius: 50% !important;
  background: var(--ph-dot); box-sizing: border-box;
  padding: 0 !important; margin: 0 !important; line-height: 0 !important;
  box-shadow: none !important;
}
.ph-dot:not(.is-contested) { border: 0 !important; }
.ph-dot.is-claimed { cursor: default; }
.ph-dot.is-contested { background: transparent !important; border: 3px solid #0084cc !important; }
.ph-map-tip {
  position: absolute; z-index: 5; padding: 6px 10px; border-radius: 8px;
  background: #101418; color: #fff; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; pointer-events: none; transform: translate(-50%, -130%);
  box-shadow: 0 6px 18px rgba(16, 20, 24, 0.25);
}
.ph-dot[data-city] { cursor: pointer; }
.ph-dot[data-city]:hover { box-shadow: 0 0 0 3px var(--ph-fill); }
.ph-map-pop {
  position: absolute; z-index: 6; width: 230px; padding: 14px 16px;
  border: 1px solid var(--ph-hair); border-radius: 12px; background: var(--ph-pop, #fff);
  box-shadow: 0 14px 34px rgba(16, 20, 24, 0.18);
}
.ph-pop-x {
  position: absolute; top: 6px; right: 6px; width: 24px !important; height: 24px;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  border-radius: 6px !important; background: transparent !important;
  color: var(--ph-quiet) !important; font-size: 15px !important; line-height: 1;
  cursor: pointer; box-shadow: none !important; font-family: inherit;
}
.ph-pop-x:hover { color: var(--ph-ink) !important; }
.ph-pop-city { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; margin-bottom: 3px; }
.ph-pop-status { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ph-t2); }
.ph-pop-status i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ph-pop-status.is-contested { color: #0084cc; }
.ph-pop-count { margin: 8px 0 2px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-pop-teams { display: flex; flex-direction: column; margin-top: 4px; }
.ph-pop-team {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  border-top: 1px solid var(--ph-row); font-size: 12px; font-weight: 600;
}
.ph-pop-team b { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-pop-first { margin-top: 9px; font-size: 11px; color: var(--ph-t3); }
.ph-pop-first a { color: var(--ph-ink); font-weight: 700; text-decoration: none; }
.ph-pop-first a:hover { text-decoration: underline; text-underline-offset: 2px; }

.ph-map-rail { display: flex; flex-direction: column; gap: 18px; }
.ph-fact { border-top: 2px solid var(--ph-ink); padding-top: 10px; }
.ph-fact-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ph-t3); }
.ph-fact-value { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.ph-fact-detail { font-size: 12.5px; color: var(--ph-t2); }

/* ---- twin leaderboards --------------------------------------------------------------- */
.ph-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.ph-board { min-width: 0; }
.ph-board .ph-subhead { margin-bottom: 10px; }

.ph-tbl {
  display: grid; column-gap: 12px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--ph-row);
}
.ph-tbl-fans { grid-template-columns: 34px minmax(0, 1.6fr) minmax(0, 1.1fr) 70px 56px 70px; }
.ph-tbl-bases { grid-template-columns: 34px minmax(0, 1.6fr) 90px 70px 62px 52px; }
.ph-tbl-head {
  border-top: 2px solid var(--ph-ink); border-bottom: 1px solid var(--ph-chrome);
  font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--ph-t3);
}
.ph-tbl .is-right { text-align: right; }
.ph-rk { font-size: 13px; font-weight: 800; color: var(--ph-ghost); font-variant-numeric: tabular-nums; }
.ph-fan { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; color: inherit; }
a.ph-fan:hover .ph-fan-name { text-decoration: underline; text-underline-offset: 2px; }
.ph-av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--ph-fill); font-size: 9px; font-weight: 800; color: var(--ph-t8);
}
.ph-av.is-you { background: var(--ph-solid); color: var(--ph-solid-text); }
.ph-fan-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-flag { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ph-flag span:last-child { font-size: 12px; font-weight: 600; color: var(--ph-t8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-num { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-dim { font-size: 12.5px; font-weight: 600; color: var(--ph-t2); font-variant-numeric: tabular-nums; }
.ph-delta { font-size: 12px; font-weight: 700; color: var(--ph-live); font-variant-numeric: tabular-nums; }
.ph-delta.is-flat { color: var(--ph-quiet); }
.ph-tbl-you { background: var(--ph-fill); }
.ph-tbl-you .ph-rk { color: var(--ph-quiet); }
.ph-tbl-you .ph-fan-name { font-weight: 800; }

/* tab capsule */
.ph-tabs { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--ph-chrome); border-radius: 999px; flex: none; }
.ph-tab {
  margin: 0 !important; padding: 3px 11px !important; width: auto !important;
  border: 0 !important; border-radius: 999px !important; background: transparent !important;
  color: var(--ph-t2) !important; font-size: 10.5px !important; font-weight: 700;
  cursor: pointer; font-family: inherit; line-height: 1.3; box-shadow: none !important;
}
.ph-tab.is-on { background: var(--ph-solid) !important; color: var(--ph-solid-text) !important; }
#phBases { transition: opacity 0.18s ease; }
#phBases.is-fading { opacity: 0; }

/* ---- responsive -------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .ph-band, .ph-mapband, .ph-boards { grid-template-columns: 1fr; }
  .ph-mapband { gap: 24px; }
  .ph-map { transform-origin: top left; }
}
@media (max-width: 860px) {
  .ph-strip { flex-wrap: wrap; gap: 16px; }
  .ph-strip .ph-cta { margin-left: 0; }
  .ph-map { display: none; }   /* the dot grid is a desktop artifact */
}

/* =============================================================================
   LIGHT MODE (html.si-light + body.si-themed)
   ============================================================================= */
html.si-light body.si-themed .ph {
  --ph-ink: #101418;
  --ph-t8: rgba(16, 20, 24, 0.8);
  --ph-t2: rgba(16, 20, 24, 0.72);
  --ph-t3: rgba(16, 20, 24, 0.65);
  --ph-quiet: rgba(16, 20, 24, 0.55);
  --ph-ghost: rgba(16, 20, 24, 0.35);
  --ph-hair: rgba(16, 20, 24, 0.38);
  --ph-row: rgba(16, 20, 24, 0.16);
  --ph-div: rgba(16, 20, 24, 0.2);
  --ph-chrome: rgba(16, 20, 24, 0.3);
  --ph-fill: rgba(16, 20, 24, 0.08);
  --ph-dot: rgba(16, 20, 24, 0.14);
  --ph-solid: #101418;
  --ph-solid-text: #fff;
  --ph-type: #0084cc;
}
html.si-light body.si-themed .ph-cta:hover { filter: none; background: #000; }
html.si-light body.si-themed .ph-av { background: rgba(16, 20, 24, 0.08); }
html.si-light body.si-themed .ph-tbl-you { background: rgba(16, 20, 24, 0.04); }
.ph { --ph-pop: #1e2028; }
html.si-light body.si-themed .ph { --ph-pop: #fff; }
