:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #ddd7c5; background: #10110f; }
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
header { min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; border-bottom: 1px solid #35382e; }
h1 { margin: 0; font-size: 16px; font-weight: 600; }
.map-choice { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b7b9aa; }
select { max-width: 240px; min-height: 32px; border: 1px solid #494d40; border-radius: 4px; padding: 4px 8px; background: #1d201a; color: #ddd7c5; font: inherit; }
button:disabled, select:disabled { opacity: .5; cursor: wait; }
.controls { display: flex; align-items: center; gap: 5px; margin-left: auto; font-size: 13px; color: #b7b9aa; }
kbd { display: inline-grid; place-items: center; width: 24px; height: 25px; border: 1px solid #494d40; border-bottom-width: 2px; border-radius: 4px; font: inherit; }
button { color: #d7c99c; font: inherit; font-size: 13px; background: none; border: 0; padding: 8px 0; cursor: pointer; }
button:hover { color: #fff1c6; }
button:focus-visible, #world:focus-visible { outline: 2px solid #d7c99c; outline-offset: -3px; }
#world { position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
canvas { display: block; image-rendering: pixelated; }
#chat-entry { position: absolute; z-index: 1; margin: 0; padding: 0; transform-origin: 0 0; }
#chat-entry[hidden] { display: none; }
.chat-original-frame { position: absolute; left: 0; top: 0; pointer-events: none; image-rendering: pixelated; }
#chat-text { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 0; outline: none; background: transparent; color: #fff; caret-color: #fff; line-height: 14px; box-sizing: content-box; }
footer { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 4px 16px; font-size: 12px; color: #cbbd9d; }
.music-controls, .voice-controls, .effect-controls, .music-controls label, .voice-controls label, .npc-choice { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.music-controls, .voice-controls { gap: 12px; }
#music-volume, #voice-volume, #effect-volume { width: 60px; accent-color: #d7c99c; }
audio { display: none; }
#npc-panel { position: absolute; z-index: 2; bottom: 20px; right: 20px; width: min(290px, calc(100% - 40px)); padding: 12px 18px; border: 1px solid #a18a52; border-radius: 6px; background: #181a15f5; box-shadow: 0 6px 25px #0008; }
#npc-panel[hidden] { display: none; }
.npc-heading, .npc-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.npc-heading strong { color: #e3cf9c; font-size: 16px; }
#npc-close { font-size: 24px; padding: 0 4px; }
#voice-status { color: #b7b9aa; font-size: 13px; min-height: 18px; margin: 10px 0; }
.npc-choice select { font-size: 12px; min-height: 28px; max-width: 180px; }
#inventory-panel { position: absolute; z-index: 3; right: 16px; top: 12px; width: 264px; max-height: calc(100% - 24px); overflow-y: auto; padding: 6px 7px 8px; border: 1px solid #806b47; background: #17191bf5; box-shadow: 0 5px 24px #0009, inset 0 0 0 1px #302e29; font-size: 12px; }
#inventory-panel[hidden] { display: none; }
.inventory-heading { height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; color: #e2cea4; }
#inventory-close { font-size: 22px; line-height: 22px; padding: 0 3px; }
#inventory-preview { width: 248px; height: 146px; }
#inventory-preview-stage { position: relative; width: 248px; }
.inventory-tabs { display: flex; gap: 3px; margin: 0 4px 3px; border-bottom: 1px solid #746244; }
.inventory-tab { width: 56px; height: 24px; padding: 0; text-align: center; line-height: 22px; color: #aaa187; border: 1px solid #494237; border-bottom: 0; background: #1d1e1d; }
.inventory-tab[aria-selected="true"] { color: #f1dda9; border-color: #746244; background: #302c24; }
#inventory-grid { display: grid; grid-template-columns: repeat(8, 30px); grid-auto-rows: 30px; width: 240px; margin: 0 4px; }
.inventory-cell { position: relative; display: block; width: 30px; height: 30px; padding: 0; border: 1px solid #363434; background: #0e1012; box-shadow: inset 1px 1px #050608; }
button.inventory-cell:hover { border-color: #c9b376; background: #282822; }
.inventory-cell[aria-pressed="true"] { border-color: #f1d287; box-shadow: inset 0 0 0 1px #9a7f48; background: #302b1f; }
.inventory-cell:disabled { cursor: not-allowed; }
.inventory-icon { position: absolute; pointer-events: none; image-rendering: pixelated; }
#inventory-current { min-height: 30px; margin: 8px 4px 2px; color: #e5d19e; line-height: 15px; overflow-wrap: anywhere; }
.inventory-help { margin: 2px 4px 0; color: #a5a39a; font-size: 11px; }
#inventory-equipment[hidden], #inventory-avatar[hidden], #avatar-slots[hidden] { display: none; }
#avatar-slots { position: absolute; inset: 0; pointer-events: none; }
.avatar-slot { position: absolute; padding: 0; border: 1px solid transparent; pointer-events: auto; }
.avatar-slot:hover { background: #c9b37618; border-color: #c9b376; }
.avatar-slot[aria-pressed="true"] { border-color: #f1d287; box-shadow: inset 0 0 0 1px #9a7f48; }
.avatar-filter { display: flex; gap: 6px; align-items: center; margin: 4px 4px 0; }
.avatar-filter input { min-width: 0; width: 154px; height: 27px; padding: 4px 6px; border: 1px solid #62563d; border-radius: 2px; color: #e5d8b9; background: #101214; font: inherit; }
.avatar-filter button { white-space: nowrap; font-size: 12px; }
#avatar-current { margin: 4px 4px 6px; color: #e5d19e; line-height: 16px; min-height: 16px; overflow-wrap: anywhere; }
#avatar-grid { display: grid; grid-template-columns: repeat(7, 30px); grid-auto-rows: 30px; width: 210px; margin: 0 12px; }
.avatar-id { display: grid; height: 100%; place-items: center; overflow-wrap: anywhere; font-size: 9px; line-height: 9px; color: #c4b994; }
.avatar-unavailable { position: absolute; right: 0; bottom: 0; min-width: 10px; font-size: 10px; line-height: 11px; background: #582721; color: #ffcfb7; }
#avatar-grid .inventory-cell:disabled { opacity: .7; }
.avatar-pagination { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 2px 4px 0; }
.avatar-pagination button, .avatar-actions button { font-size: 11px; padding: 5px 1px; }
#avatar-status { color: #b7b5a4; font-size: 10px; text-align: center; }
#avatar-detail { min-height: 30px; margin: 2px 4px 0; color: #bfb7a4; line-height: 15px; overflow-wrap: anywhere; }
.avatar-actions { display: flex; justify-content: space-between; gap: 8px; margin: 2px 4px; border-top: 1px solid #39362c; }
#weapon-catalog-panel { position: absolute; inset: 12px; z-index: 4; padding: 10px; display: flex; flex-direction: column; gap: 10px; border: 1px solid #806b47; background: #17191bfa; box-shadow: 0 5px 24px #0009; font-size: 12px; }
#weapon-catalog-panel[hidden] { display: none; }
#weapon-catalog-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
#weapon-catalog-filters label { display: flex; align-items: center; gap: 5px; }
#weapon-catalog-filters input { background: #101214; border: 1px solid #494d40; border-radius: 3px; color: #ddd7c5; padding: 6px; min-height: 30px; }
#weapon-catalog-filters input[type="number"] { width: 64px; }
#weapon-catalog-filters input[type="checkbox"] { min-height: auto; }
#weapon-catalog-filters select { font-size: 12px; max-width: 150px; }
#weapon-catalog-scroll { min-height: 0; flex: 1; overflow: auto; border: 1px solid #363a36; }
#weapon-catalog-scroll table { width: 100%; border-collapse: collapse; white-space: nowrap; }
#weapon-catalog-scroll th { position: sticky; top: 0; background: #2c2c25; text-align: left; color: #dfc990; }
#weapon-catalog-scroll th, #weapon-catalog-scroll td { padding: 8px 10px; border-bottom: 1px solid #30322f; }
#weapon-catalog-scroll tbody tr:nth-child(even) { background: #ffffff04; }
.catalog-pagination { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#weapon-catalog-status { flex: 1; }
[data-rarity="1"] { color: #a6bfff; } [data-rarity="2"] { color: #d5a8ff; }
[data-rarity="3"] { color: #f5a4dc; } [data-rarity="4"] { color: #ffce73; } [data-rarity="5"] { color: #edb28b; }
@media (max-width: 560px) { header { gap: 12px; padding: 10px 14px; } h1 { font-size: 15px; } kbd { width: 20px; } }
