:root{--sky1:#bfe0f5;--sky2:#e3f2fb;--ink:#3d3226;--line:#e6dcc6;--ok:#3c9a5f;--hint:#2f7fd1}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overscroll-behavior:none;color:var(--ink);
  background:linear-gradient(170deg,var(--sky1),var(--sky2) 60%,#f4fbff);
  font-family:"UD デジタル 教科書体 N","UD Digi Kyokasho N","Hiragino Maru Gothic ProN","Hiragino Sans",sans-serif;
  touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#app{height:100vh;height:100dvh;display:flex;flex-direction:column;align-items:center;gap:12px;padding:12px;
  padding-bottom:max(12px,env(safe-area-inset-bottom));position:relative}
#dots{display:flex;gap:8px}
#dots i{width:12px;height:12px;border-radius:50%;background:rgba(255,255,255,.7);border:2px solid #9cc4e0}
#dots i.done{background:#9cc4e0}#dots i.now{background:#fff;border-color:var(--ink)}

#paper{flex:1 1 auto;min-height:0;width:100%;max-width:980px;background:#fff;border-radius:6px;box-shadow:3px 4px 0 rgba(0,0,0,.12);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;overflow:hidden}
#scene{flex:1 1 auto;min-height:0;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:4%}
#scene img{height:clamp(160px,42vh,380px);max-width:48%;object-fit:contain}
#sentence-row{display:flex;align-items:center;gap:14px}
#sentence{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:clamp(34px,6vw,58px);font-weight:700;line-height:1.2}
.slot{display:inline-grid;place-items:center;width:1.25em;height:1.25em;border:3px dashed #b9ae98;border-radius:10px;margin:0 2px;position:relative}
.slot.now{border-color:var(--hint);border-style:solid;animation:blink 1.2s infinite}
@keyframes blink{50%{box-shadow:0 0 0 6px rgba(47,127,209,.2)}}
.slot.ok{border:3px solid var(--ok);color:var(--ok);animation:pop .25s ease-out}
.slot .ghost{color:var(--hint);opacity:0;animation:ghost 1.6s ease-out}
@keyframes ghost{0%{opacity:0}20%{opacity:.6}80%{opacity:.6}100%{opacity:0}}
@keyframes pop{from{transform:scale(.6)}to{transform:scale(1)}}

/* わ｜は のように、聞こえる音と書く字をペアで */
#tiles{display:flex;gap:clamp(12px,3vw,32px);flex:0 0 auto}
.pair{display:flex;border:3px solid #c9bea8;border-radius:16px;overflow:hidden;background:#fff}
.tile{width:clamp(70px,10vw,96px);height:clamp(70px,10vw,96px);border:0;background:#fff;font:inherit;font-size:clamp(40px,6vw,58px);font-weight:700;
  color:var(--ink);cursor:pointer;display:grid;place-items:center}
.tile+.tile{border-left:3px solid #c9bea8}
.tile.write{background:#fff8d6}
.tile:active{transform:scale(.92)}
.tile.no{animation:no .4s}
@keyframes no{20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-5px)}80%{transform:translateX(5px)}}

.round{width:64px;height:64px;border-radius:50%;border:0;background:#fff;box-shadow:0 3px 0 var(--line);border:2px solid var(--line);display:grid;place-items:center;cursor:pointer;flex:0 0 auto}
.round svg{width:34px;height:34px;fill:none;stroke:var(--ink);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.round .fill{fill:var(--ink)}
.round.big{position:absolute;right:20px;bottom:max(20px,env(safe-area-inset-bottom));width:84px;height:84px;background:#ffd84d;border-color:#e6b800;box-shadow:0 4px 0 #c99d00}
.round.big svg{width:44px;height:44px;stroke-width:3.4}
[hidden]{display:none!important}
#scene img[src*="/actions/"]{transform:scale(.6);transform-origin:50% 100%}/* 2026-10-31 うごきの絵を そろえなおして（大きく・足もとを同じ高さに）したので、前と同じ見え方になるよう倍率を合わせた */
