/* The card shapes — see card-shapes.js for the decisions.
   Every color is a page token, so the shapes follow light and dark mode, and
   the look is the tennis diamonds' (tennis-diamonds.css): faint rings with the
   50 ring stronger, the player's area in the accent at .2, a dot per point. */

/* Three across where the column has room, fewer where it does not, one per row
   on a phone. Flex rather than a three-track grid so a narrow desktop wraps to
   two and one, centered, instead of squeezing three shapes into labels that
   collide. */
.cs-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 18px 16px; margin-top: 14px;
}
.cs-shape {
  flex: 1 1 250px; max-width: 300px; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
}
@media (max-width: 900px) {
  .cs-row { gap: 30px; }
  .cs-shape { flex-basis: 100%; }
}

.cs-head { text-align: center; min-height: 36px; }
.cs-title { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--text-primary); }
.cs-sub { font-size: 11px; color: var(--text-tertiary); font-style: italic; margin-top: 1px; }

/* the drawing scales with its column; the labels are laid over it in HTML so
   they keep their size when the polygon shrinks */
.cs-box { position: relative; width: 100%; aspect-ratio: 300 / 280; }
.cs-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cs-ring { fill: none; stroke: var(--border); stroke-width: 1; opacity: .4; }
.cs-ring.cs-mid { opacity: .75; }
.cs-area {
  fill: var(--gold); fill-opacity: .2; stroke: var(--gold);
  stroke-width: 1.7; stroke-linejoin: round;
}
.cs-dot { fill: var(--gold); }

/* A point's label is the control: an <a> when it links, a <button> when not. */
.cs-pt {
  position: absolute; display: flex; flex-direction: column;
  padding: 3px 5px; border: 0; border-radius: 4px; background: transparent;
  color: inherit; text-decoration: none; font: inherit; line-height: 1.15;
  white-space: nowrap; cursor: help; -webkit-tap-highlight-color: transparent;
}
a.cs-pt { cursor: pointer; }
.cs-pt:hover, .cs-pt.on { background: var(--gold-tint-strong); }
.cs-pt:focus { outline: none; }
.cs-pt:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cs-name { font-family: var(--font-button); font-size: 10.5px; color: var(--text-tertiary); }
.cs-val {
  font-family: var(--font-display); font-weight: 400; font-size: 15px; margin-top: 2px;
  color: var(--text-primary); font-variant-numeric: lining-nums tabular-nums;
}
.cs-val.cs-none { color: var(--text-faint); }

/* anchored away from the shape: top, bottom, then either side */
.cs-t { transform: translate(-50%, -100%); align-items: center; text-align: center; justify-content: flex-end; }
.cs-b { transform: translate(-50%, 0); align-items: center; text-align: center; justify-content: flex-start; }
.cs-r { align-items: flex-start; text-align: left; justify-content: center; }
.cs-l { align-items: flex-end; text-align: right; justify-content: center; }
.cs-r.cs-mid { transform: translate(0, -50%); }
.cs-r.cs-up  { transform: translate(0, -82%); }
.cs-r.cs-dn  { transform: translate(0, -18%); }
.cs-l.cs-mid { transform: translate(-100%, -50%); }
.cs-l.cs-up  { transform: translate(-100%, -82%); }
.cs-l.cs-dn  { transform: translate(-100%, -18%); }

/* a finger needs 44px, whatever the label's text measures */
@media (max-width: 900px), (pointer: coarse) {
  .cs-pt { min-height: 44px; min-width: 44px; padding: 4px 6px; }
}

/* the hover card */
.cs-tip {
  position: absolute; z-index: 20; width: 214px; max-width: calc(100vw - 24px);
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .32);
  pointer-events: none; text-align: left; white-space: normal; line-height: 1.4;
}
.cs-tip[hidden] { display: none; }
.cs-tip.cs-touch { pointer-events: auto; }
.cs-tt { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.cs-tf {
  font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1;
  color: var(--gold); margin-top: 4px; font-variant-numeric: lining-nums tabular-nums;
}
.cs-tf small { font-family: var(--font-sans); font-size: 11px; color: var(--text-tertiary); margin-left: 6px; }
.cs-tf.cs-na { font-family: var(--font-sans); font-size: 13px; color: var(--text-secondary); }
.cs-tp { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.cs-td { font-size: 11.5px; color: var(--text-secondary); margin-top: 6px; line-height: 1.45; }
.cs-go { font-size: 11.5px; color: var(--gold); margin-top: 8px; }
.cs-go-touch { display: none; }
.cs-tip.cs-touch .cs-go-mouse { display: none; }
.cs-tip.cs-touch .cs-go-touch { display: block; margin-top: 2px; }
.cs-go-touch a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--gold); text-decoration: none;
}

.cs-empty { display: flex; align-items: center; justify-content: center; }
.cs-empty p {
  font-size: 13px; font-style: italic; color: var(--text-tertiary);
  text-align: center; margin: 0 18px;
}

/* TWO SIDES (matchup cards, 2026-09-30): the other side in the tennis
   underdog's amber, under the first side's accent, as the tennis duo draws it.
   Each label carries both values, accent first. */
.cs-area.cs-two { fill: var(--warning-text); fill-opacity: .16; stroke: var(--warning-text); }
.cs-dot.cs-two { fill: var(--warning-text); }
.cs-pair .cs-val.cs-one { color: var(--gold); font-size: 14px; }
.cs-pair .cs-val.cs-two { color: var(--warning-text); font-size: 14px; margin-top: 0; }
.cs-pair .cs-val.cs-none { color: var(--text-faint); }
.cs-key { display: flex; gap: 14px; margin-top: 4px; font-size: 11px; color: var(--text-secondary); }
.cs-key span { display: inline-flex; align-items: center; gap: 5px; }
.cs-sw { width: 9px; height: 9px; border-radius: 2px; background: var(--gold); display: inline-block; }
.cs-sw.cs-two { background: var(--warning-text); }
.cs-tf.cs-tf-pair { font-size: 15px; }
