/* Game-native play view: the shelf stays out of the way while a game is open. */
body:not(.is-playing) .game-stage,body:not(.is-playing) .arena-toolbar{display:none}
body.is-playing .welcome-room,body.is-playing .player-strip,body.is-playing .game-menu-heading,body.is-playing .game-filters,body.is-playing .game-tabs,body.is-playing .room-family,body.is-playing .clubhouse,body.is-playing .trophy-shelf,body.is-playing footer{display:none}
body.is-playing .app-shell{max-width:900px;padding-bottom:30px}
body.is-playing .topbar{margin-bottom:12px}
body.is-playing .arena-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 14px;font-size:14px}
body.is-playing .arena-toolbar a{color:#ead1ff;min-height:44px;display:flex;align-items:center;text-decoration:none}
body.is-playing .arena-toolbar span{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#c7afd9;font-size:14px}
body.is-playing .game-panel{box-shadow:0 20px 70px #10091f55}
.welcome-room{grid-template-columns:1fr 190px;min-height:180px;max-height:210px}
.welcome-copy{padding:24px 30px}.welcome-copy h1{font-size:34px;margin:0 0 8px;line-height:1.12}.welcome-copy h1 br{display:none}
.welcome-copy>p:not(.eyebrow){margin:8px 0 14px}.welcome-copy .eyebrow,.room-portrait figcaption{display:none}
.room-portrait{max-height:210px}.player-strip{display:none}
.game-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
.game-tab .tab-number{font-size:12px}.tab-number,.step-label{font-size:12px}
.game-tab small,.game-menu-heading>span{font-size:13px}
.gem-sprite{display:block;width:92%;height:92%;background-image:url("assets/gem-sprites.png");background-size:300% 300%;background-position:var(--sprite-x,0%) var(--sprite-y,12.5%);background-repeat:no-repeat;pointer-events:none;filter:drop-shadow(0 4px 3px #10092344)}
.dream-jewels{gap:5px;padding:12px;background:linear-gradient(150deg,#35234a,#171329);box-shadow:inset 0 2px 24px #0006,0 15px 40px #10081844}
.dream-jewels .dream-cell{background:#a18cbb0e;border-color:#ac82c32e;border-radius:12px;overflow:hidden}
.dream-jewels .dream-cell:hover{transform:none;background:#b88fde20}
.dream-jewels .dream-cell.frozen{background:linear-gradient(135deg,#9be2ff77,#b9a6ff33);border:2px solid #b9eaffbb;box-shadow:inset 0 0 12px #d9f8ff99}
.dream-jewels .dream-cell.frozen::after{content:'❄';position:absolute;right:3px;bottom:0;font-size:16px;color:#eefbff;text-shadow:0 1px 4px #407fb5;pointer-events:none}
.dream-jewels.spell-ready{box-shadow:0 0 0 3px #efc6fa,0 0 40px #b565bd55}
.dream-jewels .dream-cell.selected{outline:3px solid #ffe1f7;outline-offset:-3px;transform:none;background:#dfacff44}
.dream-body{max-width:740px;margin:auto}.dream-hud small{font-size:12px;letter-spacing:.08em}
.dream-hud strong{font-size:17px}.dream-levels{align-items:center;justify-content:space-between}
.dream-levels label{display:flex;flex-direction:column;gap:7px;flex:1;font-size:12px;letter-spacing:.12em;color:#c3a8db}
.dream-levels select{min-height:46px;width:100%;max-width:380px;border:1px solid #856496;border-radius:12px;background:#33243f;color:#f1e0ff;padding:10px 14px;font:inherit;font-size:16px;letter-spacing:0}
.level-mastery{font-size:24px;color:#efcd8a;letter-spacing:2px;padding-left:12px}
.quest-strip{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.quest-strip:empty{display:none}
.quest-strip span{border:1px solid #86678f;background:#403049;color:#f1cdeb;border-radius:30px;padding:8px 13px;font-size:14px}
.quest-strip .done{background:#36564b;color:#bcf2d4;border-color:#6cbd94}
.dream-progress{margin:13px 0 18px;height:7px}
.dream-message,.memory-feedback{min-height:48px;font-size:16px;line-height:1.5;color:#f0d4f7;text-align:center}
.dream-controls button{min-height:46px;font-size:14px}.dream-save-note{font-size:13px;color:#b7a1c8;text-align:center;line-height:1.6;margin:15px auto 0}
.dream-board{isolation:isolate}.dream-overlay{background:#21142beb;gap:8px;z-index:10}.dream-overlay h3{font-size:28px;margin:4px 0}.dream-overlay p{font-size:16px;margin:4px 0 12px}
.dream-overlay small{font-size:13px;color:#cbb0d5;margin-top:10px}.result-mastery{font-size:42px;letter-spacing:5px;color:#f1ce86}
.combo-burst{position:absolute;left:50%;top:45%;z-index:4;pointer-events:none;color:#ffe5a1;font-size:24px;font-weight:800;white-space:nowrap;text-shadow:0 3px 18px #362044;opacity:0;transform:translate(-50%,-50%)}
.dream-starlines{position:relative;touch-action:none}.star-cell{z-index:1;background:#382448;border-color:#85629c40}.star-cell.linked{background:transparent}.star-cell.endpoint{z-index:3;background:var(--piece)}
.star-links{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}.star-links polyline{fill:none;stroke-width:13;stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.dream-jewels{touch-action:none}.dream-rhythm{max-height:400px}.rhythm-track{height:340px}
.pet-hearts{position:absolute;top:42%;left:76%;color:#ffe4fc;font-size:45px;text-shadow:0 4px 12px #5b2b65;opacity:0}
.pet-portrait{height:auto;aspect-ratio:1.55;max-height:340px}.pet-portrait img{object-position:center 23%}
.memory-plus{padding:0 28px 28px;max-width:720px;margin:auto}.memory-levels{display:flex;gap:8px;margin:0 0 18px}
.memory-levels button{flex:1;font-size:14px;padding:10px}.memory-levels [aria-pressed=true]{background:#e1b9f3;color:#382342;border-color:#e1b9f3}
.memory-playfield{position:relative;margin-top:20px}.memory-plus .memory-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%;max-width:none;margin:0;padding:0}
.memory-plus .memory-card{width:100%;height:auto;aspect-ratio:.95;min-height:0;padding:0;background:none;border:0}
.memory-plus .card-face{border-radius:16px}.memory-plus .card-back{font:italic 40px Georgia,serif;color:#f2d8ff;background:linear-gradient(135deg,#694382,#3c2857);border:1px solid #b98ed1;box-shadow:inset 0 0 0 6px #7e569129}
.memory-plus .card-front{background:#372646;border:2px solid #c39ed5}.memory-plus .memory-card.matched .card-front{border-color:#ecc2f6;background:#634478}
.memory-plus .memory-card.matched{opacity:1}.memory-plus .card-front .gem-sprite{width:85%;height:85%}
.memory-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.memory-feedback{margin:18px 0 14px}
@media(max-width:600px){
 .app-shell{padding-top:12px}.topbar{margin-bottom:14px}.brand small{font-size:12px}.brand strong{font-size:14px}
 .welcome-room{grid-template-columns:1fr 100px;min-height:150px;max-height:180px;border-radius:18px}
 .welcome-copy{padding:18px}.welcome-copy h1{font-size:25px}.welcome-copy>p:not(.eyebrow){font-size:14px;max-width:none;margin:8px 0 12px}
 .welcome-actions .arena-button{font-size:13px;padding:8px 11px}.room-portrait{max-height:180px}
 .game-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.game-menu-heading h2{font-size:23px}.game-menu-heading>span{font-size:12px;max-width:90px}.game-tab{min-height:155px}
 .game-filters button{font-size:14px}.panel-heading{padding:17px 16px}.panel-heading h2{font-size:23px}.panel-heading p:last-child{font-size:15px}
 body.is-playing .app-shell{width:calc(100% - 20px)}body.is-playing .brand small{display:none}
 body.is-playing .arena-toolbar{gap:8px;margin-bottom:7px}body.is-playing .arena-toolbar span{font-size:13px;max-width:47%}
 .dream-body,.memory-plus{padding:0 12px 20px}.dream-hud>div{padding:9px}.dream-hud strong{font-size:15px}.dream-hud small{font-size:12px;letter-spacing:0}
 .dream-levels button{font-size:14px}.dream-levels select{font-size:15px;padding:10px}.level-mastery{font-size:19px;letter-spacing:0;padding-left:0}
 .dream-board{min-height:230px}.dream-jewels{gap:3px;padding:7px}.dream-controls{gap:7px}.dream-controls button{font-size:14px;padding:9px 12px}
 .dream-message,.memory-feedback{font-size:15px;margin:14px 0;min-height:45px}.dream-overlay{padding:16px}.dream-overlay h3{font-size:24px}.dream-overlay p{font-size:15px}.dream-overlay-icon{font-size:36px}
 .dream-save-note{font-size:12px}.dream-rhythm{min-height:280px;padding:0}.rhythm-track{height:280px}.rhythm-note{width:44px;height:38px}.star-links polyline{stroke-width:9}
 .dream-palette{margin-top:14px}.dream-palette .arena-button{font-size:14px}.dream-color{font-size:14px}.dream-starlines .dream-cell{min-height:0}.dream-garden .dream-cell{font-size:22px}
 .memory-levels{gap:5px}.memory-levels button{font-size:13px;padding:8px 5px;line-height:1.4}.memory-plus .memory-grid{gap:7px}.memory-plus .memory-card{aspect-ratio:.92}.memory-plus .card-face{border-radius:12px}
 .memory-plus .card-back{font-size:32px}.memory-playfield{margin-top:15px}.memory-plus .dream-overlay{min-height:100%}.memory-actions button{font-size:14px}
}
@media(max-width:360px){.welcome-copy{padding:14px}.welcome-copy h1{font-size:22px}.welcome-copy>p:not(.eyebrow){font-size:13px}.brand-mark{width:32px;height:36px;font-size:28px}.brand{gap:6px}.topbar .header-actions{gap:4px}.stars-total{min-width:48px}.dream-hud strong{font-size:14px}.quest-strip span{font-size:13px;padding:7px 10px}.result-mastery{font-size:32px}}
@media(prefers-reduced-motion:reduce){.gem-sprite{filter:none}}

@media(min-width:900px){
 .dream-body{display:grid;grid-template-columns:minmax(0,1fr)220px;column-gap:22px;row-gap:12px;max-width:850px;padding:0 24px 24px;align-items:start}
 .dream-board-wrap{grid-column:1;grid-row:1 / span 8;width:100%;max-width:470px;align-self:start}
 .dream-levels{grid-column:2;grid-row:1;margin:0;flex-wrap:wrap}
 .dream-levels label{flex-basis:100%}.dream-levels .level-mastery{font-size:22px;padding:0}
 .dream-levels button{font-size:13px;padding:9px;flex:1}
 .dream-hud{grid-column:2;grid-row:2;gap:5px}.dream-hud>div{padding:10px 7px}.dream-hud strong{font-size:14px}.dream-hud small{font-size:12px;letter-spacing:0}
 .quest-strip{grid-column:2;grid-row:3;margin:0}.dream-progress{grid-column:2;grid-row:4;margin:0}
 .dream-palette{grid-column:2;grid-row:5;margin:0;gap:8px}.dream-palette .arena-button{font-size:14px;width:100%}.dream-palette .dream-color{font-size:14px;flex:1;padding:8px}
 .dream-message{grid-column:2;grid-row:6;font-size:15px;min-height:0;margin:0}
 .dream-controls{grid-column:2;grid-row:7;display:grid;grid-template-columns:1fr 1fr;gap:7px}.dream-controls button{font-size:13px;padding:9px 6px}
 .dream-save-note{grid-column:2;grid-row:8;font-size:12px;margin:0}
 .dream-pet .pet-portrait{aspect-ratio:1.25}.dream-potions{gap:16px;padding:20px}.dream-overlay h3{font-size:25px}
}
