/*
 * Original Wonderland Online skin for the web HUD. Loaded after the inline styles of index.html and
 * only restyles what is already there: no element is added, no behaviour depends on this file.
 *
 * Art and measurements come from data/json/ui_skin.json (assets/skin/white, assets/skin/default):
 *   windows      form_module_1 (the plain framed form; its close medallion is baked into the corner)
 *   dialogue     Form_Talk_2, Icon_Nextone_1
 *   status       main_Status_1, Main_Hp, Main_Sp, Main_Word_*
 *   main menu    Btn_BackGround_2, Btn_11 / Btn_12 / Btn_15, Btn_MissionBook
 *   chat         Panel_TalkForm, main_input_1
 *   battle       Btn_Battle_<n>_1
 *   cursors      assets/cursor/cursor<n>_0.png (first frames, cut by scripts/build_cursor_frames.js)
 * Three-state button sheets are stacked top to bottom: normal, hover, pressed.
 *
 * The page fills the browser window instead of the original 800×600 screen, so panels keep the web
 * layout (corners of the window) and frames are sliced so they stretch to any size.
 */

:root {
  --wl-ink: #33456e;          /* text on the pale forms */
  --wl-title: #6b82b5;        /* form titles and captions */
  --wl-line: #b5cbe8;         /* thin rules and cell borders */
  --wl-paper: #f4f9ff;
  --wl-gold: #c9a23f;
  --wl-gold-dark: #8a6b3c;
  --wl-teal: rgba(69, 94, 103, 0.74);     /* panel10, the fill behind the chat log */
  --wl-outline: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000;
}

/* ── pale forms: windows, dialogue, small pop-ups ─────────────────────────────── */

.window, #dialog, #tooltip, #context-menu, .prompt, #toast, #battle-menu, .panel {
  --bg: #ffffff; --panel: var(--wl-paper); --border: var(--wl-line);
  --accent: #4a6fb5; --text: var(--wl-ink); --muted: #7083ad;
  --danger: #cf3f36; --success: #2a8f47;
  color: var(--text);
}

#tooltip, #context-menu, .prompt, #toast, #battle-menu, .panel {
  background: repeating-linear-gradient(#ffffff 0 1px, #eef6ff 1px 2px);
  border: 3px double var(--wl-gold);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ── buttons: the pale blue pill of btn_ok_1, yellow when hovered, coral when pressed ── */

.btn, .btn.sec, .list-row button {
  background: linear-gradient(#fdfeff, #dfeafa 48%, #c5d7f2);
  color: #3f5ea6;
  border: 1px solid #7d9bd0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 0 #ffffff;
  font-weight: 600;
}
.btn.sec { color: #6079b3; font-weight: 500; }
.btn:hover:not(:disabled), .list-row button:hover {
  filter: none;
  background: linear-gradient(#fcfff2, #e6f6cf);
  color: #2f8f4c;
  border-color: #d8c800;
  box-shadow: 0 0 0 1px #f2e63a, inset 0 0 0 1px #ffffff;
}
.btn:active:not(:disabled), .list-row button:active {
  background: linear-gradient(#ffb9a3, #ef8d70);
  color: #ffffff;
  border-color: #e57553;
  box-shadow: none;
  text-shadow: none;
}
.btn:focus-visible { outline: 2px solid #f2b84b; outline-offset: 1px; }

/* ── windows ──────────────────────────────────────────────────────────────────── */

.window {
  background: none;
  border: 1px solid transparent;
  border-radius: 0;
  /* corners: 64×80 top-left, 72×80 top-right (with the close medallion), 64×34 and 72×34 at the bottom */
  border-image: url(../assets/skin/white/form_module_1.png) 80 72 34 64 fill / 80px 72px 34px 64px / 0 stretch repeat;
  padding: 14px 18px 22px 16px;
  min-width: 210px;
  top: 96px; max-height: calc(100vh - 160px);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.window header {
  justify-content: center;
  min-height: 46px;
  padding: 14px 46px 6px 22px;
  border-bottom: none;
}
.window h3 {
  font-size: 16px; font-weight: 800; letter-spacing: 2px;
  color: var(--wl-title); text-shadow: 0 1px 0 #ffffff;
}
.window h4 { color: var(--wl-title); font-weight: 700; border-bottom: 1px solid #d5e4f7; padding-bottom: 2px; }
.win-body { padding: 2px 10px 6px 6px; scrollbar-width: thin; scrollbar-color: #9db7e0 transparent; }

/* The close button sits on the medallion drawn in the frame (Btn_Close_s_1, 18×18 × 3 states). */
.win-close {
  position: absolute; top: 24px; right: 33px; width: 18px; height: 18px; padding: 0;
  font-size: 0; line-height: 0; color: transparent;
  background: url(../assets/skin/default/btn_close_s_1.png) 0 0 no-repeat;
}
.win-close:hover { background-position: 0 -18px; }
.win-close:active { background-position: 0 -36px; }
.win-close:focus-visible { outline: 2px solid #f2b84b; outline-offset: 2px; border-radius: 50%; }

/* The frame takes room, so the windows are a little wider than the inline styles make them. */
#win-quests  { left: 262px; width: 366px; }
#win-pets    { left: 636px; width: 316px; }
#win-list    { left: calc(50% - 244px); width: 488px; }

.window .bar { height: 15px; background: #8696b8; border: 1px solid #5d6f99; border-radius: 4px; }
.window .bar span { line-height: 13px; }
.list-gold, .trade-gold { color: #a8740a; }
.pet { background: rgba(255, 255, 255, 0.8); }
.pet.out { border-color: var(--wl-gold); box-shadow: 0 0 0 1px #f2e63a; }
.equip-slot { border-radius: 3px; background: #f8fbff; }
.equip-slot:hover:not(:disabled) { border-color: #d8c800; }
.list-row button { padding: 3px 10px; }

/* "+" beside a stat: Btn_ArrowUp_3 */
.st-row button {
  width: 17px; height: 17px; padding: 0; border-radius: 0; font-size: 0;
  background: url(../assets/skin/default/Btn_ArrowUp_3.png) 0 0 no-repeat;
}
.st-row button:hover { background-position: 0 -17px; }
.st-row button:active { background-position: 0 -34px; }

/* bag: the original cell picture (a 5×5 block of 34 px cells) scaled to the 40 px cells used here */
#bag-grid {
  border: 1px solid #a9c3e8;
  background:
    url(../assets/skin/default/5x5Grid.png) 0 0 / 197.65px 197.65px no-repeat,
    url(../assets/skin/default/5x5Grid.png) 0 200px / 197.65px 197.65px no-repeat,
    #eaf3ff;
}
.bag-item.selected { outline-color: #e2b100; background: rgba(255, 230, 90, 0.3); }

/* ── NPC dialogue: Form_Talk_2 ────────────────────────────────────────────────── */

#dialog {
  background: none;
  border: 1px solid transparent;
  border-radius: 0;
  /* the bitmap has empty margins (10 top, 36 right, 7 bottom, 20 left): the outset puts its body on the box */
  border-image: url(../assets/skin/white/Form_Talk_2.png) 30 100 30 80 fill / 30px 100px 30px 80px / 10px 36px 7px 20px stretch;
  width: min(760px, calc(100vw - 60px));
  min-height: 162px;
  padding: 26px 34px 28px 30px;
  bottom: 24px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
/* Between the chat (521 px) and the main menu there is room for the box only on a wide window. */
@media (max-width: 1850px) { #dialog { bottom: 188px; } }
#dialog-face {
  margin: 2px 16px 6px 0;
  border: 1px solid var(--wl-gold); border-radius: 2px; background: #dcebff;
  box-shadow: 0 0 0 1px #fff7cf, 0 0 0 2px var(--wl-gold-dark);
}
#dialog-speaker { color: #2f55a4; }
#dialog-hint { color: var(--muted); }
#dialog-options button { background: #ffffff; border-color: #a9c3e8; border-radius: 6px; }
#dialog-options button:hover, #dialog-options button:focus-visible { background: #fbffe6; border-color: #d8c800; box-shadow: 0 0 0 1px #f2e63a; }
.talk-red { color: #d0342c; }
.talk-blue { color: #2f62c8; }
.talk-green { color: #23863c; }

/* "more" mark while a line waits for a click: Icon_Nextone_1, two 25×31 frames, 250 ms each */
#dialog-options:empty + #dialog-hint:not(:empty)::after {
  content: '';
  position: absolute; left: calc(50% - 12px); bottom: 22px; width: 25px; height: 31px;
  background: url(../assets/skin/default/Icon_Nextone_1.png) 0 0 no-repeat;
  animation: wl-next 0.5s steps(1) infinite;
  pointer-events: none;
}
@keyframes wl-next { 50% { background-position: 0 -31px; } }

/* NPC talk: the client's small box (TSe_TalkMsgFormPlus [0x4c8748], skin 1): Panel22 nine-sliced (left 50, top 32,
   right 60, bottom 32, tiled) at the top of the screen (y 25), as wide as the text (wrapping at 40 bytes) + 110 + the
   portrait's 120, at least 156 high; yellow lines centred, 18 px apart; the portrait centred on (W − 73, 70) with the
   name, white, 36 px under that point; options one 20 px row each, the row under the mouse filled #89BFF5; the
   "more" mark at (W/2 − 12, H − 56). (High specificity: the 對話框底 switch of mod_system only reskins cut-scenes.) */
html body #dialog.npc, html body #dialog.player {
  top: 25px; bottom: auto; left: 50%; transform: translateX(-50%);
  width: max-content; min-width: 230px; min-height: 156px; box-sizing: border-box; padding: 1px 110px 4px 0;
  border-style: solid; border-width: 32px 60px 32px 50px; border-radius: 0; background: none; filter: none; cursor: default;
  border-image: url(../assets/skin/default/Panel22.png) 32 60 32 50 fill / 32px 60px 32px 50px / 0 repeat;
}
/* the player's own line: the same box, their face on the LEFT, centred on (portrait width / 2 + 45, 70) */
html body #dialog.player { padding: 1px 0 4px 120px; }
#dialog.npc #dialog-body, #dialog.player #dialog-body, #dialog.big #dialog-body, #notice-box { color: #ffff00; text-shadow: 1px 1px 0 #101010; line-height: 18px; text-align: center; }
#dialog.npc #dialog-body, #dialog.player #dialog-body { max-width: 320px; min-height: 0; margin: 0 auto; }
:is(#dialog.npc, #dialog.player) #dialog-face { position: absolute; top: 2px; float: none; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
:is(#dialog.npc, #dialog.player) #dialog-speaker { position: absolute; top: 74px; width: 120px; margin: 0; text-align: center; color: #ffffff; text-shadow: 1px 1px 0 #101010; white-space: nowrap; }
#dialog.npc #dialog-face { right: -23px; }
#dialog.npc #dialog-speaker { right: -47px; }
#dialog.player #dialog-face { left: -11px; }
#dialog.player #dialog-speaker { left: -35px; }
#dialog.sprite-face #dialog-speaker { top: 90px; }                 /* under an NPC's own figure: 16 px lower */
/* a question: the options panel starts under the portrait and its name (text height at least 130, 0x7f8b10) */
:is(#dialog.npc, #dialog.player).asking #dialog-body { min-height: 88px; }
/* options: a framed panel across the box (14 px in from its left edge, 19 from its right), a 20 px row each, the row
   under the mouse filled #89BFF5; 關閉 (btn_close_1) centred 45 px above the box's bottom */
:is(#dialog.npc, #dialog.player) #dialog-options { display: block; margin: 8px -151px 0 -36px; padding: 4px; min-width: 200px; border: 1px solid #b4d4f7; }
#dialog.player #dialog-options { margin: 8px -41px 0 -156px; }
:is(#dialog.npc, #dialog.player) #dialog-options:empty { display: none; }
:is(#dialog.npc, #dialog.player) #dialog-options button:not(.leave) {
  display: block; width: 100%; height: 20px; margin: 0; padding: 0 6px; border: 0; border-radius: 0; box-shadow: none;
  background: none; color: #ffff00; text-shadow: 1px 1px 0 #101010; text-align: left; line-height: 20px; cursor: pointer;
}
:is(#dialog.npc, #dialog.player) #dialog-options button:not(.leave):hover,
:is(#dialog.npc, #dialog.player) #dialog-options button:not(.leave):focus-visible { background: #89bff5; outline: none; }
:is(#dialog.npc, #dialog.player) #dialog-options .leave {
  position: absolute; left: calc(50% - 28px); bottom: 3px; width: 56px; height: 20px; padding: 0; border: 0; border-radius: 0;
  font-size: 0 !important; color: transparent; background: url(../assets/skin/default/btn_close_1.png) 0 0 no-repeat; cursor: pointer;
}
:is(#dialog.npc, #dialog.player) #dialog-options .leave:hover { background-position: 0 -20px; }
:is(#dialog.npc, #dialog.player) #dialog-options .leave:active { background-position: 0 -40px; }
html body #dialog.npc.asking, html body #dialog.player.asking { padding-bottom: 36px; }
:is(#dialog.npc, #dialog.player, #dialog.big) #dialog-hint { font-size: 0 !important; min-height: 0; }
:is(#dialog.npc, #dialog.player) #dialog-options:empty + #dialog-hint:not(:empty)::after { bottom: -7px; }
/* The big form (Form_Talk_1, 768 × 169) at the bottom with the role's art on its left: the client keeps it for
   cut-scene lines and a few special speakers; kept here as mode 'big' (text left 200, top 45, right 10; wrap 45 bytes). */
html body #dialog.big {
  top: auto; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 768px; height: 169px; min-height: 0; box-sizing: border-box; padding: 47px 10px 45px 200px;
  border: 0; border-image: none; border-radius: 0; background: url(../assets/skin/white/Form_Talk_1.png) 0 0 no-repeat; filter: none;
}
#dialog.big #dialog-body { max-width: 360px; min-height: 0; margin: 0 auto; }
#dialog.big #dialog-speaker, #dialog.big #dialog-face { display: none; }
#dialog.big #dialog-options:empty + #dialog-hint:not(:empty)::after { bottom: 25px; }
#dialog-art { position: absolute; left: calc(100px - var(--aw, 0px) / 2); bottom: 8px; background: no-repeat 0 0; pointer-events: none; }
#dialog-art[hidden], #dialog:not(.big) #dialog-art { display: none; }
/* 得到道具: the client's centre box (TRe_TalkMsgFormPlus_2), Panel22 like the talk, centred 50 px above the middle,
   as wide as the longest line + 110 (wrapping at 32 bytes). */
#notice-box, #notice-top {
  position: fixed; left: 50%; top: calc(50% - 50px); transform: translateX(-50%); z-index: 9050;
  width: max-content; min-width: 170px; box-sizing: border-box; padding: 1px 0 4px; cursor: pointer;
  border-style: solid; border-width: 32px 60px 32px 50px;
  border-image: url(../assets/skin/default/Panel22.png) 32 60 32 50 fill / 32px 60px 32px 50px / 0 repeat;
}
#notice-box.hidden, #notice-top.hidden { display: none; }
#notice-box > div, #notice-top > div { max-width: 256px; }
#notice-top { top: 25px; }
#notice-top { color: #ffff00; text-shadow: 1px 1px 0 #101010; line-height: 18px; text-align: center; }

/* ── status panel: main_Status_1 with the HP and SP arcs ──────────────────────── */

#hud-status {
  top: 10px; left: 2px; width: 241px; height: 176px; padding: 0;
  pointer-events: none;                 /* nothing to press here: clicks on the frame go to the map */
  background: url(../assets/skin/white/main_Status_1.png) 0 0 no-repeat;
  border: none; border-radius: 0;
  color: #ffffff; font-size: 12px; text-shadow: var(--wl-outline);
}
#hud-status .who { display: block; margin: 0; }
/* The player's face sits in the oval of the frame, under the HP and SP arcs. */
#hud-portrait { position: absolute; left: 58px; top: 22px; width: 46px; height: 46px; }
#hud-level { position: absolute; left: 4px; top: -8px; font-weight: 700; font-size: 13px; white-space: nowrap; }
#hud-name {
  position: absolute; left: 4px; top: 120px; width: 232px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
/* The arcs are wiped in from the left by the width the page already sets on <i>. */
#hud-status .bar { position: absolute; margin: 0; background: none; border-radius: 0; overflow: visible; }
#hud-status .bar i { background-color: transparent; background-repeat: no-repeat; background-position: 0 0; max-width: 100%; }
#hud-status .bar.hp { left: 32px; top: 37px; width: 93px; height: 38px; }
#hud-status .bar.hp i { background-image: url(../assets/skin/default/Main_Hp.png); }
#hud-status .bar.sp { left: 21px; top: 38px; width: 110px; height: 47px; }
#hud-status .bar.sp i { background-image: url(../assets/skin/default/Main_Sp.png); }
#hud-status .bar span {
  inset: auto; width: 170px; text-align: left; font-size: 12px; line-height: 14px; text-shadow: var(--wl-outline);
}
#hud-status .bar::before { content: ''; position: absolute; width: 18px; height: 12px; background: no-repeat 0 0; }
#hud-status .bar.hp::before { left: -27px; top: 102px; background-image: url(../assets/skin/default/Main_Word_Hp.png); }
#hud-status .bar.hp span { left: 8px; top: 101px; }
#hud-status .bar.sp::before { left: -16px; top: 117px; background-image: url(../assets/skin/default/Main_Word_Sp.png); }
#hud-status .bar.sp span { left: 19px; top: 116px; }
#hud-gold { position: absolute; left: 5px; top: 170px; margin: 0; color: #ffe58a; white-space: nowrap; }


/* ── map label (top right) ────────────────────────────────────────────────────── */

#hud-map {
  background: var(--wl-teal); border: 1px solid #8fb6cf; border-top-color: #b4d8ad; border-radius: 0;
  color: #ffffff; text-shadow: 0 1px 1px #000000;
}
#hud-map .coords { color: #cfe0ee; }
#hud-map .btn { padding: 3px 10px; font-size: 12px; text-shadow: 0 1px 0 #ffffff; }

/* ── main menu (bottom right): Btn_BackGround_2 and the round icon buttons ─────── */

#hud-menu { right: 0; bottom: 0; z-index: 0; gap: 3px; align-items: flex-end; height: 58px; padding: 0 8px 0 30px; pointer-events: none; }
#hud-menu .btn { pointer-events: auto; }
#hud-menu::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 37px; z-index: -1;
  border-style: solid; border-width: 0 4px 0 22px;
  border-image: url(../assets/skin/default/Btn_BackGround_2.png) 0 4 0 22 fill stretch;
  pointer-events: none;
}
#hud-menu .btn {
  position: relative; flex: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; box-shadow: none; text-shadow: none; filter: none;
  background: none 0 0 no-repeat;
  font-size: 0;                         /* the caption stays in the accessibility tree, the icon replaces it on screen */
}
/* Every entry is an icon from the original skin; --h is the height of one state in its sheet. */
#hud-menu .btn[data-window=status]  { --h: 51px; width: 41px; background-image: url(../assets/skin/default/Btn_11.png); }   /* 狀態物品 */
#hud-menu .btn[data-window=bag]     { --h: 33px; width: 36px; margin-bottom: 2px; background-image: url(../assets/skin/default/Btn_9.png); }   /* the chest */
#hud-menu .btn[data-window=skills]  { --h: 51px; width: 46px; background-image: url(../assets/skin/default/Btn_12.png); }   /* 特技 */
#hud-menu .btn[data-window=pets]    { --h: 49px; width: 46px; background-image: url(../assets/skin/default/Btn_14.png); }   /* 隊伍組織 */
#hud-menu .btn[data-window=friends] { --h: 54px; width: 46px; background-image: url(../assets/skin/default/Btn_15.png); }   /* 交友情感 */
#hud-menu #btn-more                 { --h: 51px; width: 47px; background-image: url(../assets/skin/default/Btn_16.png); }   /* 系統選項 */
/* 任務本 is a wide labelled button in the original: its book end and its right edge make a square one. */
#hud-menu .btn[data-window=quests]  { --h: 32px; width: 37px; margin-bottom: 3px; background-image: url(../assets/skin/default/Btn_MissionBook.png); background-size: auto; }
#hud-menu .btn[data-window=quests]::before {
  content: ''; position: absolute; right: 0; top: 0; width: 5px; height: 100%;
  background: url(../assets/skin/default/Btn_MissionBook.png) -92px 0 no-repeat;
}
#hud-menu .btn { height: var(--h); }
#hud-menu .btn:hover  { background-position: 0 calc(var(--h) * -1); }
#hud-menu .btn:active { background-position: 0 calc(var(--h) * -2); }
#hud-menu .btn[data-window=quests]:hover::before  { background-position: -92px -32px; }
#hud-menu .btn[data-window=quests]:active::before { background-position: -92px -64px; }
#hud-menu .btn kbd { display: none; }        /* icons only: the shortcut is in the caption below */

/* Caption shown above an icon while it is hovered or focused (empty alt: not read twice). */
/* The original's hover hint (as #tooltip): a blue box with a dark navy edge and white text. The button's own text is
   hidden by font-size 0, so the caption sets its size and line height itself. Two layers of the same size (both show
   --cap): ::before the box, ::after the text alone through the crisp filter (src/crisp.js; text over its own fill
   would stay smooth). */
#hud-menu .btn::before, #hud-menu .btn::after {
  content: var(--cap, '') / '';
  position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%);
  padding: 1px 6px; font-size: 16px !important; line-height: 18px !important; font-weight: 400; white-space: nowrap;
  border: 1px solid transparent; border-radius: 0; opacity: 0; pointer-events: none;
}
#hud-menu .btn::before { color: transparent; background: var(--wl-tip-bg); border-color: var(--wl-hint-edge); }
#hud-menu .btn::after { color: var(--wl-tip-ink); text-shadow: var(--wl-hint-outline); filter: url(#wl-crisp); }
#hud-menu .btn[data-window=status]  { --cap: '狀態（C）'; }
#hud-menu .btn[data-window=bag]     { --cap: '背包（B）'; }
#hud-menu .btn[data-window=skills]  { --cap: '技能（K）'; }
#hud-menu .btn[data-window=quests]  { --cap: '任務（Q）'; }
#hud-menu .btn[data-window=pets]    { --cap: '同伴（P）'; }
#hud-menu .btn[data-window=friends] { --cap: '好友（F）'; }
#hud-menu #btn-more                 { --cap: '更多功能'; }
#hud-menu #btn-more::before, #hud-menu #btn-more::after { left: auto; right: 0; transform: none; }
#hud-menu .btn:hover::before, #hud-menu .btn:focus-visible::before,
#hud-menu .btn:hover::after, #hud-menu .btn:focus-visible::after { opacity: 1; }
#hud-menu .btn:focus-visible { outline: 2px solid #f2b84b; outline-offset: 1px; }

/* ── chat: Panel_TalkForm around the log, main_input_1 as the input bar ───────── */

#hud-chat { left: 0; bottom: 0; width: 521px; max-width: 100vw; }
#chat-log {
  height: 150px; padding: 10px 14px 6px 34px;
  background: var(--wl-teal); background-clip: padding-box;
  border: 1px solid transparent; border-radius: 0;
  /* the frame only; its left column carries the scroll arrows of the original */
  border-image: url(../assets/skin/default/Panel_TalkForm.png) 24 30 24 30 / 24px 30px 24px 30px / 6px 7px 0 0 stretch;
  color: #f4f7ff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
  scrollbar-width: thin; scrollbar-color: #c9a23f transparent;
}
#chat-log .help { color: #ffe58a; }
#chat-log .notice { color: #ff0000; }   /* 系統公告 and the server's own lines: the original's red announcements */
#chat-log .who { color: #a8e1ff; }
#chat-form { position: relative; display: block; height: 25px; background: url(../assets/skin/white/main_input_1.png) 0 0 no-repeat #222222; }
/* The bar shows its "頻道" (channel) button; only the nearby channel exists here, named in the box beside it. */
#chat-form::before {
  content: '一般' / '';
  position: absolute; left: 76px; top: 3px; width: 84px; height: 19px;
  font-size: 12px; line-height: 19px; text-align: center; color: #c8c8c8; filter: url(#wl-crisp);
}
#chat-input {
  position: absolute; left: 165px; top: 2px; width: 286px; height: 21px; padding: 0 4px;
  background: transparent; border: none; border-radius: 0; color: #ffffff; font-size: 13px;
}
#chat-input::placeholder { color: #9a9a9a; }
#chat-input:focus-visible { outline: 1px solid #ffe58a; outline-offset: -1px; }
#chat-form button {
  position: absolute; left: 454px; top: 3px; width: 44px; height: 19px; padding: 0;
  font-size: 12px; font-weight: 700; color: #1f4d12;
  background: linear-gradient(#c8f56a, #7cc932); border: 1px solid #2f7d1b; border-radius: 2px;
}
#chat-form button:hover { background: linear-gradient(#fff59a, #f2e63a); border-color: #b9a800; }
#chat-form button:active { background: linear-gradient(#d6e84a, #a9c41c); }

/* ── battle orders: the round command icons over their captions ───────────────── */

#battle-menu { border-radius: 4px; right: 8px; bottom: 66px; }
#battle-title { color: #2f55a4; }
#battle-menu .row-btns .btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px 4px; font-size: 12px;
  background: none; border: 1px solid transparent; box-shadow: none; text-shadow: none; color: var(--wl-ink);
}
#battle-menu .row-btns .btn::before { content: ''; width: 28px; height: 28px; background: no-repeat 0 0; }
#battle-menu .row-btns .btn:hover:not(:disabled) { background: #fbffe6; border-color: #d8c800; box-shadow: none; color: var(--wl-ink); }
#battle-menu .row-btns .btn:active:not(:disabled) { background: #ffe1d6; border-color: #e57553; color: var(--wl-ink); }
#battle-menu .row-btns .btn:hover::before { background-position: 0 -28px; }
#battle-menu .row-btns .btn:active::before { background-position: 0 -56px; }
#battle-menu .btn[data-battle=attack]::before { background-image: url(../assets/skin/default/Btn_Battle_6_1.png); }
#battle-menu .btn[data-battle=skill]::before  { background-image: url(../assets/skin/default/Btn_Battle_7_1.png); }
#battle-menu .btn[data-battle=item]::before   { background-image: url(../assets/skin/default/Btn_Battle_4_1.png); }
#battle-menu .btn[data-battle=defend]::before { background-image: url(../assets/skin/default/Btn_Battle_1_1.png); }
#battle-menu .btn[data-battle=flee]::before   { background-image: url(../assets/skin/default/Btn_Battle_3_1.png); }
#battle-menu .row-btns kbd { margin-left: 2px; }
#battle-list button { border-radius: 6px; }
#battle-list button:hover:not(:disabled), #battle-list button:focus-visible { background: #fbffe6; border-color: #d8c800; }

/* ── small pop-ups ────────────────────────────────────────────────────────────── */

/* every plain hover hint: the original's blue box with white text — the owner's screenshot of its Exp hint */
/* Its fill is the NPC talk box's (Panel22): #669BE0 on every other pixel, see-through between (the client's screen-door
   half-transparency) (owner 2026-11-30: 「籃底框…像NPC對話這種」). */
/* A plain hint's edge is 1 px dark navy and its white text outlined #101010 (owner 2026-12-01: 「黑框藍底」, the
   遺忘龍卷 hint of the owner's screenshot: #000084); the menus keep the pale edge. */
:root {
  --wl-tip-bg: conic-gradient(#669be0 25%, transparent 0 50%, #669be0 0 75%, transparent 0) 0 0 / 2px 2px;
  --wl-tip-edge: #dfeaff; --wl-tip-ink: #ffffff;
  --wl-hint-edge: #000084; --wl-hint-outline: -1px 0 #101010, 1px 0 #101010, 0 -1px #101010, 0 1px #101010;
}
#tooltip { background: var(--wl-tip-bg); border: 1px solid var(--wl-hint-edge); border-radius: 0; box-shadow: none; color: var(--wl-tip-ink); padding: 2px 6px; text-shadow: var(--wl-hint-outline); }
#tooltip b { color: #ffffff; }
/* An item's hint and its 目前裝備 box (owner 2026-12-01: 「金框藍底」; aLogin 0x2a612c / 0x1c4db0): panel4 — a 3 px
   gold frame (#b5964a / #ffdf94 / #635118) round the blue dither — sized and filled by ui.js _paintHint; every
   line yellow (0xFFE0) outlined #080808, 20 px apart, wrapped at any character; the 狀況 word of worn-out gear and
   the box's [ 目前裝備 ] red (0xF800, set inline). */
#tooltip.item-tip, #tooltip-cmp {
  position: absolute; z-index: 9300; box-sizing: border-box; max-width: none; padding: 0; overflow: visible;
  pointer-events: none; border: 3px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url(../assets/skin/default/panel4.png) 3 fill / 3px / 0 repeat; background: none;
  color: #ffff00; line-height: 20px; text-shadow: -1px 0 #080808, 1px 0 #080808, 0 -1px #080808, 0 1px #080808;
}
.item-tip .hint-line { position: absolute; white-space: pre-wrap; word-break: break-all; line-break: anywhere; overflow-wrap: anywhere; }
.item-tip .hint-value { position: absolute; left: 48px; top: 0; white-space: pre; }   /* 「狀況:」 + 6 spaces */
/* menus: the game's half-transparent blue (the talk box's fill) with a pale edge, white lines, the row under the mouse
   #89BFF5 as the original's lists — no box of our own */
#context-menu { padding: 3px; background: var(--wl-tip-bg) !important; border: 1px solid var(--wl-tip-edge) !important; border-radius: 0 !important; box-shadow: none !important; }
#context-menu .title { color: #ffff00 !important; text-shadow: 1px 1px 0 #101010; border-bottom-color: var(--wl-tip-edge) !important; }
#context-menu button { color: #ffffff !important; text-shadow: 1px 1px 0 #101030; border-radius: 0 !important; }
#context-menu button:hover, #context-menu button:focus-visible { background: #89bff5 !important; color: #080808 !important; text-shadow: none; }
/* 確認框 (ui.ask / askText): the client's message box, as the owner's screenshot shows it — the NPC talk box's Panel22
   (nine-sliced like #dialog.npc) at the top of the screen, the question in yellow, centred, and the 確定
   (Btn_confirm_1) / 取消 (Btn_Cancel_1) pictures centred under it. */
#prompts { top: 25px; width: auto; justify-items: center; }
.prompt {
  display: grid !important; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 6px 12px;
  min-width: 330px; max-width: 460px; box-sizing: border-box; padding: 0 6px;
  background: none !important; box-shadow: none !important; border-radius: 0 !important;
  border-style: solid; border-width: 32px 60px 32px 50px;
  border-image: url(../assets/skin/default/Panel22.png) 32 60 32 50 fill / 32px 60px 32px 50px / 0 repeat;
}
.prompt > span { grid-column: 1 / -1; color: #ffff00; text-shadow: 1px 1px 0 #101010; line-height: 18px; text-align: center; }
.prompt > input { grid-column: 1 / -1; justify-self: center; width: 200px; }
.prompt.one { grid-template-columns: auto; }
.prompt .pr-ok { --img: url(../assets/skin/default/Btn_confirm_1.png); --w: 56px; --h: 20px; }
.prompt .pr-cancel { --img: url(../assets/skin/default/Btn_Cancel_1.png); --w: 56px; --h: 20px; }

/* ── entry screens (connect, login, character) ────────────────────────────────── */

.panel h2 { color: var(--wl-title); font-weight: 800; }
.panel .role, .panel .slot, .panel .stats button, .panel .elements label { border-radius: 4px; }
.panel .role[aria-pressed=true] { border-color: #d8c800; box-shadow: 0 0 0 1px #f2e63a; color: #2f55a4; }
.panel .tints button { color: #6079b3; }

/* ── pointer: the original's animated cursor, one for the whole page ───────────────
   cursor.js sets --wl-cursor on the root (frame by frame, and per situation: skill, capture …). Every element uses
   it — buttons, lists, window title bars and text boxes included — as the original keeps its own pointer over its
   windows instead of a hand; this overrides every other cursor rule. Until cursor.js starts: the first frame. */
:root { --wl-cursor: url(../assets/cursor/cursor1_0.png) 0 0, auto; }
html, html * { cursor: var(--wl-cursor) !important; }
/* …except over a button: the pointing hand (cursor.js sets --wl-cursor-hand from cursor4). */
html button:not(:disabled), html button:not(:disabled) *, html [role="button"], html summary {
  cursor: var(--wl-cursor-hand, var(--wl-cursor)) !important;
}

@media (prefers-reduced-motion: reduce) {
  #dialog-options:empty + #dialog-hint:not(:empty)::after { animation: none; }
}

/* During a cut-scene the dialogue box sits at the bottom of the screen, below the staged characters. */
#cutscene:not(.hidden) ~ #dialog.scene { top: auto; bottom: 2vh; }   /* the NPC box stays at the top, the player's big box at the bottom */

/* Emoticons in the chat log: the picture holds two 16 × 16 frames one above the other. Show one at a time and
   alternate them, instead of squeezing both into the 16 px box. */
#chat-log img.chat-expre, .chat-expre {
  width: 16px; height: 16px; object-fit: cover; object-position: 0 0;
  animation: chat-expre 0.8s steps(1, end) infinite;
}
@keyframes chat-expre { 50% { object-position: 0 100%; } }
@media (prefers-reduced-motion: reduce) { #chat-log img.chat-expre, .chat-expre { animation: none; } }

/* ── character select: TSe_SelectCharacter on the 800 × 600 screen (aLogin 0x419d28, drawn by 0x41ad0c) ─────────
   LogPic1 behind, the logo at (617,0), Icon_SelectRole_1 at (282,80), the cards at (40,135) / (420,135), 上一步 at
   (370,500). Inside a card: face (70,31), element (223,19), HP (217,72), SP (217,87), EXP bar (215,104) and % (266,104),
   Gold (217,121) in Num_MainInfo (8 px a glyph), the name (55,108), LV (55,135) in Num_White3_1, the doll's feet at
   (170,290) between ◀ (112,260) and ▶ (209,260), 登入 (271,300), 刪除角色 / 建立角色 (271,323). ui.js renderChars. */
#screen-chars { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; background: #000; }
#screen-chars.hidden { display: none; }
#screen-chars .cs-stage { position: relative; flex: none; width: 800px; height: 600px; background: url(../assets/jpegs/LogPic1.jpg) 0 0 no-repeat; transform: scale(var(--cs-scale, 1)); }
#screen-chars .cs-stage > * { position: absolute; }
#screen-chars .cs-logo { left: 617px; top: 0; }
#screen-chars .cs-title { left: 282px; top: 80px; margin: 0; line-height: 0; }
#screen-chars #slots { inset: 0; pointer-events: none; }
#screen-chars #cs-prev { left: 370px; top: 500px; --img: url(../assets/skin/default/Btn_Prev_1.png); --w: 56px; --h: 20px; }
#screen-chars #chars-msg { left: 0; right: 0; top: 530px; margin: 0; text-align: center; font: 700 13px/1.4 "Microsoft JhengHei", sans-serif; color: #ffffff; text-shadow: var(--wl-outline); }
.cs-card { position: absolute; top: 135px; width: 337px; height: 352px; pointer-events: auto; background: url(../assets/skin/white/Form_SelectRole_Info_R.jpg) 0 0 no-repeat; }
.cs-card.empty { background-image: url(../assets/skin/white/Form_SelectRole_Empty_R.jpg); }
.cs-card[data-slot="1"] { left: 40px; }
.cs-card[data-slot="2"] { left: 420px; }
.cs-card > * { position: absolute; }
.cs-face { left: 70px; top: 31px; width: 70px; height: 70px; }
.cs-element { left: 223px; top: 19px; width: 25px; height: 25px; }
.cs-career { left: 172px; top: 45px; }                              /* 職業, under the picture's 屬性 */
.cs-job { left: 227px; top: 48px; width: 16px; height: 16px; }
.cs-career[hidden], .cs-job[hidden] { display: none; }
.cs-hp { left: 217px; top: 72px; }
.cs-sp { left: 217px; top: 87px; }
.cs-gold { left: 217px; top: 121px; }
.cs-exp-pct { left: 266px; top: 104px; }
.cs-exp-bar { left: 215px; top: 104px; width: 47px; height: 8px; background: url(../assets/skin/default/Panel37.png) 0 0 no-repeat; }
.cs-exp-fill { left: 217px; top: 106px; height: 4px; background: url(../assets/skin/default/Panel38.png) 0 0 no-repeat; }
.cs-name { left: 55px; top: 108px; width: 100px; line-height: 16px; color: #ffffff; text-shadow: 1px 1px 0 #101010; word-break: break-all; }   /* white, the client's 1 px shadow */
.cs-lv { left: 55px; top: 135px; }
.cs-doll { left: 106px; top: 186px; width: 128px; height: 128px; }
.cs-empty-mark { left: 126px; top: 161px; }
.cs-card .sbtn.cs-turn-l { left: 112px; top: 260px; --img: url(../assets/skin/default/Btn_ArrowL_1.png); --w: 18px; --h: 17px; }
.cs-card .sbtn.cs-turn-r { left: 209px; top: 260px; --img: url(../assets/skin/default/Btn_ArrowR_1.png); --w: 18px; --h: 17px; }
.cs-card .sbtn.cs-login { left: 271px; top: 300px; --img: url(../assets/skin/default/btn_logIn.png); --w: 56px; --h: 20px; }
.cs-card .sbtn.cs-delete { left: 271px; top: 323px; --img: url(../assets/skin/default/Btn_DeleteCharacter_1.png); --w: 56px; --h: 20px; }
.cs-card .sbtn.cs-create { left: 271px; top: 323px; --img: url(../assets/skin/default/Btn_CreateCharacter.png); --w: 56px; --h: 20px; }
/* picture digits: each glyph one cell of a vertical strip */
.wl-digits { display: flex; height: var(--gh); line-height: 0; pointer-events: none; }
.wl-digits > i { flex: none; width: var(--gw); height: var(--gh); margin-right: calc(var(--adv) - var(--gw)); background: var(--strip) 0 0 no-repeat; }
/* 刪除角色: Form_InputPw_2 536×352 in the middle of the screen; password ×2 and 暗碼 ×2, 確定 (342,312), 取消 (444,312) */
.cs-delete-form { left: 132px; top: 124px; width: 536px; height: 352px; z-index: 5; background: url(../assets/skin/white/Form_InputPw_2.jpg) 0 0 no-repeat; }
.cs-delete-form > * { position: absolute; }
.cs-delete-form input { left: 150px; width: 102px; height: 14px; padding: 0 2px; border: 0; background: transparent; font: 12px/14px monospace; color: #1d2a4a; }
.cs-delete-form .sbtn.ok { left: 342px; top: 312px; --img: url(../assets/skin/default/btn_ok_1.png); --w: 56px; --h: 20px; }
.cs-delete-form .sbtn.cancel { left: 444px; top: 312px; --img: url(../assets/skin/default/Btn_Cancel_1.png); --w: 56px; --h: 20px; }
.cs-delete-form .msg { left: 0; right: 0; top: 290px; text-align: center; font: 700 12px/1 "Microsoft JhengHei", sans-serif; color: #c0392b; }

/* ── the 800 × 600 front screens (server list, login; the character select above uses the same stage) ─────────
   LogPic1 behind (it has its own black bands), the logo at (617,0), a form in the middle. --fs-scale shrinks the
   stage to fit a smaller window (ui.js _fitStage). Positions measured on the owner's screenshots of the original. */
.fs-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; background: #000; }
.fs-screen.hidden { display: none; }
.fs-stage { position: relative; flex: none; width: 800px; height: 600px; background: url(../assets/jpegs/LogPic1.jpg) 0 0 no-repeat; transform: scale(var(--fs-scale, 1)); }
.fs-stage > * { position: absolute; }
.fs-logo { left: 617px; top: 0; }
.fs-form { margin: 0; }
.fs-form > * { position: absolute; }
.fs-form .msg { left: 0; right: 0; margin: 0; text-align: center; font: 700 12px/1.3 "Microsoft JhengHei", sans-serif; color: #c0392b; }
#screen-chars .cs-stage { transform: scale(var(--fs-scale, 1)); }
/* 伺服器列表: Form_ServerList_1 309×352; the list on the left (rows 24 px apart), its arrows on the line, the chosen
   server and its signal on the right, 下一步 and 離開 under them. */
.sl-form { left: 245px; top: 124px; width: 309px; height: 352px; background: url(../assets/skin/white/Form_ServerList_1.jpg) 0 0 no-repeat; }
.sl-list { left: 21px; top: 76px; width: 122px; height: 200px; overflow: hidden; }
.sl-row { display: block; width: 120px; height: 22px; margin-bottom: 2px; padding: 0 2px; border: 0; border-radius: 0; background: none; text-align: left; font: 15px/22px "MingLiU", "PMingLiU", serif; color: #000000; white-space: nowrap; overflow: hidden; }
.sl-row[aria-selected="true"] { background: #8fb8f2; }
.sl-up { left: 145px; top: 82px; --img: url(../assets/skin/default/Btn_ArrowUp_1.png); --w: 17px; --h: 17px; }
.sl-down { left: 145px; top: 285px; --img: url(../assets/skin/default/Btn_ArrowDn_1.png); --w: 17px; --h: 17px; }
/* the chosen server's 分流 on the right, each with its signal light (icon_serverSignal: grey, green, yellow, red) */
.sl-lines { left: 167px; top: 83px; width: 122px; height: 200px; overflow-y: auto; scrollbar-width: none; }
.sl-lines .sl-row { position: relative; }
.sl-lines .sl-row i { position: absolute; left: 99px; top: 2px; width: 18px; height: 18px; background: url(../assets/skin/default/icon_serverSignal.png) 0 -18px no-repeat; }
.sl-next { left: 76px; top: 312px; --img: url(../assets/skin/default/btn_next.png); --w: 56px; --h: 20px; }
.sl-leave { left: 179px; top: 312px; --img: url(../assets/skin/default/Btn_Leave_1.png); --w: 56px; --h: 20px; }
.sl-form .msg { top: 362px; color: #ffffff; text-shadow: var(--wl-outline); }
/* 登入: Form_IdPassword_1 259×352; the two fields on the printed boxes, the remembered accounts under ▼, 記憶帳號,
   then 登入 / 上一步 / 申請遊戲帳號 / 關於飄流幻境 (143×20 each). */
.lg-form { left: 270px; top: 124px; width: 259px; height: 352px; background: url(../assets/skin/white/Form_IdPassword_1.jpg) 0 0 no-repeat; }
.lg-form input[type=text], .lg-form input[type=password] { left: 99px; width: 101px; height: 14px; padding: 0 1px; border: 0; border-radius: 0; background: transparent; font: 700 12px/14px "Courier New", monospace; color: #1d3fd0; outline: none; }
#inp-user { top: 112px; }
#inp-pw { top: 144px; }
.lg-drop { left: 201px; top: 108px; --img: url(../assets/skin/default/Btn_ArrowDn_1.png); --w: 17px; --h: 17px; }
.lg-accounts { left: 98px; top: 127px; z-index: 3; width: 104px; max-height: 120px; overflow-y: auto; background: #ffffff; border: 1px solid #7d9bd0; }
.lg-accounts.hidden { display: none; }
.lg-accounts button { display: block; width: 100%; padding: 1px 3px; border: 0; border-radius: 0; background: none; text-align: left; font: 700 12px/16px "Courier New", monospace; color: #1d3fd0; }
.lg-accounts button:hover { background: #dbe8fb; }
/* Icon_RecordAccount already holds the empty box; a tick (icon_check_1) is laid on it when checked. */
.lg-remember { left: 60px; top: 168px; width: 90px; height: 18px; }
.lg-remember > * { position: absolute; left: 0; top: 0; }
.lg-remember input { opacity: 0; width: 18px; height: 18px; margin: 0; }
.lg-check { left: 1px; top: 1px; z-index: 1; width: 15px; height: 15px; }
.lg-remember input:checked + .lg-check { background: url(../assets/skin/default/icon_check_1.png) 0 0 no-repeat; }
.lg-remember input:focus-visible + .lg-check { outline: 1px dotted #1d3fd0; }
.lg-remember img { pointer-events: none; }
.lg-login { left: 59px; top: 200px; --img: url(../assets/skin/default/Btn_Login_L.png); --w: 143px; --h: 20px; }
.lg-prev  { left: 59px; top: 230px; --img: url(../assets/skin/default/Btn_Prev_L.png); --w: 143px; --h: 20px; }
.lg-apply { left: 59px; top: 260px; --img: url(../assets/skin/default/Btn_applyID_1.png); --w: 143px; --h: 20px; }
.lg-about { left: 59px; top: 291px; --img: url(../assets/skin/default/Btn_About_L.png); --w: 143px; --h: 20px; }
.lg-form .msg { top: 320px; }
/* The front screens' message box (ui.js setMsg; the owner's screenshot of 「無法與Server取得連繫」): panel15
   nine-sliced (12 px edges) to 200 × 150 in the middle of the stage, which it covers so nothing behind it takes a
   click; the text white on black in panel4's 3 px gold frame at (10, 25), 180 wide, a 16 px line each (it grows
   with a long message, and the box with it); 離開 at (32, 110), 上一頁 at (102, 110), 56 × 20 each. The screens'
   own message lines only keep the text now. */
#connect-msg, #login-msg, #register-msg, #chars-msg, #create-msg { display: none !important; }
.mb-veil { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; }
.mb-veil.loose { position: fixed; z-index: 9400; }
.mb-box {
  position: relative; width: 200px; min-height: 150px; box-sizing: border-box; padding: 13px 0 38px;
  border: 12px solid transparent; border-image: url(../assets/skin/default/panel15.png) 12 fill / 12px / 0 stretch;
}
.mb-text {
  margin: 0 -2px; min-height: 22px; box-sizing: border-box; padding: 0;
  border: 3px solid transparent; border-image: url(../assets/skin/default/panel4.png) 3 / 3px / 0 repeat; background: #000408;
  color: #ffffff; line-height: 16px; text-align: left; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
}
.mb-box > .sbtn { position: absolute; bottom: 8px; }
.mb-leave { left: 20px; --img: url(../assets/skin/default/Btn_Leave_1.png); --w: 56px; --h: 20px; }
.mb-prev  { left: 90px; --img: url(../assets/skin/default/Btn_PrePage_1.png); --w: 56px; --h: 20px; }
.mb-veil.waiting .sbtn { display: none; }

/* The game's own small font (font\TATPC1.TWN, built by scripts/build_font.js): its glyphs are its pixels, sharp at
   16 px (8 px half-width, 16 px full-width, 15 px rows), as the client draws all UI, chat and labels (aLogin 0x4a3190). */
@font-face { font-family: "WLO Small"; src: url(../assets/fonts/wlo_small.woff) format("woff"), url(../assets/fonts/wlo_small.ttf) format("truetype"); font-display: block; }
:root { --wl-font: "WLO Small", "Microsoft JhengHei", sans-serif; }
/* Every text of the game in it, at its own 16 px (any other size would blur its pixels). */
html, body, body *:not(svg):not(svg *) { font-family: var(--wl-font) !important; font-size: 16px !important; font-weight: 400 !important; letter-spacing: 0 !important; }
/* …and with its own pixels, not smoothed (src/crisp.js): every text goes into a <wl-t> that lays out exactly as the
   bare text did (all: unset beats the `x > *` rules and inherits the parent's size, even a caption's 0) and passes
   through index.html's #wl-crisp alpha threshold. Text fields with a clear background take the filter themselves. */
:root wl-t { all: unset !important; filter: url(#wl-crisp) !important; }
:root [data-wl-crisp="1"] { filter: url(#wl-crisp); }
/* …except captions that stay only for screen readers: picture buttons and icons show their picture, not the text. */
:is(.sbtn, .win-close, .st-row button, #hud-menu .btn, #hud-remote, #hud #chat-mail, .gd-plain, .em-say, .em-cell, .em-slot,
  .cr-elements button, .cr-zone, .cr-step, #dialog-options .leave, #dialog-hint) { font-size: 0 !important; line-height: 0 !important; }

/* A game window, not a web page (page_guard.js): nothing is selected by dragging or double-clicking (the chat log
   turned blue) except in text fields; pictures are not picked up. */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
[draggable="true"] { -webkit-user-drag: element; }

/* 創造角色 — the original's four pages put together (ui.js _buildCreate). The panel keeps their frame
   (Form_CreateRole_1's 6 px border); inside it, at the panel's inner coordinates: the role (name, introduction, the
   Btn_RolePic art turned with ◀ ▶), 角色解說's labels and points (cut from Form_CreateRole_2), 屬性's four words (from
   Form_CreateRole_3) over the ElementInfo explanation, 命名 (from Form_CreateRole_1), the Launched Character's Status
   box (from Form_CreateRole_1) and 調色盤 (from Form_CreateRole_4). */
.cr-title { left: 285px; top: 12px; }
.cr-panel { left: 16px; top: 66px; width: 768px; height: 528px; box-sizing: border-box; background: #ffffff;
  border: 6px solid transparent; border-image: url(../assets/skin/white/Form_CreateRole_1.jpg) 6 / 6px stretch; }
.cr-panel > * { position: absolute; }
.cr-role-name { left: 12px; top: 10px; font: 700 18px/24px "Microsoft JhengHei", sans-serif; color: #3e78a8; }
.cr-role-info { left: 12px; top: 44px; width: 138px; margin: 0; text-indent: 2em; font: 13px/20px "MingLiU", "PMingLiU", "Microsoft JhengHei", serif; color: #4b5a73; }
.cr-role-prev { left: 250px; top: 230px; --img: url(../assets/skin/default/Btn_ArrowL_9.png); --w: 20px; --h: 20px; }
.cr-role-next { left: 486px; top: 230px; --img: url(../assets/skin/default/Btn_ArrowR_9.png); --w: 20px; --h: 20px; }
/* Page 1 chooses the role alone: its name and introduction on the left, the big art between ◀ ▶, the preview on the
   right. Page 2 keeps the role (art and introduction) beside 角色解說, 屬性, 命名 and 調色盤. */
/* Page 1 chooses the role alone: its card (JRole_<body>_<head>.jpg: the stat pentagon, portrait and PROFILE) and its
   standing art between ◀ ▶. Page 2 has no art: name, introduction and 命名 on the left, 角色解說 and 屬性 in the
   middle, the preview and 調色盤 on the right. */
/* the card (its 735 × 540 middle, from (35,35), at 0.837) filling the page between ◀ ▶, the role's little figure walking
   at its lower middle */
.cr-card { left: 70px; top: 34px; width: 615px; height: 452px; background: no-repeat -29px -29px / 670px 502px; pointer-events: none; }
.cr-card-doll { left: 313px; top: 292px; width: 128px; height: 128px; image-rendering: pixelated; pointer-events: none; }
.cr-panel[data-page="1"] :is(.cr-role-info, .cr-stats, .cr-elements, .cr-element-info, .cr-name, .cr-msg, .cr-status, .cr-palette, .cr-create) { display: none; }
.cr-panel[data-page="2"] :is(.cr-card, .cr-card-doll, .cr-role-prev, .cr-role-next, .cr-next) { display: none; }
.cr-panel[data-page="1"] .cr-role-name { left: 70px; top: 2px; font-size: 22px; line-height: 30px; }
.cr-panel[data-page="1"] .cr-role-prev { left: 44px; top: 250px; }
.cr-panel[data-page="1"] .cr-role-next { left: 692px; top: 250px; }
/* Page 2, narrower: 角色解說's points, 屬性 and its explanation on the left; the preview, 命名 under it and 調色盤 on the
   right. */
.cr-panel[data-page="2"] { left: 150px; width: 500px; height: 470px; }
.cr-panel[data-page="2"] :is(.cr-role-name, .cr-role-info) { display: none; }
.cr-panel[data-page="2"] .cr-stats { left: 12px; top: 56px; }
.cr-panel[data-page="2"] .cr-elements { left: 12px; top: 238px; }
.cr-panel[data-page="2"] .cr-element-info { left: 4px; top: 270px; }
.cr-panel[data-page="2"] .cr-msg { left: 4px; top: 372px; width: 220px; }
.cr-panel[data-page="2"] .cr-status { left: 248px; top: 10px; }
.cr-panel[data-page="2"] .cr-name { left: 292px; top: 208px; }
.cr-panel[data-page="2"] .cr-palette { left: 248px; top: 244px; }
.cr-panel[data-page="2"] .cr-back { left: 336px; top: 426px; }
.cr-panel[data-page="2"] .cr-create { left: 418px; top: 426px; }
.cr-bonus { font: 700 13px/17px "Courier New", monospace; color: #3e5a7a; white-space: nowrap; }
.cr-stats { left: 340px; top: 8px; width: 180px; height: 168px; background: url(../assets/skin/white/Form_CreateRole_2.jpg) -292px -114px no-repeat; }
.cr-stats > * { position: absolute; }
.cr-stats .sbtn.l { --img: url(../assets/skin/default/Btn_ArrowL_4.png); --w: 17px; --h: 17px; }
.cr-stats .sbtn.r { --img: url(../assets/skin/default/Btn_ArrowR_4.png); --w: 17px; --h: 17px; }
.cr-elements { left: 340px; top: 190px; width: 180px; height: 26px; }
.cr-elements button { position: absolute; top: 0; width: 36px; height: 26px; padding: 0; border: 2px solid transparent; border-radius: 0;
  background: url(../assets/skin/white/Form_CreateRole_3.jpg) no-repeat; font-size: 0; color: transparent; }
.cr-elements button[aria-checked=true] { border-color: #f0a020; box-shadow: inset 0 0 0 1px #ffe27a; }
.cr-element-info { left: 322px; top: 222px; }
.cr-name { left: 340px; top: 330px; width: 146px; height: 28px; background: url(../assets/skin/white/Form_CreateRole_1.jpg) -532px -70px no-repeat; }
.cr-name input { position: absolute; left: 53px; top: 4px; width: 87px; height: 18px; padding: 0 2px; border: 0; border-radius: 0; background: #000000;
  font: 700 12px/18px "Courier New", "MingLiU", monospace; color: #ffffff; outline: none; }
.cr-msg { left: 300px; top: 368px; width: 220px; margin: 0; text-align: center; font: 700 12px/1.3 "Microsoft JhengHei", sans-serif; color: #c0392b; }
.cr-status { left: 520px; top: 2px; width: 234px; height: 192px; background: url(../assets/skin/white/Form_CreateRole_1.jpg) -494px -108px no-repeat; }
.cr-status > * { position: absolute; }
#create-face { left: 26px; top: 41px; width: 70px; height: 70px; }
#create-doll { left: 88px; top: 39px; width: 128px; height: 128px; image-rendering: pixelated; pointer-events: none; }
.cr-turn-l { left: 96px; top: 121px; --img: url(../assets/skin/default/Btn_ArrowL_2.png); --w: 18px; --h: 17px; }
.cr-turn-r { left: 184px; top: 121px; --img: url(../assets/skin/default/Btn_ArrowR_2.png); --w: 18px; --h: 17px; }
.cr-status-element { left: 174px; top: 43px; width: 25px; height: 25px; }
.cr-status-element:not([src]) { display: none; }
.cr-status-name { left: 90px; top: 157px; width: 100px; text-align: center; font: 700 12px/14px "Courier New", "MingLiU", monospace; color: #222222; white-space: nowrap; overflow: hidden; }
.cr-palette { left: 520px; top: 200px; width: 204px; height: 164px; background: url(../assets/skin/white/Form_CreateRole_4.jpg) -38px -128px no-repeat; }
.cr-palette > * { position: absolute; }
.cr-zone { top: 3px; width: 36px; height: 22px; padding: 0; border: 2px solid transparent; border-radius: 0; background: none; font-size: 0; color: transparent; }
.cr-zone[aria-pressed=true] { border-color: #f0a020; box-shadow: inset 0 0 0 1px #ffe27a; }
.cr-default { left: 77px; top: 43px; --img: url(../assets/skin/default/btn_default.png); --w: 56px; --h: 20px; }
.cr-bar { left: 60px; width: 108px; height: 9px; background: #4b4b4b; pointer-events: none; }
.cr-bar i { position: absolute; left: 0; top: 0; height: 9px; background: no-repeat 0 0; }
.cr-step { width: 18px; height: 17px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 0; color: transparent; }
.cr-step:active { background: rgba(240, 160, 32, 0.25); }
.cr-back   { left: 560px; top: 490px; --img: url(../assets/skin/default/Btn_Prev_1.png); --w: 56px; --h: 20px; }
.cr-create { left: 660px; top: 490px; --img: url(../assets/skin/default/Btn_CreateCharacter.png); --w: 56px; --h: 20px; }
.cr-next   { left: 660px; top: 490px; --img: url(../assets/skin/default/btn_next.png); --w: 56px; --h: 20px; }

/* a mini-game's own screen (mg_stage.js): the original's 800 × 600 game screen in the middle, black around it, over
   the map and under the windows; the interface is hidden meanwhile except the game's 遊戲說明 form and prompts */
.mg-stage { position: fixed; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
.mg-stage canvas { flex: none; width: 800px; height: 600px; image-rendering: pixelated; }
body.mg-full #hud > :not(.window):not(#prompts) { visibility: hidden; }
body.mg-full #hud > .window:not(#win-mg-intro) { visibility: hidden; }

/* the night at the inn (shop.js _sleep): over the map, under the interface; it takes the clicks meanwhile */
.sleep-scene { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: auto; }
