@font-face {
    font-family: 'PT Sans';
    src: url('./data/fonts/pt-sans.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans JP';
    src: url('./data/fonts/noto-jp.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans KR';
    src: url('./data/fonts/noto-kr.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'FangZheng HeiTi';
    src: url('./data/fonts/fangzheng-heiti.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
:root {
    color-scheme: dark;
    font-family: 'PT Sans', 'Noto Sans JP', 'Noto Sans KR', 'FangZheng HeiTi', Arial, sans-serif;
    background: #000;
    color: #eee;
    --tools-height: 0px;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { display: flex; flex-direction: column; }
[hidden] { display: none !important; }
#game-shell {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: #000;
    isolation: isolate;
}
#game-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#translation-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.translation {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-family: 'PT Sans', 'Noto Sans JP', 'Noto Sans KR', 'FangZheng HeiTi', Arial, sans-serif;
    font-weight: 400;
    text-align: center;
    line-height: 1;
    pointer-events: auto;
    outline: none;
    min-width: 0;
    resize: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}
.translation::-webkit-scrollbar { display: none; }
.translation:focus { background: rgb(127 127 127 / 15%); box-shadow: inset 0 -1px currentColor; }
.translation[readonly] { cursor: default; }
#game-tooltip {
    position: absolute;
    max-width: min(80vw, 700px);
    padding: 3px 5px;
    pointer-events: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    z-index: 2;
}
#loading {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    background: #000;
    padding: 24px;
    font-size: 16px;
    z-index: 5;
}
#error-panel {
    position: fixed;
    inset: auto 16px calc(var(--tools-height) + 16px);
    background: #180a0a;
    color: #fff;
    border: 1px solid #b77;
    padding: 20px;
    white-space: pre-wrap;
    z-index: 6;
}
dialog {
    max-width: min(620px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow: auto;
    padding: 24px;
    border: 1px solid #888;
    border-radius: 0;
    background: #111;
    color: #eee;
    font-size: 15px;
    line-height: 1.5;
}
dialog::backdrop { background: rgb(0 0 0 / 75%); }
dialog h2 { font-size: 20px; line-height: 1.2; margin: 0 0 16px; font-weight: 500; }
dialog p { white-space: pre-line; margin: 0 0 20px; }
dialog label { display: block; }
dialog textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    margin: 12px 0 20px;
    padding: 8px;
    resize: vertical;
    background: #000;
    color: #eee;
    border: 1px solid #777;
    font: 14px/1.4 monospace;
}
dialog button { margin: 8px 12px 0 0; padding: 6px 14px; cursor: pointer; font: inherit; }
dialog a { display: block; color: #b9d8ff; overflow-wrap: anywhere; margin: 8px 0 16px; }
