/* One portrait canvas on phones, tablets and desktop; puzzles keep their geometry. */
html.journey-portrait-root{background:#ded6c2}
body.journey-portrait{--portrait-width:810px;width:min(100%,var(--portrait-width));min-height:100dvh;margin:0 auto;background:var(--paper)}
.journey-portrait .paper-grain{width:min(100%,var(--portrait-width));left:50%;right:auto;transform:translateX(-50%)}
body.journey-portrait #top{width:100%;max-width:100%;height:auto;min-height:72px;padding:12px 16px;gap:8px;flex-wrap:wrap}
.journey-portrait .brand{font-size:17px;letter-spacing:2px;gap:8px}
.journey-portrait .brand-seal{width:33px;height:36px;font-size:22px}
.journey-portrait .brand-sub{font-size:10px}
.journey-portrait .quiet{padding:7px;font-size:12px}
.journey-portrait #journey-account{margin-left:auto;max-width:100%;white-space:normal}
body.journey-portrait main{width:100%;max-width:100%;min-width:0;padding:20px 18px 32px}
.journey-portrait .hero{display:flex;flex-direction:column;gap:12px;text-align:center;min-height:0}
.journey-portrait .hero h1{font-size:34px;letter-spacing:4px}
.journey-portrait .hero-description{font-size:15px;margin:16px auto}
.journey-portrait .hero-art{width:100%;height:190px}
.journey-portrait .hero-art img{height:180px}
.journey-portrait .hero-art:before{width:160px;height:160px}
.journey-portrait .hero-art:after{display:none}
.journey-portrait .stage-entries,.journey-portrait .space-grid,.journey-portrait .topic-grid,.journey-portrait .phase-grid,.journey-portrait .record-grid{grid-template-columns:minmax(0,1fr);gap:12px}
.journey-portrait .stage-card{min-height:130px;padding:18px 20px}
.journey-portrait .stage-card h2{font-size:27px}
.journey-portrait .space-card{padding:16px;min-height:130px}
.journey-portrait .space-card h2{display:flex;flex-wrap:wrap;font-size:25px}
.journey-portrait .space-card .era{display:inline;font-size:11px}
.journey-portrait .space-card small{font-size:11px}
.journey-portrait .stage-intro{flex-wrap:wrap;gap:12px}
.journey-portrait .stage-intro img{height:76px}
.journey-portrait .stage-intro h1{font-size:29px}
.journey-portrait .section-head{align-items:start;flex-direction:column;gap:6px}
.journey-portrait .section-head h2{font-size:25px}
.journey-portrait .bottom-note{flex-direction:column;gap:8px}
body.journey-portrait.playing #top,body.journey-portrait.task-intro #top{max-width:100%;height:44px;min-height:44px;padding:0 10px}
body.journey-portrait.playing main{max-width:100%;padding:0 8px 12px}
.journey-portrait .task-title{min-height:calc(100dvh - 76px);padding:24px 12px}
.journey-portrait .task-title h1{font-size:32px;letter-spacing:3px}
body.journey-portrait.playing .game-frame{width:100%;height:max(calc(100dvh - 56px),calc(min(100vw,810px)*4/3 - 56px));min-height:420px}
body.journey-portrait.playing .new-stage{width:100%;min-height:max(calc(100dvh - 100px),calc(min(100vw,810px)*4/3 - 100px));padding:12px 8px}
.journey-portrait .puzzle-board{width:100%;max-width:100%;min-width:0}
.journey-portrait .num-pad{gap:8px}
.journey-portrait .num-pad button{min-width:44px;padding:6px 10px}
.journey-portrait .new-stage .big-number{font-size:36px}
body.journey-portrait .new-stage .rules{font-size:16px;overflow-wrap:anywhere}
.journey-portrait .bead-art{height:300px;width:100%}
.journey-portrait .graph{height:auto;min-height:230px;max-width:100%}
.journey-portrait .game-actions,.journey-portrait .challenge-footer{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.journey-portrait .game-actions button,.journey-portrait .challenge-footer button{width:100%;margin:0;min-height:44px}
.journey-portrait .challenge-footer:has(button:not([hidden])){padding:12px 8px}
.journey-portrait dialog{width:min(440px,calc(100vw - 28px));max-height:85dvh;padding:32px 20px}
.journey-portrait dialog .actions{flex-direction:column;align-items:stretch}
.journey-portrait dialog button{min-height:44px}
/* Embedded engines receive this same sheet and a genuinely narrow viewport. */
body.rxs-minimal{box-sizing:border-box;min-width:0!important;width:100%!important;max-width:810px!important;margin:0 auto!important}
body.rxs-minimal .app,body.rxs-minimal .wrap,body.rxs-minimal .container,body.rxs-minimal main{box-sizing:border-box;min-width:0!important;width:100%!important;max-width:100%!important}
body.rxs-minimal .layout,body.rxs-minimal .game-layout,body.rxs-minimal .play-layout{display:flex!important;flex-direction:column!important;gap:16px!important;min-width:0!important}
body.rxs-minimal .layout>*,body.rxs-minimal .game-layout>*,body.rxs-minimal .play-layout>*{box-sizing:border-box;min-width:0!important;max-width:100%!important;width:100%!important}
body.rxs-minimal .row,body.rxs-minimal .toolbar,body.rxs-minimal .controls,body.rxs-minimal .actions{flex-wrap:wrap;max-width:100%;box-sizing:border-box}
body.rxs-minimal input,body.rxs-minimal select{box-sizing:border-box;max-width:100%}
body.rxs-minimal img,body.rxs-minimal video,body.rxs-minimal canvas,body.rxs-minimal svg,body.rxs-minimal iframe{max-width:100%}
body.rxs-zero-focus .app{padding:16px 10px 24px}
body.rxs-zero-focus .rules{text-align:center;line-height:1.8;font-size:16px}
body.rxs-zero-focus .equation-scroll{padding:28px 0 18px}
body.rxs-zero-focus .equation{gap:clamp(3px,1vw,8px)}
body.rxs-zero-focus .number{min-width:32px;font-size:clamp(20px,5vw,28px);padding:6px}
body.rxs-zero-focus .op,body.rxs-zero-focus .target{font-size:clamp(19px,5vw,27px)}
body.rxs-zero-focus .actions{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding-top:16px}
body.rxs-zero-focus .actions button{width:100%;min-height:44px;margin:0}
body.rxs-zero-focus #status{min-width:0;text-align:center;width:100%}
@media(min-width:811px){body.journey-portrait{box-shadow:0 0 0 1px #c8bea5,0 0 60px #59472a12}}
@media(max-width:360px){.journey-portrait .brand{font-size:15px}.journey-portrait .brand-seal{display:none}.journey-portrait .num-pad{gap:5px}.journey-portrait .num-pad button{min-width:40px;padding:6px 8px}}

/* iPad 9: 810 x 1080 CSS pixels in portrait, with room for Safari chrome. */
@media(min-width:600px){
 .journey-portrait{font-size:19px}
 body.journey-portrait main{padding:28px 32px 40px}
 body.journey-portrait #top{padding:14px 24px;min-height:80px}
 .journey-portrait .brand{font-size:21px}
 .journey-portrait .brand-sub{font-size:12px}
 .journey-portrait .quiet{font-size:16px;min-height:48px}
 .journey-portrait .hero h1{font-size:44px}
 .journey-portrait .hero-description{font-size:18px}
 .journey-portrait .hero-art{height:240px}
 .journey-portrait .hero-art img{height:225px}
 .journey-portrait .hero-art:before{width:210px;height:210px}
 .journey-portrait .stage-card,.journey-portrait .space-card{padding:22px 26px;min-height:145px}
 .journey-portrait .stage-card p,.journey-portrait .space-card p{font-size:17px}
 .journey-portrait .space-card small,.journey-portrait .stage-card small{font-size:14px}
 .journey-portrait .stage-intro h1{font-size:36px}
 .journey-portrait .task-title h1{font-size:42px}
 body.journey-portrait.playing #top,body.journey-portrait.task-intro #top{height:56px;min-height:56px;padding:0 18px}
 body.journey-portrait.playing #back,body.journey-portrait.task-intro #back{min-width:56px;min-height:56px;font-size:34px}
 body.journey-portrait.playing main{padding:0 20px 20px}
 body.journey-portrait.playing .new-stage{padding:24px 20px}
 body.journey-portrait .new-stage .rules{font-size:20px;line-height:1.8;max-width:640px;margin-bottom:28px}
 .journey-portrait .puzzle-board{max-width:650px;margin:24px auto}
 .journey-portrait .new-stage .big-number{font-size:46px}
 .journey-portrait .num-pad{gap:12px}
 .journey-portrait .num-pad button{min-width:56px;min-height:56px;font-size:27px}
 .journey-portrait .game-actions{max-width:420px;margin:24px auto 0}
 .journey-portrait .game-actions button,.journey-portrait .challenge-footer button{min-height:52px;font-size:18px}
 .journey-portrait .number-grid button{min-height:56px;font-size:24px}
 .journey-portrait .bead-art{height:360px}
 .journey-portrait .graph{min-height:320px}
 body.rxs-minimal button{min-height:44px}
 body.rxs-zero-focus .app{padding:28px 24px}
 body.rxs-zero-focus .rules{font-size:20px;max-width:640px;margin:0 auto;line-height:1.9}
 body.rxs-zero-focus .equation-scroll{padding:42px 0 24px}
 body.rxs-zero-focus .equation{gap:12px}
 body.rxs-zero-focus .number{min-width:60px;min-height:60px;font-size:34px;padding:8px 12px}
 body.rxs-zero-focus .op,body.rxs-zero-focus .target{font-size:34px}
 body.rxs-zero-focus .remove{min-width:48px;min-height:44px;font-size:16px}
 body.rxs-zero-focus .actions{max-width:420px;margin:24px auto 0}
 body.rxs-zero-focus .actions button{min-height:52px;font-size:18px}
}

/* Fill the visible iPad portrait screen without manufacturing a second scrollbar. */
@media(orientation:portrait){
 body.journey-portrait.playing .game-frame{height:calc(100dvh - 56px);min-height:420px}
 body.journey-portrait.playing .new-stage{min-height:calc(100dvh - 56px)}
}
@media(orientation:portrait) and (min-width:600px){
 body.journey-portrait.playing .game-frame{height:calc(100dvh - 76px)}
 body.journey-portrait.playing .new-stage{min-height:calc(100dvh - 76px)}
}

/* Shared task screen: banner, centered question, play area, companion guide. */
body.journey-portrait.playing main{padding:0 16px}
body.journey-portrait.playing #app{display:flex;flex-direction:column;height:calc(100dvh - 44px);min-height:660px;gap:0}
.journey-banner{flex:none;text-align:center;color:var(--ink);background:transparent;padding:14px 10px 16px;border-bottom:1px solid var(--line);font-family:var(--serif)}
.journey-banner>p{font-weight:700;font-size:clamp(18px,3.9vw,34px);line-height:1.5;letter-spacing:2px;white-space:nowrap}
.journey-banner>h1{color:#77745f;font-family:var(--serif);font-weight:500;font-size:clamp(17px,3vw,25px);letter-spacing:2px;line-height:1.6;margin-top:5px}
.task-heading{flex:none;text-align:center;padding:14px 12px 8px}
.task-heading .space-caption{font-size:12px;letter-spacing:2px;color:var(--gold)}
.task-heading h2{font-size:23px;letter-spacing:2px;margin:2px 0 6px}
#task-question{font-size:17px;line-height:1.65;max-height:116px;overflow:auto;max-width:680px;margin:0 auto;color:var(--ink);overflow-wrap:anywhere}
body.journey-portrait.playing #gameHost{flex:1;min-height:260px;min-width:0;position:relative;overflow:auto}
body.journey-portrait.playing .game-frame{height:100%!important;min-height:260px!important;width:100%;display:block}
body.journey-portrait.playing .new-stage{height:100%;min-height:260px!important;padding:4px 8px 12px}
body.journey-portrait.playing .new-stage>.rules{display:none!important}
body.journey-portrait.playing .new-stage>.puzzle-board{margin:10px auto;max-width:600px}
body.journey-portrait.playing .new-stage .game-actions{margin:12px auto 0;flex-direction:row;justify-content:center;flex-wrap:wrap}
body.journey-portrait.playing .new-stage .game-actions button{width:auto;min-width:100px}
.journey-guide{flex:none;display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:12px 10px;background:linear-gradient(90deg,#e6d8b626,#fff9e62b)}
.journey-guide img{width:66px;height:78px;object-fit:contain;flex:none}
.journey-guide>div{flex:1;min-width:0}
.guide-name{font-size:12px;letter-spacing:1px;color:var(--gold);margin-bottom:4px}
#guide-speech{font-size:15px;line-height:1.6}
.journey-guide button{min-height:44px;flex:none;padding:7px 10px;font-size:13px}
body.rxs-minimal [data-rxs-question]{display:none!important}
body.rxs-zero-focus .equation-scroll{padding-top:22px}
.journey-celebration{position:fixed;inset:0;z-index:500;background:radial-gradient(ellipse,#18263ceb,#030b1af2);display:grid;place-items:center;overflow:hidden;perspective:900px;outline:none}
.journey-celebration[hidden]{display:none!important}
.journey-celebration canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.award-arrival{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px;color:#ffe7a2;animation:award-near 1.3s cubic-bezier(.15,.7,.2,1) both;transform-origin:center;filter:drop-shadow(0 0 18px #f1b84455)}
.award-kicker{font-size:20px;letter-spacing:4px;color:#f7dca6}
#award-value{font:700 clamp(52px,12vw,108px)/1.25 Georgia,'STKaiti','KaiTi',serif;color:#ffd878;text-shadow:0 2px 0 #886018,0 0 18px #ffc54780,0 0 50px #df9d2455}
.award-note{font-size:18px;letter-spacing:6px;color:#fff2cd}
@keyframes award-near{0%{opacity:0;transform:translateZ(-800px) scale(.12)}65%{opacity:1;transform:translateZ(70px) scale(1.12)}100%{opacity:1;transform:translateZ(0) scale(1)}}
@media(min-width:600px){body.journey-portrait.playing #app{height:calc(100dvh - 56px);min-height:800px}.task-heading{padding:16px 20px 10px}.task-heading h2{font-size:27px}#task-question{font-size:19px}.journey-guide{padding:14px 20px;gap:16px}.journey-guide img{width:80px;height:90px}.guide-name{font-size:14px}#guide-speech{font-size:18px}.journey-guide button{font-size:16px;min-height:48px}}
@media(max-width:420px){body.journey-portrait.playing main{padding:0 6px}.journey-banner{padding:10px 4px}.journey-banner>p{font-size:17px;letter-spacing:1px}.journey-banner>h1{font-size:16px;letter-spacing:1px}.task-heading{padding:10px 6px 4px}.task-heading h2{font-size:20px}#task-question{font-size:15px;max-height:100px}.journey-guide{gap:8px;padding:9px 4px}.journey-guide img{width:48px;height:62px}#guide-speech{font-size:13px}.journey-guide button{font-size:12px;padding:6px}.guide-name{font-size:11px}}
@media(prefers-reduced-motion:reduce){.award-arrival{animation:none;transform:none}.journey-celebration{background:#09172c}}

.guide-actions{display:flex;flex-direction:column;gap:6px;flex:none}

body.journey-portrait.playing .new-stage .graph{height:clamp(230px,calc(100dvh - 580px),380px);min-height:0;width:100%}

.journey-guide>.guide-actions{flex:0 0 auto}

/* Task-only layouts for the selected curriculum. */
body.rxs-minimal{font-family:'STKaiti','KaiTi','Noto Serif SC','SimSun',serif!important}
body.rxs-minimal :is(.intro,.level-rail,.total-progress,.storage-note,.collection-link,.site-head,.topbar,.level-heading,.home-heading,.page-controls){display:none!important}
body.rxs-minimal[data-rxs-game="animal-rescue"] main>p,body.rxs-minimal[data-rxs-game="18"] main>p,
body.rxs-minimal[data-rxs-game="animal-rescue"] .journey,body.rxs-minimal[data-rxs-game="18"] .journey,
body.rxs-minimal[data-rxs-game="animal-rescue"] .workspace-head,body.rxs-minimal[data-rxs-game="18"] .workspace-head{display:none!important}
body.rxs-minimal:is([data-rxs-game="18"],[data-rxs-game="animal-rescue"]) main{padding:8px!important}
body.rxs-minimal:is([data-rxs-game="18"],[data-rxs-game="animal-rescue"]) .play-layout{gap:8px!important}
body.rxs-minimal:is([data-rxs-game="18"],[data-rxs-game="animal-rescue"]) .board-card{box-shadow:none;border:0;background:none;padding:4px}
body.rxs-minimal:is([data-rxs-game="18"],[data-rxs-game="animal-rescue"]) .control-panel{box-shadow:none;padding:8px}
body.rxs-minimal[data-rxs-game="prime-camera"] :is(body>header,body>footer,#lessonNav,.task-layout>aside,#solution,.puzzle-top,.task-bottom,#taskTitle){display:none!important}
body.rxs-minimal[data-rxs-game="prime-camera"] .task-layout{display:block}
body.rxs-minimal[data-rxs-game="prime-camera"] main{padding:8px!important}
body.rxs-minimal[data-rxs-game="prime-camera"] .puzzle{border:0;box-shadow:none;background:none;padding:4px}
body.rxs-minimal:is([data-rxs-game="circle-regions"],[data-rxs-game="5"]){--bg:#f2ecd9;--panel:#faf6e9;--line:#d1c6aa;--text:#414b3c;--muted:#77745f;--mint:#667b60;--gold:#ae8b47}
body.rxs-minimal:is([data-rxs-game="circle-regions"],[data-rxs-game="5"]) :is(.top,.bottom,.verbs,.reading,.discovery){display:none!important}
body.rxs-minimal:is([data-rxs-game="circle-regions"],[data-rxs-game="5"]) .screen{padding:8px;min-height:0;background:none}
body.rxs-minimal:is([data-rxs-game="circle-regions"],[data-rxs-game="5"]) .workspace{padding:0;display:block;min-height:0}
body.rxs-minimal[data-rxs-game="circle-regions"] .circle-layout{display:flex;flex-direction:column;gap:8px}
body.rxs-minimal[data-rxs-game="circle-regions"] .circle-board{max-width:400px;width:100%;margin:auto}
body.rxs-minimal[data-rxs-game="circle-regions"] .experiment-notes{padding:10px;max-width:100%}
body.rxs-minimal:is([data-rxs-game="2048"],[data-rxs-game="fib"]) :is(.top,.equations,.scorebar,main>header,main>footer,#help-dialog){display:none!important}
body.rxs-minimal:is([data-rxs-game="2048"],[data-rxs-game="fib"]) .game{padding:8px!important;max-width:440px!important;margin:auto}
body.rxs-minimal[data-rxs-game="color-series"] :is(#play>header,#play>footer,.topbar,.game-head,.player-info){display:none!important}
body.rxs-minimal[data-rxs-game="color-series"]{padding-top:42px!important}
body.rxs-minimal[data-rxs-game="color-series"] #play main{height:calc(100dvh - 50px);padding:4px!important}
body.rxs-minimal[data-rxs-game="color-series"] .stage{width:100%;height:100%;display:grid;place-items:center}
body.rxs-minimal[data-rxs-game="color-series"] #board{max-height:100%;width:100%;height:auto}
.rxs-color-choices{position:fixed;z-index:50;inset:0 0 auto;display:flex;justify-content:center;gap:6px;padding:5px;background:#f2ecd9;color:#414b3c}
.rxs-color-choices button{font:16px 'KaiTi',serif;min-width:38px;min-height:32px!important;border:1px solid #bfb59e;border-radius:5px;background:#faf6e9;color:#414b3c;padding:3px}
.rxs-color-choices button[aria-pressed="true"]{outline:2px solid #6f7966}

/* Every route fits one iPad 9 portrait viewport, including Safari's changing chrome. */
html.journey-portrait-root,body.journey-portrait{height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
body.journey-portrait{display:flex;flex-direction:column}
body.journey-portrait #top{flex:none}
body.journey-portrait main{flex:1;min-height:0;overflow:hidden;padding:14px 22px}
body.journey-portrait:not(.playing):not(.cover-mode) #app{height:100%;display:flex;flex-direction:column;min-height:0}
.journey-portrait .stage-intro{flex:none;min-height:0;margin:0 0 16px;padding:8px 0}
.journey-portrait .stage-intro img{height:68px}
.journey-portrait .stage-intro h1{font-size:30px}
.journey-portrait .space-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:14px}
.journey-portrait .space-card{min-height:0;padding:16px 12px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}
.journey-portrait .space-card h2{font-size:29px;margin:9px 0;letter-spacing:3px}
.journey-portrait .space-card p{font-size:18px;letter-spacing:1px}
.journey-portrait .space-index{font-size:12px}
.journey-portrait .return-note{flex:none;font-size:13px;margin:12px 0 0}
body.journey-portrait.playing main{min-height:0;padding:0 16px}
body.journey-portrait.playing #app{height:100%;min-height:0;overflow:hidden}
body.journey-portrait.playing #gameHost{min-height:0;overflow:hidden}
body.journey-portrait.playing .game-frame{min-height:0!important;overflow:hidden}
body.journey-portrait.playing .new-stage{min-height:0!important;overflow:hidden}
#task-question{max-height:none;overflow:visible;font-size:18px;line-height:1.6}
body.journey-portrait.playing .new-stage>h3{display:none}
body.journey-portrait.playing .new-stage>.puzzle-board{max-height:calc(100% - 86px);margin:8px auto}
body.journey-portrait.playing .new-stage .game-actions{margin-top:6px}
body.rxs-minimal{min-height:0!important;transform-origin:top left;overflow:hidden!important}
body.rxs-minimal main{min-height:0!important}
body.rxs-minimal>footer{display:none!important}
body.rxs-minimal[data-rxs-game="19"] :is(.sidebar,.level-sidebar,.level-map,.level-list,.hero,.site-header){display:none!important}
body.rxs-minimal[data-rxs-game="13"] :is(.topbar,.cover,#cover,.level-catalog,.source-link,#coverButton,#catalogButton,#sourceButton){display:none!important}
@media(max-height:900px){.journey-banner{padding:8px 5px}.journey-banner>p{font-size:28px}.journey-banner>h1{font-size:21px;margin-top:0}.task-heading{padding:8px 10px 4px}.task-heading h2{font-size:24px}#task-question{font-size:17px}.journey-guide{padding:6px 12px}.journey-guide img{height:66px;width:60px}}
@media(max-width:599px){body.journey-portrait main{padding:10px}.journey-portrait .stage-intro h1{font-size:22px}.journey-portrait .stage-intro img{height:48px}.journey-portrait .stage-intro{gap:8px;margin-bottom:8px}.journey-portrait .stage-intro p{font-size:11px}.journey-portrait .space-grid{gap:8px}.journey-portrait .space-card{padding:8px 4px}.journey-portrait .space-card h2{font-size:22px;letter-spacing:1px;margin:6px 0}.journey-portrait .space-card p{font-size:13px}.journey-portrait .space-index{font-size:9px}.journey-portrait .return-note{font-size:10px;margin-top:7px}.journey-banner>p{font-size:clamp(15px,4vw,25px);letter-spacing:1px}.journey-banner>h1{font-size:18px}#task-question{font-size:15px}.journey-guide img{width:46px;height:58px}}
/* The cover uses the same ink, paper, and calligraphic type as the puzzle screens. */
body.journey-portrait.cover-mode #top{position:absolute;z-index:10;top:4px;right:max(6px,calc((100vw - 810px)/2));width:auto!important;min-height:0;height:38px;background:none;border:0;padding:0!important}
.cover-mode #top :is(.brand,#book,#journey-account){display:none!important}
body.journey-portrait.cover-mode main{padding:0 18px}
.cover-mode #app{height:100%;min-height:0}
.journey-cover{height:100%;position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column}
.cover-banner{position:relative;z-index:3;padding-top:62px;padding-bottom:22px;border-bottom:0}
.cover-banner>p{font-size:clamp(19px,4.1vw,34px)}
.cover-banner>h1{margin-top:10px;font-size:clamp(18px,3vw,25px)}
.cover-banner:after{content:'';display:block;width:64%;height:1px;background:linear-gradient(90deg,transparent,#9e9876,transparent);margin:22px auto 0}
.tunnel-scene{flex:1;min-height:0;position:relative;perspective:850px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:7vh}
.time-portal{position:absolute;inset:1% -15% 0;pointer-events:none;overflow:hidden;border-radius:50%;mask-image:radial-gradient(ellipse,#000 40%,transparent 74%)}
.portal-haze{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 43%,#f9f5dc 0 5%,#dedcc1 12%,#b5c0b050 24%,#8b9d9250 35%,#c6c3a240 45%,transparent 68%)}
.portal-rings{position:absolute;inset:0;perspective:700px;transform-style:preserve-3d}
.portal-rings i{position:absolute;inset:15% 18%;border:1px solid #6d817c62;box-shadow:0 0 16px #7b918922,inset 0 0 14px #8c99852b;border-radius:50%;transform:translateZ(calc(var(--ring)*-80px)) rotateZ(calc(var(--ring)*16deg));animation:tunnel-drift 12s linear infinite;animation-delay:calc(var(--ring)*-1.33s)}
.portal-lines{position:absolute;inset:0;background:repeating-conic-gradient(from 10deg at 50% 43%,transparent 0deg 18deg,#758a7d20 19deg,transparent 20deg 28deg);mask-image:radial-gradient(ellipse,transparent 9%,#0008 44%,transparent 67%);animation:tunnel-turn 90s linear infinite}
.portal-core{position:absolute;inset:29% 36% 41%;border-radius:50%;background:#faf5dc;box-shadow:0 0 45px 30px #f8f1d680;filter:blur(7px)}
.tunnel-glyphs{position:absolute;top:17%;width:100%;text-align:center;font:18px var(--serif);color:#6c796957;letter-spacing:24px;transform:rotate(-15deg);animation:glyph-float 12s ease-in-out infinite}
.tunnel-buddy{position:absolute;z-index:2;top:12%;left:50%;height:43%;max-height:310px;width:48%;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 18px 20px #59674c24);animation:buddy-greet 5s ease-in-out infinite;transition:opacity .8s,filter .8s}
.grade-orbit{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(20px,6vw,52px);width:min(90%,570px);position:relative;z-index:4;align-items:center;margin-bottom:25px}
.grade-circle{width:100%;aspect-ratio:1;border-radius:50%;border:1px solid #9f9c7d;background:radial-gradient(circle at 36% 25%,#fffbedee,#ded8bcdf);box-shadow:0 10px 30px #6e745018,inset 0 0 0 5px #f5efda,inset 0 0 0 6px #b7b397;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:10px;color:var(--ink);font-family:var(--serif);opacity:0;animation:grade-appear 1.6s ease calc(.75s + var(--entry)*.25s) forwards;touch-action:manipulation;cursor:pointer}
.grade-circle span{font-size:clamp(27px,5.4vw,44px);line-height:1.2}
.grade-circle small{font-size:clamp(15px,2.3vw,20px);letter-spacing:4px;margin-top:8px}
.grade-circle:focus-visible{outline:3px solid #5d7766;outline-offset:6px}
.grade-circle:disabled{color:var(--ink);cursor:default}
.cover-invitation{font-size:17px;letter-spacing:3px;line-height:1.6;text-align:center;color:#7c7c65;min-height:30px;opacity:0;animation:grade-appear 1.4s ease 1.7s forwards;z-index:3}
.departing .grade-circle:not(.chosen){animation:none;opacity:0;transition:opacity .5s}
.departing .portal-lines{animation:tunnel-turn 3s linear infinite}
.cover-fragments{position:absolute;inset:0;width:100%;height:100%;z-index:20;pointer-events:none}
.dissolving .cover-banner,.dissolving .tunnel-scene{opacity:0;filter:blur(4px);transition:opacity 1.15s,filter 1.15s}
@keyframes tunnel-drift{0%{opacity:0;transform:translateZ(-650px) rotateZ(0)}30%{opacity:.7}85%{opacity:.5}100%{opacity:0;transform:translateZ(280px) rotateZ(38deg)}}
@keyframes tunnel-turn{to{transform:rotate(360deg)}}
@keyframes glyph-float{50%{transform:rotate(-9deg) translateY(18px);opacity:.45}}
@keyframes buddy-greet{0%,100%{transform:translateX(-50%) translateY(0) rotate(-2deg)}50%{transform:translateX(-50%) translateY(-12px) rotate(2deg)}}
@keyframes grade-appear{from{opacity:0;transform:translateY(20px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes portal-rush{to{transform:scale(3);opacity:0}}
@media(max-height:850px){.cover-banner{padding-top:42px;padding-bottom:6px}.cover-banner:after{margin-top:12px}.tunnel-scene{padding-bottom:4vh}.tunnel-buddy{top:8%;height:44%}.grade-orbit{width:min(80%,480px);gap:28px;margin-bottom:16px}.cover-invitation{font-size:14px}}
@media(max-width:599px){.cover-banner{padding-top:42px}.cover-banner>p{font-size:clamp(15px,4.3vw,24px);letter-spacing:1px;white-space:normal}.cover-banner>h1{font-size:19px;letter-spacing:1px}.grade-orbit{width:94%;gap:18px}.grade-circle{padding:5px}.grade-circle span{font-size:29px}.grade-circle small{font-size:14px;letter-spacing:2px;margin-top:4px}.cover-invitation{font-size:12px;letter-spacing:1px}.tunnel-glyphs{letter-spacing:12px;font-size:13px}}
@media(prefers-reduced-motion:reduce){.portal-rings i,.portal-lines,.tunnel-glyphs,.tunnel-buddy{animation:none}.grade-circle,.cover-invitation{animation:none;opacity:1}.departing .grade-circle.chosen{animation:none}}

body.rxs-minimal>header,body.rxs-minimal>nav:not(.rxs-color-choices),body.rxs-minimal :is(.chapters,.leveltiles,.level-panel,aside.levels,#levels,.workspace-head,.workspace-title,.heading,#hinged-extension,.nav-pair,.navigation,.steps){display:none!important}
body.rxs-minimal[data-rxs-game="19"] .layout{display:block!important}
body.rxs-minimal[data-rxs-game="17"] :is(.guide,.howto,.rule-card,.route-inspector){display:none!important}
body.rxs-minimal[data-rxs-game="9"] .journey{display:none!important}
body.rxs-minimal[data-rxs-game="8"] :is(.answer-card>h2,.answer-card>p,#resetProgress,#solutionCount,#saveStatus){display:none!important}
body.rxs-minimal[data-rxs-game="12"] :is(.quote,#flow){display:none!important}
body.rxs-minimal[data-rxs-game="106"] :is(.top,.play-header,.board-note,.tagline){display:none!important}
body.rxs-minimal[data-rxs-game="13"] :is(.top,.catalog,.cover-note){display:none!important}
body.rxs-minimal[data-rxs-game="10"] :is(.guidebox,.subhead,.stats){display:none!important}
body.rxs-minimal:is([data-rxs-game="5"],[data-rxs-game="circle-regions"]) :is(h2,h3,.slider){color:#414b3c!important}
body.rxs-minimal:is([data-rxs-game="5"],[data-rxs-game="circle-regions"]) button{background:#e5e0c9;color:#414b3c;border-color:#bab69b}
body.rxs-minimal:is([data-rxs-game="5"],[data-rxs-game="circle-regions"]) .circle-board{background:none}

body.rxs-minimal[data-rxs-game="13"] #game{padding:6px!important}
body.rxs-minimal[data-rxs-game="13"] :is(.levelbar,.panel-heading,#selectionHelp,#groupList,.level-nav,.fine-controls,#mathNote,.explain){display:none!important}
body.rxs-minimal[data-rxs-game="13"] .workspace{display:grid!important;grid-template-columns:240px minmax(0,1fr)!important;gap:10px!important;align-items:start}
body.rxs-minimal[data-rxs-game="13"] :is(.square-panel,.play-panel){padding:8px;border:1px solid #c6bea6;box-shadow:none;border-radius:10px;max-width:100%}
body.rxs-minimal[data-rxs-game="13"] #square{margin:0;gap:3px}
body.rxs-minimal[data-rxs-game="13"] .square-cell{padding:2px;min-height:40px!important;border-radius:4px}
body.rxs-minimal[data-rxs-game="13"] #stageWrap{margin:0;min-height:0}
body.rxs-minimal[data-rxs-game="13"] #stage{width:100%;height:auto;max-height:380px}
body.rxs-minimal[data-rxs-game="13"] .toolbar{padding:6px;gap:5px;margin-top:8px;background:none;border:0}
body.rxs-minimal[data-rxs-game="13"] .toolbar button{font-size:15px;padding:8px;min-height:44px}
body.rxs-minimal[data-rxs-game="13"] #feedback{font-size:14px;padding:6px;background:none}

body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .play-area{min-height:0;padding:8px}
body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) :is(.maze-grid,.animal-grid,.tiling-board){width:min(100%,330px);margin:auto}
body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .control-panel{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap}
body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .control-panel :is(h3,p,.eyebrow){margin:2px;font-size:15px}
body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .control-panel button{width:auto;min-height:44px}
body.rxs-minimal[data-rxs-game="19"] .glass-stage{padding:8px;max-width:410px;margin:auto}
body.rxs-minimal[data-rxs-game="19"] .play-panel{padding:6px;border:0;box-shadow:none}
body.rxs-minimal[data-rxs-game="19"] :is(.board-head,.glass-floor,.glass-sun,.glass-sunbeams){display:none!important}
body.rxs-minimal[data-rxs-game="19"] .color-picker{padding:6px}
body.rxs-minimal[data-rxs-game="13"] :is(.selection-help,.piece-tools){display:none!important}

body.journey-portrait.playing .game-frame{opacity:0;transition:opacity .15s}body.journey-portrait.playing .game-frame.ready{opacity:1}

body.rxs-minimal[data-rxs-game="35"] main{padding:8px!important}
body.rxs-minimal[data-rxs-game="35"] :is(main>.bar,.headline,#poolHint,#saveStatus,.pool-panel>h3,.chain-panel>.muted){display:none!important}
body.rxs-minimal[data-rxs-game="35"] .workspace{display:flex!important;flex-direction:column;gap:8px}
body.rxs-minimal[data-rxs-game="35"] .panel{padding:8px;border:0;box-shadow:none}
body.rxs-minimal[data-rxs-game="35"] #pool{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;justify-items:center}
body.rxs-minimal[data-rxs-game="35"] #pool button{width:48px;height:48px;min-height:44px;padding:0;font-size:18px}
body.rxs-minimal[data-rxs-game="35"] #pool button:disabled{display:none}
body.rxs-minimal[data-rxs-game="35"] #chain{min-height:100px;padding:8px}
body.rxs-minimal[data-rxs-game="35"] :is(.bar,.tools){margin:5px 0;gap:8px;flex-wrap:wrap}
body.rxs-minimal[data-rxs-game="35"] button{font-size:16px;min-height:44px}

body.rxs-minimal[data-rxs-game="10"] #inspector{display:none!important}
body.rxs-minimal[data-rxs-game="10"] .layout{display:block!important}
body.rxs-minimal[data-rxs-game="17"] #board{max-width:390px}
body.rxs-minimal[data-rxs-game="17"] :is(.mode-switch,.mode-toolbar,.top-controls,.mode-description){display:none!important}
body.rxs-minimal[data-rxs-game="30"] main{padding:8px!important}
body.rxs-minimal[data-rxs-game="30"] main>.eyebrow{display:none}
body.rxs-minimal[data-rxs-game="30"] .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
body.rxs-minimal[data-rxs-game="30"] .card{padding:10px}
body.rxs-minimal[data-rxs-game="30"] .animals{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-height:0}
body.rxs-minimal[data-rxs-game="30"] .animal{height:60px}
body.rxs-minimal[data-rxs-game="30"] .animal i{font-size:28px}
body.rxs-minimal[data-rxs-game="30"] .animal small{font-size:10px;top:2px;left:3px}
body.rxs-minimal[data-rxs-game="30"] .animal strong{font-size:14px}
body.rxs-minimal[data-rxs-game="30"] .card-foot{margin-top:5px;padding-top:5px}
body.rxs-minimal[data-rxs-game="30"] .result{min-height:0;padding:12px;margin-top:10px}
body.rxs-minimal[data-rxs-game="30"] .result h2{font-size:20px}
body.rxs-minimal[data-rxs-game="104"] main{padding:8px!important}
body.rxs-minimal[data-rxs-game="104"] :is(main>.eyebrow,.lead,main>.toolbar,.foot,.layout>aside,details){display:none!important}
body.rxs-minimal[data-rxs-game="104"] .layout{display:block!important}
body.rxs-minimal[data-rxs-game="104"] .calc{max-width:540px;margin:auto;padding:16px}
body.rxs-minimal[data-rxs-game="104"] #keys button{min-height:48px;font-size:20px}
body.rxs-minimal[data-rxs-game="1"] main{padding:6px!important}
body.rxs-minimal[data-rxs-game="1"] :is(main>nav,#sourceNote,main>.bar:has(#mode),#bankTitle,#referencePanel,details){display:none!important}
body.rxs-minimal[data-rxs-game="1"] .panel{padding:8px}
body.rxs-minimal[data-rxs-game="1"] .systemrow{gap:6px;margin-bottom:6px}
body.rxs-minimal[data-rxs-game="1"] .picture{min-height:44px;padding:4px}

@media(min-width:600px){
 body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .play-layout{display:grid!important;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)!important;gap:12px!important;align-items:center}
 body.rxs-minimal:is([data-rxs-game="animal-rescue"],[data-rxs-game="18"]) .control-panel{flex-direction:column;align-items:stretch;text-align:center}
}
body.rxs-minimal[data-rxs-game="10"] .board{max-width:380px;margin:8px auto}
body.rxs-minimal[data-rxs-game="10"] .play{padding:10px;margin:0 auto;max-width:600px;box-shadow:none}
body.rxs-minimal[data-rxs-game="10"] .boardnote{display:none}
body.rxs-minimal[data-rxs-game="17"] .modebar{display:none!important}
body.rxs-minimal[data-rxs-game="17"] main{padding:6px!important}
body.rxs-minimal[data-rxs-game="17"] .board-heading{padding:8px}
body.rxs-minimal[data-rxs-game="17"] .board-tools{padding:8px;gap:8px}
body.rxs-minimal[data-rxs-game="17"] .feedback{padding:6px;min-height:0}
body.rxs-minimal[data-rxs-game="color-series"] :is(.game-toolbar,.play-footer,.stage-caption){display:none!important}

/* The chosen grade becomes a flying disc under the mascot's feet. */
.tunnel-flight{position:absolute;z-index:2;top:12%;left:50%;height:43%;max-height:310px;width:48%;transform:translateX(-50%);transform-style:preserve-3d;animation:buddy-greet 5s ease-in-out infinite}
.tunnel-flight .tunnel-buddy{position:relative;inset:auto;left:auto;top:auto;height:100%;max-height:none;width:100%;object-fit:contain;transform:none;animation:none;z-index:2}
.flight-platform{position:absolute;left:50%;bottom:-12px;width:188px;height:40px;transform:translateX(-50%);border-radius:50%;border:1px solid #a6a180;background:radial-gradient(ellipse at 50% 25%,#fffde8,#d4d8bb 68%,#8d9f8c);box-shadow:0 5px 0 #8b9b8277,0 10px 30px #a1c6ad77;opacity:0;text-align:center;font:14px/37px var(--serif);color:#68765f;white-space:nowrap}
.flight-trail{position:absolute;left:50%;bottom:-8px;width:270px;height:6px;border-radius:50%;background:linear-gradient(90deg,transparent,#acc4ac88,#f9ffe9);transform:translateX(-95%);box-shadow:0 0 13px #b6dfc2;opacity:0}
.departing .tunnel-flight{animation:none}
.departing .tunnel-flight .tunnel-buddy{animation:none}
.departing .grade-circle.chosen{animation:disc-board 1.08s cubic-bezier(.3,0,.2,1) forwards}
.mounted .tunnel-flight{animation:disc-flight 1.9s cubic-bezier(.35,.08,.6,1) forwards}
.mounted .flight-platform{opacity:1;transition:opacity .2s}
.mounted .flight-trail{animation:sword-trail 1.9s ease forwards}
.departing .portal-rings{animation:portal-rush 3.8s ease .65s forwards}
@keyframes disc-board{0%{opacity:1;transform:translate(0,0) rotate(0) scale(1)}65%{opacity:1;transform:translate(var(--travel-x),var(--travel-y)) rotate(360deg) scale(1.25,.27)}86%{opacity:1;transform:translate(var(--travel-x),var(--travel-y)) rotate(360deg) scale(1.25,.27)}100%{opacity:0;transform:translate(var(--travel-x),var(--travel-y)) rotate(360deg) scale(1.25,.27)}}
@keyframes disc-flight{0%{opacity:1;transform:translateX(-50%) translateY(0) rotateY(0) rotateZ(0) scale(1)}30%{opacity:1;transform:translateX(-50%) translateY(-12px) rotateY(155deg) rotateZ(-12deg) scale(.92)}48%{opacity:1;transform:translateX(-50%) translateY(0) rotateY(180deg) rotateZ(-8deg) scale(.78)}85%{opacity:.8;transform:translateX(-50%) translateY(var(--vanish-y)) rotateY(180deg) rotateZ(0) scale(.17)}100%{opacity:0;transform:translateX(-50%) translateY(var(--vanish-y)) rotateY(180deg) rotateZ(0) scale(.015);filter:blur(3px)}}
@keyframes sword-trail{0%,20%{opacity:0}40%{opacity:.9;transform:translateX(-105%) scaleX(1.4)}85%{opacity:.8;transform:translateX(-105%) scaleX(2.5)}100%{opacity:0;transform:translateX(-105%) scaleX(3)}}
@media(max-height:850px){.tunnel-flight{top:8%;height:44%}}
@media(max-width:599px){.flight-platform{width:140px;height:30px;font-size:11px;line-height:28px;bottom:-8px}}
@media(prefers-reduced-motion:reduce){.tunnel-flight,.mounted .tunnel-flight,.mounted .flight-trail{animation:none}}
