/* Play screen: calm, the question and the answer area are the only loud things. */
.play { gap: var(--s-3); max-width: 44rem; width: 100%; margin: 0 auto; }
.play-bar { display: flex; align-items: center; gap: var(--s-2); }
.depth { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.depth-block { height: 18px; background: var(--stone-light); border: 2px solid var(--ink); border-radius: 3px; }
.depth-block.current { background: var(--white); box-shadow: 0 0 0 2px var(--gold); }
.depth-block.gem { background: var(--gem); animation: mined 320ms var(--ease); }
.depth-block.ok { background: var(--gold); animation: mined 320ms var(--ease); }
.depth-block.miss { background: var(--stone-dark); }
@keyframes mined { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.question {
  background: var(--paper); border: var(--edge); border-radius: var(--radius); box-shadow: var(--drop);
  padding: var(--s-4); display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center;
}
.question-text { font-size: var(--text-question); font-weight: 700; line-height: 1.35; text-wrap: balance; }
.question-sub { font-size: var(--text-sm); color: var(--ink-soft); }
.question-expr { font-size: var(--text-expr); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

.visual { display: grid; place-items: center; width: 100%; margin-top: var(--s-1); }
.vis { width: min(100%, 190px); height: auto; }
.vis-wide { width: min(100%, 420px); }
.vis-grid { width: min(100%, 280px); }
.vis-clock { width: min(100%, 180px); }
.vis-objects { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); font-size: 1.6rem; line-height: 1.1; }
.vis-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 12em; }
.vis-group.boxed { border: 2px dashed var(--stone-dark); border-radius: var(--radius); padding: var(--s-1) var(--s-2); max-width: 6.5em; }
.vis-column { display: inline-grid; justify-items: end; font-family: var(--font-display); font-weight: 800; font-size: var(--text-expr); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: 0.12em; }
.vis-column b { margin-right: 0.5em; }
.vis-column-line { width: 100%; height: 4px; background: var(--ink); margin-top: var(--s-1); }
.vis-division { display: inline-flex; align-items: stretch; gap: 0.3em; font-family: var(--font-display); font-weight: 800; font-size: var(--text-expr); font-variant-numeric: tabular-nums; }
.vis-division-box { border-top: 4px solid var(--ink); border-left: 4px solid var(--ink); border-top-left-radius: 10px 60%; padding: 0 0.3em; letter-spacing: 0.1em; }
.vis-table { border-collapse: collapse; background: var(--white); font-variant-numeric: tabular-nums; }
.vis-table th, .vis-table td { border: 2px solid var(--ink); padding: var(--s-1) var(--s-3); text-align: center; }
.vis-table thead th { background: var(--paper-2); }
.vis-picto-row { text-align: left !important; font-size: 1.25rem; letter-spacing: 2px; }
.vis-key { margin-top: var(--s-2); font-weight: 700; }
.vis-pie { display: flex; align-items: center; justify-content: center; gap: var(--s-4); flex-wrap: wrap; }
.vis-pie .vis { width: 150px; }
.vis-legend { display: flex; flex-direction: column; gap: var(--s-1); text-align: left; font-weight: 700; }
.vis-legend li { display: flex; align-items: center; gap: var(--s-2); }
.vis-dot { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 3px; flex: none; }

/* Feedback */
.feedback-slot { display: flex; flex-direction: column; gap: var(--s-2); min-height: 0; }
.feedback { border: var(--edge); border-radius: var(--radius); padding: var(--s-3) var(--s-4); animation: screen-in var(--normal) var(--ease); }
.feedback.good { background: var(--good-bg); border-color: var(--good); text-align: center; }
.feedback.hint { background: var(--hint-bg); border-color: var(--hint); }
.feedback.explain { background: var(--paper); }
.feedback strong { font-family: var(--font-display); }
.feedback-answer { font-size: var(--text-xl); color: var(--good); }

/* Keypad */
.pad { display: flex; flex-direction: column; gap: var(--s-2); max-width: 22rem; width: 100%; margin: 0 auto; }
.pad-display { display: flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 60px; background: var(--white); border: var(--edge); border-radius: var(--radius); box-shadow: inset 0 4px 0 rgb(0 0 0 / 0.08); padding: 0 var(--s-3); }
.pad-value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; min-width: 1ch; }
.pad-value.empty::after { content: "?"; color: var(--stone); }
.pad-unit { font-weight: 800; font-size: var(--text-lg); color: var(--ink-soft); }
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.pad-key { min-height: 56px; font-size: 1.5rem; padding: 0; background: var(--white); }
.pad.locked .pad-key { opacity: 0.5; pointer-events: none; }

/* Choices */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.choice { min-height: 68px; flex-direction: column; gap: 0; font-size: var(--text-lg); background: var(--white); padding: var(--s-2) var(--s-3); }
.choice.right { background: var(--good-bg); border-color: var(--good); }
.choice.wrong { background: var(--bad-bg); opacity: 0.7; }
.choices.locked .choice { pointer-events: none; }

@media (min-width: 900px) and (min-height: 600px) {
  .play { max-width: 62rem; display: grid; grid-template-columns: 1.2fr 1fr; grid-template-areas: "bar bar" "stage answer" "feedback answer"; align-items: start; column-gap: var(--s-5); }
  .play-bar { grid-area: bar; }
  .stage { grid-area: stage; }
  .feedback-slot { grid-area: feedback; }
  .answer-area { grid-area: answer; }
  .play > .result, .play > .boot, .play > .panel { grid-column: 1 / -1; }
}

/* Scratch paper */
.scratch { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #fffdf3; }
.scratch-bar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: max(var(--s-2), env(safe-area-inset-top)) var(--s-3) var(--s-2); background: var(--paper-2); border-bottom: var(--edge); }
.scratch-bar .spacer { flex: 1; }
.scratch-title { margin-right: var(--s-2); }
.scratch-tool[aria-pressed="true"] { background: var(--gold); }
.scratch-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); }
.scratch-question { padding: var(--s-2) var(--s-4); font-weight: 700; border-bottom: 2px dashed var(--stone-light); }
.scratch-question:empty { display: none; }
.scratch-canvas { flex: 1; width: 100%; min-height: 0; touch-action: none; cursor: crosshair; }
@media (max-width: 480px) { .scratch-title { display: none; } }

/* Result */
.result { display: flex; flex-direction: column; gap: var(--s-4); }
.result-main h1 { font-size: var(--text-xl); }
.result-stars .stars svg { width: 56px; height: 56px; }
.result-stars { margin: var(--s-3) 0; }
.result-score { font-size: var(--text-lg); }
.result-gems h2 { display: flex; align-items: center; gap: var(--s-2); }
.result-gems h2 svg { width: 28px; height: 28px; }
.gem-lines li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) 0; border-bottom: 2px dotted var(--paper-2); }
.result-pick { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.result-pick svg { width: 32px; height: 32px; }
.review-list { display: flex; flex-direction: column; gap: var(--s-3); padding-left: var(--s-5); list-style: decimal; }
.review-list li { padding-left: var(--s-1); }
.review-q { font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; }

/* The second language stays readable where it carries meaning. */
.feedback .sub { font-size: 0.9em; opacity: 0.8; margin-top: 2px; }
.choice .sub { font-size: 0.72em; }
.question-sub { font-size: var(--text-base); }

/* English: listen button, big letter and picture choices, letter tiles, pictures */
.listen { align-self: center; }
.choices.big .choice { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; min-height: 84px; line-height: 1.1; }
.spell { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.spell-slots, .spell-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.spell-slot, .spell-tile { width: 46px; height: 54px; padding: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; background: var(--white); }
.spell-slot.empty { border: 3px dashed var(--stone); border-radius: 4px; background: transparent; }
.spell-tile:disabled { opacity: 0.25; }
.spell.locked { pointer-events: none; }
.spell .pad-ok { width: 100%; }

.vis-pic { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2); font-size: 4.5rem; line-height: 1.15; }
.vis-pic.many { font-size: 2.4rem; }
.vis-emoji.small { font-size: 0.5em; }
.vis-emoji.ring { outline: 4px solid var(--gold); outline-offset: 2px; border-radius: 50%; padding: 6px; }
.vis-swatch { width: 132px; height: 96px; border: var(--edge); border-radius: var(--radius); }
.vis-shape2d { width: 170px; height: auto; fill: var(--gem); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.vis-place { position: relative; width: 170px; height: 150px; }
.vis-place-box { position: absolute; left: 25px; top: 62px; width: 120px; height: 80px; background: #c98f4e; border: var(--edge); border-radius: 4px; }
.vis-place.box .vis-place-box { border-top-style: dashed; }
.vis-place.desk .vis-place-box { height: 22px; }
.vis-place.desk .vis-place-box::before, .vis-place.desk .vis-place-box::after { content: ""; position: absolute; top: 100%; width: 8px; height: 60px; background: var(--ink); }
.vis-place.desk .vis-place-box::before { left: 6px; }
.vis-place.desk .vis-place-box::after { right: 6px; }
.vis-place-pet { position: absolute; left: 0; right: 0; text-align: center; font-size: 2.7rem; line-height: 1; z-index: 1; }
.vis-place.on .vis-place-pet { top: 18px; }
.vis-place.in .vis-place-pet { top: 78px; }
.vis-place.under .vis-place-pet { top: 98px; }
