:root{font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color:#244710;font-synthesis:none;--gold:#ffdf35;--grass:#a0ed28;--pink:#f48eb1}*{box-sizing:border-box}html,body{margin:0;min-height:100%;overscroll-behavior:none}body{min-height:100svh;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 40% 30%,#35653a,#112d22 80%)}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:disabled{cursor:default}button:focus-visible,canvas:focus-visible,input:focus-visible{outline:3px solid #216bd7;outline-offset:4px}button{color:inherit}button:hover{filter:brightness(1.035)}button:active{transform:translateY(2px)}.hidden{display:none!important}.phone{position:relative;height:100svh;width:min(100%,460px);overflow:hidden;background:var(--grass);isolation:isolate}.screen{position:absolute;inset:0}.gate{background:#9dec27;display:flex;align-items:center;justify-content:center}.gate-art{height:min(100%,calc(100vw * 1896 / 830));max-width:100%;aspect-ratio:830/1896;position:relative}.gate-art>img{display:block;width:100%;height:100%;object-fit:contain;user-select:none}.gate-start{position:absolute;left:16%;top:80.1%;width:68%;height:8%;border:3px solid #db8c00;border-radius:100px;background:linear-gradient(#fff35e,#ffdc29);box-shadow:inset 0 3px 0 #fff8ad,0 4px 0 #aa6d0b;color:#4d3d03;text-shadow:0 1px 0 #fff385;font-weight:1000;font-size:clamp(24px,4.5vh,39px);letter-spacing:2px;animation:breathe 3s ease-in-out infinite}.gate-help{position:absolute;right:3.5%;top:3.7%;height:3.7%;width:8%;font-size:25px;line-height:0;border:0;background:#e2fcc3;border-radius:14px;color:#171b0d}.gate-guide-link{position:absolute;bottom:3%;left:24%;width:52%;height:3.8%;border:1px solid #f1e4a3;background:#fff4ce;border-radius:30px;font-size:clamp(11px,1.7vh,15px);font-weight:800}.gate-guide-link span{margin-left:5px}.game{display:flex;flex-direction:column;background:radial-gradient(ellipse at 45% 48%,#b7f641 0,#a2ee2b 48%,#7cdd1b 100%);padding:max(env(safe-area-inset-top),12px) 14px max(env(safe-area-inset-bottom),12px)}.game-header{position:relative;z-index:2;flex:none}.top-row{display:flex;gap:18px;align-items:center;justify-content:space-between;padding:6px 4px}.pause{width:48px;height:48px;display:flex;gap:5px;align-items:center;justify-content:center;background:linear-gradient(#ffc4e3,#ef7ead);border:3px solid white;border-radius:12px;box-shadow:0 3px 0 #8c9150,inset 0 2px 0 #ffe4ef}.pause span{height:27px;width:10px;border-radius:4px;background:#fff8fd;border:1.5px solid #b05881}.coin-counter{display:flex;align-items:center;justify-content:center;position:relative;height:34px;min-width:145px;border:2px solid #e3fabe;border-radius:13px;background:#477a19;color:#fff;font-size:22px;text-shadow:0 2px #284908;letter-spacing:1px}.coin{position:absolute;left:-22px;display:grid;place-items:center;border:3px solid #f59600;background:#ffe139;box-shadow:inset 0 0 0 3px #fff180,0 2px 0 #c48208;border-radius:50%;width:47px;height:47px;font-size:24px;text-shadow:none}.round{width:38px;height:38px;border:2px solid #d7fda6;background:#5d9d28;color:#efffcf;border-radius:50%;font-size:24px;box-shadow:0 2px 0 #4a7a20}.level-row{display:flex;align-items:center;justify-content:space-between;margin-top:5px}.small-home{border:0;background:#ffffff30;border-radius:50%;width:30px;height:30px;font-size:24px;line-height:24px}.level-spacer{width:30px}h1{font-size:29px;letter-spacing:3px;margin:3px 0 7px;color:#fffbed;text-shadow:-2px -2px #58421e,2px -2px #58421e,-2px 2px #58421e,2px 2px #58421e,0 4px #59421b;font-weight:1000}.progress-row{max-width:260px;display:flex;align-items:center;gap:10px;margin:6px auto;font-size:12px;font-weight:800}.progress-track{height:7px;flex:1;background:#5f9c2566;box-shadow:inset 0 1px 2px #4f8d2540;border-radius:10px;overflow:hidden}.progress-track i{height:100%;width:0;display:block;background:#fff4a0;border-radius:inherit;transition:width .3s}.board-wrap{position:relative;flex:1;min-height:0;z-index:1}canvas{display:block;width:100%;height:100%;outline:none;touch-action:none}.board-hint{position:absolute;bottom:0;left:0;right:0;text-align:center;pointer-events:none;font-size:13px;font-weight:800;color:#3c621f;text-shadow:0 1px #d2ff83}.selection-mode{position:absolute;left:50%;top:4px;transform:translateX(-50%);background:#fff8dc;white-space:nowrap;border:2px solid #528533;border-radius:30px;padding:8px 17px;font-size:13px;font-weight:800;box-shadow:0 3px 0 #42751d36;pointer-events:none}.game-footer{position:relative;z-index:2;flex:none;padding-top:15px}.tools{display:flex;justify-content:space-around;gap:16px;max-width:380px;margin:auto}.tool{position:relative;background:linear-gradient(#fff16d,#ffd332);border:3px solid #fff9de;outline:2px solid #bd941c;border-radius:17px;box-shadow:0 5px 0 #718c24,inset 0 0 0 2px #ffc64a;width:90px;height:94px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 6px 6px}.tool:disabled{filter:grayscale(.55);opacity:.65}.tool.selected{outline:3px solid #e77049;background:linear-gradient(#fff6ac,#ffb04b);transform:translateY(-3px);box-shadow:0 8px 0 #718c24}.tool-icon{display:block;position:relative;height:55px;width:62px}.pig-emoji{font-size:45px;position:absolute;left:0;bottom:0}.tool-icon b{position:absolute;right:-2px;top:3px;color:#f59020;text-shadow:-1px -1px #80471a,1px 1px #80471a;font-size:29px}.tool strong{color:#5d410c;font-size:20px;font-weight:1000;text-shadow:-1px -1px white,1px 1px white,0 2px white}.tool i{position:absolute;right:-7px;top:-8px;width:23px;height:23px;border-radius:50%;background:#ed7b9a;color:white;border:2px solid #fff8cb;font-size:12px;font-style:normal;display:grid;place-items:center;font-weight:bold}.footer-links{display:flex;justify-content:space-between;align-items:center;font-size:10px;margin:17px 3px 0;color:#3b6a1f}.footer-links button{border:0;background:#efffc260;font-size:11px;font-weight:800;border-radius:20px;padding:5px 9px}.foliage{position:absolute;width:145px;height:145px;pointer-events:none;background:radial-gradient(ellipse at 30% 20%,#227c32 0 23%,transparent 24%),radial-gradient(ellipse at 60% 25%,#29933c 0 27%,transparent 28%),radial-gradient(ellipse at 26% 65%,#2ba249 0 28%,transparent 29%);opacity:.85}.foliage-tl{left:-40px;top:-45px}.foliage-tr{right:-40px;top:-45px;transform:scaleX(-1)}.foliage-bl{bottom:-60px;left:-40px;transform:scaleY(-1)}.foliage-br{bottom:-60px;right:-40px;transform:scale(-1)}.overlay{position:absolute;inset:0;z-index:10;background:#0e2a0bc7;display:flex;align-items:center;justify-content:center;padding:23px 19px;backdrop-filter:blur(2px)}.modal{width:100%;max-height:100%;overflow-y:auto;scrollbar-width:thin;background:#fff8df;border:2px solid #477d2b;border-radius:29px;box-shadow:0 5px 0 #477b2f66,0 18px 48px #10291455;padding:25px 23px;text-align:center;position:relative}.modal h2{font-size:27px;line-height:1.3;color:#234410;margin:10px 0;font-weight:1000}.modal p{font-size:14px;line-height:1.8;color:#688049;margin:8px 0 19px}.modal .subtitle{font-size:13px;margin:5px 0 18px}.modal-x{position:absolute;right:15px;top:12px;border:0;background:#dcedbd;border-radius:50%;width:28px;height:28px;font-size:23px;line-height:20px;color:#5f793d}.compass{height:73px;width:73px;border:6px solid #f9f3df;background:repeating-conic-gradient(from 0deg,#fff 0deg 1deg,#18adff 1deg 12deg);border-radius:50%;margin:0 auto 13px;box-shadow:0 3px 0 #57843b;position:relative}.compass:before{content:"";position:absolute;inset:7px;border-radius:50%;background:linear-gradient(#2ab1ff,#0c79e3)}.compass span{display:block;position:absolute;left:25px;top:6px;width:13px;height:48px;background:linear-gradient(#fb544d 0 50%,white 50%);clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);transform:rotate(40deg)}.steps{list-style:none;margin:0;padding:0;display:grid;gap:10px;text-align:left}.steps li{background:#fffdf1;border-radius:18px;padding:14px 12px;display:flex;align-items:center;gap:12px}.steps li>b{border-radius:50%;background:linear-gradient(#98cf2e,#478016);height:30px;width:30px;display:grid;place-items:center;flex:none;color:#fff;font-size:20px}.steps strong{font-size:17px}.steps small{display:block;font-size:12px;color:#718554;margin-top:4px}.steps li>span{margin-left:auto;font-size:28px;color:#42732b}.gold-button{width:100%;border:2px solid #df9827;border-radius:50px;padding:12px 16px;background:linear-gradient(#fff66e,#ffda2e);color:#4c3b03;box-shadow:inset 0 2px #fffabc,0 4px 0 #b37d15;font-size:22px;font-weight:1000;margin:13px 0 9px}.text-button{border:0;background:transparent;font-size:15px;padding:11px;color:#5d7944;font-weight:800;width:100%}.local-note{font-size:11px;color:#77855f;text-align:left;padding:10px 8px 2px;line-height:1.5}.modal-symbol{font-size:60px;line-height:1.2;margin:3px 0 9px}.standard-panel #modal-text{white-space:pre-line}.standard-panel .secondary{background:#e7f0c9;border:1px solid #cfdfaa;border-radius:40px;width:100%;padding:11px;margin:8px 0 0;font-size:16px;font-weight:800;color:#5b7442}.toast{position:absolute;bottom:150px;left:50%;transform:translateX(-50%);z-index:30;padding:10px 18px;background:#244214ed;color:#fff8df;border-radius:30px;font-size:13px;max-width:88%;width:max-content;text-align:center;box-shadow:0 4px 18px #23440c40;pointer-events:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}#copy-fallback{font-size:11px;color:#6a7c52}#copy-url{width:100%;margin-top:6px;border:1px solid #9bb575;background:white;border-radius:8px;padding:8px;color:#365324}.desktop-note{position:fixed;left:calc(50% + 275px);top:50%;transform:translateY(-50%);color:#dcecc2;display:none;max-width:180px}.desktop-note>span{font-size:54px;display:block;margin-bottom:15px}.desktop-note>strong{font-size:27px;letter-spacing:3px}.desktop-note p{font-size:25px;line-height:1.7;letter-spacing:3px;color:#b8d695}.desktop-note small{line-height:1.9;color:#8eb28f;font-size:12px}@keyframes breathe{0%,100%{filter:brightness(1)}50%{filter:brightness(1.06)}}@media(min-width:600px){body{padding:16px}.phone{height:min(900px,calc(100svh - 32px));width:min(440px,calc((100svh - 32px)*.49));min-width:320px;border-radius:28px;box-shadow:0 28px 90px #061b18aa,0 0 0 1px #accb7d44}.gate-art{height:100%}.game{padding-top:14px}}@media(min-width:1150px){.desktop-note{display:block}}@media(max-height:650px){.game{padding-top:6px}.pause{width:38px;height:38px}.pause span{height:22px;width:8px}.top-row{padding:2px 4px}.level-row{margin-top:0}h1{font-size:23px}.game-footer{padding-top:10px}.tool{width:72px;height:74px;border-radius:13px}.tool-icon{height:42px;transform:scale(.8);transform-origin:center bottom}.tool strong{font-size:16px}.footer-links{margin-top:12px}.board-hint{font-size:11px}.modal{padding:17px}.modal h2{font-size:23px}.compass{width:58px;height:58px;margin-bottom:7px}.compass span{left:18px;top:0}.steps li{padding:9px 10px}.steps strong{font-size:15px}.steps small{font-size:11px}.modal .subtitle{margin-bottom:10px}.gold-button{font-size:20px;padding:10px}.local-note{font-size:10px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
:is(.guide-panel,.standard-panel){display:block;flex:none;height:auto}
#app{overflow:clip}
.tools .tool-lock{display:none;position:absolute;right:-10px;top:-13px;width:36px;height:36px;padding:2px;background:#fff4c5;border:2px solid #fffbed;border-radius:50%;box-shadow:0 2px 0 #9b701b;pointer-events:none}.tool-lock svg{display:block;width:100%;height:100%}.tools .tool.locked .tool-lock{display:block}.tools .tool.locked i{display:none}.tools .tool.locked .tool-icon{filter:saturate(.45);opacity:.78}
.stage-meta{display:flex;justify-content:center;gap:10px;align-items:center;margin:2px 0 7px;font-size:10px;color:#426b1c}.stage-meta>span:first-child{background:#f3ffd478;border:1px solid #ebffc39c;border-radius:20px;padding:3px 8px;font-weight:800}.long-level{font-size:22px;letter-spacing:1px}.tools .tool{height:110px}.tools .tool small{font-size:10px;line-height:16px;font-weight:700;color:#7c6728;white-space:nowrap}.tools .tool i{width:34px;border-radius:13px;font-size:10px}.tools .tool.ready i{background:#529620}.tools .tool.ready small{color:#42771b}.tools .tool.waiting{filter:saturate(.65)}.modal .gold-button:disabled{background:#e6e9d1;border-color:#b2bea0;box-shadow:0 3px #9eab88,inset 0 2px #f7f8e9;color:#8b9679;transform:none;filter:none}#standard-panel.unlock-panel .modal-symbol{display:grid;place-items:center;width:92px;height:92px;margin:5px auto 22px;border-radius:50%;font-size:44px;font-weight:900;color:#497a1f;background:radial-gradient(circle,#fff8df 58%,transparent 59%),conic-gradient(#78bb29 var(--unlock-progress,0%),#e0e9bf 0);font-variant-numeric:tabular-nums}.unlock-panel h2{font-size:25px}.unlock-panel #modal-text{font-size:13px}#modal-text{overflow-wrap:anywhere}@media(max-height:650px){.tools .tool{height:90px}.tools .tool small{font-size:9px;line-height:12px}.stage-meta{margin-bottom:3px}}

/* The viewport follows Safari's visible area, including older iPhones. */
:root{--safe-top:0px;--safe-right:0px;--safe-bottom:0px;--safe-left:0px}
@supports(padding-top:constant(safe-area-inset-top)){
  :root{--safe-top:constant(safe-area-inset-top);--safe-right:constant(safe-area-inset-right);--safe-bottom:constant(safe-area-inset-bottom);--safe-left:constant(safe-area-inset-left)}
}
@supports(padding-top:env(safe-area-inset-top)){
  :root{--safe-top:env(safe-area-inset-top);--safe-right:env(safe-area-inset-right);--safe-bottom:env(safe-area-inset-bottom);--safe-left:env(safe-area-inset-left)}
}
body{min-height:100vh;min-height:var(--app-height,100vh)}
.phone{width:100%;max-width:460px;height:100vh;height:var(--app-height,100vh)}
#app{overflow:hidden;overflow:clip}
.game{padding:12px 14px;padding-top:calc(12px + var(--safe-top));padding-bottom:calc(12px + var(--safe-bottom));padding-left:calc(14px + var(--safe-left));padding-right:calc(14px + var(--safe-right))}
.gate{display:flex;flex-direction:column;padding:18px 16px 12px;padding-top:calc(18px + var(--safe-top));padding-bottom:calc(12px + var(--safe-bottom));padding-left:calc(16px + var(--safe-left));padding-right:calc(16px + var(--safe-right));background:radial-gradient(ellipse at 45% 40%,#c6fa62,#93e524 75%)}
.demo-heading{position:relative;z-index:1;flex:none;text-align:center;padding:0 0 14px}
.demo-heading h1{color:#fb8ab4;letter-spacing:1px;font-size:48px;line-height:1.15;margin:0 0 7px;font-weight:1000;text-shadow:-2px -2px #fff9e6,2px -2px #fff9e6,-2px 2px #fff9e6,2px 2px #fff9e6,0 5px #975830}
.demo-heading p{font-size:13px;letter-spacing:3px;font-weight:800;margin:0;color:#49651b}
.demo-player{position:relative;z-index:1;flex:1;min-height:0;width:100%;overflow:hidden;background:#a1ec2b;border:3px solid #f6ffdc;border-radius:25px;box-shadow:0 5px 0 #6a9b3260,0 9px 25px #669e271a}
#gate-video{display:block;width:100%;height:100%;object-fit:contain;background:#a1ec2b}
.demo-badge{position:absolute;left:11px;top:12px;display:flex;align-items:center;background:#f9ffe5e8;padding:7px 10px;border-radius:30px;font-size:11px;font-weight:800;color:#466528;pointer-events:none}
.demo-badge>span{width:6px;height:6px;background:#70a82d;border-radius:50%;margin-right:6px}
.demo-toggle{position:absolute;right:8px;top:7px;min-height:38px;padding:7px 12px;border:1px solid #f1ffc8aa;border-radius:30px;background:#3d6920c4;color:#fff9df;font-size:11px;font-weight:700}
.demo-caption{position:absolute;left:0;right:0;bottom:0;padding:24px 8px 13px;background:linear-gradient(transparent,#709a224d);text-align:center;font-size:13px;font-weight:800;color:#355618;text-shadow:0 1px #ddff9e;pointer-events:none}
.demo-footer{position:relative;z-index:1;flex:none;width:100%;text-align:center;padding-top:15px}
.demo-footer .demo-start{margin:0;font-size:27px;padding:10px 16px;min-height:55px}
.demo-footer p{margin:10px 0 5px;font-size:12px;font-weight:700;color:#4d6d23}
.demo-guide{background:#fff5d8;border:1px solid #e4d79c;border-radius:30px;padding:7px 20px;min-height:34px;font-size:11px;font-weight:700;color:#5b661e}
.demo-guide span{margin-left:6px}
.guide-panel{padding:16px 14px 8px}
.guide-panel h2{font-size:24px;margin:7px 0 5px;padding:0 23px}
.guide-panel .subtitle{margin:3px 0 10px;font-size:12px;line-height:1.55}
.guide-panel picture{display:block}
.safari-guide-animation{display:block;width:100%;height:auto;max-height:calc(var(--app-height,100vh) - 300px - var(--safe-top) - var(--safe-bottom));object-fit:contain;border-radius:17px;background:#efeffb}
.guide-panel .local-note{padding:4px 1px 0;font-size:10px;line-height:1.5;text-align:center}
.guide-copy{display:block;width:100%;min-height:44px;margin-top:6px;padding:9px 3px;border:0;background:transparent;color:#497529;font-size:12px;text-decoration:underline;text-underline-offset:3px}
.guide-panel .text-button{min-height:44px;font-size:12px;padding:9px 0}
.guide-panel .modal-x{width:44px;height:44px;right:4px;top:4px;line-height:44px;padding:0;background:radial-gradient(circle,#dcedbd 0 14px,transparent 15px)}
.top-row{display:grid;grid-template-columns:72px minmax(0,1fr) 72px;align-items:center;gap:0;padding:4px 0 9px}
.top-row h1{text-align:center;margin:0;font-size:28px;letter-spacing:2px;white-space:nowrap}
.top-row h1.long-level{font-size:19px;letter-spacing:0}
.header-actions{display:flex;align-items:center;justify-content:flex-end}
.header-actions .small-home{margin-right:5px;flex:none}
.header-actions .sound{flex:none}
.progress-row{width:76%;max-width:280px;margin:8px auto 5px;gap:0}
.stage-meta{gap:0}
.stage-meta>span+span{margin-left:10px}
.tools{gap:0}
.steps li{gap:0}
.steps li>b{margin-right:12px}
.pause{gap:0}
.pause span+span{margin-left:5px}
.modal{max-height:100%;-webkit-overflow-scrolling:touch}
.overlay{padding:18px 16px;padding-top:calc(18px + var(--safe-top));padding-bottom:calc(18px + var(--safe-bottom));padding-left:calc(16px + var(--safe-left));padding-right:calc(16px + var(--safe-right));-webkit-backdrop-filter:blur(2px)}
.toast{bottom:calc(150px + var(--safe-bottom))}
.gate-start,.gold-button,.tool{min-height:44px}
.small-home,.round{touch-action:manipulation}
@media(min-width:600px){
  body{padding:16px}
  .phone{width:440px;max-width:calc((var(--app-height,100vh) - 32px)*.49);min-width:320px;height:calc(var(--app-height,100vh) - 32px);max-height:900px}
}
/* iPhone 6/7/8 with Safari's address and tool bars visible. */
@media(max-height:650px){
  .game{padding:6px 12px;padding-top:calc(6px + var(--safe-top));padding-bottom:calc(6px + var(--safe-bottom));padding-left:calc(12px + var(--safe-left));padding-right:calc(12px + var(--safe-right))}
  .top-row{padding-bottom:5px}
  .top-row h1{font-size:25px}
  .game-footer{padding-top:10px}
  .tools .tool{height:88px;width:78px}
  .tools .tool-lock{width:32px;height:32px;right:-8px;top:-10px}
  .footer-links{margin-top:12px}
  .stage-meta{margin:0 0 4px}
  .progress-row{margin:6px auto 3px}
  .gate{padding:10px 12px 8px;padding-top:calc(10px + var(--safe-top));padding-bottom:calc(8px + var(--safe-bottom));padding-left:calc(12px + var(--safe-left));padding-right:calc(12px + var(--safe-right))}
  .demo-heading{padding-bottom:9px}
  .demo-heading h1{font-size:38px;margin-bottom:4px}
  .demo-heading p{font-size:11px;letter-spacing:2px}
  .demo-player{border-radius:21px}
  .demo-footer{padding-top:11px}
  .demo-footer .demo-start{font-size:24px;min-height:47px;padding:7px 12px}
  .demo-footer p{margin:7px 0 4px;font-size:11px}
  .demo-guide{padding:5px 15px;min-height:29px}
  .guide-panel{padding:13px 14px 10px}
  .guide-panel h2{font-size:22px;margin:6px 0 4px}
  .guide-panel .subtitle{margin:2px 0 7px;font-size:11px}
  .guide-copy{font-size:11px}
}
@media(max-width:374px){
  .top-row h1{font-size:24px}
  .tools .tool{width:78px}
  .footer-links{font-size:9px}
  .footer-links button{padding:5px 7px}
}

/* Locale controls stay in the document flow; the board uses the remaining space. */
.locale-row{display:flex;align-items:center;justify-content:center;min-height:32px;margin:0 0 5px;color:#3e6822;font-size:14px}
.locale-row>span{margin:0 5px}
.language-select{font:inherit;font-size:16px;line-height:1.3;max-width:220px;min-width:115px;height:32px;border:1px solid #e8ffc1;border-radius:18px;background:#f4ffde;color:#355b1c;padding:2px 10px;cursor:pointer;direction:ltr}
.language-select option{font-size:16px}
.demo-heading{width:100%;padding-bottom:10px}
.demo-heading h1{font-size:36px;line-height:1.2;letter-spacing:0;overflow-wrap:break-word}
.demo-heading p{letter-spacing:0;font-size:12px;line-height:1.4}
.demo-player{min-height:85px}
.demo-badge{max-width:48%;font-size:10px;padding:6px 8px}
.demo-badge b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.demo-toggle{max-width:45%;font-size:11px;line-height:1.3}
.demo-caption{font-size:12px;line-height:1.4}
.demo-footer .demo-start{font-size:24px;line-height:1.2;min-height:48px}
.demo-footer p{font-size:11px;line-height:1.4}
.demo-guide{max-width:100%;font-size:12px;min-height:36px;line-height:1.3}
.demo-guide span{margin:0}
.game-header .locale-row{margin:0 0 4px;min-height:30px}
.game-header .language-select{height:30px}
.top-row h1{font-size:24px;line-height:1.15;letter-spacing:0;white-space:normal;overflow-wrap:break-word}
.stage-meta{flex-wrap:wrap;font-size:9px;line-height:1.35;text-align:center}
.stage-meta b{font-weight:700}
.stage-meta>span{max-width:100%}
.stage-meta>span+span{margin-left:6px}
.board-hint{font-size:11px;line-height:1.3;padding:0 4px}
.selection-mode{white-space:normal;width:90%;font-size:12px;text-align:center;line-height:1.35}
.tools{align-items:stretch}
.tools .tool{height:auto;min-height:110px;padding:3px 5px 6px;width:92px;flex:none}
.tool-icon{height:42px;flex:none;transform:scale(.83);transform-origin:center bottom}
.tool strong{font-size:15px;line-height:1.15;width:100%;overflow-wrap:break-word}
.tools .tool small{font-size:10px;line-height:1.2;white-space:normal;margin-top:3px;max-width:100%;overflow-wrap:break-word}
.tools .tool i{width:24px}
.footer-links{font-size:9px;line-height:1.3;text-align:center}
.footer-links>span{max-width:47%;padding:0 4px}
.footer-links button{font-size:10px;max-width:27%;min-height:30px;line-height:1.2}
.guide-panel h2{font-size:23px;line-height:1.25;overflow-wrap:break-word}
.guide-panel .subtitle{font-size:12px;line-height:1.4}
.guide-copy{line-height:1.4;white-space:normal}
.safari-guide-animation{max-height:calc(var(--app-height,100vh) - 340px - var(--safe-top) - var(--safe-bottom))}
.modal h2,.modal p,.modal button{overflow-wrap:break-word}
.standard-panel #modal-text{line-height:1.55;text-align:start}
.modal .gold-button{font-size:20px;line-height:1.25}
.modal .secondary{font-size:15px;line-height:1.3}
#copy-url{font-size:16px;direction:ltr}
.toast{width:auto;min-width:180px;line-height:1.4}
[dir=rtl] .guide-panel .modal-x{right:auto;left:4px}
[dir=rtl] .stage-meta>span+span{margin-left:0;margin-right:6px}
/* The game board and reference menu retain their physical directions in RTL. */
#board,.safari-guide-animation{direction:ltr}
@media(max-height:650px){
  .locale-row{margin-bottom:3px;min-height:30px}
  .demo-heading h1{font-size:29px;margin-bottom:3px}
  .demo-heading p{font-size:11px}
  .demo-heading{padding-bottom:7px}
  .demo-footer{padding-top:8px}
  .demo-footer .demo-start{font-size:22px;min-height:45px}
  .demo-footer p{margin:5px 0 3px;font-size:10px}
  .demo-guide{min-height:30px;font-size:11px}
  .game-header .locale-row{min-height:28px;margin-bottom:2px}
  .game-header .language-select{height:28px}
  .top-row h1{font-size:21px}
  .tools .tool{min-height:94px;width:82px;padding:2px 4px 5px}
  .tool-icon{height:31px;transform:scale(.68)}
  .tool strong{font-size:13px}
  .tools .tool small{font-size:9px;line-height:1.15}
  .game-footer{padding-top:9px}
  .footer-links{margin-top:11px;font-size:8px}
  .footer-links button{font-size:9px}
  .guide-panel h2{font-size:21px}
  .guide-panel .subtitle{font-size:11px}
  .guide-copy{font-size:11px}
}
