:root{color-scheme:dark;font-family:Arial,sans-serif;background:#100b0b;color:#f8e7db}*{box-sizing:border-box}body{margin:0;min-height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}header{display:flex;align-items:center;gap:14px;padding:12px 18px;border-bottom:1px solid #60303a;background:#211014}header strong{color:#ff586f;font:bold italic 25px Georgia,serif;text-shadow:0 0 15px #ff003d70}header span{color:#bda9a0;font-size:12px}header button{margin-left:auto}main{max-width:1000px;margin:auto;padding:10px}button,input{font:inherit;min-height:42px;border:1px solid #80504d;border-radius:5px;padding:8px 12px;background:#30181b;color:#ffece1}button{cursor:pointer;touch-action:manipulation}button:hover{background:#4b2229}button:disabled{opacity:.55;cursor:wait}input{background:#170f10;width:100%;font-size:16px}#status{font-size:13px;line-height:1.5;color:#dcc3b7;margin:0 0 12px}#start{display:block;margin:10px auto 18px;background:#962737}form{max-width:580px;margin:12px auto;display:flex;align-items:end;gap:10px}form[hidden],[hidden]{display:none!important}label{font-size:12px;color:#dcc3b7;flex:1}label input{display:block;margin-top:5px}#viewport{position:relative;margin:0 auto;overflow:hidden;background:#000;border:1px solid #5f3038;min-height:120px}#surface{position:absolute;width:765px;height:503px;transform-origin:top left}#display,#touch{position:absolute;inset:0;width:765px;height:503px}#touch{z-index:10000;touch-action:none}#controls{display:flex;justify-content:center;flex-wrap:wrap;gap:7px;margin:9px 0}#controls button{min-width:45px}#controls button[aria-pressed=true]{background:#a32e40}#typing input{flex:1}footer,.hint{font-size:11px;color:#ac9690;text-align:center;line-height:1.5}footer{padding:10px}footer a{color:#d9a9ad}body:fullscreen{background:#100b0b;overflow:auto}body:fullscreen header{padding:4px 10px}body:fullscreen .hint,body:fullscreen footer{display:none}@media(max-width:520px){header{padding:8px 10px;gap:9px}header strong{font-size:22px}header span{max-width:70px}main{padding:7px}#login{display:grid;grid-template-columns:1fr 1fr}#login button{grid-column:1/-1}#controls{gap:4px}#controls button{padding:6px 9px;font-size:13px}}

body.playing{overscroll-behavior:none}
#login{flex-wrap:wrap}#login-help{flex-basis:100%;margin:0;color:#dcc3b7;font-size:13px;line-height:1.5}@media(max-width:520px){#login-help{grid-column:1/-1}}
#home-shortcut{display:block;margin:8px auto;font-size:13px;min-height:36px}#home-help{max-width:580px;margin:8px auto;color:#dcc3b7;font-size:13px;line-height:1.6}
body.playing #home-shortcut,body.playing #home-help{display:none}
#surface,#display,#touch{width:100%;height:100%}
body.compact-game header,body.compact-game footer,body.compact-game .hint{display:none}
body.compact-game main{display:grid;grid-template-columns:minmax(0,1fr) 90px;grid-template-rows:24px auto;gap:0 8px;max-width:none;padding:4px;align-items:center}
body.compact-game #status{grid-column:1/-1;grid-row:1;font-size:11px;margin:0;line-height:20px}
body.compact-game #viewport{grid-column:1;grid-row:2;min-height:0;border:0}
body.compact-game #controls{grid-column:2;grid-row:2;display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0;align-content:center;max-height:calc(100dvh - 42px);overflow:auto}
body.compact-game #controls button{min-width:0;min-height:34px;padding:4px;font-size:12px}
body.compact-game #controls #keyboard,body.compact-game #controls #options,body.compact-game #controls #fullscreen{grid-column:1/-1}
body.compact-game #typing{grid-column:1/-1;grid-row:3;margin:4px 0;max-width:none;width:100%}

#typing{position:fixed;z-index:20000;max-width:580px;margin:0;display:flex;align-items:center;gap:5px;padding:6px;border:1px solid #9b6c4b;border-radius:4px;background:#2b211cef;box-shadow:0 2px 12px #000a}
#typing input{min-width:0;flex:1;min-height:40px;background:#17120f;border-color:#745b45;font-size:16px;color:#a8ffff}
#typing button{flex:none;min-height:40px;padding:6px 10px;background:#4b3529;border-color:#886344}
#chat-close{font-size:22px;line-height:1}
#chat-status{position:absolute;bottom:100%;left:0;width:100%;color:#ffe0b0;background:#211611;font-size:12px;padding:4px}
#chat-status:empty{display:none}
body.compact-game #typing{position:fixed;margin:0;width:auto;max-width:580px}

/* The native fields are inside the game, above its canvas, so Android/iOS open their own keyboard. */
#game-login{position:absolute;z-index:15000;left:50%;top:50%;transform:translate(-50%,-50%);width:min(92%,360px);max-height:100%;overflow:auto;display:grid;gap:5px;margin:0;padding:10px 14px;background:#201713f5;border:1px solid #b0824a;box-shadow:0 4px 24px #000;color:#ffedcf;border-radius:8px}
#game-login strong{text-align:center;color:#f8ca81;font-size:17px}#game-login label{font-size:12px}#game-login input{margin-top:2px;min-height:40px;font-size:16px;padding:5px 9px;touch-action:manipulation}#game-enter{min-height:40px;background:#723522;border-color:#cf9b57;font-weight:bold}#game-login small{font-size:11px;line-height:1.3;color:#ddc5aa;text-align:center}
@media(orientation:landscape) and (max-height:600px){#game-login{grid-template-columns:1fr 1fr;gap:6px;width:min(92%,460px)}#game-login strong,#game-login button,#game-login small{grid-column:1/-1}}
