@font-face{font-family:Bangkok;src:url('../assets/BeVietnamPro-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Bangkok;src:url('../assets/BeVietnamPro-SemiBold.ttf') format('truetype');font-weight:600 800;font-display:swap}
@font-face{font-family:BangkokThai;src:url('../assets/NotoSansThai-Variable.ttf') format('truetype');font-weight:100 900;font-display:swap}
@font-face{font-family:BangkokLao;src:url('../assets/saysettha_ot.ttf') format('truetype');font-weight:400;font-display:swap}
:root{color-scheme:dark;font-family:Bangkok,system-ui,sans-serif;color:#f2e9d4;background:#080706;font-synthesis:none;--gold:#e8c677;--line:rgba(215,174,92,.4)}
*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden}button,select,a{-webkit-tap-highlight-color:transparent}button,select{font:inherit}button,a,select{touch-action:manipulation}button,a{outline-offset:4px}button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid #ffe5a4}button{cursor:pointer}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round;flex-shrink:0}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html[lang=th]{font-family:BangkokThai,Bangkok,system-ui,sans-serif}html[lang=lo]{font-family:BangkokLao,Bangkok,system-ui,sans-serif}
html,body{overscroll-behavior:none}#game{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;min-width:0;min-height:0}.is-fullscreen #game{height:100%}
#runtime{position:absolute;inset:0;background:#080706}#runtime iframe{display:block;width:100%;height:100%;border:0;background:#080706}.screen{position:absolute;inset:0;z-index:2;display:grid;place-items:end center;background:#080706}.poster,.shade{position:absolute;inset:0}.poster{background:linear-gradient(0deg,rgba(8,7,6,.2),rgba(8,7,6,.1)),url('../assets/poster.png') center 38%/cover no-repeat}.shade{background:linear-gradient(180deg,rgba(8,7,6,.12) 30%,rgba(8,7,6,.7) 70%,#080706 100%)}.loading-card{position:relative;z-index:1;text-align:center;width:min(90%,540px);margin:0 0 max(5vh,30px);text-shadow:0 2px 15px #000}.eyebrow{font-size:10px;letter-spacing:.3em;font-weight:600;color:#d5b773;margin:0 0 10px}h1{font-size:clamp(29px,4vw,48px);font-weight:600;line-height:1.25;letter-spacing:.04em;margin:0;color:#fff3d3}h1 span{color:var(--gold)}.mode-label{font-size:12px;color:#c3b38f;margin:11px 0 22px}.progress{height:5px;background:#211b11;border:1px solid rgba(226,186,104,.25);border-radius:10px;overflow:hidden;width:100%}.progress>span{height:100%;display:block;width:0;background:linear-gradient(90deg,#8c6329,#f0d58e);box-shadow:0 0 15px #d9ae64;transition:width .22s linear}.progress.indeterminate>span{width:32%;animation:loading 1.8s ease-in-out infinite}.loading-status{font-size:13px;line-height:1.6;color:#f5d58e;margin:14px 0 0}.loading-note{font-size:11px;color:#b6a889;line-height:1.8;margin:8px auto 0;max-width:430px}
.toolbar{position:absolute;z-index:5;top:0;left:0;right:0;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;gap:16px;pointer-events:none;background:linear-gradient(180deg,rgba(8,7,6,.76),transparent)}.toolbar>*{pointer-events:auto}.brand{font-size:12px;font-weight:600;text-decoration:none;letter-spacing:.07em;color:#e7c77f;white-space:nowrap;line-height:36px}.brand span{color:#eddfc2}.controls{display:flex;align-items:center;gap:7px}.icon-button,.language-control,.mode-switch{display:flex;align-items:center;height:37px;border:1px solid var(--line);border-radius:7px;background:rgba(17,13,8,.83);color:#f1dec0;box-shadow:0 2px 12px rgba(0,0,0,.2)}.icon-button{justify-content:center;width:38px;padding:7px}.icon-button:hover,.language-control:hover{background:#302315;border-color:#e0bb6f}.language-control{position:relative;padding-left:9px;gap:1px}.language-control svg{width:17px}.language-control select{height:35px;appearance:none;border:0;background:transparent;color:#f1dec0;font-size:11px;font-weight:600;width:34px;padding:0 7px;cursor:pointer}.language-control option{background:#1a140e}.mode-switch{padding:3px;gap:2px}.mode-switch button{display:flex;align-items:center;justify-content:center;gap:5px;height:29px;padding:0 9px;background:transparent;border:0;border-radius:4px;color:#b8a990;font-size:10px;font-weight:600;white-space:nowrap}.mode-switch button svg{width:15px;height:15px}.mode-switch button[aria-pressed=true]{background:linear-gradient(180deg,#d9b66a,#a87e3b);color:#1b1207;box-shadow:0 1px 5px #0006}.mode-switch button:hover:not([aria-pressed=true]){background:#302315;color:#f3dfbb}.status-badge{position:absolute;top:max(14px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);font-size:10px;line-height:1.4;text-align:center;color:#ead09b;border:1px solid var(--line);border-radius:20px;padding:5px 12px;background:rgba(19,14,8,.88);max-width:33vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.is-ready .status-badge{display:none}.is-ready .toolbar{background:linear-gradient(180deg,rgba(8,7,6,.38),transparent)}
.error-screen{position:absolute;inset:0;z-index:4;background:rgba(6,5,4,.86);display:grid;place-items:center;padding:80px 20px 30px;backdrop-filter:blur(8px)}.error-card{width:min(100%,520px);padding:36px 30px;border:1px solid var(--line);background:linear-gradient(135deg,#22190f,#100d09);border-radius:12px;box-shadow:0 25px 90px #0008;text-align:center}.error-card h2{font-weight:600;font-size:23px;line-height:1.5;margin:8px 0 14px;color:#f2dab0}.error-card>p:not(.eyebrow){font-size:13px;line-height:1.9;color:#c8baa1;overflow-wrap:anywhere}.error-actions{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap;margin-top:25px}.gold-button,.plain-button{font-size:12px;font-weight:600;border-radius:6px;padding:11px 17px;text-decoration:none;line-height:1.5}.gold-button{color:#1a1106;border:1px solid #edcf8e;background:linear-gradient(#e8c77c,#b48a40)}.plain-button{color:#e0cb9d;border:1px solid #6d5632;background:#19130b}.toast{position:absolute;z-index:8;bottom:max(25px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);margin:0;padding:12px 18px;max-width:min(90vw,550px);font-size:12px;line-height:1.6;text-align:center;border:1px solid var(--line);border-radius:8px;background:#1d160eef;box-shadow:0 5px 30px #0008}.noscript{position:fixed;z-index:10;inset:0;display:grid;place-items:center;padding:30px;background:#100d09;color:#ebd4a1;text-align:center}
@keyframes loading{0%{transform:translateX(-100%)}100%{transform:translateX(420%)}}
@media(max-width:850px){.toolbar{gap:8px;padding-left:max(12px,env(safe-area-inset-left))}.brand{font-size:10px}.status-badge{top:58px;max-width:90vw}.controls{gap:5px}.loading-card{margin-bottom:max(5vh,20px)}.loading-note{font-size:10px}}
@media(max-width:440px){.brand{font-size:9px;letter-spacing:0}.brand span{display:none}.mode-switch button{padding:0 7px}.mode-switch button svg{display:none}.icon-button{width:33px}.controls{gap:4px}.loading-card{width:86%;margin-bottom:7vh}.poster{background-position:50% 35%}.error-card{padding:28px 18px}.error-card h2{font-size:21px}}
@media(max-height:500px){.loading-card{margin-bottom:18px}h1{font-size:25px}.eyebrow{font-size:9px;margin-bottom:5px}.mode-label{margin:5px 0 12px}.loading-status{margin-top:9px;font-size:11px}.loading-note{margin-top:4px;font-size:9px}.error-card{padding:22px}.error-card h2{font-size:20px;margin:4px 0 8px}.error-card>p:not(.eyebrow){font-size:11px}.error-actions{margin-top:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.progress.indeterminate>span{width:100%;opacity:.45}}
.fps{color:#d7c598;font:11px Bangkok,system-ui,sans-serif;min-width:45px;text-align:right;padding-right:3px;white-space:nowrap}@media(max-width:440px){.fps{font-size:9px;min-width:35px}}
.fullscreen-help{position:absolute;z-index:9;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:min(92vw,420px);max-height:90dvh;overflow:auto;padding:20px;border:1px solid var(--line);border-radius:10px;background:#171109f5;box-shadow:0 12px 50px #0009;color:#e6d6b6;font-size:12px;line-height:1.7}.fullscreen-help h2{font-size:17px;color:#f0d291;margin:0 0 10px}.fullscreen-help p{margin:0 0 8px}.fullscreen-help ol{margin:0 0 16px;padding-left:22px}.fullscreen-help button{float:right}
.toolbar-toggle{position:absolute;z-index:6;left:env(safe-area-inset-left,0px);top:50%;transform:translateY(-50%);width:44px;height:52px;padding:0;border:0;background:transparent;color:#ccb47f;touch-action:manipulation;opacity:.72}.toolbar-toggle::before{content:"";position:absolute;left:0;top:6px;width:24px;height:40px;border:1px solid #ad8c4d77;border-left:0;border-radius:0 7px 7px 0;background:#17130dc9;box-shadow:1px 2px 8px #0005}.toolbar-toggle svg{position:absolute;left:4px;top:17px;width:16px;height:18px}.toolbar-toggle:hover,.toolbar-toggle:focus-visible{opacity:1}.toolbar-open .toolbar-toggle svg{transform:rotate(180deg)}
.toolbar-compact .toolbar{top:50%;left:max(50px,calc(env(safe-area-inset-left,0px) + 44px));right:auto;transform:translateY(-50%);display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:max-content;max-width:min(440px,calc(100vw - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px) - 64px));max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);overflow:auto;padding:12px;gap:9px;border:1px solid var(--line);border-radius:10px;background:#17120af2;box-shadow:0 10px 35px #0009}.toolbar-compact .brand{font-size:11px;line-height:22px;align-self:flex-start}.toolbar-compact .brand span{display:inline}.toolbar-compact .status-badge{position:static;transform:none;max-width:100%;white-space:normal;font-size:10px;padding:5px 8px}.toolbar-compact .controls{flex-wrap:wrap;gap:7px;max-width:100%}.toolbar-compact .icon-button{width:44px;height:44px}.toolbar-compact .language-control{height:44px}.toolbar-compact .language-control select{height:42px;min-width:40px}.toolbar-compact .mode-switch{height:44px}.toolbar-compact .mode-switch button{height:36px;min-width:44px}.toolbar-compact .mode-switch button svg{display:block}.toolbar-compact .fps{min-width:0;text-align:left;font-size:10px}.toolbar-compact .toolbar-collapse{margin-left:auto}
.quality-control{display:flex;align-items:center;gap:7px;min-height:37px;max-width:100%;padding:0 9px;border:1px solid var(--line);border-radius:7px;background:rgba(17,13,8,.83);color:#d7c198;font-size:10px;white-space:nowrap}.quality-control select{height:35px;min-width:0;max-width:100%;padding:0 2px;border:0;color:#f1dec0;background:transparent;font-size:11px;cursor:pointer}.quality-control option{background:#1a140e}.toolbar-compact .quality-control{min-height:44px;flex:1 1 160px}.toolbar-compact .quality-control select{height:42px;flex:1;font-size:12px}
