/* Higher or Lower (inc/hilo.php, assets/js/hilo.js): the two bars and the
   scale from 0 to 180 as the app draws them (css/style.css .hl-bars/.hl-scale),
   the hero demo, the five visits against 41 / 26, the example game, the
   settings and the two dead ends. Loaded only with the block. Prefix .hl- */

.hilo-demo, .hl-zones-fig, .hl-ends-fig { --hl-bad: var(--danger, #f06a6a); }
.hl-replay, .hl-opts { --hl-bad: var(--danger, #f06a6a); }

/* ---- the bars and the scale */
.hl-bars { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; width: 100%; }
.hl-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 9px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid rgba(61, 220, 132, 0.45); transition: opacity 0.3s, border-color 0.3s; }
.hl-bar small { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hl-bar b { font-size: 40px; line-height: 1; color: var(--cream); font-variant-numeric: tabular-nums; }
.hl-bar em { font-size: 13px; line-height: 1; font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }
.hl-bar.off { opacity: 0.42; border-color: transparent; }
.hl-bar.fresh b { color: var(--accent); animation: hlPop 0.6s cubic-bezier(0.3, 1.45, 0.45, 1); }
@keyframes hlPop { 0% { transform: scale(0.6); } }

.hl-scale { position: relative; width: 100%; box-sizing: border-box; height: 10px; margin-top: 22px; border-radius: 5px; background: rgba(61, 220, 132, 0.55); }
.hl-mid { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--hl-bad) 70%, var(--surface-2)); transition: left 0.6s var(--out), width 0.6s var(--out); }
.hl-dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; box-sizing: border-box; border-radius: 50%; background: var(--cream); border: 2px solid var(--bg); transition: left 0.45s var(--out), background 0.3s, opacity 0.3s; }
.hl-dot b { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font: 700 13px/1 var(--font-num); color: var(--text); white-space: nowrap; }
.hl-dot.ok { background: var(--accent); }
.hl-dot.bad { background: var(--hl-bad); }
.hl-dot.is-hidden { opacity: 0; }
.hl-ends { display: flex; justify-content: space-between; width: 100%; margin-top: 5px; font: 600 11px/1 var(--font-num); color: var(--faint); }

/* an outcome */
.hl-tag { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 26px; padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 13px; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.hl-tag.is-ok { color: var(--accent); border-color: rgba(61, 220, 132, 0.45); }
.hl-tag.is-equal { color: var(--text); border-color: var(--line-strong); }
.hl-tag.is-bad { color: var(--cream); border-color: color-mix(in srgb, var(--hl-bad) 70%, transparent); }
.hl-tag.is-bonus { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.hl-tag i { display: inline-flex; width: 14px; height: 14px; flex: none; }
.hl-tag svg { width: 100%; height: 100%; fill: none; stroke: var(--hl-bad); stroke-width: 2.2; stroke-linejoin: round; }

/* ---- the hero: two cards, the visit, the bars */
.hilo-demo { margin: 0; }
.hilo-demo-body { position: relative; overflow: hidden; isolation: isolate; }
.hilo-demo .hl-art { position: absolute; z-index: -1; right: -90px; top: -90px; width: 300px; height: 300px; opacity: 0.5; pointer-events: none; }
.hilo-demo .hl-art svg { display: block; width: 100%; height: 100%; animation: artDrift 120s linear infinite; }
.hl-cards.bt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
.hl-cards .bt-card { padding-bottom: 14px; }
.hl-center { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 22px 18px; text-align: center; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.hl-sum { font-size: clamp(72px, 7.5vw, 104px); line-height: 0.95; color: var(--cream); font-variant-numeric: tabular-nums; }
.hl-center .bt-who { margin-bottom: 6px; }
.hl-center .bt-chips { width: 100%; max-width: 300px; }
.hl-center .bt-hint { margin: 8px 0 12px; }
.hl-center .hl-bars { max-width: 380px; }
.hl-center .hl-scale, .hl-center .hl-ends { max-width: 380px; }
.hilo-demo figcaption { margin-top: 14px; }
.hilo-demo .bt-cards, .hilo-demo .hl-center > * { transition: opacity 0.4s; }
.hilo-demo.is-fading .bt-cards, .hilo-demo.is-fading .hl-center > * { opacity: 0.3; }
@media (max-width: 560px) {
	.hl-cards.bt-cards { padding: 10px; gap: 6px; }
	.hl-cards .bt-card { padding: 10px 10px 30px; }
	.hl-cards .bt-pips { right: auto; left: 10px; bottom: 8px; }
	.hl-center { padding: 16px 12px 14px; }
	.hl-sum { font-size: 68px; }
	.hl-bar b { font-size: 32px; }
	.hilo-demo .hl-art { width: 220px; height: 220px; right: -70px; top: -70px; }
}

/* ---- five visits against 41 / 26 */
.hl-zones-fig { margin: 0; }
.hl-zones-head { max-width: 360px; margin: 0 0 14px; }
.hl-zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hl-zones > li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 250px minmax(0, 1fr); align-items: center; gap: 8px 18px; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); }
.hl-zones > li.is-bad { border-color: color-mix(in srgb, var(--hl-bad) 45%, var(--line)); }
.hl-zones-n { font-size: 40px; line-height: 1; color: var(--cream); font-variant-numeric: tabular-nums; }
.hl-zones > li.is-ok .hl-zones-n { color: var(--accent); }
.hl-zones-scale .hl-scale { margin-top: 0; }
.hl-zones-scale .hl-dot b { display: none; }
.hl-zones p { margin: 0; }
.hl-zones .hl-tag { justify-self: start; }
.hl-zones-fig figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
	.hl-zones > li { grid-template-columns: 52px minmax(0, 1fr); padding: 12px 14px; }
	.hl-zones-n { font-size: 34px; grid-row: span 2; }
	.hl-zones .hl-tag { justify-self: start; }
	.hl-zones p { grid-column: 1 / -1; }
}

/* ---- the example game: five visits in a row (cards and arrows of .bt-round) */
.bt-round.hl-replay { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hl-replay > li.is-high, .hl-replay > li.is-low { border-color: rgba(61, 220, 132, 0.35); }
.hl-replay > li.is-middle { border-color: color-mix(in srgb, var(--hl-bad) 45%, var(--line)); }
.hl-replay-bars { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hl-replay-bars small { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hl-replay-bars b { font-size: 20px; line-height: 1; color: var(--muted); white-space: nowrap; }
.hl-replay-who { margin-top: 6px; font-weight: 700; color: var(--text); }
.hl-replay-darts { font: 600 15px/1.2 var(--font-num); letter-spacing: 0.03em; }
.hl-replay-sum { font-size: 52px; line-height: 1; color: var(--cream); font-variant-numeric: tabular-nums; }
.hl-replay > li.is-high .hl-replay-sum, .hl-replay > li.is-low .hl-replay-sum { color: var(--accent); }
.hl-replay .hl-scale { margin: 4px 0 6px; height: 8px; }
.hl-replay .hl-dot { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.hl-replay .hl-dot b { display: none; }
.hl-replay .hl-tag { align-self: flex-start; }
.hl-replay-next { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 12px; }
.hl-replay > li.is-middle .hl-replay-next { color: var(--accent); font-weight: 600; }
@media (max-width: 1100px) { .bt-round.hl-replay { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bt-round.hl-replay > li:nth-child(3n)::after { display: none; } .bt-round.hl-replay > li:last-child { grid-column: span 2; } }
@media (max-width: 560px) { .bt-round.hl-replay { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hl-replay-sum { font-size: 42px; } .hl-replay-bars b { font-size: 17px; } }

/* ---- the settings (cards of .bt-opts) */
.bt-opts.hl-opts > li { scroll-margin-top: calc(var(--header) + 16px); }
.hl-opt-fig { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; padding: 16px; box-sizing: border-box; border-radius: var(--r-m); background: color-mix(in srgb, var(--bg) 55%, var(--surface)); margin-bottom: 16px; }
.hl-opt-fig .bt-chips { width: 100%; max-width: 240px; }
.hl-opt-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; }
.hl-opt-line > .num { font-size: 34px; line-height: 1; color: var(--cream); }
.hl-opt-line small { color: var(--muted); font-size: 12.5px; }
.hl-presets { align-items: stretch; gap: 14px; }
.hl-preset { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; }
.hl-preset-name { font-size: 20px; line-height: 1; color: var(--cream); white-space: nowrap; }
.hl-preset-name small { display: block; margin-top: 3px; font: 600 10.5px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hl-preset .hl-scale { margin: 0; }
.hl-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.hl-chips span { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.hl-lives { align-items: stretch; }
.hl-life-row { display: grid; grid-template-columns: 24px auto 1fr; align-items: center; gap: 12px; }
.hl-life-row > .num { font-size: 24px; color: var(--cream); }
.hl-life-row small { justify-self: end; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hl-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.hl-switch > span:first-child:not(.hl-way) { min-width: 34px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }
.hl-switch > span.is-on { background: var(--accent); color: var(--accent-ink); }
.hl-switch > b.num { font-size: 34px; line-height: 1; color: var(--accent); min-width: 64px; text-align: right; }
.hl-way { color: var(--text); font-weight: 600; font-size: var(--fs-sm); min-width: 130px; }
.hl-keep { align-items: stretch; gap: 10px; }
.hl-keep-row { display: grid; grid-template-columns: 44px auto auto auto; align-items: center; justify-content: start; gap: 10px; }
.hl-keep-row .num { font-size: 22px; line-height: 1; color: var(--cream); white-space: nowrap; }
.hl-keep-row i { font-style: normal; color: var(--faint); }
.hl-keep-row .is-reset { color: var(--accent); }
.hl-keep-k { padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }
.hl-keep-k.is-on { background: var(--accent); color: var(--accent-ink); }
.hl-keep-note { margin-top: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 1000px) { .hl-opt-fig { min-height: 0; } }

/* the closing screenshot below the screen section */
.split + .hl-shot-end { margin-top: clamp(32px, 4vw, 48px) !important; max-width: 940px; }

/* ---- the two dead ends */
.hl-ends-fig { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hl-ends-fig > li { box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); }
.hl-ends-fig .hl-opt-line { justify-content: flex-start; margin: 16px 0 12px; }
.hl-ends-fig .hl-opt-line b { font-size: 22px; color: var(--cream); }
.hl-ends-fig p { margin: 0; }
.hl-ends-fig + .checks { margin-top: clamp(32px, 4vw, 48px) !important; }
@media (max-width: 760px) { .hl-ends-fig { grid-template-columns: 1fr; } }

/* ---- coming in (reveal.js marks .hl-zones-fig, .hl-ends-fig > li and the cards it knows) */
.hl-zones-fig.rv .hl-zones > li { opacity: 0; transform: translateX(-12px); }
.hl-zones-fig.rv-in .hl-zones > li { opacity: 1; transform: none; transition: opacity 0.5s var(--out), transform 0.6s var(--out); transition-delay: calc(200ms + var(--i, 0) * 120ms); }
.hl-zones-fig.rv .hl-dot, .hl-replay > li.rv .hl-dot, .hl-ends-fig > li.rv .hl-mid { opacity: 0; }
.hl-zones-fig.rv-in .hl-dot, .hl-replay > li.rv-in .hl-dot { opacity: 1; transition: opacity 0.4s 0.6s, left 0.45s var(--out); }
.hl-ends-fig > li.rv-in .hl-mid { opacity: 1; transition: opacity 0.6s 0.3s; }

@media (prefers-reduced-motion: reduce) {
	.hl-bar, .hl-mid, .hl-dot, .hl-tag { transition: none !important; }
	.hl-bar.fresh b, .hilo-demo .hl-art svg { animation: none !important; }
	.hl-zones-fig .hl-zones > li, .hl-zones-fig .hl-dot, .hl-replay .hl-dot, .hl-ends-fig .hl-mid { opacity: 1 !important; transform: none !important; }
}
