/* Shot reveal (Nov 2026 redo): the facts row between the field and the card,
   and the card's score line. The field's own drawing lives in the shot views. */

/* The reveal's two voices match the canvas: you in coral, the answer in cream
   on navy (steel blue on paper, ink for numbers). */
:root{--fx-you:#ff8873;--fx-truth:#fff0bd;--fx-truth-text:#fff0bd;--fx-rule:rgba(165,192,222,.28)}
:root[data-theme="light"]{--fx-you:#bc423c;--fx-truth:#27678d;--fx-truth-text:#15263b;--fx-rule:rgba(23,40,60,.18)}

/* ---------- Facts row ---------- */
.shot-facts{
  --fx-in:clamp(0,calc((var(--reveal-progress,1) - .42) * 3.4),1);
  width:100%;display:grid;gap:5px;justify-items:center;text-align:center;
  opacity:var(--fx-in);transform:translateY(calc((1 - var(--fx-in)) * 8px));
}
.shot-facts[hidden],body:not([data-phase="reveal"]) .shot-facts{display:none}
.facts-pair{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;column-gap:20px;width:min(100%,360px)}
.fact{display:grid;justify-items:center;gap:2px;min-width:0}
.fact-k{font:700 .68rem/1.05 var(--font-ui);letter-spacing:.16em;text-transform:uppercase;color:var(--ink-2);white-space:nowrap}
.fact-k.tone-you{color:var(--fx-you)}
.fact-v{font:900 1.85rem/.9 var(--display);letter-spacing:.01em;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
.fact-v.tone-you{color:var(--fx-you)}
.fact-v.tone-truth{color:var(--fx-truth-text)}
.fact-v small{display:block;font:700 .76rem/1.2 var(--font-ui);letter-spacing:0;color:var(--ink-2);margin-top:3px}
.fact-rule{display:block;width:1px;align-self:stretch;min-height:30px;background:var(--fx-rule)}
.facts-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 24px;font:700 .8rem/1.3 var(--font-ui);color:var(--ink-2)}
.facts-legend>span{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}

/* Legend marks: the same strokes the field draws. */
.lg{display:inline-block;flex:none;color:var(--fx-you)}
.lg.tone-truth{color:var(--fx-truth)}
.lg.tone-ink{color:var(--ink)}
.lg.tone-context{color:var(--ink-3)}
.lg-line{width:22px;height:3px;border-radius:2px;background:currentColor}
.lg-dash{width:22px;height:0;border-top:3px dashed currentColor}
.lg-dot{width:10px;height:10px;border-radius:50%;background:currentColor}
.lg-ring{width:12px;height:12px;border-radius:50%;border:2px solid currentColor}
.lg-cross{width:14px;height:14px;background:linear-gradient(currentColor,currentColor) center/100% 2.5px no-repeat,linear-gradient(currentColor,currentColor) center/2.5px 100% no-repeat}
.lg-reticle{width:16px;height:16px;border-radius:50%;background:radial-gradient(circle,transparent 4px,currentColor 4.5px,currentColor 6px,transparent 6.5px),linear-gradient(currentColor,currentColor) center/100% 2px no-repeat,linear-gradient(currentColor,currentColor) center/2px 100% no-repeat}
.lg-pin{width:10px;height:16px;background:radial-gradient(circle at 50% 5px,currentColor 4.5px,transparent 5px),linear-gradient(currentColor,currentColor) center 8px/2px 8px no-repeat}
.lg-band{width:18px;height:12px;border-radius:2px;background:currentColor;}
.lg-hatch{width:18px;height:12px;border-radius:2px;background:repeating-linear-gradient(135deg,currentColor 0 2px,transparent 2px 5px)}

/* ---------- The card's score line: number | verdict ---------- */
body[data-phase="reveal"] .score-chip .score-line{gap:0;align-items:center}
body[data-phase="reveal"] .score-chip .n{font:900 3.5rem/.9 var(--display);min-width:0;padding:2px 18px 2px 2px;margin-right:18px;border-right:1px solid var(--fx-rule);font-variant-numeric:tabular-nums}
body[data-phase="reveal"] .score-chip .d{gap:3px}
body[data-phase="reveal"] .score-chip .d b{font:700 1.22rem/1.15 var(--font-ui);letter-spacing:-.01em}
body[data-phase="reveal"] .score-chip .d span{font-size:.9rem;line-height:1.35}
body[data-phase="reveal"] .score-chip.is-perfect .n{border-right-color:rgba(11,22,40,.25)}
/* Room for the facts row on every phone: the field never moves at the reveal,
   so the card gives back the height the row needs (about 30px). */
:root body[data-phase="reveal"] #controls>.btn,:root body[data-phase="reveal"] #controls>.btn.primary{min-height:44px;padding-block:9px}
:root body[data-phase="reveal"] .dock{padding-block:8px 9px;gap:8px}
:root body[data-phase="reveal"] #play .dock #controls{gap:8px;row-gap:8px}
:root body[data-phase="reveal"] #play .score-chip .n{line-height:.86;padding-block:0;min-height:0}
/* A daily's standing can add a third text row. Reclaim the old 2px card
   top inset so the longest compact-phone verdict still clears the footer. */
:root[data-theme] body[data-phase="reveal"] #controls>.score-chip:has(.shot-population):not(.is-perfect){padding-top:0}
/* Tighten only below the field: changing #play's gap would also move the
   field under the daily's progress strip. */
:root body[data-phase="reveal"] #play>.shot-facts{margin-block:-6px}
/* A 40px band and a 69px card fit even 360×640 without changing the field
   or #play's gap. The compact pair below fits inside that same band. A duel
   keeps its content height because it also has the opponent's comparison. */
@media (min-width:360px) and (max-width:600px){
  body[data-phase="reveal"] #play:not(:has(.duel-shot))>.shot-facts{height:40px;min-height:40px;align-content:center}
  /* Only the global [hidden] rule needs overriding for an empty band. */
  body[data-phase="reveal"] #play:not(:has(.duel-shot))>.shot-facts[hidden]{display:grid!important;visibility:hidden}
  /* Season 2 prints its numbers in the card, never in a facts row, so every
     shot of a Season 2 day would show the same empty hole: close it there.
     The card still lands in one place on every shot of the day. */
  body.season-playing[data-phase="reveal"] #play:not(:has(.duel-shot))>.shot-facts[hidden]{display:none!important}
  body[data-phase="reveal"] #play #controls:not(:has(.duel-shot))>.score-chip{min-height:69px;align-content:center}
  .facts-pair .fact-v{font-size:1.65rem}
}
/* The larger band adds 16px to the former 42px band, so the budget grows
   from width + 347px to width + 363px. Its pair has at least 14px of air on
   each side, including the unchanged 6px gap outside the facts row. */
@media (min-width:360px) and (max-width:600px) and (min-height:calc(100vw + 363px)){
  body[data-phase="reveal"] #play:not(:has(.duel-shot))>.shot-facts{height:58px;min-height:58px}
  .facts-pair .fact-v{font-size:1.85rem}
  /* Seven real daily lineups, including standings and crowned cards, peak at
     85px after removing its old 2px inset. The daily has one fewer button, so this fits the same height budget. */
  body[data-phase="reveal"] #play #controls:not(:has(.duel-shot))>.score-chip:has(.shot-population){min-height:85px}
}

@media (prefers-reduced-motion:reduce){.shot-facts{opacity:1;transform:none}}

/* ---------- The reading is printed on the paper (build 29 playtest) ----------
   The facts row is no longer a third block between the field and the card:
   the field's paper runs on under the drawing and its numbers sit at its foot,
   so a reveal reads as two things, the paper and the score. The paper's foot
   is there from the first frame of the reveal and its numbers fade in on the
   reveal's clock as before. Its height and the field's position are unchanged
   (the field never moves; the card keeps its place). A Season 2 night field
   keeps the separate row: its navy paper would need its own ink. */
body[data-phase="reveal"] #play:not(:has(#stage.season-night))>.shot-facts:not([hidden]){
  position:relative;opacity:1;transform:none;margin-block:-12px 0;padding-block:10px 12px;
  align-self:center;width:var(--field-w,100%);max-width:100%;container-type:inline-size;
  background-color:var(--es-surface);background-image:var(--paper-tooth,none);background-size:var(--paper-tooth-size,160px) var(--paper-tooth-size,160px);
  border:1px solid var(--es-line);border-top:0;border-radius:0 0 20px 20px;
  box-shadow:0 3px 10px rgba(3,10,22,.16);clip-path:inset(0 -16px -16px -16px)
}
:root[data-theme="light"] body[data-phase="reveal"] #play:not(:has(#stage.season-night))>.shot-facts:not([hidden]){box-shadow:0 3px 10px rgba(23,40,60,.08)}
body[data-phase="reveal"] #play:not(:has(#stage.season-night))>.shot-facts:not([hidden])>*{opacity:var(--fx-in);transform:translateY(calc((1 - var(--fx-in)) * 6px))}
body[data-phase="reveal"] #play:not(:has(#stage.season-night)):has(>.shot-facts:not([hidden]))>#stage{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;box-shadow:0 1px 0 rgba(255,255,255,.035) inset}
:root[data-theme="light"] body[data-phase="reveal"] #play:not(:has(#stage.season-night)):has(>.shot-facts:not([hidden]))>#stage{box-shadow:none}
/* The fixed phone bands below already centre their content in the band. */
@media (min-width:360px) and (max-width:600px){
  body[data-phase="reveal"] #play:not(:has(.duel-shot)):not(:has(#stage.season-night))>.shot-facts:not([hidden]){padding-block:0}
}
@media (prefers-reduced-motion:reduce){body[data-phase="reveal"] #play>.shot-facts:not([hidden])>*{opacity:1;transform:none}}
/* A field narrowed by a short screen: the same reading, set a size smaller so
   one line still fits the paper's width. */
@container (max-width:330px){
  .facts-pair{column-gap:12px}
  .facts-pair .fact-v{font-size:1.45rem}
  .fact-k{font-size:.6rem;letter-spacing:.12em}
  .facts-legend{gap:4px 14px;font-size:.72rem}
}

/* ---------- Pages: a softer grid behind dense text, quieter card shadows ---------- */
:root[data-theme="dark"],:root[data-theme="dark"][data-palette]{--sheet-fine:rgba(155,190,230,.042);--es-shadow-soft:0 1px 0 rgba(255,255,255,.035) inset,0 3px 10px rgba(3,10,22,.16)}
:root[data-theme="light"],:root[data-theme="light"][data-palette]{--sheet-fine:rgba(39,103,141,.058)}

/* The perfect card keeps its gold, with a little less padding so a 100 fits
   the same phone height as any other result. */
:root body[data-phase="reveal"] #play #controls>.score-chip.is-perfect{padding:6px 10px}
/* The crown perches above the card edge, clear of long headlines. */
body[data-phase="reveal"] .score-chip>.perfect-crown{top:-24px}
/* Small phones: a two-line verdict still fits beside the facts row. */
@media (max-width:380px){
  body[data-phase="reveal"] .score-chip .n{font-size:3.1rem;padding-right:14px;margin-right:14px}
  body[data-phase="reveal"] .score-chip .d b{font-size:1.08rem}
  body[data-phase="reveal"] .score-chip .d span{font-size:.82rem;line-height:1.28}
  .fact-v{font-size:1.8rem}
  :root body[data-phase="reveal"] #play #controls>.score-chip.is-perfect{padding:4px 8px}
  body[data-phase="reveal"] .score-chip.is-perfect .d b{font-size:1rem}
}

/* The finished sheet must fit the same compact phone as its reveals. Keep its
   top aligned with the next day's intro; recover space inside the card. */
@media (max-width:600px) and (max-height:760px){
  :root[data-theme]:not(.enlarged-text) body:not(.native-app)[data-phase="results"] #app{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] #results>.result-ticket.es-sheet{gap:4px;padding:10px 12px 8px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-head{padding-bottom:4px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-total :is(strong,.sheet-total-live){font-size:84px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-standing{padding-block:4px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-standing :is(.spark,.spark-slot:empty){height:22px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-actions>.btn.primary{min-height:44px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-actions .es-link{min-height:36px}
  :root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .sheet-foot{padding-top:6px}
}
/* Keep a short name such as Triangle from leaving one orphaned letter. The
   enlarged-text list already has room and keeps its own padding. */
:root[data-theme]:not(.enlarged-text) body[data-phase="results"] .result-sheet .tiles>.tile .nm{padding-inline:0}

/* ---------- Shot demos ----------
   How a shot is played, shown: the ready card's Watch opens the demo in the
   card, and during a shot the help button peeks it over the field's corner.
   The field is the shot's own paper; nothing in it takes a touch. */
.shot-demo-field{position:relative;overflow:hidden;background:var(--play-paper);border:1px solid var(--es-line);border-radius:14px}
.shot-demo-field.is-night{background:#081A36}
.shot-demo-field *{pointer-events:none}
.shot-demo-field>.shot-demo-canvas{display:block;width:100%;height:100%}
.shot-demo-field .k-demo{position:relative;width:100%;height:100%}
.shot-demo-field .k-demo-field{position:absolute;left:0;top:0;width:100%}
.shot-demo-field .k-demo-field>svg{display:block;width:100%;height:100%}
.shot-demo-field .k-demo-over{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.k-demo-touch{fill:var(--you,var(--pencil));fill-opacity:.2;stroke:var(--you,var(--pencil));stroke-opacity:.85;stroke-width:6px}
.k-demo-hand-shade{fill:#050d18;fill-opacity:.22}
.k-demo-hand{fill:#fffdf7;stroke:#14253a;stroke-width:1.150px;stroke-linejoin:round}
.k-demo-hand-folds{fill:none;stroke:#14253a;stroke-width:.95px;stroke-linecap:round}
.k-demo-rule{stroke:var(--line);stroke-width:2px}
.k-demo-track,.k-demo-fill{stroke-width:14px;stroke-linecap:round}
.k-demo-track{stroke:var(--line)}
.k-demo-fill{stroke:var(--pencil)}
.k-demo-thumb{fill:var(--play-paper);stroke:var(--pencil);stroke-width:7px}
.k-demo-trail{fill:none;stroke:var(--ink-3);stroke-width:4px;stroke-opacity:.5;stroke-linecap:round;stroke-linejoin:round}
/* The ready card: the demo plays between the objective and Play, at a size
   that keeps Play on screen; Practice first sits alone under Play. The frame
   is drawn at its final size at once and the picture fades in, so nothing in
   the card moves while the demo loads. */
:root[data-theme] body.shot-ready #controls>.ready-links{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;column-gap:14px}
#shot-ready .ready-demo{display:grid;justify-items:center;margin-top:18px}
/* The demo is the shot's picture, so the objective stands alone over it,
   without the icon tile the strip above already shows. */
body.ready-demoed #shot-ready .ready-summary{grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center}
body.ready-demoed #shot-ready .ready-mark{display:none}
body.ready-demoed #shot-ready h2{text-wrap:balance}
#shot-ready .ready-demo .shot-demo-field>*{opacity:0;transition:opacity .45s cubic-bezier(.2,.8,.2,1)}
#shot-ready .ready-demo.is-live .shot-demo-field>*{opacity:1}
/* The header's play mark is the demo mid-shot. The ready card already plays
   it, and a reveal is past needing it, so there the mark steps aside (its
   slot is kept, so the title never shifts). */
body.shot-ready.ready-demoed .shot-help-btn,body[data-phase="reveal"] .shot-help-btn{visibility:hidden;pointer-events:none}
/* The peek: small, over the field's top corner, below the clock's bar. */
.shot-demo-peek{position:absolute;z-index:6;top:12px;right:10px;width:min(44%,224px);border-radius:14px;box-shadow:0 14px 32px -14px rgba(3,10,22,.55),0 2px 8px rgba(3,10,22,.16);transform-origin:top right;cursor:pointer}
.shot-demo-peek>.shot-demo-field{width:100%;aspect-ratio:var(--demo-aspect,1);border-color:var(--es-line-strong,var(--line))}
.shot-demo-peek.is-closing{pointer-events:none}
/* The help button reads as "watch how", and as a close while the demo is open. */
.shot-help-btn .glyph-close,.shot-help-btn.is-open .glyph-play{display:none}
.shot-help-btn.is-open .glyph-close{display:inline}
@media (prefers-reduced-motion:reduce){#shot-ready .ready-demo .shot-demo-field>*{transition:none}}
/* One finger holds the answer on the field while another presses Lock in. The
   field takes no pan or zoom (touch-action:none), and nor does Lock in during a
   shot, so the browser can never read the two touches as a pinch and cancel them. */
body[data-phase="play"] #controls [data-score-commit]{touch-action:none}
