/* Phone round screens, group A, in Puzzle studio: Close Enough and Sample It, Put in Order,
   Four Groups, Weigh the Evidence, Toxic Combination, Find It, Incident Path.
   The round's family colour arrives as --accent from the phone shell. Tokens are in base.css. */

/* ---- Close Enough and Sample It: a chunky number line in the round colour, a thumb you press, nudge cards ---- */
.guess { display: grid; gap: 4px; }
.readout { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1.15; color: var(--accent, var(--blue)); font-variant-numeric: tabular-nums; text-align: center; letter-spacing: -0.02em; min-height: 46px; overflow-wrap: anywhere; }
.readout.idle { font-weight: 800; font-size: 24px; color: var(--ink-3); letter-spacing: -0.01em; }
.readout.truth { color: var(--ink); }
.nline { position: relative; height: 68px; --inset: 22px; }
.nline .track { position: absolute; left: var(--inset); right: var(--inset); top: 27px; height: 14px; border-radius: 7px; background: var(--well); border: 2px solid var(--line-2); overflow: hidden; }
.nline .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--accent, var(--blue)); }
.nline .gap { position: absolute; left: var(--a, 0%); width: var(--w, 0%); top: 0; bottom: 0; background: var(--line-2); }
.nline input[type='range'] { position: absolute; left: 0; top: 2px; width: 100%; height: 64px; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.nline input[type='range']::-webkit-slider-runnable-track { height: 64px; background: transparent; border: 0; }
.nline input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 44px; height: 44px; margin-top: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); box-shadow: 0 4px 0 var(--accent, var(--blue)); transition: transform .08s, box-shadow .08s; }
.nline input[type='range']:active::-webkit-slider-thumb { transform: translateY(4px); box-shadow: 0 0 0 var(--accent, var(--blue)); background: var(--well); }
.nline input[type='range']::-moz-range-track { height: 64px; background: transparent; border: 0; }
.nline input[type='range']::-moz-range-thumb { width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); box-shadow: 0 4px 0 var(--accent, var(--blue)); }
.nline input[type='range']:focus-visible { outline: none; }
.nline input[type='range']:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--blue); outline-offset: 3px; }
.nline input[type='range']:focus-visible::-moz-range-thumb { outline: 3px solid var(--blue); outline-offset: 3px; }
.nline input[type='range']:disabled { opacity: 0; pointer-events: none; }
/* On reveal: your guess and the answer as two marked points, the gap between them on the track */
.nline .marks { position: absolute; left: var(--inset); right: var(--inset); top: 0; bottom: 0; pointer-events: none; }
.nline .mark { position: absolute; left: var(--x); top: 34px; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--card); display: grid; place-items: center; }
.nline .mark.you { background: var(--accent, var(--blue)); z-index: 2; }
/* The answer is a pin above the track: a green circle with a tick, a stem down to the scale, so the guess dot never hides under it */
.nline .mark.ans { top: 0; transform: translateX(-50%); width: 26px; height: 26px; border-width: 2px; background: var(--ok); color: var(--white); z-index: 1; }
.nline .mark.ans::after { content: ''; position: absolute; left: 50%; top: 100%; width: 3px; height: 12px; margin-left: -1.5px; background: var(--ok); }
.nline .mark.ans svg { width: 14px; height: 14px; }
.nline .lab { position: absolute; left: var(--x); transform: translateX(-50%); font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nline .lab.ans { top: 7px; transform: none; margin-left: 17px; color: var(--ok); }
.nline .lab.ans.r { transform: translateX(-100%); margin-left: -17px; }
.answers .opt.none { justify-content: center; --c: var(--accent, var(--blue)); }
.nline .lab.you { top: 54px; color: var(--accent, var(--blue)); }
.nline .lab.you.l { transform: none; margin-left: -14px; }
.nline .lab.you.r { transform: translateX(-100%); margin-left: 14px; }
.ends { display: flex; justify-content: space-between; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* The number verdicts ("Some way off") sit beside a decimal score, so the label steps down a size */
.fb-tight .feedback .verdict b { font-size: min(25px, 6.2vw); line-height: 1.05; }
.nudge { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.nudge button { min-height: 48px; padding: 0 4px; border: 2px solid var(--line); border-radius: var(--r-control); background: var(--card); color: var(--ink); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; box-shadow: 0 var(--edge-sm) 0 var(--line-2); margin-bottom: var(--edge-sm); transition: transform .08s, box-shadow .08s; }
.nudge button:active { transform: translateY(var(--edge-sm)); box-shadow: 0 0 0 var(--line-2); background: var(--well); }
.nudge button:disabled { color: var(--ink-3); border-color: var(--line); box-shadow: 0 var(--edge-sm) 0 var(--line); transform: none; cursor: default; }

/* ---- Put in Order: each line a pressable white card; the numbered chip fills in the family colour ---- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lines .line { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px 10px 10px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--card); color: var(--ink); text-align: left; font-size: 15px; font-weight: 600; line-height: 1.3; box-shadow: 0 var(--edge) 0 var(--line-2); margin-bottom: var(--edge); transition: transform .08s, box-shadow .08s, background-color .12s; }
.lines button.line:active { transform: translateY(var(--edge)); box-shadow: 0 0 0 var(--line-2); background: var(--well); }
.lines .line .no { flex: none; width: 40px; height: 40px; border-radius: var(--r-chip); border: 2px dashed var(--line-2); display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--white); font-variant-numeric: tabular-nums; }
.lines .line .txt { flex: 1; min-width: 0; }
.lines .line.set { border-color: var(--accent, var(--blue)); box-shadow: 0 var(--edge) 0 var(--accent, var(--blue)); }
.lines .line.set .no { background: var(--accent, var(--blue)); border: 0; }
.lines .line b { font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 6px; }
.lines .line .when { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.lines .line .was { margin-left: 10px; color: var(--red-text); }
.lines .line.ok .was { color: var(--white); }
/* Reveal, in place: right ones green with a tick, wrong ones carry the correct number */
.lines .line .verdict-mark { flex: none; width: 24px; height: 24px; }
.lines .line.ok { background: var(--ok); border-color: var(--ok); color: var(--white); box-shadow: 0 var(--edge) 0 var(--ok-deep); }
.lines .line.ok .no { background: var(--white); border: 0; color: var(--ok); }
.lines .line.ok .when { color: var(--white); opacity: .88; }
.lines .line.off { border-color: var(--red-text); box-shadow: 0 var(--edge) 0 var(--red-text); }
.lines .line.off .no { background: var(--red-text); border: 0; }

/* ---- Four Groups: pressable tiles that sink and go dark when picked, found groups as colour bars, mistakes as dots ---- */
.gridtop { display: flex; align-items: center; justify-content: flex-end; min-height: 22px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.gridtop .miss { display: inline-flex; align-items: center; gap: 6px; }
.gridtop .miss i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card); }
.gridtop .miss i.hit { background: var(--red-text); border-color: var(--red-text); }
.found { display: grid; gap: 8px; }
.found div { padding: 10px 14px; border-radius: var(--r-tile); text-align: center; color: var(--white); }
.found b { display: block; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; line-height: 1.2; }
.found span { display: block; font-size: 13px; margin-top: 2px; line-height: 1.35; }
.found .missed { background: var(--card); border: 2px dashed var(--line-2); color: var(--ink); }
.found .missed span { color: var(--ink-2); }
/* A found group takes the next option colour, solid, so no bar reads as right or wrong */
.found .g0 { background: var(--o1); } .found .g1 { background: var(--o2); } .found .g2 { background: var(--o3); color: var(--ink); } .found .g3 { background: var(--o4); }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile { aspect-ratio: 1 / 0.9; padding: 3px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.15; overflow-wrap: anywhere; hyphens: manual; box-shadow: 0 var(--edge-sm) 0 var(--line-2); margin-bottom: var(--edge-sm); transition: transform .08s, box-shadow .08s, background-color .1s; }
/* A tile whose longest word does not fit at 13 px takes a size down, that tile only (grid.js measures) */
.tile.tight { font-size: 12px; letter-spacing: -0.01em; }
.tile:active { transform: translateY(var(--edge-sm)); box-shadow: 0 0 0 var(--line-2); background: var(--well); }
.tile[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--white); transform: translateY(var(--edge-sm)); box-shadow: 0 0 0 var(--ink); }
.gridmsg { min-height: 20px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.gridbar { display: flex; align-items: center; gap: 6px; }
.gridbar .btn.quiet { padding: 0 10px; font-size: 15px; }
.gridbar [data-submit] { margin-left: auto; min-height: 50px; padding: 0 26px; }
.gridbar [data-submit]:disabled { background: var(--card); color: var(--ink-2); border: 2px solid var(--line-2); box-shadow: 0 var(--edge) 0 var(--line-2); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---- Weigh the Evidence and Toxic Combination: option cards with the mark chips; multi-select fills a check ---- */
.opt.second .pts-tag, .opt.right .pts-tag { color: inherit; }
.opt.second { display: flex; gap: 14px; padding: 12px 16px; } /* play.css gives .second (the second-chance panel) a grid; the option card wins here */
.opt.check-opt .box { margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--card); color: var(--white); display: grid; place-items: center; }
.opt.check-opt .box svg { width: 16px; height: 16px; opacity: 0; }
.opt.check-opt[aria-pressed='true'] { background: var(--card); border-color: var(--c); }
.opt.check-opt[aria-pressed='true'] .box { background: var(--c); border-color: var(--c); color: var(--c-ink); }
.opt.check-opt[aria-pressed='true'] .box svg { opacity: 1; }
.opt.check-opt.right, .opt.check-opt.right[aria-pressed='true'] { background: var(--ok); border-color: var(--ok); }
.opt.check-opt.wrong, .opt.check-opt.wrong[aria-pressed='true'] { background: var(--card); border-color: var(--red-text); }
.opt.check-opt.right .box { background: var(--white); border-color: var(--white); color: var(--ok); }
.opt.check-opt.right .box svg { opacity: 1; }
.opt.check-opt.wrong .box { background: var(--card); border-color: var(--red-text); color: var(--red-text); }
.opt.check-opt.wrong .box svg { opacity: 1; }
.opt.check-opt.quiet-ok { color: var(--ink-3); border-color: var(--line); box-shadow: 0 var(--edge) 0 var(--line); }
.opt.check-opt.quiet-ok .chip.mark { opacity: .45; }
.opt.check-opt.quiet-ok .box { border-color: var(--line); }

/* ---- Find It: the document as one white card on the edge, a title strip in the round colour, tappable lines ---- */
.doc { border: 2px solid var(--line); border-radius: var(--r-tile); overflow: hidden; background: var(--card); box-shadow: 0 var(--edge) 0 var(--line-2); margin-bottom: var(--edge); }
.doc-title { padding: 10px 14px; background: var(--accent, var(--blue)); color: var(--white); font-size: 13px; font-weight: 700; line-height: 1.3; }
.doc-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; text-align: left; padding: 11px 14px; border: 0; border-top: 1.5px solid var(--line); background: none; color: var(--ink); font-size: 15px; line-height: 1.4; transition: background-color .08s; }
.doc-line:first-of-type { border-top: 0; }
.doc-line:active { background: var(--well); }
.doc-line:disabled { cursor: default; }
.doc-line .verdict-mark { flex: none; width: 22px; height: 22px; }
.doc-line.right { background: var(--ok-soft); font-weight: 600; }
.doc-line.right .verdict-mark { color: var(--ok); }
.doc-line.wrong { background: var(--red-soft); }
.doc-line.wrong .verdict-mark { color: var(--red-text); }

/* ---- Incident Path: the earlier decisions as a path of dots joined by a line, the current one red ---- */
.trail { list-style: none; margin: 0; padding: 0; display: grid; }
.trail li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 12px; }
.trail li::before { content: ''; position: absolute; left: 12px; top: 30px; bottom: -2px; border-left: 3px dashed var(--line-2); }
.trail li:last-child::before { display: none; }
.trail .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--accent, var(--blue)); color: var(--white); display: grid; place-items: center; font: 900 13px/1 var(--display); font-variant-numeric: tabular-nums; }
.trail li span { font-size: 13px; color: var(--ink-3); line-height: 1.35; padding-top: 1px; }
.trail li b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.3; }
.trail li.now .dot { background: var(--card); box-shadow: inset 0 0 0 3px var(--red); color: var(--red-text); }
.trail li.now { padding-bottom: 0; }
.trail li.now span { padding-top: 7px; font-weight: 600; }
.opt .pts-tag + .verdict-mark { margin-left: 8px; }
