*{box-sizing:border-box;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html,body,main{width:100%;height:100%;margin:0;overflow:hidden}body{background:#fffefa;color:#363632;font:24px/1.4 'Gaegu',sans-serif}button,a{font:inherit;color:inherit;touch-action:manipulation;cursor:pointer}button{border:1px solid #77736c;background:#fffefa;padding:9px 18px;min-height:48px}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:2px solid #008e8d;outline-offset:4px}[hidden]{display:none!important}.screen{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:30px 22px;gap:22px;text-align:center;overflow:auto}p,h1,h2{margin:0;word-break:keep-all}h1{font-size:32px;font-weight:400}.title-art{width:min(620px,90%);height:auto;max-height:30vh;object-fit:contain}.intro-friends{display:flex;align-items:center;gap:40px;height:100px;margin-top:26px}.intro-friends img{width:70px;max-height:95px;object-fit:contain}.intro-friends img:first-child{width:100px}.intro-actions a{background:#fffefa;border:1px solid #77736c}.intro-actions button,.intro-actions a{clip-path:none!important;font:22px/1.2 'Gaegu',sans-serif!important;min-height:58px!important}.choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;width:min(760px,100%)}.choices button{display:flex;flex-direction:column;align-items:center;gap:18px;padding:16px 8px;border:1px solid #d3cfc5;background:transparent}.choices img{width:100%;height:115px;object-fit:contain}.choices button:hover{border-color:#008e8d;background:#f4faf5}.quiet{border:0;background:none;font-size:18px;text-decoration:underline;text-underline-offset:5px}.screen>.quiet{position:absolute;top:16px;left:16px}#play,#world{position:absolute;inset:0;width:100%;height:100%}#world{touch-action:none;outline:none}.score{position:absolute;left:20px;right:20px;top:16px;display:flex;gap:26px;align-items:flex-start;pointer-events:none}.score>div{display:flex;flex-direction:column}.score span{font-size:17px}.score strong{font-size:34px;line-height:1.1;font-weight:400}.score button{pointer-events:auto;margin-left:auto;font-size:18px;padding:7px 13px}#equation{position:absolute;left:20px;right:20px;top:93px;font-size:26px;min-height:38px}#tip{position:absolute;top:140px;left:20px;right:20px;font-size:19px;color:#58584e}.controls{position:absolute;left:16px;right:16px;bottom:52px;display:flex;justify-content:space-between;pointer-events:none}.controls>div{display:flex;gap:12px}.controls button{pointer-events:auto;border-radius:50%;width:62px;height:62px;padding:14px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0;background:#fffefaed;touch-action:none}.controls svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}.controls span{font:13px/1 'Gaegu',sans-serif}.actions{position:absolute;bottom:5px;left:0;right:0;display:flex;justify-content:center;gap:18px}.actions button{border:0;font-size:16px;background:transparent;padding:7px}.overlay{position:absolute;inset:0;background:#fffefaab;display:grid;place-items:center;padding:24px}.result{width:min(410px,100%);padding:30px 24px;background:#fffefa;border:1px solid #6b6962;text-align:center;display:flex;flex-direction:column;gap:18px}.result h2{font-size:35px;font-weight:400}.result p{font-size:22px}.result>button{font-size:23px}#result-title{color:#00827f}@media(max-width:600px){.choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.choices img{height:85px}.choices button{padding:12px 5px;gap:10px}.screen{gap:18px}.intro-actions button,.intro-actions a{font-size:18px!important}.score{gap:20px;left:16px;right:16px}.score strong{font-size:30px}.score span{font-size:16px}#equation{left:16px;top:90px;font-size:24px}#tip{left:16px;top:130px;font-size:18px}}@media(max-height:430px){.screen{padding:16px;gap:10px}.intro-friends{display:none}.choices img{height:68px}.choices{gap:8px}.score{top:8px}.score strong{font-size:26px}.score span{font-size:13px}#equation{top:65px;font-size:21px}#tip{top:102px;font-size:16px}.controls{bottom:37px}.controls button{width:48px;height:48px;padding:10px}.actions button{font-size:14px;min-height:30px}.result{gap:10px;padding:18px}.result h2{font-size:28px}}

/* Reserve actual canvas space for the HUD and controls, in every aspect ratio. */
#world{top:176px;bottom:132px;height:calc(100% - 308px)}
.score{gap:12px;align-items:center}.score>div{min-width:124px;padding:8px 18px;border:2px solid #268fbd;text-align:center}.score .goal-box{background:#edf8fc;color:#166182}.score .total-box{background:#166182;color:#fff}.score strong{font-size:38px;font-weight:700}.score span{font-size:18px}#stage-number{margin-left:6px;font-size:17px}#equation{top:111px;font-size:25px}#tip{top:148px;font-size:18px}
@media(max-width:600px){.score{gap:8px}.score>div{min-width:104px;padding:7px 10px}.score span{font-size:16px}.score strong{font-size:34px}#stage-number{position:absolute;top:89px;right:0;font-size:15px}.score button{padding:7px 10px}#equation{top:106px;font-size:24px}#tip{top:143px;font-size:17px}}
@media(max-height:430px){#world{top:112px;bottom:86px;height:calc(100% - 198px)}.score>div{min-width:115px;padding:3px 12px}.score strong{font-size:28px}.score span{font-size:15px}#stage-number{position:static;font-size:15px}#equation{top:71px;font-size:21px}#tip{top:99px;font-size:15px}.controls{bottom:33px}}

/* A slightly uneven, thin marker frame, shared by the game's UI. */
:root{--pen-frame:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M3 4 Q49 2 97 3 L96 97 Q50 95 3 97 L4 3' fill='none' stroke='%23363632' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
button,.intro-actions a,.choices button,.result,.score>div,.game-help{border:5px solid transparent;border-image:var(--pen-frame) 8 stretch}.score>div{border-width:5px;padding:5px 15px}.score .total-box{color:#166182;background:#d8f0f9}.score .goal-box{background:#fffefa;color:#363632}.controls button{border:0;border-image:none;border-radius:0;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M31 3 C48 2 62 17 60 33 C60 49 47 61 30 60 C13 62 2 47 3 31 C2 15 16 2 33 3' fill='%23fffefa' fill-opacity='.95' stroke='%23363632' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat}.quiet,.actions button{border:0;border-image:none}.choices button:hover{background:#edf8fc}.score button{padding:4px 10px}.intro-actions button,.intro-actions a{border-image:var(--pen-frame) 8 stretch!important}
@media(max-width:600px){.score>div{padding:4px 7px}}@media(max-height:430px){.score>div{padding:0 9px}}
