.phone-only,#phone-hud,#piece-shelf,#phone-menu-shade{display:none}
#toast{opacity:0;visibility:hidden}#toast.show{opacity:1;visibility:visible}
aside button svg{width:16px;height:16px;flex-shrink:0}
@media(max-width:800px),(max-height:600px) and (max-width:1100px){
 body{font-size:15px}button,input,select{font-size:16px}button{min-height:46px}header{margin:0 16px;height:68px;gap:4px}.brand{font-size:20px;gap:7px}.logo{font-size:30px}.quiet{padding:8px;font-size:12px}main{padding:0 16px}
 #lobby{display:flex;flex-direction:column}.intro{order:0;padding:24px 0 18px}.intro h1{font-size:40px;letter-spacing:-1.5px;line-height:1.15;margin:12px 0}.intro p{font-size:14px;line-height:1.5;margin:10px 0}.intro .eyebrow{font-size:9px;letter-spacing:1.4px}
 .bottom-grid{order:1;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 24px}.bottom-grid .resume{order:-1;grid-column:1/-1;min-height:70px;background:#e4eadc;border:1px solid var(--line);padding:14px;gap:12px}.dark .bottom-grid .resume{background:#293b2a}.resume h3{font-size:16px}.resume p{font-size:13px}.resume b{font-size:14px}.upload{min-height:56px;padding:10px;gap:7px;border-style:solid}.upload-icon{width:24px;height:24px;background:none;font-size:24px}.upload h3{font-size:0}.upload h3:after{content:'Use my photo';font-size:14px}.upload p,.upload strong{display:none}#phone-load{display:block;padding:10px;font-size:14px}.section-title{order:2;margin-bottom:16px}.section-title h2{font-size:25px}.gallery{order:3;grid-template-columns:1fr;gap:14px;margin-bottom:24px}.card{display:grid;grid-template-columns:40% 1fr;min-height:170px}.card .photo{height:100%;min-height:170px}.card-body{padding:16px}.card h3{font-size:22px;line-height:1.25}.card p{font-size:13px;line-height:1.5;margin-bottom:12px}.card-foot{font-size:10px;margin-top:10px}.card-foot b{min-width:30px}.daily-card{order:4;margin-bottom:16px;padding:20px}.daily-card p{font-size:14px}.daily-card small{font-size:12px}.daily-card h2{font-size:25px}.daily-card .primary{min-height:50px;font-size:15px}.room-card{order:5}.room-card>button{width:100%;margin-top:12px}footer{order:6;font-size:10px;padding:20px 0}
 dialog{padding:20px;width:calc(100% - 20px);max-height:calc(100dvh - 24px);overflow:auto;border-radius:18px}dialog h2{font-size:28px}dialog p{font-size:14px}dialog label{font-size:14px}dialog small{font-size:12px;line-height:1.5}dialog .close{top:28px;right:28px;min-width:44px;min-height:44px;padding:0;font-size:28px}#setup-image{height:130px;margin-bottom:18px}.difficulty{gap:8px;margin:16px 0}.difficulty button{min-height:76px;padding:10px 3px}.difficulty b{font-size:27px}.difficulty span{font-size:11px;line-height:1.2}.timed-option{padding:12px;margin:14px 0;font-size:14px}.timed-option input{width:20px;height:20px;vertical-align:middle}.timed-option small{font-size:11px}.primary{min-height:52px;font-size:16px}#saved-number{font-size:16px;letter-spacing:0;padding:14px 6px}#phone-picture-dialog img{display:block;max-height:65dvh;width:100%;object-fit:contain;margin:18px 0}
 .phone-playing{background:var(--paper)}.phone-playing #phone-hud{display:flex;position:fixed;z-index:32;top:0;left:0;right:0;height:calc(62px + env(safe-area-inset-top));padding:calc(8px + env(safe-area-inset-top)) 100px 8px max(10px,env(safe-area-inset-left));gap:10px;align-items:center;background:var(--paper);border-bottom:1px solid var(--line)}#phone-hud>button{width:44px;min-width:44px;padding:0;font-size:24px}#phone-hud>div{min-width:0;display:flex;flex-direction:column;gap:4px}#phone-title{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#phone-progress{font-size:12px;color:var(--muted)}.phone-playing #game-menu-toggle{top:calc(8px + env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));min-height:46px;min-width:80px;font-size:14px;box-shadow:none}
 .phone-playing .canvas-viewport{top:calc(62px + env(safe-area-inset-top));bottom:calc(242px + env(safe-area-inset-bottom));height:auto;background:#e7e8df}.dark .phone-playing .canvas-viewport{background:#c2c3bb}.phone-playing canvas{box-shadow:none;touch-action:none}
 .phone-playing #piece-shelf{display:block;position:fixed;bottom:0;left:0;right:0;z-index:30;height:calc(242px + env(safe-area-inset-bottom));padding:6px 10px calc(6px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line);box-shadow:0 -5px 20px #0001}.shelf-tools{display:flex;gap:8px;align-items:center;justify-content:space-between}.shelf-filters{display:flex;gap:4px}.shelf-tools button{min-height:40px;font-size:13px;padding:7px 12px}.shelf-filters [aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}#phone-instruction{font-size:12px;line-height:1.3;margin:5px 0;color:var(--muted);height:16px;white-space:nowrap}#shelf-pieces{display:grid;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(2,54px);gap:4px;height:112px}#shelf-pieces>p{grid-column:1/-1;font-size:13px;margin:14px 0}.shelf-piece{min-height:54px;height:54px;min-width:0;padding:0;background:#e6e8df;border:2px solid transparent;overflow:hidden;border-radius:9px;touch-action:pan-x;user-select:none;-webkit-user-select:none}.dark .shelf-piece{background:#354332}.shelf-piece[aria-pressed=true]{border-color:#bf923e;background:#e8dab8}.shelf-piece canvas{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;filter:none;background:transparent}.shelf-bottom{display:flex;gap:5px;align-items:center;height:46px;margin-top:5px}.shelf-bottom button{min-width:42px;min-height:42px;padding:5px;font-size:20px}.shelf-bottom #phone-fit{font-size:14px;min-width:46px}#shelf-page{font-size:12px;min-width:45px;text-align:center}.shelf-spacer{flex:1}
 .phone-playing #game-menu{top:auto;bottom:0;left:0;right:0;width:100%;max-height:calc(85dvh - env(safe-area-inset-top));padding:20px 18px calc(18px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;transform:translateY(24px);z-index:43}.phone-playing #game-menu.menu-visible{transform:translateY(0)}.phone-playing #game-menu:before{content:'Puzzle menu';display:block;font:500 27px 'Playfair Display',serif;margin:0 0 18px}.phone-playing #game-menu .game-top,.phone-playing #game-menu .tray-bar,.phone-playing #game-menu .tray-pages,.phone-playing #game-menu #tray-help,.phone-playing #game-menu .board-bottom{display:none}.phone-playing #game-menu .room-bar{display:grid;grid-template-columns:1fr;gap:9px;padding:16px 0;border-top:1px solid var(--line)}.phone-playing #game-menu .room-bar>span{font-size:13px;margin-bottom:5px}.phone-playing #game-menu .room-bar button{font-size:15px;min-height:48px;text-align:left}.phone-playing #game-menu aside{display:block;border-top:1px solid var(--line);padding:12px 0}.phone-playing #game-menu aside button{min-height:48px;font-size:15px;width:100%;padding:12px}.phone-playing #game-menu #peek,.phone-playing #game-menu #edges,.phone-playing #game-menu #shuffle{display:none}.phone-playing #game-menu aside small{display:block;font-size:12px}.view-actions{gap:8px;margin-bottom:16px}.view-actions button{font-size:13px;min-height:46px;flex:1}.phone-menu-open #phone-menu-shade{display:block;position:fixed;inset:0;z-index:40;border:0;border-radius:0;background:#0d211a88}.phone-menu-open #piece-shelf{pointer-events:none}.piece-drag-ghost{position:fixed;width:72px;height:60px;pointer-events:none;z-index:100;background:#fff5;border-radius:8px;box-shadow:0 5px 18px #0004}#toast{z-index:150;bottom:calc(252px + env(safe-area-inset-bottom));font-size:13px}
 .intro{display:block;min-height:0}.hero-art,.hero-cta,.hero-notes{display:none}.hero-copy>.eyebrow{font-size:8px;letter-spacing:1.2px}.intro p br{display:none}header #theme-toggle,header #sound{font-size:0;padding:0;width:44px;min-width:44px;height:44px;min-height:44px;display:grid;place-items:center}header #theme-toggle:after{content:'\25d0';font-size:22px}header #sound:after{content:'\266a';font-size:22px}.brand{letter-spacing:-.6px}.phone-playing #game-menu aside button{display:flex;align-items:center;gap:10px}.shelf-piece{touch-action:none}#phone-instruction{font-size:11px}.phone-playing .canvas-viewport{background:#d9e3d6;scrollbar-width:none}.phone-playing .canvas-viewport::-webkit-scrollbar{display:none}.dark .phone-playing .canvas-viewport{background:#263f36}
}
@media(max-width:800px) and (orientation:landscape),(max-height:600px) and (max-width:1100px) and (orientation:landscape){.phone-playing #piece-shelf{left:auto;width:204px;height:auto;top:calc(62px + env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom));overflow:auto}.phone-playing .canvas-viewport{right:204px;bottom:0;width:auto}.shelf-tools{display:block}.shelf-tools #phone-picture{width:100%;margin-top:5px}.shelf-tools button{font-size:12px;padding:6px 10px}#phone-instruction{white-space:normal;height:auto;font-size:11px;margin:8px 0}#shelf-pieces{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(4,54px);height:228px}.shelf-bottom{flex-wrap:wrap;height:auto}.shelf-spacer{display:none}#toast{bottom:20px;max-width:calc(100% - 220px);left:40%}}
@media(max-width:800px) and (orientation:landscape),(max-height:600px) and (max-width:1100px) and (orientation:landscape){#shelf-pieces{grid-template-rows:repeat(2,54px);height:112px}.shelf-tools button{min-height:32px}.shelf-bottom{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.shelf-bottom button{min-height:36px;min-width:0}#shelf-page{min-width:0}.shelf-bottom #phone-fit{min-width:0}.shelf-tools #phone-picture{margin-top:4px}#phone-instruction{margin:5px 0}.phone-playing #piece-shelf{padding-top:5px}}
@media(max-width:350px){.brand{font-size:18px}.brand .logo{width:29px;height:29px}.brand .logo svg{width:25px;height:25px}header{gap:3px}.intro h1{font-size:36px}.card-body{padding:13px}.card h3{font-size:20px}.shelf-tools button{padding:7px 9px}#phone-instruction{font-size:10px}.shelf-bottom{gap:3px}.shelf-bottom button{min-width:38px}.shelf-bottom #phone-fit{min-width:42px}#shelf-page{min-width:40px}}
