/* S3 プレイ */
#play-inner { position: relative; display: flex; flex-direction: column; height: 100%; transform-origin: 0 0; }

.hud { display: flex; align-items: center; height: var(--h-header); gap: 8px; flex: none; }
.hud-mid { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 16px; overflow: hidden; }
#play-inner .xp { margin-top: 8px; }
.sp { min-height: 0; }
.sp1 { flex: 1 1 0; max-height: 24px; }
.sp2 { flex: 1 1 0; }

.dots-row { display: flex; align-items: center; justify-content: space-between; height: 24px; margin-bottom: 8px; flex: none; }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots i.done { background: var(--ink); }
.dots i.cur { background: var(--white); box-shadow: inset 0 0 0 2px var(--ink); }
.combo { height: 24px; padding: 0 16px; border-radius: 12px; background: var(--ink); color: var(--white); font-size: var(--fs-s); line-height: 24px; }
.combo.bump { animation: comboBump 0.3s ease-out 1; }
@keyframes comboBump { 0% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* 筆算カード */
.pv-wrap { position: relative; flex: none; background: var(--white); border: 2px solid var(--line); border-radius: 16px; padding: var(--card-pad); }
.pv-grid { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); }
.pv-col { display: flex; flex-direction: column; min-width: 0; }
.pv-tens, .pv-ones { padding: 0 4px; }
.pv-band { display: flex; flex-direction: column; position: relative; border-radius: 8px; flex: 1; transition: box-shadow 0.2s; }
.pv-tens .pv-band { background: var(--tens-band); }
.pv-ones .pv-band { background: var(--ones-band); }
.pv-tens .pv-band.active { box-shadow: inset 0 0 0 2px var(--tens-line); }
.pv-ones .pv-band.active { box-shadow: inset 0 0 0 2px var(--ones-line); }
.pv-hun .pv-band { background: transparent; }
.pv-hun .pv-band.on { background: var(--hun-band); }
.pv-hun .pv-band.on.active { box-shadow: inset 0 0 0 2px var(--hun-line); }

.pv-chip-row { height: var(--h-chip); display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.pv-row { height: var(--h-row); display: flex; align-items: center; justify-content: center; position: relative; font-size: var(--fs-l); line-height: 1; flex: none; }
.pv-plus { font-size: var(--fs-m); }
.pv-rule { height: 2px; background: var(--ink); flex: none; }
.pv-tens .pv-rule { margin: 0 -4px; }
.pv-ones .pv-rule { margin: 0 -4px; }
.pv-block { height: var(--h-block); position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.pv-ans-row { height: var(--h-ans); display: flex; align-items: center; justify-content: center; flex: none; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 12px; font-size: var(--fs-xs); line-height: 1; white-space: nowrap; }
.chip-tens { background: var(--tens); color: var(--white); }
.chip-ones { background: var(--ones); color: var(--ink); }
.chip-hun { background: var(--hun-line); color: var(--white); padding: 0 2px; visibility: hidden; }
.pv-hun .pv-band.on .chip-hun { visibility: visible; }
.count-chip { position: absolute; right: 4px; top: 0; min-width: 24px; height: 24px; padding: 0 2px; border-radius: 50%; background: var(--white); border: 2px solid var(--tens-line); color: var(--ink); font-size: var(--fs-s); line-height: 20px; text-align: center; visibility: hidden; }
.count-chip.on { visibility: visible; }

/* ブロック枠 */
.frame { display: grid; grid-template-columns: repeat(5, var(--pitch)); justify-content: center; }
.frame-ones { grid-auto-rows: var(--pitch); }
.frame-tens { grid-auto-rows: calc(var(--rod-h) + 8px); }
.slot { place-self: center; border: 2px dashed; }
.slot-o { width: 16px; height: 16px; border-radius: 50%; border-color: rgba(178, 94, 0, 0.4); }
.slot-t { width: 16px; height: var(--rod-h); border-radius: 4px; border-color: rgba(18, 63, 133, 0.4); }
.slot-h { width: 40px; height: 40px; border-radius: 4px; border-color: rgba(43, 43, 43, 0.4); visibility: hidden; }
.pv-hun .pv-band.on .slot-h { visibility: visible; }

/* 答え枠 */
.ans { width: 96px; height: calc(var(--h-ans) - 8px); border-radius: 16px; background: var(--white); border: 4px solid; display: flex; align-items: center; justify-content: center; font-size: var(--fs-l); line-height: 1; }
.ans-ones { border-color: var(--ones-line); }
.ans-tens { border-color: var(--tens-line); }
.ans-hun { width: 48px; border-color: var(--hun-line); visibility: hidden; }
.pv-hun .pv-band.on .ans-hun { visibility: visible; }
.ans.done.ans-ones { background: var(--ones-band); }
.ans.done.ans-tens { background: var(--tens-band); }
.ans.done.ans-hun { background: var(--hun-band); }
.ans.soft { border-color: var(--line); }
.ans-ones.wait { animation: breatheO 1.6s ease-in-out infinite; }
.ans-tens.wait { animation: breatheT 1.6s ease-in-out infinite; }
.ans-hun.wait { animation: breatheH 1.6s ease-in-out infinite; }
@keyframes breatheO { 0%, 100% { box-shadow: 0 0 0 0 rgba(178, 94, 0, 0); } 50% { box-shadow: 0 0 0 4px rgba(178, 94, 0, 0.6); } }
@keyframes breatheT { 0%, 100% { box-shadow: 0 0 0 0 rgba(18, 63, 133, 0); } 50% { box-shadow: 0 0 0 4px rgba(18, 63, 133, 0.6); } }
@keyframes breatheH { 0%, 100% { box-shadow: 0 0 0 0 rgba(43, 43, 43, 0); } 50% { box-shadow: 0 0 0 4px rgba(43, 43, 43, 0.6); } }

.carry { position: absolute; left: 8px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); border: 2px solid; font-size: var(--fs-xs); line-height: 20px; text-align: center; visibility: hidden; z-index: 2; }
.carry.show { visibility: visible; }
.carry-o { border-color: var(--ones-line); }
.carry-t { border-color: var(--tens-line); left: 50%; top: 16px; margin-left: -12px; }

/* キー */
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; flex: none; }
.key { height: var(--h-key); border-radius: 16px; background: var(--white); border: 2px solid var(--key-line); box-shadow: 0 4px 0 var(--key-line); font-size: var(--fs-m); line-height: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0; }
.key:active:not(.off) { transform: translateY(4px); box-shadow: 0 0 0 var(--key-line); }
.key-aux { font-size: var(--fs-xs); }
.key.off { opacity: 0.4; border-color: var(--line); box-shadow: 0 4px 0 var(--line); cursor: default; }
.key.pulse { animation: keyPulse 1.2s ease-in-out 1; }
@keyframes keyPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
