/* Layan.ai — Play: "Before you say it" (fill in the blanks by voice) and the memory challenge. Quiet, one thing at a time. */
.play-body { background: var(--abyss); }
.play { position: relative; min-height: calc(100vh - 64px); padding: clamp(72px, 9vw, 104px) var(--gutter) 64px; display: grid; justify-items: center; align-content: start; overflow-x: clip; }
.play::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 12%, rgba(96, 157, 252, 0.16), transparent 70%), radial-gradient(40% 40% at 85% 70%, rgba(176, 140, 255, 0.10), transparent 70%); }
.play-wisp { width: min(420px, 78vw); height: auto; aspect-ratio: 420 / 220; position: relative; z-index: 1; margin-bottom: 4px; }
.stage { display: none; position: relative; z-index: 1; width: min(760px, 100%); text-align: center; gap: 14px; justify-items: center; animation: rise 360ms var(--ease-out) both; }
.stage.is-on { display: grid; }
.stage-read, .stage-memory { text-align: left; justify-items: stretch; }
.stage-memory { width: min(1040px, 100%); }
.kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal); margin: 0; }
.stage h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.4rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.02; margin: 0; }
.stage h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 500; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.lede { font-size: var(--fs-md); color: var(--frost); max-width: 52ch; margin: 0; line-height: 1.55; }
.hint { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.hint.is-bad { color: var(--warn); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.stage-read .row, .stage-memory .row { justify-content: flex-start; }
.linkish { font-size: var(--fs-sm); color: var(--frost); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.linkish:hover { color: var(--paper); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* choose */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-top: 10px; }
.mode { text-align: left; display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: var(--r-xl); border: 1px solid var(--line-strong); background: rgba(7, 20, 51, 0.6); backdrop-filter: blur(10px); transition: transform var(--t-ui) var(--ease-out), border-color var(--t-fast), background var(--t-fast); }
.mode:hover, .mode:focus-visible { transform: translateY(-3px); border-color: var(--signal); background: rgba(11, 28, 72, 0.75); }
.mode b { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -0.02em; }
.mode span:not(.mode-orb) { font-size: var(--fs-sm); color: var(--frost); line-height: 1.5; }
.mode em { font-style: normal; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mode-orb { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #fff 0, hsl(var(--h) 95% 78%) 18%, hsl(var(--h) 90% 55%) 46%, hsl(var(--h) 80% 30% / 0.25) 70%, transparent 72%); box-shadow: 0 0 22px hsl(var(--h) 95% 65% / 0.6); }

/* context and inputs */
.ctx-form { display: grid; gap: 12px; width: min(560px, 100%); }
.field-input { width: 100%; font: inherit; font-size: var(--fs-md); color: var(--paper); background: rgba(2, 9, 31, 0.6); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; outline: none; transition: border-color var(--t-fast); }
.field-input:focus { border-color: var(--signal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chips button { font-size: var(--fs-xs); font-weight: 500; padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--frost); background: rgba(170, 206, 253, 0.06); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chips button.is-on, .chips button[aria-checked="true"] { background: rgba(96, 157, 252, 0.22); color: var(--paper); border-color: var(--signal); }
.privacy { width: min(560px, 100%); text-align: left; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.55); font-size: var(--fs-sm); color: var(--frost); line-height: 1.55; }
.privacy p { margin: 0; } .privacy b { color: var(--paper); font-weight: 500; }

/* reading */
.read-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.read-tools { display: flex; align-items: center; gap: 16px; }
.timer { font-size: var(--fs-sm); color: var(--frost); }
.laya-line { min-height: 1.5em; margin: 0; font-size: var(--fs-md); color: var(--frost); font-style: italic; }
.laya-line::before { content: "Laya  "; font-family: "Great Vibes", cursive; font-style: normal; font-size: 1.5rem; color: var(--signal); margin-right: 4px; }
.statement { margin: 4px 0 0; font-size: clamp(1.35rem, 1rem + 1.6vw, 2rem); line-height: 1.75; letter-spacing: -0.01em; color: var(--muted); text-wrap: pretty; }
.statement .w { transition: color var(--t-ui), text-shadow var(--t-ui); }
.statement .w.is-read { color: var(--paper); }
.statement .w.is-next { color: var(--paper-2); }
.statement .blank { display: inline-block; min-width: 2.2em; padding: 0 0.3em; margin: 0 0.05em; border-radius: 8px; border-bottom: 2px solid var(--signal); background: rgba(96, 157, 252, 0.10); color: var(--signal); font-family: var(--font-mono); font-size: 0.82em; letter-spacing: 0.06em; text-align: center; }
.statement .blank.is-current { animation: pulse-blank 1.6s ease-in-out infinite; }
.statement .blank.is-filled { background: rgba(61, 220, 151, 0.18); border-bottom-color: var(--ok); color: var(--ok); font-family: inherit; font-size: 1em; letter-spacing: 0; animation: fill-in 420ms var(--ease-out) both; }
.statement .blank.is-hinted { border-bottom-color: var(--warn); color: var(--warn); background: rgba(242, 184, 75, 0.12); }
.statement .blank .ms { font-family: var(--font-mono); font-size: 0.5em; letter-spacing: 0.02em; color: var(--muted); margin-left: 5px; vertical-align: 0.35em; }
@keyframes pulse-blank { 50% { background: rgba(96, 157, 252, 0.22); } }
@keyframes fill-in { from { transform: scale(0.85); filter: brightness(2); } to { transform: none; filter: none; } }
.listen { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.listen .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.listen.is-live .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.4s infinite; --pill-c: var(--ok); }
.type-form { width: min(420px, 100%); }
.next { padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.5); display: grid; gap: 8px; }
.next-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--muted); }
.next-head em { font-style: normal; letter-spacing: 0.02em; text-transform: none; font-size: var(--fs-xs); color: var(--frost); filter: blur(5px); transition: filter 600ms var(--ease-out); }
.next-head em.is-ready { filter: none; }
.next-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.next-steps li { font-size: var(--fs-xs); padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); filter: blur(4px); opacity: 0.6; transition: filter 600ms var(--ease-out), opacity 600ms, color 300ms, border-color 300ms; }
.next-steps li.is-done { filter: none; opacity: 1; color: var(--paper-2); }
.next-steps li.is-now { filter: none; opacity: 1; color: var(--paper); border-color: var(--signal); background: rgba(96, 157, 252, 0.12); }
.next-q { margin: 0; font-size: var(--fs-sm); color: var(--frost); min-height: 1.4em; filter: blur(6px); opacity: 0.5; transition: filter 700ms var(--ease-out), opacity 700ms; }
.next-q.is-ready { filter: none; opacity: 1; }

/* result */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.stat { padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.55); display: grid; gap: 2px; }
.stat b { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--fs-xs); color: var(--muted); }
.understood { width: 100%; text-align: left; display: grid; gap: 8px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: rgba(7, 20, 51, 0.7); }
.understood h3 { margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.understood dl { margin: 0; display: grid; gap: 6px; } .understood dt { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); } .understood dd { margin: 0 0 4px; color: var(--paper); }
.closing { font-family: "Great Vibes", cursive; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); color: var(--paper); margin: 4px 0; min-height: 1.4em; }

/* memory */
.mem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mem-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.mem-main { display: grid; gap: 14px; justify-items: center; min-width: 0; }
.mem-setup { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; width: 100%; }
.mem-setup .field-input { width: 220px; }
.race { display: grid; gap: 8px; width: min(520px, 100%); }
.race-row { display: grid; grid-template-columns: 56px 1fr 64px; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--frost); }
.race-row .mono { text-align: right; } .who { color: var(--paper); }
.bar { height: 8px; border-radius: 4px; background: rgba(170, 206, 253, 0.12); overflow: hidden; } .bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--signal); transition: width 320ms var(--ease-out); } .bar-laya i { background: var(--ev-assumed); }
.board { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 84px)); gap: 10px; perspective: 900px; justify-content: center; }
.mcard { position: relative; aspect-ratio: 1; border-radius: 16px; transform-style: preserve-3d; transition: transform 420ms var(--ease-out); }
.mcard.is-up, .mcard.is-matched { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mcard .back { background: radial-gradient(circle at 50% 45%, rgba(96, 157, 252, 0.22), transparent 55%), linear-gradient(180deg, rgba(11, 28, 72, 0.95), rgba(4, 12, 34, 0.98)); border: 1px solid var(--line-strong); }
.mcard .back::after { content: ""; width: 30%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(170, 206, 253, 0.4); }
.mcard .front { transform: rotateY(180deg); border: 1px solid hsl(var(--h) 90% 70% / 0.6); background: radial-gradient(circle at 50% 45%, hsl(var(--h) 95% 62% / 0.55), hsl(var(--h) 80% 22% / 0.9) 70%); box-shadow: inset 0 0 24px hsl(var(--h) 95% 70% / 0.35); }
.mcard .front span { font-size: 1.9rem; color: #fff; text-shadow: 0 0 14px hsl(var(--h) 95% 70%); }
.mcard.is-matched .front { box-shadow: 0 0 22px hsl(var(--h) 95% 65% / 0.7), inset 0 0 24px hsl(var(--h) 95% 70% / 0.45); }
.mcard[aria-disabled="true"] { cursor: default; } .mcard:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.laya-strip { display: grid; grid-template-columns: repeat(8, 26px); gap: 5px; justify-content: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(7, 20, 51, 0.5); }
.lcard { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: rgba(11, 28, 72, 0.9); font-size: 0.8rem; color: transparent; transition: background var(--t-fast), color var(--t-fast); }
.lcard.is-up { color: #fff; background: hsl(var(--h) 80% 38%); border-color: hsl(var(--h) 90% 70% / 0.7); }
.lcard.is-matched { box-shadow: 0 0 10px hsl(var(--h) 95% 65% / 0.7); }
.mem-msg { min-height: 1.4em; margin: 0; font-size: var(--fs-sm); color: var(--frost); text-align: center; }
.mem-result { width: min(520px, 100%); padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: rgba(7, 20, 51, 0.75); display: grid; gap: 10px; text-align: left; }
.mem-result h3 { margin: 0; font-size: var(--fs-lg); font-weight: 500; }
.lb { padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.55); display: grid; gap: 8px; text-align: left; min-width: 0; }
.lb h3 { margin: 0; font-size: var(--fs-md); font-weight: 500; } .lb h4 { margin: 8px 0 0; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.lb-note { margin: 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; }
.lb-list, .lb-recent { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.lb-list li, .lb-recent li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: baseline; font-size: var(--fs-xs); padding: 5px 8px; border-radius: var(--r-sm); background: rgba(170, 206, 253, 0.05); color: var(--paper-2); }
.lb-recent li { grid-template-columns: 1fr auto; }
.lb-list li.is-you { background: rgba(96, 157, 252, 0.2); color: var(--paper); }
.lb-list .n { color: var(--muted); font-family: var(--font-mono); } .lb-list .nm, .lb-recent .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-recent .sub { color: var(--muted); font-size: 0.68rem; }

@media (max-width: 860px) { .modes { grid-template-columns: 1fr; } .mem-grid { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } .next-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .board { grid-template-columns: repeat(var(--cols, 4), minmax(0, 68px)); gap: 8px; } .mcard .front span { font-size: 1.5rem; } .read-top { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .stage, .mcard, .bar i, .statement .blank.is-filled { animation: none; transition: none; } .statement .blank.is-current { animation: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
[hidden] { display: none !important; }
@media (max-width: 520px) { .play-wisp { width: 190px; } .play { padding-top: 56px; } }
.play { grid-template-columns: minmax(0, 1fr); }
.stage h1:focus, .stage h2:focus { outline: none; }
@media (max-width: 1100px) { .mem-grid { grid-template-columns: minmax(0, 1fr); } .stage-memory .lb { max-width: 520px; width: 100%; justify-self: center; } }
.stage h1:focus-visible, .stage h2:focus-visible { outline: none; box-shadow: none; }
