
@font-face{font-family:ShodoMincho;src:url("../../assets/fonts/mincho.woff2") format("woff2")}
@font-face{font-family:ShodoGothic;src:url("../../assets/fonts/gothic.woff2") format("woff2")}
@font-face{font-family:ShodoHand;src:url("../../assets/fonts/handwritten.woff2") format("woff2")}
@font-face{font-family:ShodoPop;src:url("../../assets/fonts/pop.woff2") format("woff2")}
#current.multi{font-size:14px}
#guide-font{margin-left:6px;font:inherit}
*{box-sizing:border-box}
.game{position:relative;isolation:isolate;overflow:hidden;line-height:normal}
.game-standalone{position:fixed;inset:0;background:#2b2622;color:#eef8ff;font:16px system-ui,sans-serif;isolation:isolate}
.desk{position:absolute;inset:0}
#surface{position:absolute;inset:0;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
#surface canvas{display:block;width:100%;height:100%;cursor:crosshair;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
#paper,[hidden]{display:none!important}
.brand,#picker,#finish,#message{position:absolute;z-index:1}
.brand{top:max(16px,env(safe-area-inset-top));left:16px;color:#d9eeff;text-decoration:none;font-weight:900;text-shadow:0 2px 5px #081522}
#picker{top:max(16px,env(safe-area-inset-top));right:16px;text-align:right}
#picker summary{list-style:none;cursor:pointer;margin-left:auto;width:46px;height:46px;display:grid;place-items:center;border-radius:50%;background:#191612dc;border:1px solid #796c60;font:24px "Yu Mincho",serif}
#picker summary::-webkit-details-marker{display:none}
#choices{margin-top:8px;padding:10px;max-width:calc(100vw - 32px);border:1px solid #796b5d;border-radius:15px 5px 15px 15px;background:#221c18ee}
#presets{display:flex;justify-content:space-between;gap:4px}
#presets button{min-width:40px;padding:6px;font:21px "Yu Mincho",serif}
#custom{display:flex;gap:6px;margin:8px 0}
#word{width:145px;min-width:0;border:1px solid #6588a7;border-radius:6px;padding:7px;font:inherit}
#guide-row{font-size:13px;color:#d3eaff}
:is(.game,.game-standalone) button{font:inherit;padding:8px 14px;border:1px solid #84766a;border-radius:22px;background:#4c423a;color:#effaff;cursor:pointer}
:is(.game,.game-standalone) button[aria-pressed="true"],#again{background:#f6f2e8;color:#2b2622}
:is(.game,.game-standalone) button:disabled{opacity:.55}
:is(.game,.game-standalone) :focus-visible{outline:2px solid #f6f2e8;outline-offset:3px}
#finish{bottom:max(16px,env(safe-area-inset-bottom));left:50%;translate:-50% 0;min-width:160px;height:54px;font-weight:800;font-size:20px;background:#191612dc}
#message{bottom:80px;left:50%;translate:-50% 0;width:max-content;max-width:90vw;text-align:center;color:#dcefff;font-size:13px;pointer-events:none;text-shadow:0 2px 6px #000}
#ink{position:absolute;bottom:20px;right:16px;width:min(76px,15vw);accent-color:#cb3a2b;pointer-events:none}
#ending{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px 16px max(20px,env(safe-area-inset-bottom));background:#2b2622}
#result{margin:0;font-size:clamp(23px,5vw,38px);font-weight:900;color:#f6f2e8}
#art-frame{flex:1;min-height:0;display:grid;place-items:center;width:100%}
#art{display:block;max-width:100%;max-height:100%;object-fit:contain}
#art-frame{position:relative;overflow:hidden}
#ending:not([hidden]) #art{animation:paper-in .32s ease-out both}
#ending:not([hidden]) #actions{animation:paper-in .28s .75s ease-out both}
@keyframes paper-in{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){#ending:not([hidden]) #art,#ending:not([hidden]) #actions{animation:none}}
#feedback{margin:0;text-align:center;color:#d8edff;font-size:13px}
#actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}
#actions button{min-width:120px;height:48px;font-weight:800}


/* Make the handwritten battle the primary result action. */
#ending #actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:min(100%,480px);gap:10px}
#ending #actions>button,#ending #actions>.game-x-share{min-width:0;width:100%;padding:8px 6px;font-size:14px}
#ending #actions #battle{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;height:auto;min-height:78px;padding:14px 20px;border:2px solid #f0a17a;border-radius:12px;background:#b62821;color:#fff8ed;box-shadow:0 4px 0 #661b18;text-align:left}
#battle .battle-cta-copy{display:grid;gap:4px}
#battle strong{font-size:clamp(18px,4.5vw,22px);line-height:1.35;font-weight:900}
#battle small{font-size:12px;line-height:1.5;font-weight:500;color:#ffe5cf}
#battle .battle-cta-arrow{flex:none;font-size:30px;line-height:1}
#ending #actions #battle:hover{background:#ca3529}
#ending #actions #battle:focus-visible{outline:3px solid #fff8ed;outline-offset:4px}
@media(max-height:500px){#ending #actions #battle{min-height:62px;padding:9px 14px}#battle strong{font-size:18px}}
