:root{color-scheme:light;--lemon:#ffdc58;--cream:#fff0ce;--pink:#f56baf;--plum:#742347;--deep:#4f203e;--edge:#a03965}
body[data-mobile-std="1"] #egm-play-header{display:none!important}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f9cc45;color:var(--deep);font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;font-weight:600}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;border:0}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #542343;outline-offset:3px}button:active{transform:translateY(2px)}button:disabled{cursor:default;opacity:.5}a{color:inherit}button,img{-webkit-user-select:none;user-select:none}button{touch-action:manipulation}[hidden]{display:none!important}
.game-shell{width:min(100%,460px);min-height:100svh;min-height:100dvh;margin:auto;padding:0 12px max(8px,env(safe-area-inset-bottom));background:#ffdc58;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 0 90px #ba862354}
.topline{display:flex;justify-content:space-between;align-items:center;font-size:10px;letter-spacing:.03em;min-height:38px;padding-top:env(safe-area-inset-top)}.topline a{min-height:32px;display:flex;align-items:center;text-decoration:none}.topline span{font-size:8px;letter-spacing:.18em;opacity:.7}
.brand{position:relative;margin:0 -12px;text-align:center}.brand img{display:block;width:100%;height:auto}.brand p{font-size:10px;letter-spacing:.2em;margin:0 0 9px;color:#76294b}
.hud{border-radius:25px;background:linear-gradient(135deg,#913353,#6c2346);border:2px solid #ab446a;box-shadow:inset 0 2px 1px #e97d9766,0 4px 0 #c99431;display:flex;align-items:center;justify-content:space-around;min-height:52px;color:var(--cream);position:relative;z-index:2;margin:0 8px -4px}
#health{display:flex;gap:5px;font-size:28px;line-height:1;color:#ff80b4;text-shadow:0 2px 0 #501e37,1px -1px #ffbfce}.empty-heart{opacity:.22}.room-count{border-left:1px solid #d67493;border-right:1px solid #d67493;padding:0 15px;display:grid;text-align:center;gap:2px}.room-count small{font-size:8px;letter-spacing:.14em}.room-count strong{font-size:14px;letter-spacing:.08em}.clock{display:flex;align-items:center;gap:4px}.clock>span{font-size:33px}.clock strong{font-size:24px;font-variant-numeric:tabular-nums}.clock small{font-size:12px;align-self:flex-end;margin-bottom:9px}
.stage-wrap{position:relative;flex:1;min-height:270px;max-height:430px;margin:0 -12px;background:#ffdc58 url('/assets/play/foamfoundry/backdrop.webp') center/cover;border-radius:18px 18px 0 0;overflow:hidden}canvas{display:block;width:100%;height:100%;min-height:270px;position:absolute;inset:0;touch-action:none;outline:none}.room-ribbon{position:absolute;left:16px;right:16px;top:16px;display:flex;justify-content:space-between;gap:4px;pointer-events:none;font-size:10px;text-shadow:0 1px #fff4d2}.room-ribbon>span{background:#fff0cea6;padding:5px 8px;border-radius:20px}#flag-status{color:#823252}
.state-panel{position:absolute;left:11%;right:11%;top:16%;padding:12px 14px;border:2px solid #fff0ced9;border-radius:22px;background:#fff1d5ef;box-shadow:0 5px 0 #a94f6640,0 12px 24px #9c662c24;text-align:center;z-index:3}.state-panel h2{font-size:22px;line-height:1.08;margin:0 0 6px;letter-spacing:-.045em}.state-panel p{font-size:11px;line-height:1.45;margin:6px 0 10px}.state-panel .eyebrow{font-size:8px;letter-spacing:.13em;margin:0 0 5px}.primary,.secondary{width:100%;min-height:48px;border-radius:14px;padding:10px 12px;box-shadow:0 4px 0 #692342;font-size:14px;font-weight:900}.primary{background:linear-gradient(#ff88bb,#ed5b9d);color:#511d3c;border:2px solid #f5a8c8}.secondary{background:#ffdf73;box-shadow:0 3px 0 #ce9b3e;border:2px solid #ffefb6;margin-top:8px}.primary:hover{filter:brightness(1.06)}.text-button{background:none;font-size:11px;text-decoration:underline;min-height:32px;margin-top:3px}.hero-pick{display:flex;justify-content:center;gap:8px;margin:8px 0 10px}.hero-pick button{display:flex;align-items:center;gap:6px;min-height:48px;min-width:90px;border-radius:14px;background:#fff9e9;border:2px solid #e0bb8b;padding:3px 10px;font-size:13px}.hero-pick button[aria-pressed=true]{border-color:#923556;background:#ffe1eb;box-shadow:0 2px 0 #ac5474}.hero-pick img{width:32px;height:36px;object-fit:contain}.panel-stat{font-variant-numeric:tabular-nums;font-size:14px!important;color:#8c345a}.toast{position:absolute;bottom:9%;left:8%;right:8%;text-align:center;pointer-events:none;z-index:2;font-size:12px;color:#fff2ce;text-shadow:0 1px 2px #4b203d;background:#742347eb;border-radius:14px;padding:8px;opacity:0;transition:opacity .18s}.toast.show{opacity:1}
.control-tray{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:10px 12px 8px;border-radius:28px;background:linear-gradient(135deg,#a63864,#702044);box-shadow:inset 0 3px 2px #df7296,0 5px 0 #b57a32;position:relative;z-index:4;margin:0 -5px}.game-key{background:none;padding:0;min-width:48px;min-height:80px;display:flex;flex-direction:column;align-items:center;justify-content:center;touch-action:none;color:#ffe9c7}.game-key img{width:66px;height:64px;object-fit:fill;border-radius:43%;box-shadow:0 3px 5px #4a123c4a;pointer-events:none}.game-key span{font-size:9px;letter-spacing:.08em;margin-top:5px;pointer-events:none}.game-key kbd{font:inherit;font-size:7px;opacity:.6;display:none}.game-key.held img{transform:translateY(3px) scale(.96);filter:brightness(1.12)}.jump-key,.fire-key{min-width:56px;min-height:80px}
.state-ready{top:9%;left:15%;right:15%;padding:7px 12px}.state-ready h2{font-size:14px;letter-spacing:-.02em;margin-bottom:3px}.state-ready .hero-pick{margin:4px 0 6px}.state-ready .text-button{min-height:26px;font-size:10px;margin-top:0}
.toast{top:49px;bottom:auto}
.stage-wrap:has(.state-panel:not([hidden])) .toast{display:none}
.utility{display:flex;gap:7px;margin-top:12px}.utility button{min-height:48px;flex:1;background:#fff0b9;border-radius:14px;border:2px solid #ffe9a0;box-shadow:0 3px #d7a23a;font-size:12px}.micro-tip{font-size:10px;text-align:center;margin:10px 0 1px;line-height:1.4}.help{max-width:760px;margin:0 auto;padding:64px 24px;background:#fff0cb;line-height:1.75;font-weight:500}.help h1{font-size:30px;line-height:1.15;letter-spacing:-.04em}.help h2{font-size:21px;margin-top:32px}.help .eyebrow{font-size:11px;letter-spacing:.14em}.help li{margin:10px 0}.help p,.help li{font-size:15px}
dialog{max-width:min(92vw,410px);width:410px;max-height:90dvh;overflow:auto;border:3px solid #ffd960;border-radius:25px;padding:23px;background:#fff1d5;color:var(--deep);box-shadow:0 15px 90px #48152b80}dialog::backdrop{background:#49203e99;backdrop-filter:blur(4px)}dialog h2{margin:0 0 8px;font-size:25px;letter-spacing:-.045em}dialog p{font-size:13px;line-height:1.5}.setting-row{display:flex;align-items:center;justify-content:space-between;min-height:56px;border-bottom:1px solid #e7cea9;gap:15px;font-size:14px}.setting-row input{width:28px;height:28px;accent-color:#a23e68}.limits{font-size:11px}.stage-card{width:100%;text-align:left;border:2px solid #e6b459;border-radius:15px;background:#ffe49a;padding:12px;margin:5px 0;min-height:65px}.stage-card strong,.stage-card small{display:block}.stage-card small{font-size:11px;margin-top:4px}.stage-card:last-child{margin-bottom:15px}
@media(min-width:760px){body{background:radial-gradient(ellipse at 25% 20%,#ffe694,#f3bd39 80%)}.game-shell{width:460px;height:800px;min-height:min(100dvh,800px);max-height:100dvh}.game-key kbd{display:inline}.help{border-radius:28px 28px 0 0}.brand img{max-height:137px;object-fit:cover}.topline{min-height:32px}.stage-wrap{min-height:270px}.control-tray{padding-top:8px;padding-bottom:7px}}
@media(max-height:760px){.topline{min-height:30px}.brand img{max-height:105px;object-fit:contain}.brand p{font-size:8px;margin-bottom:6px}.hud{min-height:46px}.stage-wrap,canvas{min-height:245px}.control-tray{padding-top:7px;padding-bottom:6px}.game-key{min-height:70px}.game-key img{width:57px;height:55px}.utility{margin-top:9px}.micro-tip{margin-top:7px}.state-panel{top:14%;padding:10px}.state-panel h2{font-size:20px}.hero-pick{margin:6px 0}.state-panel p{margin:4px 0 6px}.state-panel .text-button{min-height:26px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}}
