* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #15271e; }
body { font-family: Georgia, 'Times New Roman', serif; color: #f3edd9; }
.game-shell, canvas { width: 100%; height: 100%; display: block; }
canvas { image-rendering: auto; }
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; display: flex; align-items: flex-start; justify-content: space-between; padding: 30px 36px; font-size: 11px; letter-spacing: .16em; text-shadow: 0 2px 12px #0b1b13; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; letter-spacing: .28em; font-weight: bold; }
.brand-mark { color: #dfbd72; font-size: 24px; line-height: 1; }
.controls { margin-top: 4px; color: #d5d9c9; opacity: .85; letter-spacing: .08em; }
.key { display: inline-block; border: 1px solid #e9e4ce66; border-radius: 3px; padding: 5px 7px; color: #fff7dc; font-size: 9px; letter-spacing: .12em; }
.location { margin-top: 4px; color: #f2d496; font-size: 10px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #e2bf76; box-shadow: 0 0 10px #e2bf76; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 48%, #0a1710aa 100%); }
.inventory { position: fixed; inset: 0; z-index: 5; display: none; place-items: center; background: #08130db3; backdrop-filter: blur(4px); }
.inventory.open { display: grid; }
.inventory-card { width: min(680px, calc(100% - 32px)); padding: 28px; color: #eee6ce; background: linear-gradient(145deg, #1e3027f5, #101e18f5); border: 1px solid #c6a86666; border-radius: 5px; box-shadow: 0 25px 80px #0008; }
.inventory-heading { position: relative; padding-bottom: 22px; border-bottom: 1px solid #d1b77633; }
.inventory-heading h1 { margin: 5px 0 0; font-size: 29px; font-weight: normal; letter-spacing: .04em; }
.eyebrow, .section-label { color: #d8b86f; font-size: 10px; letter-spacing: .18em; }
#close-inventory { position: absolute; top: -8px; right: 0; border: 0; background: none; color: #d8b86f; font-size: 30px; cursor: pointer; }
.inventory-content { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; padding: 24px 0 10px; }
.hand-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.hand-slots > * { grid-row: 1; }
.hand-slots > [data-slot="left-hand"], .hand-slots > [data-slot="left-holster"] { grid-column: 1; }
.hand-slots > [data-slot="right-hand"], .hand-slots > [data-slot="right-holster"] { grid-column: 2; }
.holster-label { display: block; margin-top: 18px; }
.holster-slots .item-slot { min-height: 72px; }
.bag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.item-slot { min-height: 92px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border: 1px solid #d3b87555; border-radius: 4px; background: #0a1811aa; text-align: center; }
.item-slot[draggable="true"] { cursor: grab; }
.item-slot { position: relative; }
.stack-count { position: absolute; top: 5px; right: 7px; color: #f0d58e; font: bold 11px Arial, sans-serif; letter-spacing: 0; text-shadow: 0 1px 4px #000; }
.item-slot[draggable="true"]:active { cursor: grabbing; opacity: .65; }
.item-slot.drag-over { border-color: #e8c87d; background: #d8b86f22; }
.item-slot.empty { min-height: 58px; border-color: #d3b8751e; background: #0a181133; }
.item-slot strong { font-size: 12px; font-weight: normal; }
.item-slot small { color: #a9b09f; font-size: 9px; }
.item-icon { display: block; height: 30px; color: #e8c87d; font-size: 28px; line-height: 30px; }
.bow-icon { transform: rotate(-35deg); font-size: 34px; }
.inventory-tip { margin: 16px 0 0; color: #9aa594; font-size: 10px; text-align: right; letter-spacing: .08em; }
.shop-panel { position: fixed; inset: 0; z-index: 6; display: none; place-items: center; background: #08130db3; backdrop-filter: blur(4px); }
.shop-panel.open { display: grid; }
.shop-card { position: relative; width: min(430px, calc(100% - 32px)); padding: 28px; border: 1px solid #c6a86666; border-radius: 5px; color: #eee6ce; background: linear-gradient(145deg, #1e3027f5, #101e18f5); box-shadow: 0 25px 80px #0008; }
.shop-items[hidden], .warehouse-layout[hidden], .trader-layout[hidden] { display: none; }
.shop-card.warehouse-open { width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.shop-card.trader-open { width: min(520px, calc(100% - 32px)); }
.trader-balance { display: flex; justify-content: space-between; margin-top: 20px; padding: 13px 15px; border: 1px solid #d3b87544; border-radius: 3px; background: #0a1811aa; color: #d9d4c2; }
.trader-balance strong { color: #e8c87d; font-weight: normal; }
.trader-hint { margin: 12px 0; }
.trader-items { display: grid; gap: 7px; max-height: 44vh; overflow-y: auto; }
.trader-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid #d3b87533; border-radius: 3px; background: #0a1811aa; }
.trader-row-name { display: grid; gap: 4px; }
.trader-row-name strong { color: #eee6ce; font-size: 13px; font-weight: normal; }
.trader-row-name small, .trader-price { color: #a9b09f; font: 11px Arial, sans-serif; }
.trader-row button { padding: 8px 11px; border: 1px solid #d3b87566; border-radius: 3px; color: #f3edd9; background: #1a3022; font: 12px Georgia, serif; cursor: pointer; }
.trader-row button:disabled { opacity: .45; cursor: not-allowed; }
.warehouse-layout { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; margin-top: 20px; }
.warehouse-side { min-width: 0; }
.warehouse-side > .bag { margin: 0; }
.chest-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.chest-grid .item-slot { min-height: 76px; }
.warehouse-side .bag-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-card h2 { margin: 7px 0; font-size: 28px; font-weight: normal; }
.shop-card p { color: #abb3a0; font-size: 13px; }
#close-shop { position: absolute; top: 12px; right: 16px; border: 0; color: #d8b86f; background: none; font-size: 28px; cursor: pointer; }
.shop-items { display: grid; gap: 8px; margin-top: 20px; }
.shop-items div { display: flex; justify-content: space-between; padding: 14px; border: 1px solid #d3b87533; background: #0a1811aa; }
.shop-items strong { color: #e3c274; font-weight: normal; }
.interact-prompt { position: fixed; left: 50%; top: calc(50% - 58px); z-index: 10; display: none; transform: translateX(-50%); padding: 9px 14px; border: 1px solid #dfbd7266; border-radius: 4px; color: #f5e8c2; background: #102219ee; box-shadow: 0 5px 20px #0008; font: 12px Georgia, serif; letter-spacing: .06em; pointer-events: none; white-space: nowrap; }
.interact-prompt.visible { display: block; }
.hud { align-items: flex-start; padding-top: 24px; }
.brand { padding: 10px 15px; border: 1px solid #e4ca8b33; border-radius: 3px; background: linear-gradient(110deg, #13251dcc, #13251d66); box-shadow: 0 8px 26px #09150e55; }
.brand-mark { text-shadow: 0 0 14px #e8cb7b88; }
.controls { padding: 10px 15px; border: 1px solid #d4c79a2c; border-radius: 3px; background: #13231dbb; box-shadow: 0 8px 26px #09150e44; }
.location { padding: 10px 13px; border: 1px solid #e4ca8b33; border-radius: 3px; background: #13251dcc; }
.account-button { position: fixed; right: 24px; bottom: 24px; z-index: 4; padding: 10px 14px; border: 1px solid #e4ca8b66; border-radius: 3px; color: #f3edd9; background: linear-gradient(135deg, #24392beF, #101f17f5); box-shadow: 0 6px 20px #09150e77; font: 12px Georgia, serif; cursor: pointer; }
.account-button:hover, .account-actions button:hover, .account-logout:hover { border-color: #e8c87d; background-color: #304530; }
.account-panel { position: fixed; inset: 0; z-index: 12; display: none; place-items: center; padding: 16px; background: #08130dbb; backdrop-filter: blur(5px); }
.account-panel.open { display: grid; }
.account-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 30px; border: 1px solid #d4b66e88; border-radius: 5px; color: #eee6ce; background: radial-gradient(ellipse at 50% 0%, #3c4c37 0%, transparent 58%), linear-gradient(145deg, #1e3027f7, #101a15fa); box-shadow: 0 28px 90px #000a, inset 0 1px #f2d99422; }
.account-card h2 { margin: 8px 0; font-size: 26px; font-weight: normal; }
.account-close { position: absolute; top: 12px; right: 16px; border: 0; color: #d8b86f; background: none; font-size: 28px; cursor: pointer; }
.account-status { min-height: 36px; color: #c3c8b8; font: 13px Arial, sans-serif; line-height: 1.4; }
#account-form label, #profile-form label { display: block; margin: 14px 0 6px; color: #d8b86f; font-size: 12px; }
#account-form input, #profile-form input { width: 100%; padding: 11px 12px; border: 1px solid #d3b87555; border-radius: 3px; outline: none; color: #f3edd9; background: #0a1811cc; font: 14px Arial, sans-serif; }
#account-form input:focus, #profile-form input:focus { border-color: #e8c87d; box-shadow: 0 0 0 2px #e8c87d22; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.account-actions button, .account-logout, .profile-save { padding: 11px 12px; border: 1px solid #d3b87566; border-radius: 3px; color: #f3edd9; background: #15271eee; font: 13px Georgia, serif; cursor: pointer; }
.account-logout { width: 100%; }
.profile-username { color: #abb3a0; font-size: 12px; }
.profile-username strong { color: #e3c274; font-weight: normal; }
.profile-save { width: 100%; margin-top: 18px; }
.account-actions button:disabled { opacity: .6; cursor: wait; }
.inventory-card, .shop-card { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #3c4c37 0%, transparent 58%), linear-gradient(145deg, #1e3027f7, #101a15fa); border-color: #d4b66e88; box-shadow: 0 28px 90px #000a, inset 0 1px #f2d99422; }
.inventory-card::before, .shop-card::before { content: ''; position: absolute; top: 0; left: 8%; width: 84%; height: 2px; background: linear-gradient(90deg, transparent, #e3c477cc, transparent); }
.item-slot { border-color: #d3b87566; background: linear-gradient(145deg, #192a20dd, #0a1711ee); box-shadow: inset 0 1px #ffffff08, 0 4px 10px #0002; transition: border-color .16s, background .16s, transform .16s, box-shadow .16s; }
.item-slot[draggable="true"]:hover { transform: translateY(-2px); border-color: #e8c87d; background: linear-gradient(145deg, #293a28, #122017); box-shadow: 0 6px 16px #0004, 0 0 12px #e8c87d12; }
.item-slot.empty { background: linear-gradient(145deg, #0c1912aa, #0a1510aa); box-shadow: inset 0 2px 9px #0004; }
.item-icon { filter: drop-shadow(0 2px 3px #0007); }
.stack-count { min-width: 16px; padding: 2px 4px; border: 1px solid #ecd28b66; border-radius: 3px; background: #17231ddd; }
.shop-items div { border-radius: 3px; transition: background .16s, border-color .16s; }
.shop-items div:hover { border-color: #d3b87588; background: #18291edd; }
.interact-prompt { border-color: #e4cb8d99; background: linear-gradient(135deg, #24392beF, #101f17f5); box-shadow: 0 8px 30px #0009, 0 0 20px #d7b86a22; animation: prompt-glow 2s ease-in-out infinite; }
@keyframes prompt-glow { 50% { box-shadow: 0 8px 30px #0009, 0 0 24px #d7b86a44; } }
@media (max-width: 600px) { .inventory-card { padding: 20px; } .inventory-content { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 650px) { .warehouse-layout { grid-template-columns: 1fr; } .shop-card.warehouse-open { padding: 20px; } .chest-grid { gap: 5px; } .chest-grid .item-slot { min-height: 66px; } }
@media (max-width: 650px) { .hud { padding: 20px; } .controls { display: none; } .location { font-size: 9px; } }
