/* Embedded player: fit the iframe viewport, not the containing web page. */
html[data-embed=true],html[data-embed=true] body{width:100%;height:100%;min-width:0;min-height:0;margin:0;overflow:hidden;overscroll-behavior:none}
html[data-embed=true] body{padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
html[data-embed=true] .sky-decoration,html[data-embed=true] .top,html[data-embed=true] .heading,html[data-embed=true] aside,html[data-embed=true] footer{display:none}
html[data-embed=true] main,html[data-embed=true] .layout{width:100%;height:100%;min-width:0;min-height:0;max-width:none;padding:0;margin:0;display:block}
html[data-embed=true] .game-card{width:100%;height:100%;min-height:0;display:flex;flex-direction:column;border:0;border-radius:0;overflow:hidden}
html[data-embed=true] .game-toolbar{flex:0 0 auto;display:flex;flex-wrap:nowrap;gap:5px;padding:4px 8px;min-height:40px}
html[data-embed=true] .mode-label{flex:1;min-width:0;letter-spacing:0;gap:5px}
html[data-embed=true] .mode-label select{width:100%;max-width:260px;min-width:0;height:32px;min-height:32px;padding:4px 6px;font-size:12px}
html[data-embed=true] #mode-label{display:none}
html[data-embed=true] #pause,html[data-embed=true] #embed-menu{height:32px;min-height:32px;padding:4px 10px;font-size:12px;flex-shrink:0}
html[data-embed=true] .embed-hud{display:flex;align-items:center;gap:10px;flex:0 0 auto;min-height:28px;padding:2px 10px;background:#f8f0de;border-bottom:1px solid var(--line)}
html[data-embed=true] #stats{display:flex;flex:0 0 auto;gap:12px;padding:0;border:0}
html[data-embed=true] .stat{display:flex;flex-direction:row;align-items:baseline;gap:4px}
html[data-embed=true] .stat b{font:700 15px ui-sans-serif,system-ui,sans-serif}
html[data-embed=true] .stat span{font-size:10px;letter-spacing:0;white-space:nowrap}
html[data-embed=true] .embed-goal{min-width:0;flex:1;overflow:hidden;min-height:24px;padding:2px 4px;border:0;background:none;text-align:left}
html[data-embed=true] #goal{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:18px}
html[data-embed=true] .stage-wrap{flex:1 1 0;min-height:0;min-width:0;overflow:hidden}
html[data-embed=true] .stage{width:100%;height:100%;min-height:0;min-width:0;overflow:hidden}
html[data-embed=true] .embed-scene{box-sizing:border-box;max-height:none}
html[data-embed=true] .board-grid{aspect-ratio:1;width:auto;padding:12px;margin:0;gap:7px}
html[data-embed=true] .board-2048{gap:10px}
html[data-embed=true] .quilt-grid{margin:8px auto!important;max-width:460px;width:460px!important}
html[data-embed=true] .pieces{padding:8px;min-height:70px;gap:18px}
html[data-embed=true] .keyboard-hint{margin:4px 0 6px}
html[data-embed=true] .shelf-area{padding:15px 10px;min-height:0;gap:10px}
html[data-embed=true] .shelf{height:230px;width:80px}
html[data-embed=true] .shelf .parcel{width:54px;height:45px}
html[data-embed=true][data-narrow=true] .shelf{height:195px;width:65px}
html[data-embed=true][data-narrow=true] .shelf .parcel{width:44px;height:38px}
html[data-embed=true] .freecell-board{min-height:0;padding:8px 6px}
html[data-embed=true] .card-slot{height:100%}
html[data-embed=true] .card-columns{min-height:0}
html[data-embed=true] .band-stage{min-height:0;padding:12px}
html[data-embed=true] .band-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
html[data-embed=true][data-narrow=true] .band-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
html[data-embed=true] .musician svg{height:90px}
html[data-embed=true] .beat-dots{margin-top:12px}
html[data-embed=true] .controls{flex:0 0 auto;max-height:min(28vh,120px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px 8px;margin:0;gap:5px;min-height:0}
html[data-embed=true] .controls button{min-height:32px;padding:4px 9px;font-size:12px}
html[data-embed=true] .dpad{gap:5px}
html[data-embed=true] .dpad button{width:38px;height:34px;min-height:34px;font-size:19px}
html[data-embed=true] .status{flex:0 0 auto;min-height:0;max-height:32px;overflow:auto;margin:0;padding:2px 8px;font-size:11px;line-height:14px}
html[data-embed=true] .status:empty{display:none}
html[data-embed=true] .overlay{padding:8px;overflow:auto}
html[data-embed=true] .welcome{padding:16px;max-width:410px;max-height:100%;overflow:auto;border-radius:14px}
html[data-embed=true] .welcome img{width:30px;height:36px;margin:0 0 5px}
html[data-embed=true] .welcome h2{font-size:24px;margin:4px 0 8px}
html[data-embed=true] .welcome p{margin:4px 0}
html[data-embed=true] .welcome .eyebrow{display:none}
html[data-embed=true] .welcome .primary{margin-top:6px;min-height:36px;padding:6px 20px}
html[data-embed=true] dialog{max-height:calc(100dvh - 16px);overflow:auto;margin:auto;padding:14px;width:min(94%,520px)}
html[data-embed=true] .embed-dialog .tools,html[data-embed=true] .embed-dialog nav{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
html[data-embed=true] .embed-dialog h2{font-size:21px;margin:4px 0 10px}
html[data-embed=true] .embed-dialog button{min-height:38px}
html[data-embed=true] .embed-dialog .controls{max-height:none;overflow:visible;display:flex;padding:8px 0;margin-bottom:12px}
html[data-embed=true] .embed-dialog .palette{padding:4px;gap:4px;max-width:100%}
html[data-embed=true] .embed-dialog .palette button{width:38px;height:38px;padding:4px}
html[data-embed=true] .embed-tree-tools{padding:4px 8px;display:flex;justify-content:center;flex:0 0 auto}
html[data-embed=true] .embed-tree-tools button{min-height:34px;padding:4px 12px;font-size:12px}
html[data-embed=true] .clue-list{padding:3px;gap:4px;flex-wrap:wrap;max-width:100%}
html[data-embed=true] .clue{padding:3px 6px;font-size:11px}
html[data-embed=true][data-short=true] .welcome img,html[data-embed=true][data-short=true] #overlay-body{display:none}
html[data-embed=true][data-short=true] .welcome{padding:10px}
html[data-embed=true][data-short=true] .welcome h2{font-size:19px;margin:2px 0 6px}
html[data-embed=true][data-short=true] .controls{max-height:76px}
html[data-embed=true][data-short=true] .embed-hud{min-height:24px;padding-top:0;padding-bottom:0;gap:6px}
html[data-embed=true][data-short=true] .stat b{font-size:13px}
html[data-embed=true][data-short=true] .stat span{font-size:9px}
html[data-embed=true][data-short=true] .embed-goal{min-height:22px}

/* Preserve important numbers and expose zoom controls in short windows. */
html[data-embed=true] .number-tile{font-size:clamp(26px,calc(22px / var(--scene-scale,1)),64px)}
html[data-embed=true][data-short=true] .number-tile small{display:none}
html[data-embed=true] .clue-list{flex:1 0 100%;display:flex;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin}
html[data-embed=true] .clue-list .clue{flex:0 0 auto;white-space:nowrap}
html[data-embed=true][data-short=true] .band-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
html[data-embed=true][data-short=true] .band-stage{padding:8px}
html[data-embed=true][data-short=true] .musician{padding:7px 4px}
html[data-embed=true][data-short=true] .musician svg{height:85px}
html[data-embed=true][data-short=true] .band-lights{margin-bottom:4px;height:12px}
html[data-embed=true][data-short=true] .beat-dots{margin-top:5px}
html[data-embed=true][data-short=true] .musician button{font-size:20px;min-height:55px;max-width:100%;padding:4px}
html[data-embed=true][data-short=true] .musician small{font-size:18px;margin:2px 0}
@media(min-height:430px){html[data-embed=true] .controls button,html[data-embed=true] .dpad button{min-height:40px}}
