/* lesson-reward-hub.css — the lesson reward on the real hubs (lesson-project-scene.js), laid out as Codex's frames
   (tools/lesson-reward-preview.html; evidence/lesson-reward-v2, lesson-reward/body). It covers the whole screen while it
   plays (the tab bar, the stage chip and the greeting bubble included) and a tap skips to the end. The header 24 px from
   the top; the title block at 170 px with the 174 px star stage; the credited amount at 400 px, moving to the top right
   for the build; the island in Codex's band (137 px from the top, 433 px tall) with soft paper edges; the caption on the
   band's lower edge. On return the paper fades (--cp-reward-out) while the path's own controls and the tab bar fade in
   (--cp-reward-chrome). Shared tokens only; its paper is --lesson-reward-paper; the gold lives in lesson-reward-stars.css. */
.cp-reward-active :is(.cp-header,.cp-goal,.cp-panel,.cp-greet,.cp-scene-caption,.dw-nav){opacity:var(--cp-reward-chrome,0)}
.cp-reward-layer{--paper:var(--lesson-reward-paper);--band-top:137px;--band-bottom:570px;position:fixed;inset:0;z-index:2147483000;color:var(--ink);font-family:var(--font-jp,inherit);cursor:pointer;-webkit-tap-highlight-color:transparent}
.cp-reward-layer::before{content:"";position:absolute;inset:0;opacity:var(--cp-reward-out,1);
  background:linear-gradient(to bottom,var(--paper) 0,var(--paper) calc(var(--band-top) - 14px),transparent calc(var(--band-top) + 22px),transparent calc(var(--band-bottom) - 64px),var(--paper) calc(var(--band-bottom) + 6px),var(--paper) 100%)}
.cp-reward-layer[data-scene=stars]::before{background:var(--paper)}
.cp-reward-head{position:absolute;top:calc(24px + env(safe-area-inset-top,0px));left:24px;right:24px;display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);opacity:var(--cp-reward-out,1)}
.cp-reward-word{font-size:23px;font-weight:850;color:var(--ink);letter-spacing:-1px}
.cp-reward-marker{padding:5px 12px;border-radius:999px;background:var(--card);font-size:12px;font-weight:700;color:var(--brand);box-shadow:0 1px 0 var(--line)}
.cp-reward-top{position:absolute;top:calc(170px + env(safe-area-inset-top,0px));left:16px;right:16px;text-align:center;transition:opacity .32s,transform .5s}
.cp-reward-title{margin:0 0 30px;font-size:24px;font-weight:750;letter-spacing:.02em;color:var(--ink);text-wrap:balance}
.cp-reward-stars{--shimago-reward-stage-height:174px}
.cp-reward-copy{margin:22px 0 0;font-size:15px;color:var(--muted);min-height:24px}
.cp-reward-layer[data-scene=build] .cp-reward-top{opacity:0;transform:translateY(-10px)}
.cp-reward-award{position:absolute;left:calc(50% - 80px);top:calc(400px + env(safe-area-inset-top,0px));width:160px;height:64px;display:flex;align-items:center;justify-content:center;gap:10px;background:var(--card);border-radius:24px;box-shadow:0 4px 0 var(--line),0 12px 22px var(--sg-shadow);opacity:0;transform:translateY(12px);transition:opacity .2s,transform .3s}
.cp-reward-award img{width:34px;height:34px}
.cp-reward-award b{font-size:24px;font-variant-numeric:tabular-nums}
.cp-reward-layer[data-phase=currency] .cp-reward-award{opacity:1;transform:none}
.cp-reward-layer[data-scene=build] .cp-reward-award{left:auto;right:24px;top:calc(72px + env(safe-area-inset-top,0px));width:auto;height:52px;padding:0 18px;opacity:var(--cp-reward-out,1);transform:none;transition:none}
.cp-reward-award[hidden]{display:none}
.cp-reward-place{position:absolute;top:calc(81px + env(safe-area-inset-top,0px));left:24px;right:150px;opacity:0;transition:opacity .3s}
.cp-reward-place strong{display:block;font-size:16px}.cp-reward-place span{display:block;margin-top:6px;font-size:11px;color:var(--muted)}
.cp-reward-layer[data-scene=build] .cp-reward-place{opacity:var(--cp-reward-out,1)}
.cp-reward-caption{position:absolute;left:20px;right:20px;top:calc(var(--band-bottom) - 40px);text-align:center;opacity:0;transition:opacity .3s}
.cp-reward-caption p{margin:0 0 14px;font-size:17px;font-weight:700}
.cp-reward-caption .small{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.cp-reward-caption .small img{width:24px;height:24px}
.cp-reward-layer[data-scene=build] .cp-reward-caption{opacity:var(--cp-reward-out,1)}
/* the deck under the stars (founder, 2 Oct): this lesson's words as Wordex cards, stacked; the star screen's only control */
.cp-reward-layer>:not(.cp-reward-deck){pointer-events:none}   /* every tap lands on the layer itself, or on the deck */
.cp-reward-deck{position:absolute;left:calc(50% - 80px);top:calc(494px + env(safe-area-inset-top,0px));width:160px;display:flex;flex-direction:column;align-items:center;gap:10px;padding:0;margin:0;border:0;background:none;color:var(--ink);font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .32s}
.cp-reward-layer[data-deck=waiting] .cp-reward-deck,.cp-reward-layer[data-scene=build] .cp-reward-deck{opacity:0;pointer-events:none}
.cp-deck-stack{position:relative;display:block;width:100px;min-height:124px}
.cp-deck-slot{position:absolute;left:0;top:0;width:100px;pointer-events:none}   /* the roll itself: word-cards.css .sgwc-roll */
.cp-deck-slot:first-child{position:relative}   /* the stack is as tall as a card */
.cp-deck-slot>*{width:100%;margin:0}
.cp-deck-plain{display:flex;flex-direction:column;justify-content:flex-end;height:124px;padding:10px;border-radius:17px;background:var(--card);box-shadow:0 4px 0 var(--line)}
.cp-deck-plain b{font-size:15px}.cp-deck-plain span{font-size:11px;color:var(--muted)}
.cp-deck-label{display:flex;align-items:baseline;gap:8px;font-size:12px;color:var(--muted);opacity:var(--deck-in,0)}
.cp-deck-label b{font-size:14px;color:var(--ink)}
.cp-reward-deck:focus-visible{outline:3px solid var(--brand);outline-offset:6px;border-radius:18px}
.cp-deck-sheet{box-sizing:border-box;position:fixed;inset:0;margin:auto;height:fit-content;width:calc(100% - 32px);max-width:560px;max-height:86vh;padding:18px 16px 22px;border:0;border-radius:24px;background:var(--lesson-reward-paper);color:var(--ink);box-shadow:0 18px 40px var(--sg-shadow);overflow:auto;font-family:var(--font-jp,inherit)}
.cp-deck-sheet::backdrop{background:rgba(30,40,36,.38)}
.cp-deck-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.cp-deck-sheet h2{margin:0;font-size:18px;font-weight:800}
.cp-deck-close{min-height:40px;padding:0 16px;border:0;border-radius:999px;background:var(--card);color:var(--ink);font:inherit;font-size:13px;font-weight:700;box-shadow:0 2px 0 var(--line);cursor:pointer}
.cp-deck-note{margin:6px 0 16px;font-size:12px;line-height:1.7;color:var(--muted)}
.cp-deck-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px}
.cp-deck-card{position:relative;display:block;width:100%;padding:0;margin:0;border:0;background:none;font:inherit;cursor:pointer}
.cp-deck-card>article{width:100%;margin:0;pointer-events:none}
.cp-deck-again{position:absolute;right:-4px;top:-6px;padding:3px 8px;border-radius:999px;background:var(--card);color:var(--brand);border:1.5px solid currentColor;font-size:10px;font-weight:800;box-shadow:0 2px 0 var(--line)}
.cp-deck-card[data-missed=true]>article{outline:2px solid var(--brand);outline-offset:2px;border-radius:17px}
@media(max-width:420px){.cp-deck-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.cp-reward-layer[data-phase=return] *,.cp-reward-layer[data-phase=path] *{transition:none}
.cp-reward-layer .sr,.cp-app .sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cp-wallet .cp-ccy{width:25px;height:25px}
@media(max-width:380px){.cp-reward-stars{--shimago-reward-stage-height:158px}.cp-reward-top{top:calc(155px + env(safe-area-inset-top,0px))}.cp-reward-award{top:calc(370px + env(safe-area-inset-top,0px))}.cp-reward-deck{top:calc(460px + env(safe-area-inset-top,0px))}}
@media(prefers-reduced-motion:reduce){.cp-reward-layer *,.cp-reward-layer::before{transition:none!important;animation:none!important}}
