/* A warm workboard and an enamel serving tray share the bakery's materials. */
body[data-view=game] .workbench{
 position:relative;isolation:isolate;
 background:linear-gradient(100deg,#e4ae6922,transparent 30%,#b67c3820),
  url('assets/art/wood-grain.svg') center/720px 210px,#f1ce98;
 border:1px solid #bb844a;
 box-shadow:inset 0 2px #fff1d1,inset 0 0 0 5px #f9dfac,inset 0 -8px #daa76c,0 5px 0 #a47040,0 10px 14px #583b292b;
}
body[data-view=game] .result-panel{
 background:linear-gradient(145deg,#d4eff0,#88bcbb 45%,#6a9997);
 box-shadow:inset 0 2px #efffff,inset 0 0 0 3px #b4dfe0,inset 0 -5px #568b8c,0 5px 0 #4b787b,0 10px 15px #3b555738;
}
body[data-view=game] .result-panel::before{
 inset:11px;z-index:-1;border:1px solid #e0cba4;border-radius:15px;
 background:radial-gradient(ellipse at 0 0,#fffdf0,transparent 60%),
  url('assets/art/wood-grain.svg') 0 0/800px 300px,#fff4d9;
 box-shadow:inset 0 2px 6px #7d713528,0 1px 0 #efffff;
}
body[data-view=game] .result-panel::after{
 top:4px;left:calc(50% - 34px);right:auto;width:68px;height:4px;
 border-radius:10px;background:#527e8055;box-shadow:0 1px #ecffffb0;rotate:none;
}

/* The question, answer display and keys are one register, always ready to use. */
body[data-entry=register] .work-content{grid-template-columns:minmax(0,1fr) minmax(334px,.95fr)}
body[data-entry=register] .work-content>.bakery-register{
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 34px auto auto;
 gap:8px;padding:16px;max-width:440px;justify-self:center;align-self:center;
 border:2px solid #679d96;border-radius:24px 24px 18px 18px;
 background:linear-gradient(155deg,#d6f0de,#9ccebc 70%,#83b8a5);
 box-shadow:inset 0 3px #efffeb,inset 0 -5px #679d89,0 5px 0 #527d68,0 10px 12px #72523626;
}
.register-head{display:grid;grid-template-columns:minmax(0,1fr) 76px;gap:10px;align-items:center;padding:10px;background:#fff9e6;border:1px solid #83a591;border-radius:13px;box-shadow:0 2px 0 #70a58b55}
body[data-entry=register] .bakery-register .label-small{font-size:11px;line-height:1.2;margin:0 0 6px;color:#405e46;text-align:left}
body[data-entry=register] .bakery-register h2{font-size:21px;line-height:1.2;margin:0;text-align:left;color:#513827}
.register-screen{display:grid;place-items:center;min-width:0;border-radius:12px;background:#527e75;padding:4px;box-shadow:inset 0 2px 3px #263e3355,0 1px #ffffdc}
body[data-entry=register] .bakery-register .number-field{
 width:100%;min-width:0;min-height:64px;margin:0;padding:4px;border:1px solid #9daf8a;border-radius:8px;
 background:linear-gradient(#eff5c9,#e4edb6);box-shadow:inset 0 2px 4px #68775040;
 font-size:34px;line-height:1;font-weight:800;color:#2e533a;font-variant-numeric:tabular-nums;
}
body[data-entry=register] .bakery-register .number-field:is([aria-invalid=true],[data-selected=true]){outline:3px solid #a9462f;outline-offset:1px}
body[data-entry=register] .bakery-register .number-field:focus-visible{outline:3px solid #175d91;outline-offset:2px}
body[data-entry=register] .bakery-register .register-hint{
 align-self:center;min-height:0;margin:0;padding:0 3px;border:0;background:none;font-size:13px;line-height:16px;font-weight:650;text-align:center;color:#355741;
}
body[data-entry=register] .bakery-register .register-hint.count-answer-error{color:#812e1c;background:#fff2dd;border-radius:7px;box-shadow:0 0 0 3px #fff2dd}
.register-keys{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:7px}
body[data-entry=register] .register-keys .register-key{min-width:44px;min-height:50px;padding:5px;font-size:25px;line-height:1;font-weight:800;border-radius:15px}
.register-keys .register-key:nth-child(3n+2){--control-top:#e9f8ff;--control-bottom:#bbdeee;--control-edge:#729aaa;--control-ink:#24556a}
.register-keys .register-key:nth-child(3n){--control-top:#f3f8d4;--control-bottom:#d5e4a9;--control-edge:#819959;--control-ink:#3d5c2c}
.register-keys .register-key.edit-key{--control-top:#ffe6eb;--control-bottom:#f2b1c1;--control-edge:#ae687b;--control-ink:#68334b}
body[data-entry=register] .register-keys #register-clear{font-size:14px}
body[data-entry=register] .bakery-register .equation-actions{display:flex;grid-column:1;grid-row:auto;margin:3px 0 0;gap:6px}
body[data-entry=register] .bakery-register .equation-actions button{min-height:44px;min-width:44px;padding:5px;font-size:12px}
body[data-entry=register] .bakery-register .equation-actions .icon{width:16px;height:16px}

/* Short displays get a wide two-row keypad: every key is at least 44 px. */
@media(max-height:760px),(max-width:700px){
 .register-keys{grid-template-columns:repeat(6,minmax(44px,1fr));gap:5px}
 body[data-entry=register] .register-keys .register-key{min-height:44px;font-size:23px}
 #register-clear{grid-column:6;grid-row:1}
 #register-6{grid-column:1;grid-row:2}#register-7{grid-column:2;grid-row:2}
 #register-8{grid-column:3;grid-row:2}#register-9{grid-column:4;grid-row:2}
 #register-0{grid-column:5;grid-row:2}#register-back{grid-column:6;grid-row:2}
 body[data-entry=register] .work-content>.bakery-register{padding:10px;gap:6px;grid-template-rows:auto 32px auto auto}
}
@media(max-width:1100px) and (min-width:701px){
 body[data-entry=register] .work-content{gap:10px;grid-template-columns:minmax(0,1fr) 334px}
 body[data-entry=register] .work-content>.bakery-register{padding:10px}
}
@media(min-width:701px) and (max-width:1100px) and (min-height:541px) and (max-height:660px){
 body[data-view=game] .app-shell{grid-template-rows:54px minmax(0,1fr)}
}
@media(max-width:700px){
 body[data-family=CC-A][data-stage=label] .work-layout{grid-template-rows:minmax(0,1fr)}
 /* The visible question and Read question replace the duplicate coach row here. */
 body[data-family=CC-A][data-stage=label] .baker-coach{display:none}
 body[data-entry=register] .work-content{grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) auto;gap:6px}
 body[data-entry=register] .work-content>.bakery-register{grid-column:1;grid-row:3;max-width:none;padding:8px;gap:5px;border-radius:18px;grid-template-rows:auto 30px auto auto}
 body[data-entry=register] .register-head{grid-template-columns:minmax(0,1fr) 58px;padding:6px;gap:6px}
 body[data-entry=register] .bakery-register h2{font-size:17px;line-height:1.15}
 body[data-entry=register] .bakery-register .label-small{font-size:10px;margin-bottom:3px}
 body[data-entry=register] .bakery-register .number-field{min-height:48px;font-size:29px}
 body[data-entry=register] .bakery-register .register-hint{font-size:12px;line-height:14px}
 body[data-entry=register] .bakery-register .equation-actions{gap:4px;margin:0}
 body[data-entry=register] .bakery-register .equation-actions button{font-size:11px}
 body[data-view=game] .result-panel::before{inset:6px;border-radius:14px}
}
@media(max-width:700px) and (max-height:760px){
 /* Move the secondary actions into the existing top control row. This gives
    short phones more counting room without shrinking the number keys. */
 body[data-entry=register] .work-content>.work-title h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body[data-entry=register] .work-content>.work-title{grid-template-columns:minmax(0,1fr) 74px}
 body[data-entry=register] .work-content>.work-title button{grid-column:2;grid-row:1}
 body[data-entry=register] .work-content>.bakery-register{position:static}
 body[data-entry=register] .bakery-register .equation-actions{position:absolute;left:10px;right:90px;top:10px;margin:0;gap:4px}
 body[data-entry=register] .bakery-register .equation-actions button{font-size:11px;padding:4px;min-width:44px}
 body[data-entry=register] .bakery-register .equation-actions .btn-content{gap:3px}
 body[data-entry=register] .work-content>.bakery-register{grid-template-rows:auto 16px auto}
 body[data-entry=register] .register-head{padding:4px}
 body[data-entry=register] .bakery-register .number-field{min-height:44px}
}
@media(max-width:370px){
 body[data-entry=register] .workbench{padding-inline:8px}
 body[data-entry=register] .work-content>.bakery-register{padding:6px;gap:4px}
 .register-keys{gap:4px}
}
