html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#344f45}
.count-game{height:100%;max-height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;color:#3b3028;position:relative;width:min(100%,1120px);margin:auto;--mat-height:300px;--mat-width:680px;--scene-width:1100px}
.count-speech{box-sizing:border-box;align-self:start;justify-self:center;display:flex;align-items:center;justify-content:center;width:min(92%,460px);height:88px;margin:0;padding:12px 30px;background:url('assets/ui/instruction-ribbon.webp') center/100% 100% no-repeat;text-align:center;font-size:clamp(20px,2.5vmin,27px);line-height:1.15}
.count-scene{min-height:0;width:100%;max-width:var(--scene-width);height:100%;max-height:430px;align-self:center;justify-self:center;position:relative;display:grid;grid-template-columns:18% minmax(0,1fr) 20%;grid-template-rows:minmax(0,1fr);align-items:center}
.count-cast{display:contents}.actor{grid-row:1;grid-column:1;position:relative;width:100%;height:100%;max-height:300px;align-self:center;pointer-events:none}.actor:last-child{grid-column:3;max-height:320px}.count-game .actor img,.count-game .actor video{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 3px 3px #4e341b33)}.actor video[hidden]{display:none}
.fruit-bed{position:relative;grid-row:1;grid-column:2;display:grid;gap:6px;align-items:center;justify-items:center;width:100%;max-width:var(--mat-width);height:100%;max-height:var(--mat-height);min-height:0;justify-self:center;align-self:center;background:url('assets/counting-mat.webp') center/100% 100% no-repeat;padding:28px 24px;box-sizing:border-box}
.count-game[data-total="1"],.count-game[data-total="2"],.count-game[data-total="3"]{--mat-height:180px;--mat-width:330px;--scene-width:760px}.count-game[data-total="1"] .count-scene,.count-game[data-total="2"] .count-scene,.count-game[data-total="3"] .count-scene{grid-template-columns:28% minmax(0,1fr) 28%}
.count-game[data-total="4"],.count-game[data-total="5"]{--mat-height:230px;--mat-width:530px;--scene-width:920px}
.count-game button{font-family:inherit;touch-action:manipulation}.fruit{width:min(100%,105px);height:100%;max-height:100px;min-height:48px;min-width:48px;box-sizing:border-box;background:none;border:0;padding:3px;position:relative;cursor:pointer}.count-game .fruit img{height:100%;width:100%;max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 3px 2px #4e341b33)}.fruit[aria-pressed=true]::after{content:'';position:absolute;right:4%;top:4%;width:14px;height:14px;border-radius:50%;background:#f8d55e;border:3px solid #654419}.fruit[aria-pressed=true]{filter:saturate(.8)}.count-game button:focus-visible{outline:3px solid #74512b;outline-offset:2px}.fruit-empty{grid-column:1/-1;grid-row:1/-1;font-size:23px;text-align:center;margin:0}
.answer-area{min-height:0;display:grid;grid-template-columns:auto 180px;align-items:center;gap:0 14px;justify-content:center;padding:0}.number-cards{display:flex;justify-content:center;gap:10px}.number-card,.total-label,.recount{color:#493324;border:0;box-shadow:none;border-radius:0;min-width:48px;min-height:48px;cursor:pointer;box-sizing:border-box;line-height:1}.count-game .number-card{width:88px;height:94px;padding:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:url('assets/ui/number-tile.webp') center/100% 100% no-repeat;font-size:44px}.number-card[aria-pressed=true]{filter:brightness(1.12) saturate(1.3)}.dots{display:flex;flex-wrap:wrap;gap:3px;justify-content:center;max-width:45px;min-height:5px;margin:0}.dots i{flex:0 0 5px;width:5px;height:5px;border-radius:50%;background:currentColor}.count-game .total-label{background:url('assets/ui/total-tag.webp') center/100% 100% no-repeat;font-size:18px;min-height:104px;width:180px;padding:34px 20px 8px;display:grid;justify-items:center;align-content:center;gap:3px}.total-label strong{font-size:36px;line-height:1}.count-foot{grid-column:1/-1;display:flex;justify-content:center;align-items:center}.count-game .recount{background:none;font-size:16px;min-height:48px;padding:6px 18px;text-decoration:underline;text-underline-offset:3px}.recount:disabled{opacity:.65;cursor:default}
.tutorial-hand{position:fixed;width:70px;height:70px;object-fit:contain;pointer-events:none;z-index:15;transform:translate(-20%,-12%);transition:left 600ms ease,top 600ms ease}.tutorial-hand[hidden]{display:none}.count-game[data-demo=true] .fruit,.count-game[data-demo=true] .number-card,.count-game[data-demo=true] .total-label,.count-game[data-demo=true] .recount{pointer-events:none}
@media(orientation:portrait) and (min-width:600px){.count-scene{max-height:420px;grid-template-columns:22% minmax(0,1fr) 22%}.actor{max-height:270px}.actor:last-child{max-height:290px}.fruit-bed{padding:24px 20px}.count-speech{height:88px;font-size:25px}}
@media(max-width:599px) and (orientation:portrait){.count-game{gap:4px;--mat-height:250px;--mat-width:430px}.count-speech{height:58px;font-size:20px;padding:10px 18px;width:100%}.count-scene,.count-game[data-total="1"] .count-scene,.count-game[data-total="2"] .count-scene,.count-game[data-total="3"] .count-scene{max-height:430px;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,58fr) minmax(0,42fr)}.fruit-bed{grid-row:1;grid-column:1/-1;padding:12px 18px;gap:4px}.actor,.actor:last-child{grid-row:2;grid-column:1;width:min(90%,150px);height:100%;max-height:160px;align-self:end;justify-self:start}.actor:last-child{grid-column:2;justify-self:end;width:min(95%,165px)}.fruit{max-height:80px}.answer-area{grid-template-columns:auto 110px;gap:0 8px}.number-cards{gap:5px}.count-game .number-card{width:60px;height:70px;padding:7px;font-size:32px}.count-game .total-label{min-height:88px;width:110px;font-size:14px;padding:28px 12px 7px}.total-label strong{font-size:32px}.count-game .recount{font-size:14px}.count-game[data-total="1"],.count-game[data-total="2"],.count-game[data-total="3"]{--mat-height:165px;--mat-width:285px}.count-game[data-total="4"],.count-game[data-total="5"]{--mat-height:190px;--mat-width:430px}}
@media(max-height:500px) and (orientation:landscape){.count-game{grid-template-rows:44px minmax(0,1fr);grid-template-columns:minmax(0,1fr) 216px;gap:2px 6px;--mat-height:190px}.count-speech{grid-column:1/-1;height:44px;width:min(80%,500px);font-size:18px;padding:8px 20px}.count-scene,.count-game[data-total="1"] .count-scene,.count-game[data-total="2"] .count-scene,.count-game[data-total="3"] .count-scene{grid-row:2;grid-column:1;max-height:100%;grid-template-columns:12% minmax(0,1fr) 12%}.fruit-bed{padding:20px 12px;gap:4px}.fruit{max-height:72px}.actor,.actor:last-child{max-height:180px}.answer-area{grid-row:2;grid-column:2;grid-template-columns:1fr;align-self:center;gap:0}.number-cards{gap:5px}.count-game .number-card{width:60px;height:62px;font-size:32px;padding:7px}.count-game .total-label{width:160px;min-height:64px;padding:22px 17px 4px;justify-self:center;grid-template-columns:1fr 35px;font-size:14px}.total-label strong{font-size:28px}.count-game .recount{font-size:14px}}
@media(prefers-reduced-motion:reduce){.tutorial-hand{transition:none}}

