*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#fff8e9;color:#52382b;font-family:ui-rounded,"Trebuchet MS","Microsoft YaHei",sans-serif}body{padding:10px;background:radial-gradient(ellipse at top,#ffe7ce,transparent 65%),#fff8e9}button,input{font:inherit}button{border:solid transparent;border-width:15px 22px;border-image:url('../button.png') 60 80 60 80 fill / 15px 22px / 0 stretch;background:none;color:#52382b;font-weight:800;min-height:48px;cursor:pointer;line-height:1.25;padding:0 9px;transition:filter .12s,transform .12s;overflow-wrap:anywhere}button.primary{border-image-source:url('../primary.png');color:#613421}button:hover:not(:disabled){border-image-source:url('../hover.png');color:#52382b;filter:brightness(1.02)}button:active:not(:disabled){border-image-source:url('../pressed.png');transform:translateY(1px)}button:focus-visible{outline:none;filter:drop-shadow(0 0 2px #6753ad) drop-shadow(0 0 1px #6753ad)}input:focus-visible{outline:2px solid #6753ad;outline-offset:2px}button:disabled{opacity:.52;cursor:default}button.icon{min-width:45px;font-size:23px;border-width:12px;padding:0;min-height:43px}.panel,#game{border:solid transparent;border-width:21px;border-image:url('../panel.png') 60 fill / 21px / 0 stretch;background:none}#game{position:relative;max-width:680px;margin:auto;padding:0 9px 6px;outline:none}header{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:57px}.logo{width:210px;max-width:65%;height:auto;display:block}.tools{display:flex;gap:5px}.garden-label{text-align:center;font-size:13px;min-height:18px;color:#876546;font-weight:700}#hud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:5px 0 9px}#hud>div{border:solid transparent;border-width:10px 16px;border-image:url('../hud.png') 50 75 50 75 fill / 10px 16px / 0 stretch;text-align:center;padding:0 2px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;min-height:40px}#hud strong{font-size:16px;white-space:nowrap}#arena{width:min(100%,calc(100svh - 350px));min-width:220px;aspect-ratio:1;margin:auto;border-radius:23px;overflow:hidden;touch-action:none;background:url('../arena.webp') center/contain no-repeat}canvas{display:block!important}#hint{font-size:13px;text-align:center;line-height:1.5;min-height:39px;margin:6px 0 0}.aim-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.aim-row label{display:grid;grid-template-columns:1fr auto;font-size:12px;font-weight:700;gap:3px}.aim-row input{grid-column:1/-1}input[type=range]{appearance:none;width:100%;height:21px;background:none;border:solid transparent;border-width:6px 12px;border-image:url('../track.png') 35 60 fill / 6px 12px / 0 stretch;cursor:pointer;margin:3px 0 8px}input[type=range]::-webkit-slider-thumb{appearance:none;width:23px;height:23px;border:0;background:url('../badge.png') center/contain}input[type=range]::-moz-range-thumb{width:23px;height:23px;border:0;background:url('../badge.png') center/contain}.actions{display:grid;grid-template-columns:1fr 1.25fr 1fr;gap:6px}.actions button{font-size:14px;padding:0 2px}#overlay{position:absolute;inset:0;z-index:5;border-radius:22px;background:#71533a40;display:grid;place-items:center;padding:14px;backdrop-filter:blur(3px)}#overlay[hidden]{display:none}#sheet{width:100%;max-width:480px;max-height:100%;overflow-y:auto;overscroll-behavior:contain;text-align:center;padding:12px 10px 16px}#sheet h1,#sheet h2{font-size:clamp(23px,4vw,32px);margin:5px 0 12px;color:#633f2f}#sheet p{font-size:14px;line-height:1.65;margin:9px 0}#sheet button{margin:4px 2px;max-width:100%;min-width:110px}.sheet-logo{width:min(100%,300px);height:auto}.hero{height:120px;display:flex;justify-content:center;align-items:center;gap:8px}.hero img{width:auto;height:110px;object-fit:contain}.hero img.small{height:70px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}#sheet .grid button{min-width:0;width:100%;margin:0;min-height:70px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:12px;border-width:13px 16px;padding:3px}.grid b{font-size:18px}.grid small{font-size:11px}.settings label{display:block;text-align:start;font-weight:700;margin:20px 8px}.settings input{display:block;margin-top:12px}.loading-track{border:solid transparent;border-width:8px 16px;border-image:url('../track.png') 35 60 fill / 8px 16px / 0 stretch;height:30px;margin:14px auto;max-width:270px}.loading-fill{height:100%;width:0;background:url('../fill.png') center/100% 100%;border-radius:9px}.result-badge{width:80px;height:80px;object-fit:contain}.result-stars{font-size:32px;color:#ab7e23;letter-spacing:6px}.muted{color:#876c52;font-size:12px!important}@media(max-width:420px){body{padding:3px}#game{border-width:16px;border-image-width:16px;padding:0 3px 3px}.logo{width:176px}#hud{gap:3px}#hud>div{flex-direction:column;gap:1px;border-width:8px 10px;border-image-width:8px 10px;font-size:11px}#hud strong{font-size:15px}#arena{width:min(100%,calc(100svh - 370px));min-width:220px}#hint{font-size:12px;min-height:36px}.actions button{font-size:12px;border-width:14px 13px;border-image-width:14px 13px}#sheet{border-width:16px;border-image-width:16px;padding:6px}#overlay{padding:8px}.hero{height:90px}.hero img{height:85px}.hero img.small{height:55px}#sheet p{font-size:12px}#sheet .grid button{font-size:11px}}@media(prefers-reduced-motion:reduce){button{transition:none}}

input[type=range]{direction:ltr}@media(max-width:340px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-height:500px) and (min-width:600px){body{padding:3px}#game{max-width:820px;display:grid;grid-template-columns:minmax(220px,1fr) 260px;grid-template-rows:44px 18px auto auto auto auto;column-gap:18px;border-width:14px;border-image-width:14px;padding:0 6px 5px}header{grid-column:1/-1;min-height:44px}.logo{width:170px}.garden-label{grid-column:1/-1}#arena{grid-column:1;grid-row:3/7;width:min(100%,calc(100svh - 110px));min-width:220px}#hud{grid-column:2;grid-row:3;margin:4px 0;gap:3px}#hud>div{flex-direction:column;gap:2px;padding:0;font-size:10px;border-width:7px;border-image-width:7px}#hud strong{font-size:14px}#hint{grid-column:2;grid-row:4;min-height:0;font-size:12px;margin:5px 0}.aim-row{grid-column:2;grid-row:5;gap:10px}.actions{grid-column:2;grid-row:6;gap:3px}.actions button{font-size:11px;border-width:12px 8px;border-image-width:12px 8px;min-height:46px}#sheet{max-width:500px;padding:5px 10px}#sheet h1,#sheet h2{font-size:22px}#sheet .hero{display:none}#sheet p{font-size:12px;margin:7px 0}.sheet-logo{width:180px}#sheet .grid{grid-template-columns:repeat(4,minmax(0,1fr))}#sheet .grid button{min-height:58px;font-size:10px}}

#hud strong,.aim-row output{direction:ltr;unicode-bidi:isolate}#hud strong{display:inline-block}

.grid span{overflow-wrap:normal;hyphens:auto}html:not(:lang(zh)):not(:lang(tw)):not(:lang(ja)):not(:lang(ko)) .grid{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-height:500px) and (min-width:600px){html:not(:lang(zh)):not(:lang(tw)):not(:lang(ja)):not(:lang(ko)) .grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.result-stars img{width:32px;height:32px;object-fit:contain;margin:0 3px}

/* Source corners are 80×60: every button family uses one uniform 1:5 scale. */
button,button.icon,.actions button,#sheet .grid button{border-width:12px 16px;border-image-width:12px 16px}
button.icon{min-width:48px;min-height:48px}
#hud>div{border-width:10px 15px;border-image-width:10px 15px}
input[type=range]{border-width:7px 12px;border-image-width:7px 12px}
@media(max-width:420px){#hud>div{border-width:8px 12px;border-image-width:8px 12px}}
@media(max-height:500px) and (min-width:600px){#hud>div{border-width:6px 9px;border-image-width:6px 9px}.actions button{border-width:9px 12px;border-image-width:9px 12px}}

.logo{max-width:calc(100% - 112px)}.tools{flex-shrink:0}.tools .icon{width:48px;flex:0 0 48px;font-size:20px;border-width:9px 12px;border-image-width:9px 12px}.actions button{padding-inline:0}

.loading-fill{background:none;border:solid transparent;border-width:4px 7px;border-image:url('../fill.png') 35 60 fill / 4px 7px / 0 stretch;min-width:14px}

.loading-track{border-width:7px 12px;border-image-width:7px 12px}.loading-fill{border-width:4px 6.857px;border-image-width:4px 6.857px}
