/* A finished-order board. All rules stay inside the completion state. */
body[data-stage=result] .topbar{margin-bottom:12px}
body[data-stage=result] .game-heading{margin-top:0;margin-bottom:9px}
body[data-stage=result] .steps{margin-bottom:12px}
.result-panel{
  position:relative;isolation:isolate;display:grid;
  grid-template-columns:180px minmax(0,1fr) 260px;
  gap:14px 18px;align-items:start;max-width:1104px;margin:0 auto;
  padding:22px 24px 20px;border:0;border-radius:24px;
  background:radial-gradient(ellipse at 0 0,#ffd6e5a6,transparent 42%),
    radial-gradient(ellipse at 100% 100%,#d9efcb9c,transparent 50%),
    url('assets/art/wood-grain.svg') 0 0/620px 180px,#fff5dc;
  box-shadow:inset 0 2px #fffdf1,inset 0 0 0 5px #fff3cd,0 5px 0 #d6ae73,0 9px 0 #ad804d,0 17px 22px #543d3430;
  scroll-margin-block:12px;
}
.result-panel::before{content:'';position:absolute;inset:10px;border:1px dashed #ae85637d;border-radius:17px;pointer-events:none;z-index:-1}
.result-panel::after{content:'';position:absolute;right:24px;top:-5px;width:58px;height:14px;border-radius:2px;background:repeating-linear-gradient(90deg,#dd9a9db3 0 7px,#f2c3bfb3 7px 14px);box-shadow:0 2px 2px #98714720;rotate:3deg;pointer-events:none}
.result-panel .result-welcome{display:contents}
.result-panel .result-greeting{grid-column:2/4;grid-row:1;max-width:none;text-align:left;align-self:center;padding-bottom:2px}
.result-panel .result-greeting .eyebrow{margin:0 0 5px;color:#396443;font-size:11px;letter-spacing:.13em}
.result-panel .result-greeting h2{font-family:var(--display);font-weight:400;font-size:34px;line-height:1.1;letter-spacing:0;margin:0 0 7px;color:#633b28}
.result-panel .result-greeting .rule{font-size:15px;line-height:1.4;max-width:650px;margin:0;color:#624831}
.result-panel .result-art{grid-column:1;grid-row:1/3;align-self:end;position:relative;width:180px;min-width:0;height:245px;margin:0 0 8px;pointer-events:none}
.result-panel .result-art::before{content:'';position:absolute;inset:auto 12px 0;height:23px;border-radius:50%;background:radial-gradient(ellipse,#8764433d,transparent 70%)}
.result-panel .result-art .benny{position:absolute;bottom:5px;left:-2px;width:184px;height:230px}
.result-panel .result-star{width:38px;height:36px;right:4px;top:7px}
.result-outcome{grid-column:2;grid-row:2;min-width:0;align-self:center}
.result-panel .work-title{justify-content:center;margin:0 0 12px}
.result-panel .work-title h2{font-family:var(--display);font-weight:400;font-size:26px;letter-spacing:0;line-height:1.15;color:#663b32;margin:0;padding:8px 15px 10px;background:linear-gradient(#fff5,transparent),#ffdae2;border:1px solid #be8790;border-bottom:3px solid #ad727e;border-radius:5px 13px 8px 5px;box-shadow:0 3px 0 #fff6d7,0 5px 5px #7b59421a}
.result-panel .pair-work.arranged{padding:0;max-width:none}
.result-panel .pair-area{display:flex;flex-wrap:nowrap;justify-content:center;align-items:start;gap:14px;width:100%;margin:0}
.result-panel .pair-rack{width:208px;min-width:0;max-width:100%}
.result-panel .pair-heads{margin:0 0 8px;gap:12px;font-size:13px;line-height:18px}
.result-panel .rack-body{padding:6px;min-height:74px}
.result-panel .rack-strips{inset:0;gap:12px}
.result-panel .plate-row{min-height:68px;gap:12px}
.result-panel .plate-row img{width:64px;height:64px}
.result-panel .leftover-column{width:104px;flex-shrink:0}
.result-panel .leftover-column .leftover-heading{font-size:13px;line-height:18px;margin:0 0 8px}
.result-panel .leftover-tray{padding:6px 8px 8px}
.result-panel .leftover-tray>span{height:68px}
.result-panel .leftover-column img{width:64px;height:64px}
.result-panel .leftover-tray p{font-size:12px;margin-top:5px}
.result-panel .rack-empty-caption{margin:10px 0 0;font-size:14px}
.result-panel[data-many-pairs=true] .plate-row{min-height:44px}
.result-panel[data-many-pairs=true] .plate-row img{width:42px;height:42px}
.result-panel[data-many-pairs=true] .pair-rack{width:180px}
.result-label-board{grid-column:3;grid-row:2;align-self:center;min-width:0;padding:16px 12px;border-radius:5px 5px 14px 14px;background:linear-gradient(#fffdf1,#fff6e0);box-shadow:inset 0 1px #fff,0 3px 0 #dbbd83,0 7px 9px #72522f22}
.result-label-board .equation-text{font-size:27px;line-height:1.35;margin:0 0 12px;color:#543923}
.result-panel .box-preview{width:174px;height:100px;margin:0 auto 17px;box-shadow:inset 0 4px #ffedc66b,0 5px 0 #ad804d,0 9px 7px #735b3926}
.result-panel .box-preview::before{inset-inline:calc(50% - 24px)}
.result-panel .box-preview:is(.waves,.dots)::before{inset:0}
.result-panel .box-seal{width:52px;height:52px}
.result-panel .box-seal .icon{width:30px;height:30px}
.result-panel .box-options{display:flex;flex-wrap:wrap;gap:7px;justify-content:center}
.result-panel .box-options button{min-height:48px;padding:7px 10px;font-size:13px;flex:1 1 94px}
.result-panel .result-actions{grid-column:1/-1;grid-row:3;margin:0;padding-top:6px;gap:10px;align-items:center}
.result-panel .result-actions>button:not(.primary){min-height:52px}
.result-panel .finished-board{grid-column:1/-1;grid-row:4;margin:0;border-top:1px solid #cdb990}
.result-panel .finished-board>summary{padding:10px;min-height:44px}
.result-panel.other-result{grid-template-columns:230px minmax(0,1fr);max-width:850px}
.other-result .result-greeting{grid-column:2}
.other-result .result-art{justify-self:center}
.other-result .result-label-board{grid-column:2;display:grid;grid-template-columns:1fr 174px;align-items:center;gap:12px}
.other-result .result-label-board .equation-text{margin:0}
.other-result .box-preview{margin:0 0 7px}
.other-result .box-options{grid-column:1/-1}

/* Long finished batches use the same three columns, with the greeting above
   Benny. This saves a full header row without reducing the counting objects. */
@media(min-width:701px){
  .pair-result[data-many-pairs=true] .result-greeting{grid-column:1;grid-row:1;align-self:start;text-align:center}
  .pair-result[data-many-pairs=true] .result-greeting h2{font-size:28px}
  .pair-result[data-many-pairs=true] .result-greeting .rule{font-size:14px}
  .pair-result[data-many-pairs=true] .result-art{grid-row:2}
  .pair-result[data-many-pairs=true] .result-outcome,.pair-result[data-many-pairs=true] .result-label-board{grid-row:1/3}
}

@media(max-width:1050px) and (min-width:701px){
  .result-panel{grid-template-columns:138px minmax(0,1fr) 220px;gap:12px;padding:20px}
  .result-panel .result-art{width:138px;height:214px}
  .result-panel .result-art .benny{width:160px;height:200px;left:-12px}
  .result-panel .pair-rack{width:180px}
  .result-panel .leftover-column{width:104px}
  .result-panel .pair-area{gap:10px}
  .result-panel .work-title h2{font-size:24px;padding-inline:11px}
}
@media(max-width:700px){
  body[data-stage=result] .topbar{margin-bottom:8px}
  .result-panel,.result-panel.other-result{grid-template-columns:112px minmax(0,1fr);gap:12px;padding:18px 14px 16px;border-radius:21px}
  .result-panel .result-greeting{grid-column:2;grid-row:1}
  .result-panel .result-greeting h2{font-size:27px}
  .result-panel .result-greeting .rule{font-size:13px;line-height:1.4}
  .result-panel .result-greeting .eyebrow{font-size:10px}
  .result-panel .result-art{grid-column:1;grid-row:1;width:112px;height:150px;align-self:end;margin:0}
  .result-panel .result-art .benny{width:120px;height:150px;left:-4px;bottom:-5px}
  .result-panel .result-star{width:27px;height:26px;right:-3px;top:4px}
  .result-outcome{grid-column:1/-1;grid-row:2}
  .result-panel .work-title{margin-bottom:10px}
  .result-panel .work-title h2{font-size:23px;padding:7px 13px 8px}
  .result-panel .pair-rack{width:188px}
  .result-panel .pair-area{gap:12px}
  .result-panel .pair-heads{font-size:12px;gap:10px;margin-bottom:7px}
  .result-panel .rack-strips,.result-panel .plate-row{gap:10px}
  .result-panel .plate-row{min-height:58px}
  .result-panel .plate-row img,.result-panel .leftover-column img{width:54px;height:54px}
  .result-panel .leftover-column{width:96px}
  .result-panel .leftover-column .leftover-heading{font-size:12px;margin-bottom:7px}
  .result-panel .leftover-tray>span{height:58px}
  .result-panel[data-many-pairs=true] .plate-row{min-height:48px}
  .result-panel[data-many-pairs=true] .plate-row img{width:46px;height:46px}
  .result-label-board,.other-result .result-label-board{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) 112px;align-items:center;gap:10px;padding:12px}
  .result-label-board .equation-text{font-size:24px;line-height:1.3;margin:0}
  .result-label-board:not(:has(.equation-text)){grid-template-columns:1fr}
  .result-panel .box-preview{width:112px;height:65px;margin:0 auto 5px}
  .result-panel .box-seal{width:44px;height:44px}
  .result-panel .box-seal .icon{width:27px;height:27px}
  .result-panel .box-options{grid-column:1/-1;gap:6px;flex-wrap:nowrap}
  .result-panel .box-options button{flex:1 1 0;min-width:0;padding:7px 4px;font-size:12px}
  .result-panel .result-actions{grid-row:4;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-top:0}
  .result-panel .result-actions>.primary{grid-column:1/-1;justify-self:stretch;width:100%}
  .result-panel .result-actions>button:not(.primary){padding:8px 6px;font-size:13px}
  .result-panel .finished-board{grid-row:5}
  .other-result .result-label-board{grid-row:2}
  .other-result .result-actions{grid-row:3}
  .other-result .finished-board{grid-row:4}
}
