/* VIPER Survival Lab: wheel coverage view (app/wheel.js). Display only.
   Wedge face = the layout's net result for that pocket (tint + glyph:
   + net win, = push, − net loss); outer ring = the pocket's real colour.
   Colour is never the only cue: glyphs, the hub readout, the accessible
   names and the "Wheel as a table" alternative all carry the result. */

.lab-wh {
  /* Shell colour roles with fallbacks, so the wheel also renders outside .lab-page. */
  --lab-wh-ink: var(--color-text, #201e1d);
  --lab-wh-win: var(--lab-win, #1d6b45);
  --lab-wh-win-bg: var(--lab-win-bg, #e3f1e9);
  --lab-wh-push: var(--lab-push, #4a5a70);
  --lab-wh-push-bg: var(--lab-push-bg, #e6eaf0);
  --lab-wh-loss: var(--lab-loss, #ae1800);
  --lab-wh-loss-bg: var(--lab-loss-bg, #fff2ef);
  --lab-wh-line: var(--lab-line, rgba(32, 30, 29, 0.18));
  --lab-wh-line-strong: var(--lab-line-strong, rgba(32, 30, 29, 0.4));
  --lab-wh-muted: var(--lab-muted, rgba(32, 30, 29, 0.66));
  --lab-wh-panel: var(--lab-panel, #fbfafa);
  --lab-wh-panel-2: var(--lab-panel-2, #eae9e9);
}
.lab-wh-full { container-type: inline-size; container-name: lab-wh; }
.lab-wh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.lab-wh-figure { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.lab-wh-side { min-width: 0; }

.lab-wh-svg { display: block; width: 100%; height: auto; overflow: visible; }
.lab-wh-full .lab-wh-svg { max-width: 440px; }
.lab-wh-mini .lab-wh-svg { width: 220px; max-width: 100%; margin: 0 auto; }

@container lab-wh (min-width: 760px) {
  .lab-wh-grid { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; }
}

/* ---- SVG parts */
.lab-wh-rim-red { fill: var(--pocket-red, #c0262d); }
.lab-wh-rim-black { fill: var(--pocket-black, #1d1d1f); }
.lab-wh-rim-green { fill: var(--pocket-green, #15803d); }
.lab-wh-rim path { stroke: #fff; stroke-width: 1; stroke-opacity: 0.55; }
.lab-wh-frame { fill: none; stroke: var(--lab-wh-ink); stroke-width: 2; }

.lab-wh-face { fill: #fff; stroke: #fff; stroke-width: 1.5; }
.lab-wh-win .lab-wh-face { fill: color-mix(in srgb, var(--lab-wh-win) 24%, #fff); }
.lab-wh-push .lab-wh-face { fill: color-mix(in srgb, var(--lab-wh-push) 13%, #fff); }
.lab-wh-loss .lab-wh-face { fill: color-mix(in srgb, var(--lab-wh-loss) 21%, #fff); }
.lab-wh-none .lab-wh-face { fill: #fff; stroke: var(--lab-wh-line); stroke-width: 1; }

.lab-wh-num, .lab-wh-glyph, .lab-wh-hub text {
  font-family: var(--font-heading, "Archivo", system-ui, sans-serif);
  text-anchor: middle; dominant-baseline: central; font-feature-settings: 'tnum' 1;
}
.lab-wh-num { fill: var(--lab-wh-ink); font-weight: 800; letter-spacing: -0.02em; }
.lab-wh-glyph { font-weight: 800; }
.lab-wh-win .lab-wh-glyph { fill: var(--lab-wh-win); }
.lab-wh-push .lab-wh-glyph { fill: var(--lab-wh-push); }
.lab-wh-loss .lab-wh-glyph { fill: var(--lab-wh-loss); }

.lab-wh-wedge { cursor: pointer; outline: none; }
.lab-wh-wedge:focus { outline: none; }
.lab-wh-hl { fill: none; stroke: var(--lab-wh-ink); stroke-width: 3.5; stroke-linejoin: round; pointer-events: none; }
.lab-wh-ball { fill: #fff; stroke: var(--lab-wh-ink); stroke-width: 2; pointer-events: none; }

.lab-wh-hub-ring { fill: var(--lab-wh-ink); }
.lab-wh-hub-disc { fill: #fff; }
.lab-wh-hub-k { fill: var(--lab-wh-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; }
.lab-wh-hub-big { fill: var(--lab-wh-ink); font-size: 46px; font-weight: 800; letter-spacing: -0.02em; }
.lab-wh-hub-sub { fill: var(--lab-wh-muted); font-size: 15px; font-weight: 600; }
.lab-wh-mini .lab-wh-hub-k { font-size: 16px; }
.lab-wh-mini .lab-wh-hub-big { font-size: 58px; }
.lab-wh-mini .lab-wh-hub-sub { font-size: 18px; }
.lab-wh-hub .lab-wh-t-win { fill: var(--lab-wh-win); }
.lab-wh-hub .lab-wh-t-push { fill: var(--lab-wh-push); }
.lab-wh-hub .lab-wh-t-loss { fill: var(--lab-wh-loss); }

.lab-wh-mark { fill: none; stroke: var(--lab-wh-ink); stroke-width: 5; stroke-linecap: butt; }
.lab-wh-mark-nonwin { stroke-dasharray: 10 5; }
.lab-wh-mark-tick { fill: none; stroke: var(--lab-wh-ink); stroke-width: 2; }

/* ---- steps under the full wheel */
.lab-wh-steps { display: flex; gap: 8px; justify-content: center; }
.lab-wh-step { min-width: 104px; }

/* ---- legend */
.lab-wh-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; line-height: 18px; }
.lab-wh-legend li { display: inline-flex; align-items: center; gap: 7px; }
.lab-wh-sw { width: 18px; height: 18px; flex: none; overflow: visible; }
.lab-wh-sw .lab-wh-face { stroke: var(--lab-wh-line-strong); stroke-width: 1; }
.lab-wh-sw .lab-wh-glyph { text-anchor: middle; dominant-baseline: central; }
.lab-wh-sw-rim { width: 27px; }
.lab-wh-sw-mark { width: 22px; height: 10px; margin-top: 4px; }
.lab-wh-sw-mark .lab-wh-mark { stroke-width: 4; }
.lab-wh-mini .lab-wh-legend { justify-content: center; gap: 4px 12px; font-size: 12px; margin: 8px 0 6px; }

/* ---- sector callout */
.lab-wh-callout { border-left: 4px solid var(--lab-wh-ink); background: var(--lab-wh-panel); padding: 10px 14px; margin: 0 0 14px; }
.lab-wh-callout p { margin: 0; font-size: 14px; line-height: 21px; }
.lab-wh-callout p + p { margin-top: 6px; }
.lab-wh-callout .lab-wh-call-sub strong { font-weight: 600; }
.lab-wh-call-lead { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.lab-wh-call-fact { color: var(--lab-wh-muted); }
.lab-wh-callout .lab-wh-call-note { font-size: 12.5px; line-height: 18px; color: var(--lab-wh-muted); }
.lab-wh-hint { margin: 0; font-size: 13px; line-height: 19px; color: var(--lab-wh-muted); }

/* ---- pocket detail */
.lab-wh-detail { border: 1px solid var(--lab-wh-line); background: #fff; padding: 10px 14px; min-height: 64px; margin: 0 0 12px; }
.lab-wh-detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }
.lab-wh-detail .lab-wh-hint { display: flex; align-items: center; min-height: 42px; }
.lab-wh-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.lab-wh-dot-red { background: var(--pocket-red, #c0262d); }
.lab-wh-dot-black { background: var(--pocket-black, #1d1d1f); }
.lab-wh-dot-green { background: var(--pocket-green, #15803d); }
.lab-wh-pill { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 700; font-feature-settings: 'tnum' 1; border: 1px solid currentColor; }
.lab-wh-pill.lab-wh-t-win { color: var(--lab-wh-win); background: var(--lab-wh-win-bg); }
.lab-wh-pill.lab-wh-t-push { color: var(--lab-wh-push); background: var(--lab-wh-push-bg); }
.lab-wh-pill.lab-wh-t-loss { color: var(--lab-wh-loss); background: var(--lab-wh-loss-bg); }
.lab-wh-unpin {
  margin-left: auto; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--lab-wh-ink);
  background: none; border: 1px solid var(--lab-wh-line-strong); padding: 3px 10px; cursor: pointer;
}
.lab-wh-unpin:hover { background: var(--lab-wh-panel-2); }
.lab-wh-unpin:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.lab-wh-bets { list-style: none; margin: 0; padding: 0; font-size: 13.5px; line-height: 20px; }
.lab-wh-bets li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--lab-wh-line); }
.lab-wh-bet-name { min-width: 0; overflow-wrap: anywhere; }
.lab-wh-bet-net { white-space: nowrap; font-weight: 600; font-feature-settings: 'tnum' 1; }
.lab-wh-detail-total { margin: 8px 0 0; font-size: 13px; line-height: 19px; font-weight: 600; }
.lab-wh-mini .lab-wh-detail { padding: 8px 10px; min-height: 0; margin: 0; }
.lab-wh-mini .lab-wh-detail-title { font-size: 13px; margin: 0 0 4px; }
.lab-wh-mini .lab-wh-detail .lab-wh-hint { min-height: 0; font-size: 12.5px; }
.lab-wh-mini-bets { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--lab-wh-muted); overflow-wrap: anywhere; }

/* ---- text alternative */
.lab-wh-text { border-top: 1px solid var(--lab-wh-line); padding-top: 8px; }
/* display:flex drops the browser's disclosure triangle, so draw our own
   chevron: right when closed, down when open (static, no transition). */
.lab-wh-text summary { cursor: pointer; font-size: 13.5px; font-weight: 600; min-height: 28px; display: flex; align-items: center; gap: 8px; list-style: none; }
.lab-wh-text summary::-webkit-details-marker { display: none; }
.lab-wh-text summary::before {
  content: '▸'; content: '▸' / ''; flex: none; width: 1em; text-align: center; font-size: 14px; line-height: 1;
}
.lab-wh-text[open] > summary::before { content: '▾'; content: '▾' / ''; }
.lab-wh-text summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.lab-wh-text .lab-table-wrap { max-height: 360px; overflow: auto; margin-top: 8px; }
.lab-wh-table td, .lab-wh-table th { padding: 4px 8px; font-size: 13px; }
.lab-wh-table .r { text-align: right; font-feature-settings: 'tnum' 1; }
.lab-wh-table tbody th { font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--lab-wh-ink); font-size: 13px; border-bottom: 1px solid var(--lab-wh-line); }

/* Phones: 44px targets for every HTML control (wedges are complemented by
   the Previous/Next steppers and the table alternative). */
@media (max-width: 860px) {
  .lab-wh-step, .lab-wh-unpin { min-height: 44px; }
  .lab-wh-text summary { min-height: 44px; }
}

/* Windows high contrast: fills go to the system palette, so the glyphs carry
   the result and the highlight uses the system Highlight colour. */
@media (forced-colors: active) {
  .lab-wh .lab-wh-wedge .lab-wh-face, .lab-wh .lab-wh-sw .lab-wh-face { fill: Canvas; stroke: CanvasText; stroke-width: 1; }
  .lab-wh .lab-wh-num, .lab-wh .lab-wh-wedge .lab-wh-glyph, .lab-wh .lab-wh-sw .lab-wh-glyph, .lab-wh .lab-wh-hub text { fill: CanvasText; }
  .lab-wh-rim path, .lab-wh-sw-rim rect { fill: Canvas; stroke: CanvasText; }
  .lab-wh-hub-ring, .lab-wh-frame, .lab-wh-mark, .lab-wh-mark-tick { stroke: CanvasText; }
  .lab-wh-hub-ring { fill: CanvasText; }
  .lab-wh-hub-disc { fill: Canvas; }
  .lab-wh-hl { stroke: Highlight; }
  .lab-wh-ball { fill: Highlight; stroke: CanvasText; }
  .lab-wh-dot { border: 1px solid CanvasText; }
}
