/* Rewards stay in one small, playful surface; the learning pages keep their layout. */
:root { --reward-blue: #238bd3; --reward-blue-soft: #eaf6ff; --reward-edge: #e3e9e3; --reward-surface: #fafcf8; --reward-text: #26442e; }
:root[data-theme="dark"] { --reward-blue: #70c6ff; --reward-blue-soft: #16354a; --reward-edge: #34433a; --reward-surface: #1b2620; --reward-text: #e5f3e7; }
.reward-asset { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.gems-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 57px; min-height: 36px; padding: 4px 9px; border: 1px solid transparent; border-radius: 11px; color: var(--reward-blue); background: var(--reward-blue-soft); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.gems-chip .reward-asset { width: 26px; height: 27px; filter: drop-shadow(0 2px 1px #006eb51a); }
.gems-chip:hover { border-color: var(--reward-blue); }
.gems-chip:hover .reward-asset { animation: reward-mini-bob .8s ease-in-out; }
.app-stat.app-streak .reward-asset, .chip-stat.streak .reward-asset { width: 28px; height: 30px; transform-origin: center bottom; animation: reward-flame-breathe 3s ease-in-out infinite; }
.gem-ready-dot { position: absolute; top: 1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; background: #f4b529; box-shadow: 0 0 0 2px var(--card); }
.reward-overlay { padding: 20px; background: rgba(18, 36, 24, .43); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.reward-simple { width: min(460px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--reward-edge); border-radius: 25px; background: var(--card); color: var(--reward-text); box-shadow: 0 24px 90px -22px #071e2580; animation: reward-enter .24s ease both; }
.reward-simple-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 25px 0; }
.reward-simple-header h2 { margin: 0; font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif; font-size: 24px; font-weight: 750; letter-spacing: -.04em; color: var(--reward-text); }
.reward-close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--reward-edge); border-radius: 11px; background: var(--reward-surface); color: var(--muted-2); cursor: pointer; }
.reward-close .ic { width: 17px; height: 17px; }
.reward-close:hover { color: var(--reward-text); border-color: var(--muted); }
.reward-simple-scroll { min-height: 0; padding: 0 25px 14px; overflow-y: auto; overscroll-behavior: contain; }
.reward-totals { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 5px -8px 10px; }
.reward-total { display: flex; align-items: center; gap: 5px; min-width: 0; }
.reward-total > div { min-width: 0; }
.reward-total strong { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 37px; font-weight: 750; color: var(--reward-text); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.reward-total > div > span { display: block; margin-top: 5px; color: var(--muted-2); font-size: 13px; }
.reward-total.gem-total { justify-content: flex-end; }
.reward-total.gem-total strong { color: var(--reward-blue); }
.reward-scene { position: relative; display: block; flex: none; isolation: isolate; }
.reward-scene canvas { display: block; width: 100%; height: 100%; outline: none; }
.reward-scene > .reward-asset { position: absolute; inset: 0; }
.reward-flame-scene { width: 88px; height: 104px; }
.reward-gem-scene { width: 78px; height: 93px; }
.reward-week { padding: 0 0 19px; border-bottom: 1px solid var(--reward-edge); }
.reward-week-label { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 12px; }
.reward-week-label b { font-size: 13px; font-weight: 650; color: var(--reward-text); }
.reward-week-label > span { font-size: 12px; color: var(--muted); }
.reward-week ol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; padding: 0; margin: 0; list-style: none; }
.reward-week li { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.reward-week li > span { font-size: 11px; font-weight: 750; text-transform: uppercase; color: var(--muted); }
.reward-week li i { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--reward-surface); border: 1.5px solid var(--reward-edge); font-style: normal; color: var(--muted); font-size: 24px; }
.reward-week .learned i { background: #e9943f; border-color: #d88230; box-shadow: 0 2px 0 #cf7c2e; color: #fff; }
.reward-week .learned .ic { width: 22px; height: 22px; }
.reward-week .learned .ic path { stroke: #fff; }
.reward-week .is-today:not(.learned) i { border-color: #efa441; background: #fff8e8; color: #d78d29; }
.reward-week .is-today > span { color: #cb7b26; }
.reward-chest-focus { margin-top: 17px; padding: 17px 19px 18px; border-radius: 18px; border: 1px solid #efe4c9; background: #fffaf0; }
.reward-chest-focus.is-ready { background: #fff8e7; border-color: #eacb84; }
.reward-chest-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.reward-kicker { font-size: 10px; font-weight: 800; color: #a1804c; letter-spacing: .12em; }
.reward-chest-heading h3 { margin: 4px 0 0; color: #6f4e26; font-family: "Bricolage Grotesque", sans-serif; font-size: 20px; line-height: 1.1; letter-spacing: -.02em; }
.reward-prize { display: inline-flex; align-items: center; gap: 3px; padding: 5px 9px; border-radius: 10px; background: #fff; color: #2186c9; border: 1px solid #e5d9c1; font-size: 16px; font-weight: 800; }
.reward-prize .reward-asset { width: 27px; height: 27px; }
.reward-stage { display: grid; place-items: center; position: relative; height: 204px; margin: 9px 0 10px; overflow: hidden; isolation: isolate; }
.reward-chest-scene { width: 260px; height: 100%; max-width: 100%; z-index: 1; }
.reward-stage::before { content: ""; position: absolute; inset: 5% 7%; background: radial-gradient(ellipse, #ffe1a767, transparent 70%); pointer-events: none; }
.reward-chest-focus.is-ready .reward-stage::before { background: radial-gradient(ellipse, #ffe2959c, transparent 70%); }
.reward-goal-copy { position: relative; margin: 0 0 14px; color: #88714f; font-size: 13px; line-height: 1.5; text-align: center; }
.reward-progress { height: 6px; border-radius: 99px; overflow: hidden; background: var(--reward-edge); }
.reward-progress > span { display: block; height: 100%; border-radius: inherit; background: #75b968; transition: width .35s ease; }
.reward-chest-focus > .reward-progress { margin: 0 2px 12px; background: #ebdfc5; }
.reward-chest-focus > .reward-progress > span { background: #dca846; }
.reward-open { display: block; width: 100%; min-height: 43px; padding: 11px 14px; border: 1px solid #ac731d; border-radius: 11px; color: #fff; background: #bb841f; box-shadow: 0 3px 0 #936013; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s; }
.reward-open:not(:disabled):hover { background: #a67018; transform: translateY(-1px); }
.reward-open:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.reward-open:disabled { color: #968366; background: #ede4d1; border-color: #e5d8bd; box-shadow: none; cursor: default; }
.reward-how { padding: 0 1px; margin-top: 8px; }
.reward-how summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 42px; color: var(--muted-2); font-size: 12px; cursor: pointer; list-style: none; }
.reward-how summary::-webkit-details-marker { display: none; }
.reward-how summary > span:last-child { font-size: 18px; transition: transform .2s; }
.reward-how[open] summary > span:last-child { transform: rotate(45deg); }
.reward-how p { font-size: 13px; line-height: 1.65; color: var(--muted-2); margin: 2px 0 12px; }
.reward-small-stats { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 4px 0 7px; font-size: 12px; color: var(--muted-2); }
.reward-small-stats b { margin-left: 4px; color: var(--reward-text); }
.reward-win { position: absolute; bottom: 5px; z-index: 3; color: #117ab9; background: #f5fbffff; padding: 5px 12px; border-radius: 99px; font-family: "Bricolage Grotesque", sans-serif; font-size: 22px; font-weight: 800; transform: translateY(15px) scale(.7); opacity: 0; pointer-events: none; }
.reward-burst { position: absolute; left: 50%; top: 45%; pointer-events: none; z-index: 4; }
.reward-burst > span { position: absolute; width: 24px; height: 28px; opacity: 0; }
.is-revealed .reward-win { animation: reward-win .5s cubic-bezier(.16,1,.3,1) forwards; }
.is-revealed .reward-burst > span { animation: reward-particle 1.2s ease-out both; animation-delay: calc(var(--particle) * 35ms); }
.reward-count-pop { animation: reward-number .48s cubic-bezier(.2,.8,.2,1); }
.is-opening .reward-chest-scene > img { animation: reward-chest-shake .16s ease-in-out infinite alternate; }
.is-revealed .reward-chest-scene > img { transform: translateY(-8px); filter: drop-shadow(0 0 13px #ffd465); }
.reward-simple button:focus-visible, .reward-simple summary:focus-visible, .gems-chip:focus-visible, .chapter-extras summary:focus-visible { outline: 3px solid var(--reward-blue); outline-offset: 3px; }
:root[data-theme="dark"] .reward-chest-focus { background: #2e291e; border-color: #514730; }
:root[data-theme="dark"] .reward-chest-focus.is-ready { background: #332a18; border-color: #8e6e32; }
:root[data-theme="dark"] .reward-chest-heading h3 { color: #f6d68c; }
:root[data-theme="dark"] .reward-kicker, :root[data-theme="dark"] .reward-goal-copy { color: #c5ac7e; }
:root[data-theme="dark"] .reward-prize { background: #16354a; color: #84cfff; border-color: #536164; }
:root[data-theme="dark"] .reward-open:disabled { background: #403624; color: #c5ad82; border-color: #57482d; }
:root[data-theme="dark"] .reward-week .is-today:not(.learned) i { background: #3d2e18; }
/* The original photo, proportions, title and Open link remain untouched. */
.chapter .chapter-tile-progress { position: absolute; display: block; left: 17px; right: 17px; bottom: 7px; z-index: 3; height: 4px; pointer-events: none; }
.chapter-tile-progress .reward-progress, .tile-progress-track { display: block; width: 100%; height: 4px; border-radius: 99px; background: #ffffff35; }
.chapter-tile-progress .reward-progress > span { background: #b9e986; }
.tile-progress-percent { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* Compact practice information, never a "continue" card. */
.chapter-practice-meter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 15px; padding: 5px 2px; color: var(--muted-2); font-size: 13px; }
.chapter-practice-meter > span { display: inline-flex; align-items: center; gap: 5px; }
.chapter-practice-meter > span .ic { width: 17px; height: 17px; margin-right: 4px; color: var(--green-d); }
.chapter-practice-meter .reward-progress { width: min(210px, 30vw); height: 5px; margin-left: auto; }
.chapter-practice-meter > b { color: var(--reward-text); font-size: 12px; }
.chapter-exercises { display: flex; flex-direction: column; gap: 14px; }
.chapter-extras { margin: 12px 0 3px; border: 1px solid var(--reward-edge); border-radius: 14px; background: var(--card); }
.chapter-extras > summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; gap: 14px; color: var(--reward-text); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.chapter-extras > summary::-webkit-details-marker { display: none; }
.chapter-extras > summary > span:first-child { display: flex; align-items: center; gap: 11px; }
.chapter-extras > summary .ic { width: 19px; height: 19px; color: var(--muted-2); }
.chapter-extras > summary > span:last-child { font-size: 22px; font-weight: 500; }
.chapter-extras[open] > summary > span:last-child { transform: rotate(45deg); }
.chapter-extra-material { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.chapter-extra-material > .section-title { display: none; }
@keyframes reward-enter { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes reward-mini-bob { 30% { transform: translateY(-3px) rotate(-12deg); } 70% { transform: translateY(-1px) rotate(8deg); } }
@keyframes reward-flame-breathe { 50% { transform: scale(.96,1.04) rotate(2deg); } }
@keyframes reward-chest-shake { from { transform: rotate(-3deg) translateX(-2px); } to { transform: rotate(3deg) translateX(2px); } }
@keyframes reward-win { to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes reward-number { 45% { transform: scale(1.17); color: #21a1ef; } }
@keyframes reward-particle { 0% { opacity: 0; transform: translate(-50%,0) scale(.6); } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(calc((var(--particle) - 3) * 32px), calc(-65px - (3 - var(--particle)) * 8px)) rotate(calc(var(--particle) * 42deg)) scale(.4); } }
@media (max-width: 480px) {
  .reward-overlay { padding: 10px; }
  .reward-simple { max-height: calc(100dvh - 20px); border-radius: 22px; }
  .reward-simple-header { padding: 17px 20px 0; }
  .reward-simple-header h2 { font-size: 22px; }
  .reward-simple-scroll { padding: 0 20px 9px; }
  .reward-flame-scene { width: 77px; height: 96px; }
  .reward-gem-scene { width: 68px; height: 84px; }
  .reward-total strong { font-size: 33px; }
  .reward-week ol { gap: 6px; }
  .reward-week li i { width: 32px; height: 32px; }
  .reward-chest-focus { padding: 15px 16px; }
  .reward-stage { height: 183px; }
  .reward-chest-scene { width: 238px; }
  .chapter-practice-meter .reward-progress { order: 3; width: 100%; }
  .chapter-practice-meter > b { margin-left: auto; }
  body.shell-active .app-topbar { gap: 7px; }
  .gems-chip { min-width: 46px; padding: 4px 6px; font-size: 12px; }
  .gems-chip .reward-asset { width: 24px; height: 25px; }
}
@media (max-width: 350px) {
  .reward-simple-header { padding-left: 16px; padding-right: 16px; }
  .reward-simple-scroll { padding-left: 16px; padding-right: 16px; }
  .reward-flame-scene { width: 66px; }
  .reward-gem-scene { width: 60px; }
  .reward-total strong { font-size: 28px; }
  .reward-week li i { width: 29px; height: 29px; }
  .reward-week ol { gap: 3px; }
  .reward-week-label b, .reward-goal-copy { font-size: 12px; }
}
@media (max-height: 700px) {
  .reward-simple-header { padding-top: 14px; }
  .reward-totals { margin-top: 0; margin-bottom: 3px; }
  .reward-flame-scene { height: 82px; }
  .reward-gem-scene { height: 77px; }
  .reward-week { padding-bottom: 13px; }
  .reward-chest-focus { margin-top: 13px; padding-top: 13px; padding-bottom: 13px; }
  .reward-stage { height: 155px; }
  .reward-chest-scene { width: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .reward-simple, .reward-count-pop, .reward-asset, .reward-win, .reward-burst > span { animation: none !important; }
  .reward-progress > span, .reward-open, .reward-how summary > span { transition: none; }
  .is-revealed .reward-win { opacity: 1; transform: none; }
  .is-revealed .reward-burst { display: none; }
}
.reward-scene:has(.bio-reward-model) > .reward-asset { display: none; }
.reward-hero { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 15px; min-height: 135px; }
.reward-hero > div { min-width: 0; }
.reward-hero strong { display: block; font: 750 clamp(36px, 7vw, 52px)/1 "Bricolage Grotesque", sans-serif; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.reward-hero > div > span { display: block; margin-top: 4px; font-size: 15px; font-weight: 650; }
.reward-hero p { margin: 8px 0 0; font-size: 12px; color: var(--muted-2); }
.reward-hero .reward-gem-scene { width: 124px; height: 124px; }
.reward-hero .reward-flame-scene { width: 133px; height: 142px; }
.reward-gems-hero strong { color: var(--reward-blue); }
.reward-streak-hero strong { color: #e98623; }
.reward-freezers { display: flex; align-items: center; gap: 12px; padding: 12px 13px 12px 5px; margin-top: 20px; border: 1px solid #c8dfeb; border-radius: 18px; background: #f0f8fc; }
.reward-freezer-scene { width: 115px; height: 128px; }
.reward-freezer-copy { min-width: 0; flex: 1; }
.reward-freezer-copy .reward-kicker { color: #56849b; font-size: 9px; letter-spacing: .08em; }
.reward-freezer-copy h3 { display: flex; align-items: center; gap: 9px; margin: 4px 0 10px; font: 750 20px/1.2 "Bricolage Grotesque", sans-serif; color: #28546d; }
.reward-freezer-copy h3 > span { font: 750 13px "Hanken Grotesk", sans-serif; color: #52829a; }
.reward-freezer-stock { display: flex; gap: 6px; }
.reward-freezer-stock > span { display: grid; place-items: center; width: 30px; height: 29px; border: 1px dashed #b6ccdb; border-radius: 8px; color: #94b2c4; }
.reward-freezer-stock > .is-full { border-style: solid; border-color: #9bcee7; background: #d9f1ff; color: #2486ba; box-shadow: 0 2px 0 #beddec; font-size: 21px; }
.reward-freezer-copy p { margin: 10px 0 0; color: #547587; font-size: 12px; line-height: 1.5; }
.reward-freezer-hint { margin: 10px 5px 4px; font-size: 12px; line-height: 1.6; color: var(--muted-2); }
.reward-switch { display: flex; width: 100%; align-items: center; gap: 9px; padding: 10px 4px 8px; border: 0; border-top: 1px solid var(--reward-edge); background: none; color: var(--muted-2); font: 650 13px "Hanken Grotesk", sans-serif; cursor: pointer; text-align: left; }
.reward-switch .reward-asset { width: 24px; height: 27px; }
.reward-switch > span:last-child { margin-left: auto; font-size: 18px; }
.reward-switch:hover { color: var(--reward-blue); }
.reward-switch:disabled { opacity: .5; cursor: default; }
:root[data-theme="dark"] .reward-freezers { border-color: #304e61; background: #1b2b37; }
:root[data-theme="dark"] .reward-freezer-copy h3 { color: #b7e2fa; }
:root[data-theme="dark"] .reward-freezer-copy p, :root[data-theme="dark"] .reward-freezer-copy .reward-kicker { color: #9cbcd0; }
:root[data-theme="dark"] .reward-freezer-stock > .is-full { background: #254d65; color: #a0dcff; border-color: #436d86; box-shadow: 0 2px 0 #102d40; }
@media (max-width: 350px) {
  .reward-hero { gap: 10px; }
  .reward-hero .reward-gem-scene { width: 100px; height: 110px; }
  .reward-hero .reward-flame-scene { width: 109px; height: 122px; }
  .reward-freezers { gap: 5px; }
  .reward-freezer-scene { width: 83px; height: 112px; }
  .reward-freezer-copy h3 { font-size: 18px; }
}
@media (max-height: 700px) {
  .reward-hero { min-height: 100px; margin: 5px 0 9px; }
  .reward-hero .reward-gem-scene { width: 100px; height: 100px; }
  .reward-hero .reward-flame-scene { width: 106px; height: 112px; }
}
.local-test-panel { position: fixed; bottom: 12px; left: 12px; z-index: 1000; width: min(310px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--reward-blue); border-radius: 15px; background: var(--card); color: var(--reward-text); box-shadow: 0 8px 32px #0003; font: 13px/1.5 "Hanken Grotesk", sans-serif; }
.local-test-panel summary { cursor: pointer; font-weight: 800; }
.local-test-panel[inert] { visibility: hidden; }
.local-test-panel p { margin: 8px 0; font-size: 12px; }
.local-test-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.local-test-actions button { padding: 8px; border: 1px solid var(--reward-edge); border-radius: 8px; background: var(--reward-surface); color: var(--reward-text); cursor: pointer; font: inherit; font-size: 12px; }
.local-test-actions button:first-child { grid-column: 1 / -1; background: var(--reward-blue-soft); color: var(--reward-blue); font-weight: 800; }
.local-test-actions button:focus-visible { outline: 2px solid var(--reward-blue); outline-offset: 2px; }
