@font-face{font-family:Orbitron;src:url('/site/assets/rai-adventure-v7/fonts/orbitron.ttf') format('truetype');font-display:swap}
:root{font-family:Orbitron,Consolas,monospace;color-scheme:dark;background:#030916;--blue:#336699;--line:#33669970;--panel:#071425f0}
body{height:100dvh;min-height:0;overflow:hidden;background:#030916;color:#dcecff}button,input,select,.fileButton{font-family:inherit}
.shell{max-width:none;height:100dvh;padding:10px 18px;display:grid;grid-template-rows:45px minmax(0,1fr);gap:8px}.shell>header{padding:0 0 8px;border-color:#33669950;flex-wrap:nowrap}.brand-mark,.brand small,.shell>footer{display:none}.brand strong{font-size:13px;letter-spacing:.18em}.shell>main{min-height:0;position:relative}.shell header button{padding:7px 12px;font-size:10px}.card{border:1px solid #33669980;border-radius:7px;background:#061325ec;box-shadow:0 0 24px #33669918}
button,.fileButton{background:#33669920;border:1px solid #33669980;color:#c8def5;transition:box-shadow .16s,background .16s,transform .16s}button:hover,.fileButton:hover{background:#33669945;box-shadow:0 0 16px #33669970}button:focus-visible{outline:2px solid #a8d2ff;outline-offset:3px}button[aria-pressed=true]{background:#33669960}button:disabled{opacity:.4;cursor:default}
body[data-dash-mode="menu"] .shell{padding:0;display:block}body[data-dash-mode="menu"] .shell>header{display:none}body[data-dash-mode="menu"] .shell>main{height:100dvh}body[data-dash-mode="menu"] #artBackground{background-image:url('/site/assets/rai-dash-design/rai-dash-menu-20261023.png')!important;opacity:1;filter:blur(18px);transform:scale(1.04)}
#menu.menu{border:0;border-radius:0;padding:0;margin:0;max-width:none;position:absolute;inset:0;background:transparent;box-shadow:none;display:grid;place-items:center}.dash-menu-scene{position:relative;width:min(100vw,calc(100dvh * 1672/941));aspect-ratio:1672/941}.dash-menu-scene>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.dash-menu-scene .art-button{position:absolute;left:11.2%;width:36.9%;height:6.8%;padding:0;border:0;border-radius:8px;background:transparent;color:transparent;font-size:1px;text-shadow:none;z-index:3}.art-button:nth-of-type(1){top:35.6%}.art-button:nth-of-type(2){top:42.9%}.art-button:nth-of-type(3){top:50.2%}.art-button:nth-of-type(4){top:57.5%}.art-button:nth-of-type(5){top:64.8%}.art-button:nth-of-type(6){top:72.1%}.art-button:nth-of-type(7){top:79.4%}.dash-menu-scene .art-button:hover:not(:disabled),.dash-menu-scene .art-button:focus-visible{background:#9fcbff13;box-shadow:0 0 22px #5996edb0,inset 0 0 20px #33669965;transform:translateX(3px)}.dash-menu-scene .art-button:disabled{opacity:1;backdrop-filter:grayscale(.8) brightness(.5)}.art-button .soon{position:absolute;right:4%;top:35%;font-size:8px;letter-spacing:.12em;color:#90a8c3;background:#061325e8;padding:2px 5px;border-radius:3px}
#menuRai{position:absolute;left:64.5%;bottom:32.5%;width:18%;height:32%;min-height:0;min-width:0;background:transparent;border:0;pointer-events:none;image-rendering:auto}
.game-panel{height:100%;min-height:0;margin:0;grid-template-columns:minmax(0,1fr) 330px;gap:10px}.game-panel:not(:has(.editor:not(.hidden))){grid-template-columns:minmax(0,1fr)}.stage{min-height:0;padding:5px 9px;display:flex;flex-direction:column;overflow:hidden}.stone-hud{position:relative;width:min(100%,1150px);aspect-ratio:2172/335;max-height:145px;align-self:center;flex:none}.stone-hud>canvas{position:absolute;inset:0;width:100%;height:100%;min-height:0;image-rendering:auto;pointer-events:none}.stone-value{position:absolute;top:43%;height:25%;display:grid;place-items:center;background:#030b16;color:#f1f7ff;font:700 clamp(11px,2.3vw,29px)/1 Orbitron,monospace;text-shadow:0 0 8px #67a5ed80;white-space:nowrap}.stone-value.life{left:10%;width:12%;color:#f04458;font-size:clamp(13px,2.6vw,34px);letter-spacing:.12em}.stone-value.score{left:27%;width:14%}.stone-value.need{left:46%;width:8%}.stone-value.diamond{left:65%;width:9%}.stone-value.time{left:80%;width:12%}
.hud{font-size:9px;gap:8px;margin:0 0 5px;flex-wrap:nowrap;min-height:28px}.hud span{padding:4px 7px;background:#33669918;border-radius:3px}.hud button{font-size:9px;padding:4px 8px}.hud #matchLabel{margin-left:auto}.hud #gemLabel,.hud #timeLabel{display:none}
#stageWrap{min-height:0;flex:1;border:2px solid #33669990;border-radius:4px;box-shadow:0 0 16px #33669930;overflow:hidden}#cave{position:absolute;inset:0;width:100%;height:100%;min-height:0;image-rendering:auto;outline-offset:-3px}#notice{font-size:9px;line-height:1.5;min-height:17px;margin:6px 0 0;color:#9dbde1}.editor{font-size:10px;max-height:none;height:100%;padding:10px;overflow:auto;scrollbar-width:thin;scrollbar-color:#336699 #061325}.editor h2{font-size:13px}.editor p,.editor small{font-size:8px;line-height:1.7}.editor input,.editor select{background:#041020;border-color:#33669980;color:#d2e6ff;padding:5px;font-size:10px}.editor .fieldrow{margin:7px 0;gap:5px}.editor button,.editor .fileButton{font-size:9px;padding:6px}.editor .palette button{font-size:8px;padding:7px 3px;min-height:38px}.palette button[data-tool="*"]{background-image:url('/site/assets/rai-dash-design/rai-dash-diamond-atlas-20261023.png');background-size:400% 400%;background-position:0 0;text-shadow:0 1px 4px #000,0 0 5px #000}details{border-color:#33669970}
#dashSettings{max-width:560px;width:90vw;background:#061325f5;color:#c7dff8;border:1px solid #336699;border-radius:7px;font:12px/1.9 Orbitron,monospace;padding:25px;box-shadow:0 0 40px #33669940}#dashSettings::backdrop{background:#000b;backdrop-filter:blur(8px)}#dashSettings h2{font-size:15px}#dashSettings p{font-size:10px}
@media(max-width:900px){.shell{padding:6px}.brand strong{font-size:10px}.shell header button{font-size:8px;padding:6px}.shell header nav{gap:4px}.game-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,32%)}.editor{margin:0}.stone-value{font-size:clamp(10px,2vw,22px)}.stone-hud{max-height:115px}.hud #matchLabel{font-size:7px}.art-button .soon{font-size:5px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

body[data-dash-mode="play"],body[data-dash-mode="test"],body[data-dash-mode="edit"]{background:#000}.stage{position:relative;background:#000;padding:0;border:0;box-shadow:none;align-self:start}.game-panel{align-items:start}#stageWrap{width:min(100%,1024px);height:min(calc(100dvh - 180px),576px);min-height:200px;flex:0 0 auto;align-self:center;margin:0;border:0;border-radius:0;background:#000;box-shadow:none}#cave{background:#000;image-rendering:pixelated}.stone-hud{height:82px;aspect-ratio:auto;max-height:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;width:min(100%,1024px);margin:0;isolation:isolate}.hud-cell{position:relative;min-width:0;background-image:var(--dash-hud-frame);background-size:100% 100%;background-repeat:no-repeat;background-color:#000}.stone-value{position:absolute;left:20%!important;top:45%;width:60%!important;height:27%;font-size:19px;background:#000;z-index:1}.stone-caption{position:absolute;left:20%;top:24%;width:60%;text-align:center;font-size:11px;font-weight:900;letter-spacing:.04em;color:#e7f4ff;text-shadow:0 0 5px #336699}.stone-value.life{display:flex;align-items:center;justify-content:center;gap:2px;letter-spacing:0}.life-heart{display:inline-block;width:24px;height:24px;background-image:var(--dash-heart-sprite);background-size:contain;background-position:center;background-repeat:no-repeat;filter:drop-shadow(0 0 3px #a11e47);animation:heart-beat 1.45s ease-in-out infinite}.stone-hud::after,#stageWrap::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:5;background:repeating-linear-gradient(0deg,rgba(0,0,0,.17) 0,rgba(0,0,0,.17) 1px,transparent 1px,transparent 3px),radial-gradient(ellipse at center,transparent 60%,rgba(0,0,0,.26));mix-blend-mode:multiply}#notice{align-self:center;width:min(100%,1024px);margin:4px 0;font-size:9px}.shell>header .hud{display:flex;position:static;margin:0 0 0 auto;gap:7px;font-size:8px;min-height:0}.shell>header{gap:10px}.shell>header .hud button{padding:5px 7px}.hud #matchLabel{margin:0}.hud #gemLabel,.hud #timeLabel{display:none}.shell>header nav{gap:5px;margin-left:auto}.shell>header nav button{padding:6px 8px;font-size:9px}
@keyframes heart-beat{0%,35%,100%{transform:scale(1)}42%{transform:scale(1.13)}50%{transform:scale(1)}58%{transform:scale(1.07)}68%{transform:scale(1)}}
.sprite-tool{display:flex;flex-direction:column;align-items:center;gap:4px}.sprite-tool::before{content:"";display:block;width:27px;height:27px;background-image:var(--tool-sprite);background-size:contain;background-repeat:no-repeat;background-position:center}.palette button[data-tool="*"]{background-image:none}.editor .palette{grid-template-columns:repeat(4,minmax(0,1fr))}.editor .palette button{min-height:52px}.editor-top-actions{display:flex;gap:8px}
/* The approved art supplies unlabelled frame sprites. All text and controls are live. */
.dash-menu-scene{position:relative;width:min(100vw,calc(100dvh * 1672/941));aspect-ratio:1672/941}.menu-controls{position:absolute;left:11%;top:9%;width:39%;display:flex;flex-direction:column;gap:7px}.menu-title{font:900 clamp(28px,5.7vw,82px)/1.15 Orbitron,monospace;letter-spacing:.07em;text-align:center;margin:0 0 18px;color:#e4f5ff;text-shadow:0 3px 0 #1e4c85,0 -1px 0 white,0 0 16px #2377ff,0 8px 12px #000}.menu-button,.stone-button{position:relative;border:0;border-radius:0;background-color:transparent;background-image:var(--dash-button-frame);background-size:100% 100%;background-repeat:no-repeat;color:#e9f6ff;font:900 clamp(11px,1.55vw,22px)/1 Orbitron,monospace;text-shadow:0 0 5px #4e9fff;min-height:52px;padding:14px 36px;transition:filter .18s,transform .18s}.menu-button{height:clamp(39px,6.4vh,64px);min-height:0;width:100%;text-align:center}.menu-button:hover:not(:disabled),.stone-button:hover:not(:disabled),.stone-button[aria-pressed="true"]{background-image:var(--dash-hover-frame);background-color:transparent;filter:drop-shadow(0 0 8px #336699aa);transform:translateX(2px)}.menu-button:disabled,.stone-button:disabled{opacity:.38;filter:grayscale(.4)}.menu-button .soon{font-size:7px;position:absolute;right:13%;top:43%;color:#88a9ce}.menu-button:focus-visible,.stone-button:focus-visible{outline:2px solid #9acbff;outline-offset:-8px}#menuRai{left:67%;bottom:21%;width:12%;height:23%;min-height:0;image-rendering:auto}
#dashScores{padding:0;border:0;border-radius:0;background:#000;width:min(96vw,calc(94dvh * 1.55));max-width:none;max-height:94dvh;overflow:auto;color:#d9eeff;box-shadow:0 0 70px #000;font-family:Orbitron,monospace;scrollbar-width:thin;scrollbar-color:#336699 #000}#dashScores::backdrop{background:#000c;backdrop-filter:blur(8px)}.scores-scene{position:relative;min-height:550px;padding:35px 7%;background:#000;border:42px solid transparent;border-image-source:var(--dash-panel-frame);border-image-slice:115 fill;border-image-repeat:stretch}.scores-scene>header{display:block;text-align:center;border:0;padding:0}.scores-scene h1{margin:0;font:900 clamp(28px,4vw,58px)/1.1 Orbitron,monospace;letter-spacing:.10em;color:#e3f5ff;text-shadow:0 3px #1f5ab0,0 0 14px #248aff}.scores-scene h2{font-size:clamp(13px,2vw,24px);letter-spacing:.16em;margin:10px 0 14px}.scores-scene>nav{display:grid;grid-template-columns:repeat(4,1fr);margin:0 0 12px;gap:4px}.scores-scene .stone-button{font-size:clamp(9px,1.2vw,15px);min-height:42px;padding:11px 12px}.scores-scene table{width:100%;border-collapse:collapse;background:#000;font-size:clamp(10px,1.3vw,17px);text-align:center;table-layout:fixed}.scores-scene th,.scores-scene td{height:39px;padding:7px 9px;border:1px solid #24558b80;text-shadow:0 0 5px #33669970;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scores-scene thead th{color:#e0f3ff;font-size:.8em;background:linear-gradient(#102b4b,#030b15);border-top:2px solid #336699}.scores-scene th:first-child{width:13%}.scores-scene th:nth-child(2){width:30%}.scores-scene .top-rank{color:#82baff;text-shadow:0 0 9px #2566ff}.scores-scene tbody tr:hover{background:#33669924}.score-name{background:transparent;border:0;font:inherit;padding:0;color:#d9eeff;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.scores-scope{font-size:8px;letter-spacing:.10em;text-align:center;color:#7096c2;margin:11px 0}.scores-scene>footer{display:flex;justify-content:center;gap:18px;padding:0}.scores-scene>footer button{width:190px}.scores-scene::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,#0002 0,#0002 1px,transparent 1px,transparent 4px)}body>dialog:not(#dashScores){font-family:Orbitron,monospace!important;background:#000!important;color:#d0e7ff!important;border-color:#336699!important;border-radius:6px!important}body>dialog:not(#dashScores)::backdrop{background:#000b;backdrop-filter:blur(7px)}
@media(max-width:1000px){.shell>header .hud #matchLabel{display:none}.stone-hud{height:70px}.stone-value{font-size:15px}.stone-caption{font-size:9px}.life-heart{width:19px;height:19px}.scores-scene{padding:15px 4%;border-width:25px;min-height:480px}.menu-controls{top:8%;gap:4px}.menu-title{margin-bottom:7px}}@media(prefers-reduced-motion:reduce){.life-heart{animation:none}.menu-button,.stone-button{transition:none}}
.editor .fieldrow>*{min-width:0}.editor .fieldrow input{width:100%;min-width:0}.editor input[type=color]{width:100%}.editor{overflow-x:hidden}.editor .material-colors{min-width:0}.material-colors label{min-width:0}.stone-hud .hud-cell{background-size:calc(100% + 22px) 100%;background-position:center}.stone-hud .hud-cell:first-child{background-position:left}.stone-hud .hud-cell:last-child{background-position:right}.stone-hud{overflow:hidden}
.stone-hud{box-sizing:border-box;height:88px;border:18px solid transparent;border-left-width:43px;border-right-width:43px;border-image-source:var(--dash-hud-frame);border-image-slice:70 135 fill;border-image-repeat:stretch;background:#000;overflow:visible}.stone-hud .hud-cell{background:none!important;background-color:transparent!important;position:relative}.stone-hud .hud-cell:not(:first-child)::before{content:"";position:absolute;left:-12px;top:-18px;width:24px;height:88px;background-image:var(--dash-divider-frame);background-size:100% 100%;pointer-events:none;z-index:2}.stone-hud .stone-caption{top:0;left:5%;width:90%;font-size:10px;line-height:16px}.stone-hud .stone-value{top:19px!important;left:8%!important;width:84%!important;height:26px;font-size:22px;background:transparent;line-height:1}.stone-hud .stone-value.life{top:17px!important}.stone-hud .life-heart{width:24px;height:24px}.stone-hud::after{inset:-18px -43px}.stone-hud .stone-value{font-weight:800}@media(max-width:1000px){.stone-hud{height:80px;border-left-width:30px;border-right-width:30px}.stone-hud .hud-cell:not(:first-child)::before{height:80px}.stone-hud .stone-caption{font-size:8px}.stone-hud .stone-value{font-size:15px}.stone-hud .life-heart{width:18px;height:18px}}
/* Game-owned forms use the SalihRoom hologram dialog standard. */
body>dialog:not(#dashScores){position:fixed;padding:28px!important;background:linear-gradient(135deg,#071d35ed,#020a15f5)!important;border:1px solid #336699!important;border-radius:6px!important;box-shadow:0 0 35px #33669955,inset 0 0 30px #33669915!important;color:#c2dcf5!important;text-shadow:0 0 5px #33669977;isolation:isolate}body>dialog:not(#dashScores)::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:4;background:repeating-linear-gradient(0deg,#0002 0,#0002 1px,transparent 1px,transparent 3px);border-radius:inherit}body>dialog:not(#dashScores) h2{font-size:18px!important;letter-spacing:.07em;color:#b9d6f2}body>dialog:not(#dashScores) input{background:#030d1be0!important;color:#dbedff!important;border:1px solid #336699!important;border-radius:2px!important;outline:none!important;box-shadow:inset 0 0 12px #33669920!important;font-family:Orbitron,monospace!important}body>dialog:not(#dashScores) input:focus{border-color:#73a7e0!important;box-shadow:0 0 13px #33669970!important}body>dialog:not(#dashScores) button{background:#33669920!important;border:1px solid #336699!important;border-radius:2px!important;font:10px Orbitron,monospace!important;letter-spacing:.03em;color:#b9d6f2!important;padding:10px 15px!important}body>dialog:not(#dashScores) button:hover{background:#33669966!important;box-shadow:0 0 14px #33669980!important}

/* Native editor: palette first, real sprites and per-level colors. */
.game-panel{grid-template-columns:260px minmax(0,1fr);gap:10px}.stage{grid-column:2;grid-row:1;min-width:0}.editor{grid-column:1;grid-row:1;background:#020812;border:1px solid #336699;border-radius:0;box-shadow:inset 0 0 16px #33669928;padding:12px}.game-panel:not(:has(.editor:not(.hidden))) .stage{grid-column:1}.editor h2{font-size:12px;letter-spacing:.06em;margin:0 0 10px}.editor h3{color:#d1ebff;letter-spacing:.13em}.editor .palette{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.editor .palette button{min-height:83px;font-size:8px;border-radius:3px;background:#031020;box-shadow:inset 0 0 12px #33669920;padding:6px 3px}.sprite-tool::before{width:48px;height:48px;image-rendering:pixelated}.editor .palette button:hover{border-color:#89c8ff;background:#102f56;box-shadow:0 0 12px #337fff70}.editor .palette button[aria-pressed=true]{border-color:#8bc4ff;background:#15375e;box-shadow:inset 0 0 15px #336699a0,0 0 12px #275bff70}.material-colors{display:flex;gap:8px;margin:12px 0}.material-colors label{font-size:7px;flex:1}.material-colors input{display:block;width:100%;height:30px;margin-top:5px;padding:2px}.stone-hud .stone-value{font-size:18px}.stone-hud .stone-caption{font-size:10px}.shell>header .hud span{font-size:7px}.shell>header .hud{flex-wrap:nowrap}.shell>header .brand strong{font-size:12px}#menuRai{left:66%;bottom:22%;width:11%;height:22%}.menu-controls{top:10%;left:10%;width:42%}.menu-title{font-size:clamp(28px,5.2vw,75px);margin-bottom:15px}.menu-button:hover:not(:disabled){color:#fff;filter:drop-shadow(0 0 12px #3b83ff);text-shadow:0 0 8px #a5e1ff;transform:translateX(4px) scale(1.015)}.menu-button:active:not(:disabled){transform:translateX(3px) scale(.98)}
#loadTest64Btn{margin-top:8px;width:100%;color:#a4cfff}.shell>header{justify-content:flex-start}.shell>header nav{margin-left:20px!important}.shell>header .hud{margin-left:10px!important}.shell>header .hud #matchLabel{display:none}
.material-colors{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.editor .material-colors input{height:27px}
@media(max-width:1000px){.game-panel{grid-template-columns:220px minmax(0,1fr)}.shell>header .hud #matchLabel{display:none}.shell>header .brand strong{font-size:9px}.stone-hud .stone-value{font-size:13px}.stone-hud .stone-caption{font-size:7px}.sprite-tool::before{width:42px;height:42px}.editor .palette button{min-height:74px}}

/* Keep the approved frame caps at a stable size; only their centre stretches. */
.menu-button,.stone-button,
.menu-button:hover:not(:disabled),.menu-button:active:not(:disabled),
.stone-button:hover:not(:disabled),.stone-button:active:not(:disabled),
.stone-button[aria-pressed="true"]{
  box-sizing:border-box;isolation:isolate;display:grid;place-items:center;
  background:none;box-shadow:none;border:0;transform:none;
  background-size:100% 100%;background-position:center;background-repeat:no-repeat;
  padding:0 42px;color:#e9f6ff;line-height:1.15;
  transition:color .18s,text-shadow .18s,filter .18s;
}
.menu-button::before,.stone-button::before{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;
  border-image-source:var(--dash-button-frame);border-image-slice:100 150 fill;
  border-image-width:24px 36px;border-image-repeat:stretch;
}
.menu-button:hover:not(:disabled)::before,.menu-button:focus-visible::before,
.stone-button:hover:not(:disabled)::before,.stone-button:focus-visible::before,
.stone-button[aria-pressed="true"]::before{border-image-source:var(--dash-hover-frame)}
.menu-button:hover:not(:disabled),.stone-button:hover:not(:disabled),
.stone-button[aria-pressed="true"]{
  color:#fff;text-shadow:0 0 7px #d4eaff,0 0 13px #336699;
  filter:drop-shadow(0 0 6px #336699b0);
}
.menu-button:active:not(:disabled),.stone-button:active:not(:disabled){filter:brightness(1.18)}
.menu-button:focus-visible,.stone-button:focus-visible{outline:1px solid #8cb8e8;outline-offset:2px}
.menu-controls{left:10%;top:11%;width:360px;max-width:43%;gap:8px}
.menu-title{font-size:42px;margin:0 0 14px;letter-spacing:.05em;white-space:nowrap}
.menu-button{width:100%;height:50px;min-height:50px;max-height:50px;flex:none;font-size:13px}
.menu-button .soon{right:38px;font-size:6px;top:22px}
.scores-scene>nav{display:grid;grid-template-columns:repeat(4,minmax(0,176px));justify-content:center;align-items:center;gap:12px;margin:18px 0}
.scores-scene .stone-button{width:100%;height:46px;min-height:46px;max-height:46px;padding:0 32px;font-size:11px;white-space:nowrap}
.scores-scene .stone-button::before{border-image-width:22px 32px}
.scores-scene>footer{gap:18px;margin-top:14px}
.scores-scene>footer>.stone-button{width:180px;min-width:0;flex:0 0 180px}
.scores-scene .stone-button:disabled{opacity:.35;filter:grayscale(.35);cursor:default}
/* Scene captions: transparent hologram, a fine blue outline and white light. */
.rai-scene-text{
  background:transparent;border:1px solid #336699;border-radius:3px;
  box-shadow:0 0 9px #33669955,inset 0 0 6px #33669915;
  color:#fff;font:600 clamp(11px,1.05vw,15px)/1.55 Orbitron,monospace;
  letter-spacing:.035em;padding:8px 13px;
  text-shadow:0 0 3px #fff9,0 0 9px #dceaffbb,0 0 17px #336699aa;
  opacity:1;transition:opacity 1.2s ease-out;
}
.rai-scene-text.is-fading{opacity:0}
@media(max-width:1000px){
  .menu-controls{width:310px;gap:6px;top:9%}.menu-title{font-size:34px;margin-bottom:9px}
  .menu-button{height:44px;min-height:44px;max-height:44px;font-size:11px;padding:0 35px}
  .menu-button::before{border-image-width:21px 32px}.menu-button .soon{right:32px;top:19px}
  .scores-scene>nav{gap:7px}.scores-scene .stone-button{font-size:9px;padding:0 25px}
  .scores-scene .stone-button::before{border-image-width:22px 25px}
}
@media(max-width:650px){
  .menu-controls{left:5%;top:7%;width:250px;max-width:49%;gap:3px}
  .menu-title{font-size:23px;margin-bottom:6px}
  .menu-button{height:36px;min-height:36px;max-height:36px;font-size:9px;padding:0 26px}
  .menu-button::before{border-image-width:17px 25px}.menu-button .soon{display:none}
  .scores-scene>nav{grid-template-columns:repeat(2,minmax(0,176px));gap:7px}
  .scores-scene>footer>.stone-button{width:130px;flex-basis:130px}.scores-scene>footer{gap:8px}
}
@media(prefers-reduced-motion:reduce){.menu-button,.stone-button,.rai-scene-text{transition:none}}

/* The canvas uses the whole remaining viewport; the editor owns its own scroll. */
.shell{padding:6px 8px;grid-template-rows:42px minmax(0,1fr);gap:6px}
.game-panel{height:100%;grid-template-columns:244px minmax(0,1fr);gap:8px;align-items:stretch}
.stage{height:100%;min-height:0;align-self:stretch;display:grid;grid-template-rows:88px minmax(0,1fr);gap:0;overflow:hidden}
.stone-hud{width:100%;max-width:none;height:88px;align-self:stretch;margin:0}
#stageWrap{width:100%;height:100%;min-height:0;max-height:none;min-width:0;align-self:stretch;margin:0}
#notice{position:absolute;left:6px;bottom:0;z-index:9;width:calc(100% - 12px);min-height:0;height:20px;margin:0;font-size:8px;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;text-shadow:0 0 3px #000,0 1px #000}
#gamePerf{position:absolute;right:12px;top:9px;z-index:10;pointer-events:none;font:700 10px/1.5 Orbitron,monospace;letter-spacing:.08em;color:#6d9dff;text-shadow:0 0 5px #245bd6,0 0 11px #245bd6;background:transparent}
.editor{height:100%;padding:9px;overflow-y:auto;overflow-x:hidden}
.editor .palette{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.editor .palette button{min-height:68px;font-size:6px;padding:4px 2px}
.sprite-tool::before{width:38px;height:38px}
.editor label{min-width:0}.editor #levelName{margin-bottom:8px;font-size:10px}
.palette-help{font-size:7px!important;margin:7px 0;color:#94b8dc}
.paint-modes,.save-load-actions{display:flex;gap:5px;margin:8px 0}
.paint-modes button{flex:1;min-width:0;padding:6px 2px;font-size:7px}
.save-load-actions button{flex:1;padding:8px}.block-text-controls{display:grid;grid-template-columns:1fr;gap:5px;margin:8px 0}
.block-text-controls label{font-size:8px}.editor details.simulation-rules label{font-size:7px}
#tileColorDialog{width:290px}#tileColorDialog h2{font-size:11px!important}
#tileColorDialog input[type=color]{width:100%;height:76px;margin:10px 0 18px}
.menu-controls{top:9%}.menu-controls h1.menu-title{font-size:40px;margin-bottom:12px}
#menuDemo{position:absolute;left:55%;top:18%;width:36%;height:27%;min-height:0;border:1px solid #33669970;box-shadow:0 0 16px #33669940;background:#020b18}
.demo-caption{position:absolute;left:55%;top:14%;width:36%;text-align:center;color:#bad5ed;font:700 9px Orbitron,monospace;letter-spacing:.18em;text-shadow:0 0 8px #336699}
#menuRai{left:72%;bottom:22%;width:9%;height:18%;min-height:0}
#menuWall{position:absolute;left:55%;bottom:20%;width:38%;height:4%;min-height:0;background:transparent}
.menu-walk{position:absolute;left:55%;bottom:12%;width:38%;display:flex;justify-content:center;align-items:center;gap:13px;color:#9dbfe0;font:8px Orbitron,monospace;letter-spacing:.08em}
.menu-walk button{font-size:12px;padding:6px 12px;touch-action:none}
.menu-display-controls{position:absolute;right:6%;bottom:5%;display:flex;gap:8px}
.menu-display-controls button{padding:9px 13px;font-size:9px;letter-spacing:.05em}
body[data-crt=off] .stone-hud::after,body[data-crt=off] #stageWrap::after,body[data-crt=off] .scores-scene::after,body[data-crt=off]>dialog::after{display:none}
body[data-crt=on] .dash-menu-scene::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,#0001 0,#0001 1px,transparent 1px,transparent 4px)}
@media(max-width:1000px){.game-panel{grid-template-columns:210px minmax(0,1fr)}.stage{grid-template-rows:80px minmax(0,1fr)}.stone-hud{height:80px}.editor .palette{grid-template-columns:repeat(2,minmax(0,1fr))}.menu-controls h1.menu-title{font-size:32px}.menu-display-controls button{font-size:7px;padding:7px 9px}.demo-caption{font-size:7px}}
@media(max-width:650px){.shell{padding:4px}.game-panel{grid-template-columns:155px minmax(0,1fr);gap:4px}.editor{padding:6px}.editor .palette button{font-size:5px;min-height:55px}.sprite-tool::before{width:31px;height:31px}.menu-controls h1.menu-title{font-size:23px}.menu-display-controls{right:4%;gap:3px;bottom:3%}.menu-display-controls button{padding:6px;font-size:6px}.menu-walk{font-size:6px;gap:6px}.menu-walk button{padding:4px 7px}.paint-modes{flex-wrap:wrap}.paint-modes button{flex:1 1 40%}}

#levelComplete{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;padding:20px;color:#fff;text-align:center;font-family:Orbitron,monospace;background:#0005;text-shadow:0 0 5px #fff8,0 0 16px #336699,0 0 25px #336699}
#levelComplete h2{font-size:clamp(18px,2.5vw,36px);letter-spacing:.12em;margin:0}#levelComplete p{margin:0;font-size:clamp(10px,1.1vw,16px);letter-spacing:.08em}#levelComplete #completionBest{font-size:10px;color:#b9d8ff}#levelComplete button{margin-top:10px;padding:11px 22px;font-size:10px;background:#33669928;border-color:#336699}
body #artBackground{background-image:var(--chosen-background)!important}body[data-dash-mode=menu] #artBackground{background-image:var(--chosen-background,url('/site/assets/rai-dash-design/rai-dash-menu-20261023.png'))!important}

/* Owner: Space pause is a large white Orbitron message in the actual playfield. */
#gamePause{position:absolute;inset:0;z-index:18;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;pointer-events:none;color:#fff;font-family:Orbitron,monospace;text-align:center;background:transparent}
#gamePause[hidden]{display:none}#gamePause strong{font-size:clamp(26px,4vw,64px);letter-spacing:.14em;font-weight:800;text-shadow:0 0 7px #fff9,0 0 22px #fff6;animation:dashPausePulse 2s ease-in-out infinite}
#gamePause span{font-size:clamp(8px,.8vw,12px);letter-spacing:.17em;text-shadow:0 0 8px #fff8}
@keyframes dashPausePulse{0%,100%{opacity:.6;text-shadow:0 0 5px #fff7,0 0 13px #fff4}50%{opacity:1;text-shadow:0 0 10px #fffc,0 0 26px #fff7}}
@media(prefers-reduced-motion:reduce){#gamePause strong{animation:none;opacity:1}}

/* Owner menu and Settings standard, real controls over the same sprite theme. */
#menuPickups{position:absolute;left:55%;width:38%;bottom:24%;height:18%;min-height:0;pointer-events:none}
.menu-history{position:absolute;left:7%;right:7%;bottom:1%;height:22px;overflow:hidden;white-space:nowrap;color:#608edf;font:700 9px/22px Orbitron,monospace;letter-spacing:.1em;text-shadow:0 0 6px #336699}
.menu-history span{display:inline-block;padding-left:100%;animation:dashHistory 42s linear infinite}.menu-history:hover span{animation-play-state:paused}@keyframes dashHistory{from{transform:translateX(0)}to{transform:translateX(-100%)}}
#cave,.stone-hud,.dash-menu-scene>img,#menuDemo,#menuRai,#menuWall,#menuPickups{filter:brightness(var(--dash-brightness,1)) saturate(var(--dash-saturation,1))}
#dashSettings{width:min(1000px,94vw);max-width:94vw;max-height:92dvh;box-sizing:border-box;padding:26px 30px;background:#020913ef;border:1px solid #336699;border-radius:2px;color:#e9f4ff;font-family:Orbitron,monospace;overflow:auto;box-shadow:0 0 25px #33669955}
#dashSettings>header p{font-size:8px;color:#84a8d4;letter-spacing:.16em;margin:0 0 7px}#dashSettings>header h2{font:800 28px Orbitron,monospace;letter-spacing:.14em;margin:0 0 24px;text-shadow:0 0 10px #336699}
#dashSettings .settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}#dashSettings section{min-width:0}#dashSettings h3{font-size:11px;letter-spacing:.12em;color:#8cb3e7;margin:0 0 18px}#dashSettings label{display:block;font:600 9px/1.7 Orbitron,monospace;letter-spacing:.04em;margin:12px 0;color:#dcecff}
#dashSettings output{float:right;color:#fff}#dashSettings input[type=range]{display:block;width:100%;height:22px;margin:6px 0 15px;accent-color:#336699;cursor:pointer}
#dashSettings .rai-media{padding:0;background:none;box-shadow:none;border:0;font-family:Orbitron,monospace}#dashSettings .rai-media label,#dashSettings .rai-media select,#dashSettings .rai-media button{font-family:Orbitron,monospace;font-size:9px}#dashSettings .rai-media select{background:#08182d;border:1px solid #336699;border-radius:0;padding:9px}#dashSettings .rai-media button,#settingsCrt{background:#33669920;border:1px solid #336699;border-radius:0;padding:9px;font:600 9px Orbitron,monospace;color:#fff}#dashSettings .rai-media button:hover,#settingsCrt:hover{background:#33669960;box-shadow:0 0 12px #33669960}
#dashSettings .rai-media p,#dashSettings .settings-controls p{font:8px/1.9 Orbitron,monospace;color:#9bb7d9}#dashSettings footer{display:flex;justify-content:center;gap:20px;margin-top:25px}#dashSettings footer .stone-button{width:180px;height:46px;font:800 11px Orbitron,monospace}#settingsSaveState{font-size:9px;color:#ffd5a4}
@media(max-width:650px){#dashSettings{padding:20px 16px}.settings-grid{grid-template-columns:1fr!important}.menu-history{left:4%;right:4%;font-size:7px}#dashSettings footer{gap:7px}#dashSettings footer .stone-button{width:140px}}
@media(prefers-reduced-motion:reduce){.menu-history{overflow:auto}.menu-history span{padding-left:0;animation:none}}

/* Owner18: single Settings home, readable text and a larger scrolling attract cave. */
.menu-display-controls[hidden]{display:none!important}
.menu-history{height:30px;line-height:30px;font-size:clamp(11px,.85vw,14px);bottom:1.5%;color:#6197e5;-webkit-text-stroke:.25px #fff;text-shadow:0 0 2px #fff,0 0 7px #336699,0 0 13px #336699}
#menuDemo{left:54%;top:16%;width:43%;height:42%;background:transparent}.demo-caption{left:54%;top:12%;width:43%;font-size:11px}
.menu-controls{gap:6px}.menu-controls .menu-button{height:clamp(35px,5.6vh,52px)}
#levelComplete{background:transparent}#levelComplete #completionBest{font-size:13px}
#dashSettings .settings-grid label,#dashSettings .settings-grid p,#dashSettings .settings-grid button,#dashSettings .settings-grid select{font-size:12px;line-height:1.7}#dashSettings .settings-grid h3{font-size:14px}#dashSettings output{font-size:12px}
#caveTransition{position:fixed;inset:0;z-index:9999;display:grid;grid-template-columns:repeat(var(--transition-cols),1fr);grid-template-rows:repeat(14,1fr);pointer-events:auto}#caveTransition i{background:#000;opacity:0;animation:caveDissolve 780ms linear both}@keyframes caveDissolve{0%{opacity:0}12%,57%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){#caveTransition{display:none}}

/* Owner21: only the playfield transitions; HUD/editor never receive cover cells. */
#stageWrap>#caveTransition{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:17;pointer-events:auto}
body:not([data-dash-mode=menu]) .shell>header{display:none}
body:not([data-dash-mode=menu]) .shell{padding:0;height:100dvh;display:flex;flex-direction:column}
body:not([data-dash-mode=menu]) .game-panel{height:100dvh;flex:1;min-height:0;margin:0}
body:not([data-dash-mode=menu]) .stage{height:100%;min-height:0}
.menu-history{color:#89b2f0;-webkit-text-stroke:.65px #020409;paint-order:stroke fill;text-shadow:1px 0 #000,-1px 0 #000,0 1px #000,0 -1px #000,0 0 7px #336699,0 0 12px #336699;font-size:clamp(12px,.9vw,15px)}
#settingsQuit[hidden]{display:none}

/* Owner: editor navigation and reversible saved-level deletion. */
.editor-heading{position:sticky;top:-15px;z-index:12;background:#071424f2;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 0;border-bottom:1px solid #33669980;margin-bottom:9px}.editor-heading h2{margin:0!important;font-size:12px}.editor-heading button{padding:7px 10px;font-size:10px}.level-management{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:6px 0 12px}.level-management button{padding:8px 4px;font-size:9px}#deleteLevelBtn{color:#ffb7be;border-color:#a9506080}#deleteLevelDialog{max-width:min(540px,90vw);padding:25px}#deleteLevelDialog p{font:14px/1.7 system-ui,sans-serif;color:#e5edf6}#deleteLevelDialog button{margin:8px 8px 0 0;padding:10px 15px;font-size:11px}

#networkLobby{width:min(620px,92vw);max-height:88dvh;padding:26px;overflow:auto}#networkLobby h2{font-size:19px;color:#edf7ff;text-shadow:0 0 12px #336699}#networkLobby p{font:14px/1.65 system-ui,sans-serif;color:#cad8e9}#networkLobby label{display:grid;gap:5px;font-size:11px;margin:15px 0}#networkLobby input{width:100%;background:#071424;color:#fff;border:1px solid #336699;padding:10px;margin:5px 0;font:14px system-ui,sans-serif}#networkLobby button{padding:10px 14px;font:11px Orbitron,monospace;margin:6px 8px 6px 0}#networkRoomCode{display:block;color:#fff;font:20px Orbitron,monospace;letter-spacing:3px;margin-top:12px}#networkPlayers{border-block:1px solid #33669960;margin:14px 0}#networkInfo{position:absolute;left:12px;bottom:9px;max-width:90%;pointer-events:none;font:11px/1.6 Orbitron,monospace;color:#fff;text-shadow:0 1px 2px #000,0 0 7px #336699;z-index:7}#networkResult{position:absolute;inset:20% 6%;display:grid;align-content:center;justify-items:center;text-align:center;z-index:20;gap:15px;pointer-events:auto}#networkResult h2{font:700 clamp(25px,4vw,58px) Orbitron,monospace;color:#fff;text-shadow:0 0 12px #336699,1px 1px #000}#networkResult p{font:15px/1.7 Orbitron,monospace;color:#fff;text-shadow:1px 1px #000,0 0 7px #336699}#networkResult button{font:13px Orbitron,monospace;padding:12px 22px}
#gameTouch{display:none}body[data-dash-mode=edit] #gameTouch{display:none!important}@media(pointer:coarse){#gameTouch{position:absolute;right:12px;bottom:13px;z-index:15;display:grid;grid-template-columns:repeat(3,48px);gap:5px;touch-action:none}#gameTouch button{height:46px;touch-action:none;background:#06182ecc;border:1px solid #336699c0;border-radius:8px;color:white;font:19px Orbitron,monospace;padding:0}#gameTouch [data-direction=UP]{grid-column:2}#gameTouch [data-direction=LEFT]{grid-column:1}#gameTouch [data-direction=DOWN]{grid-column:2}#gameTouch [data-direction=RIGHT]{grid-column:3}#networkInfo{max-width:52%;font-size:8px}}

[hidden]{display:none!important}

/* Mobile29: fixed viewport, small HUD and controls wholly inside the visual playfield. */
html{width:100%;height:100%;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{width:100%;max-width:100%;overscroll-behavior:none}
body[data-network-game=true] #notice{display:none}
@media(max-width:900px),(pointer:coarse){
 body input,body select,body textarea,body #networkLobby input{font-size:16px!important}
 body[data-dash-mode=play] .shell,body[data-dash-mode=test] .shell{display:block;width:100%;max-width:100%;height:100dvh;min-width:0;padding:0;overflow:hidden}
 body[data-dash-mode=play] .shell>main,body[data-dash-mode=test] .shell>main{width:100%;height:100%;min-width:0;min-height:0}
 body[data-dash-mode=play] .game-panel,body[data-dash-mode=test] .game-panel{display:block;width:100%;max-width:100%;height:100%;min-width:0;min-height:0;margin:0;gap:0}
 body[data-dash-mode=play] .stage,body[data-dash-mode=test] .stage{position:relative;display:flex;width:100%;max-width:100%;height:100%;min-width:0;min-height:0;flex-direction:column;padding:0;overflow:hidden}
 body[data-dash-mode=play] .stone-hud,body[data-dash-mode=test] .stone-hud{flex:0 0 52px;width:100%;max-width:100%;height:52px;min-height:52px;margin:0;padding:0}
 .stone-hud .stone-value{font-size:clamp(9px,2.8vw,16px)}.stone-hud .stone-caption{font-size:clamp(5px,1.6vw,9px)}.stone-hud .life-heart{width:12px;height:12px;flex:0 0 12px}.stone-value.life{gap:1px}
 body[data-dash-mode=play] #stageWrap,body[data-dash-mode=test] #stageWrap{position:relative;flex:1 1 0;width:100%;max-width:100%;height:0;min-width:0;min-height:0;margin:0;align-self:stretch;border:0;overflow:hidden}
 #stageWrap #cave{display:block;width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:0}
 #gamePerf{right:max(7px,env(safe-area-inset-right));top:7px;font-size:9px;max-width:50%;white-space:nowrap}
 #gameTouch{position:absolute;display:grid;right:max(8px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));grid-template-columns:repeat(3,44px);gap:5px;max-width:calc(100% - 16px);z-index:15;touch-action:none}
 #gameTouch button{width:44px;height:44px;padding:0;margin:0;font-size:17px;touch-action:none}
 #networkInfo{left:max(8px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));max-width:calc(100% - 166px);font:8px/1.6 Orbitron,monospace;white-space:normal;overflow-wrap:anywhere}
 #networkLobby{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 30px);padding:18px!important;overflow:auto}#networkLobby h2{font-size:16px!important}#networkLobby button{min-height:42px}#networkInvite{font-size:16px!important}
 #dashSettings{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);padding:16px!important}#dashSettings .settings-grid{grid-template-columns:1fr}#dashSettings footer{flex-wrap:wrap;gap:6px}
 #networkResult{inset:12% 5% 20%;gap:10px}#networkResult h2{font-size:clamp(20px,6vw,34px)}#networkResult p{font-size:11px}
 #gamePause strong{font-size:clamp(22px,6vw,38px);letter-spacing:.05em}
}

#gameTouch{grid-template-areas:". up ." "left down right" "settings . ."}#gameTouch [data-direction=UP]{grid-area:up}#gameTouch [data-direction=LEFT]{grid-area:left}#gameTouch [data-direction=DOWN]{grid-area:down}#gameTouch [data-direction=RIGHT]{grid-area:right}#gameTouch button:last-child{grid-area:settings}

@media(max-width:900px),(pointer:coarse){
 body[data-dash-mode=play] .stone-hud,body[data-dash-mode=test] .stone-hud{border-width:10px 18px}
 .stone-hud .stone-caption{top:0;left:4%;width:92%;font-size:clamp(6px,1.6vw,8px);line-height:10px}
 .stone-hud .stone-value{top:12px!important;height:16px;font-size:clamp(10px,2.8vw,14px);line-height:1}
 .stone-hud .stone-value.life{top:11px!important;height:16px}
 .stone-hud .hud-cell:not(:first-child)::before{top:-10px;left:-8px;width:16px;height:52px}
 .stone-hud::after{inset:-10px -18px}
}
