/* In-game screens: auth, character creator, loading, HUD, panels. */
body.play { overflow: hidden; height: 100vh; height: 100dvh; background: #0f1613; }
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 64px 16px 16px; overflow: auto;
  background: radial-gradient(120% 90% at 50% 0%, #22342d 0%, #121a17 70%); }
.play-top { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 18px; padding: 0 18px; z-index: 5; }
.play-top .who { margin-left: auto; color: var(--stone); }
body.in-game .play-top { display: none; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--birch); font: 900 1.45rem/1 var(--display); letter-spacing: 0.04em; }

.auth-card { width: min(420px, 100%); background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.auth-card h2 { font-size: 2.2rem; }

.loading { text-align: center; width: min(360px, 90vw); }
.loading p { color: var(--stone); margin: 18px 0 12px; }
.loading-track { height: 6px; background: rgba(236, 231, 218, 0.1); border-radius: 3px; overflow: hidden; }
.loading-track i { display: block; height: 100%; width: 0; background: var(--ember); transition: width 0.3s; }

.creator { display: grid; grid-template-columns: 340px minmax(280px, 420px); gap: 36px; align-items: center; background: var(--glass);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
#creator-preview { width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, #6b9a4c 0%, #4a7339 70%, #3a5c2d 100%); }
.creator-controls h2 { font-size: 2.6rem; margin-bottom: 4px; }
.creator-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; margin: 12px 0; }
.creator-row > span { font-weight: 700; font-size: 0.9rem; color: var(--stone); }
.swatches, .choices { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.35); background: var(--c); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--ember); outline-offset: 2px; }
.choice { font: 700 0.85rem var(--body); color: var(--birch); background: var(--spruce-3); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; text-transform: capitalize; }
.choice.on { border-color: var(--ember); color: var(--ember); }
@media (max-width: 760px) { .creator { grid-template-columns: 1fr; justify-items: center; } #creator-preview { width: 220px; height: 220px; } }

/* ---------------------------------------------------------------- game */
#game { position: fixed; inset: 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
#game-ui { position: absolute; inset: 0; pointer-events: none; font-size: 14px; user-select: none; -webkit-user-select: none; }
#game-ui > * { pointer-events: auto; }
#game-ui .hud-vitals, #game-ui .hud-stats, #game-ui .hud-hint, #game-ui .gains, #game-ui .hurt-ring, #game-ui .build-banner, #game-ui .hud-status { pointer-events: none; }

.hud-vitals { position: absolute; top: 14px; left: 14px; width: 248px; padding: 10px 12px; background: rgba(14, 21, 18, 0.62); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(4px); }
.vital { display: grid; grid-template-columns: 20px 1fr 42px; align-items: center; gap: 8px; height: 22px; }
.v-icon { display: grid; place-items: center; }
.vital .bar { height: 9px; background: rgba(236, 231, 218, 0.1); border-radius: 5px; overflow: hidden; }
.vital .bar i { display: block; height: 100%; width: 100%; border-radius: 5px; transition: width 0.25s; }
.vital b { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.v-hp .bar i { background: linear-gradient(90deg, #b83c34, #e05a4e); }
.v-st .bar i { background: #d9b84a; }
.v-hu .bar i { background: #c27a46; }
.v-th .bar i { background: #5aa0c8; }
.v-tp .bar i { background: #8fbf6a; }
.v-tp.cold .bar i { background: #7fb2e0; }
.v-tp.hot .bar i { background: #e08a4a; }
.vital.warn b { color: #ff8a7a; }
.vital.warn .v-icon { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.hud-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hud-chips:empty { display: none; }
.chip { font-size: 0.75rem; padding: 2px 7px; border-radius: 10px; background: rgba(201, 211, 163, 0.12); color: var(--lichen); }
.chip.buff { background: rgba(126, 196, 120, 0.18); color: #b9e6a8; }                    /* v0.9.0: a vial at work */
.chip.safe { background: rgba(201, 161, 74, 0.22); color: #f0d79a; }                      /* v0.12.0: inside the Crossroads */

.hud-world { position: absolute; top: 14px; right: 14px; display: grid; justify-items: center; gap: 6px; width: 210px; }
.minimap { width: 168px; height: 168px; border-radius: 50%; border: 3px solid rgba(14, 21, 18, 0.85); box-shadow: 0 0 0 1px var(--line), 0 6px 20px rgba(0, 0, 0, 0.35); cursor: pointer; background: #121a17; }
.hud-clock { display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 10px; border-radius: 14px; background: rgba(14, 21, 18, 0.72); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-clock em { font-style: normal; font-weight: 400; color: var(--stone); font-size: 0.85rem; }
.hud-coords { font-size: 0.78rem; color: var(--stone); background: rgba(14, 21, 18, 0.6); padding: 2px 8px; border-radius: 10px; font-variant-numeric: tabular-nums; }

.hud-stats { position: absolute; right: 14px; top: 260px; min-width: 176px; max-width: 240px; padding: 10px 12px; background: rgba(14, 21, 18, 0.55); border: 1px solid var(--line); border-radius: 10px; font-size: 0.84rem; }
.hud-stats-name { font: 800 1.15rem/1 var(--display); margin-bottom: 6px; }
.hud-stats dl, .stat-list, .tt-rows, .keys { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 0; }
.hud-stats dt, .stat-list dt { color: var(--stone); }
.hud-stats dd, .stat-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.hud-stats dd { white-space: nowrap; }
.hud-stats dt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-status { position: absolute; right: 14px; bottom: 10px; font-size: 0.75rem; color: var(--stone); }

.hud-bottom { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; }
.hotbar { display: flex; gap: 5px; padding: 6px; background: rgba(14, 21, 18, 0.66); border: 1px solid var(--line); border-radius: 10px; align-items: center; }
.hotbar-gap { width: 8px; }
.progress { position: relative; width: 300px; height: 22px; background: rgba(14, 21, 18, 0.85); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; z-index: 1; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(232, 133, 58, 0.55); }

/* slots */
.slot { position: relative; width: 52px; height: 52px; border-radius: 7px; background: rgba(10, 16, 13, 0.72); border: 1px solid rgba(201, 211, 163, 0.14);
  box-shadow: inset 0 -2px 0 var(--rarity, transparent); display: grid; place-items: center; cursor: pointer; touch-action: none; }
.slot.small { width: 44px; height: 44px; }
.slot img { width: 80%; height: 80%; pointer-events: none; }
.slot.small img { width: 74%; height: 74%; }
.slot .slot-ghost { opacity: 0.16; filter: grayscale(1); }
.slot:hover { border-color: rgba(201, 211, 163, 0.4); }
.slot.selected { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember), 0 0 14px rgba(232, 133, 58, 0.35), inset 0 -2px 0 var(--rarity, transparent); }
.slot-key { position: absolute; top: 2px; left: 4px; font-size: 0.68rem; font-weight: 700; color: var(--stone); }
.slot-qty { position: absolute; right: 4px; bottom: 2px; font-size: 0.78rem; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot-ammo { position: absolute; right: 3px; top: 2px; font-size: 0.66rem; font-weight: 700; color: #e8c35a; text-shadow: 0 1px 2px #000; }
.slot-dura { position: absolute; left: 5px; right: 5px; bottom: 4px; height: 3px; background: rgba(0, 0, 0, 0.5); border-radius: 2px; overflow: hidden; }
.slot-dura i { display: block; height: 100%; }
.slot-water { color: #8cc8f0; top: auto; bottom: 7px; }                            /* v0.9.0: sips in a bottle */
.slot-water-bar i { background: #5aa8e8; }
.slot.spoiling::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #9aa04a; box-shadow: 0 0 0 1px #000; }
.drag-ghost { position: fixed; width: 48px; height: 48px; pointer-events: none; z-index: 2000; opacity: 0.9; }
.drag-ghost img { width: 100%; height: 100%; }

.tooltip { position: fixed; z-index: 1500; display: none; width: 260px; padding: 12px 14px; background: rgba(12, 18, 15, 0.97); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.86rem; pointer-events: none; }
.tt-name { font: 800 1.2rem/1.1 var(--display); }
.tt-type { color: var(--stone); font-size: 0.78rem; margin: 2px 0 6px; text-transform: capitalize; }
.tt-desc { margin-bottom: 8px; }
.tt-rows dt { color: var(--stone); }
.tt-rows dd { margin: 0; text-align: right; }

/* chat */
.hud-chat { position: absolute; left: 14px; bottom: 14px; width: min(400px, 40vw); display: grid; gap: 5px; }
/* the hotbar is ~750px wide and centred: below ~1600px it would run under the chat box, so the chat sits above it */
@media (max-width: 1599px) { .hud-chat { bottom: 80px; } }
.hud-chat:hover .chat-log, .hud-chat:focus-within .chat-log { background: rgba(14, 21, 18, 0.45); }
.chat-log { height: 180px; overflow-y: auto; padding: 6px 8px; background: transparent; border-radius: 8px; font-size: 0.86rem; line-height: 1.35; scrollbar-width: thin; mask-image: linear-gradient(transparent, #000 25%); }
.chat-line { margin: 2px 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); overflow-wrap: anywhere; }
.chat-time { color: var(--stone); font-size: 0.72rem; margin-right: 5px; }
.chat-ch { font-size: 0.72rem; font-weight: 700; margin-right: 5px; padding: 0 4px; border-radius: 3px; background: rgba(236, 231, 218, 0.1); }
.chat-line b { margin-right: 2px; }
.ch-global .chat-ch { color: #e8c35a; }
.ch-party .chat-ch, .ch-party b { color: #9fe08a; }
.ch-clan .chat-ch, .ch-clan b { color: #7fcfc0; }
.ch-whisper { color: #d7b6f0; }
/* v0.12.1: local speech — yelled (orange capitals, as over the head) and said quietly (pale; "pspsps" when too far) */
.ch-local.mode-yell, .ch-local.mode-yell .chat-ch { color: #ffb36b; }
.ch-local.mode-quiet { color: #e9dca8; }
.ch-local.mode-quiet .chat-ch { color: #e9dca8; }
.ch-local.unheard span:last-child { font-style: italic; opacity: 0.8; }
.ch-system { color: var(--lichen); font-style: italic; }
.chat-tabs { display: flex; gap: 4px; }
.chat-tab { font: 700 0.75rem var(--body); color: var(--stone); background: rgba(14, 21, 18, 0.7); border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px; cursor: pointer; }
.chat-tab.on { color: var(--birch); border-color: var(--ember); }
.chat-input { background: rgba(14, 21, 18, 0.78); padding: 8px 10px; font-size: 0.9rem; }

.hud-hint { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); padding: 6px 12px; border-radius: 6px; background: rgba(14, 21, 18, 0.85); opacity: 0; transition: opacity 0.2s; }
.hud-hint.show { opacity: 1; }
.build-banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px; background: rgba(40, 60, 40, 0.92); border: 1px solid var(--ok); font-weight: 700; }
.gains { position: absolute; right: 210px; bottom: 120px; display: grid; gap: 4px; justify-items: end; }
.gain { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 14px; background: rgba(14, 21, 18, 0.82); font-weight: 700; font-size: 0.85rem; animation: gain 2.2s ease-out forwards; }
.gain img { width: 22px; height: 22px; }
@keyframes gain { 0% { transform: translateX(16px); opacity: 0; } 10% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.hurt-ring { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at calc(50% + cos(var(--a, 0rad)) * 45%) calc(50% + sin(var(--a, 0rad)) * 45%), rgba(200, 30, 30, 0.45), transparent 45%); }
.hurt-ring.on { animation: hurt 0.6s ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }
.prompts { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; }
.prompt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--glass); border: 1px solid var(--ember); border-radius: 8px; }
.achievement { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; padding: 12px 26px; border-radius: 10px; background: rgba(20, 30, 25, 0.95); border: 1px solid #c9a14a; box-shadow: 0 0 30px rgba(201, 161, 74, 0.3); animation: toast-in 0.3s ease-out; text-align: center; }
.achievement small { color: #c9a14a; font-weight: 700; }
.achievement strong { font: 900 1.7rem/1.1 var(--display); }
.achievement.out { opacity: 0; transition: opacity 0.5s; }

.touch-stick { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(236, 231, 218, 0.3); background: rgba(14, 21, 18, 0.3); display: none; pointer-events: none; }
.touch-stick .knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(236, 231, 218, 0.45); }

/* death / disconnect */
.death-screen, .disconnected { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; background: radial-gradient(circle, rgba(40, 8, 8, 0.55), rgba(8, 4, 4, 0.88)); padding: 16px; }
.death-screen h2, .disconnected h2 { font-size: clamp(3rem, 9vw, 6rem); color: #e8d6c8; margin: 0; }
.disconnected { background: rgba(10, 14, 12, 0.9); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- panels */
.panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: min(78vh, 760px); display: none; flex-direction: column;
  background: rgba(18, 27, 23, 0.96); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); z-index: 50; }
.panel.open { display: flex; }
.panel.wide { width: min(940px, 96vw); }
.panel.tall { max-height: 86vh; }
.panel-small { width: min(340px, 92vw); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 1.6rem; margin: 0; }
.panel-close { font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--stone); cursor: pointer; padding: 0 4px; }
.panel-close:hover { color: var(--birch); }
.panel > :not(.panel-head) { padding: 14px 16px; overflow: auto; }
.panel h4 { font-size: 1.15rem; color: var(--lichen); margin: 4px 0 8px; }
.panel-inventory { left: auto; right: 2vw; transform: translateY(-50%); width: min(620px, 96vw); }
.panel-inventory.wide { width: min(980px, 96vw); }
.panel-crafting { left: 2vw; transform: translateY(-50%); width: min(560px, 96vw); }
.panel-trade, .panel-vendor { left: 2vw; transform: translateY(-50%); }
.panel-inspect { top: 30%; }

.inv-layout { display: flex; gap: 18px; flex-wrap: wrap; }
.inv-grid { display: grid; grid-template-columns: repeat(6, 52px); gap: 5px; }
.inv-hot { grid-template-columns: repeat(5, 52px); }
.inv-main { flex: 1; min-width: 330px; }
.equip { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 10px; }
.equip-cell { display: grid; justify-items: center; gap: 2px; }
.equip-cell small { color: var(--stone); font-size: 0.7rem; text-transform: capitalize; }
.inv-container { padding-right: 18px; border-right: 1px solid var(--line); }
.inv-container .btn { margin-top: 10px; }
/* v0.22.0: the open bag — a narrow column of its own next to the backpack */
.inv-bag { max-width: 260px; }
.inv-bag h4 { display: flex; align-items: center; gap: 6px; }
.inv-bag-icon { width: 22px; height: 22px; image-rendering: auto; }
.inv-bag-close { margin-left: auto; font-size: 18px; line-height: 1; padding: 0 4px; }
.inv-bag .inv-grid { grid-template-columns: repeat(4, 52px); }
/* v0.23.0: up to four open bags, one under another (a scroll when they don't fit) */
.inv-bags { display: flex; flex-direction: column; gap: 12px; max-height: 72vh; overflow-y: auto; }
/* v0.23.0: the open bags in a window of their own, at the left (the inventory stays at the right, the ground between) */
.panel-bags { left: 2vw; right: auto; transform: translateY(-50%); width: auto; max-width: min(600px, 96vw); }
.panel-bags.two-cols .inv-bags { display: grid; grid-template-columns: repeat(2, auto); column-gap: 18px; }
.panel-bags.two-cols .inv-bags.several .inv-bag:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.inv-bags .inv-container { padding-right: 0; border-right: 0; }
.inv-bags.several .inv-bag { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.inv-bags.several .inv-bag:last-child { border-bottom: 0; }
.inv-bags.several .inv-bag .inv-grid { grid-template-columns: repeat(4, 44px); }
.inv-bags.several .inv-bag .btn { margin-top: 6px; }
.slot-bag { color: #e8d39a; top: auto; bottom: 7px; }
.weight { position: relative; margin-top: 12px; height: 18px; background: rgba(236, 231, 218, 0.08); border-radius: 9px; overflow: hidden; }
.weight span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; z-index: 1; }
.weight i { display: block; height: 100%; background: rgba(143, 191, 106, 0.45); }
.weight.over i { background: rgba(217, 83, 74, 0.55); }
.coins { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 10px 0 4px; }
.coins img { width: 22px; height: 22px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tab { font: 700 0.8rem var(--body); color: var(--stone); background: var(--spruce-2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; cursor: pointer; }
.tab.on { color: var(--birch); border-color: var(--ember); }
.recipes { display: grid; gap: 6px; }
.recipe { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; background: rgba(236, 231, 218, 0.04); border: 1px solid transparent; }
.recipe:hover { border-color: var(--line); }
.recipe.unavailable { opacity: 0.55; }
/* (v0.23.1) the crafting list holds ~500 recipes (~10 000 elements, ~1700 icons): rows out of sight are skipped when
   the page draws. Before, an open crafting window slowed every frame of the game (measured in a software-rendered
   browser: 69 frames in 6 s closed, 27 open, stalls up to 2 s; with this, 42 — found in the 0.23.1 e2e regression) */
.panel-crafting .recipe { content-visibility: auto; contain-intrinsic-size: auto 84px; }
.recipe-icon { width: 44px; height: 44px; }
.recipe-name { font-weight: 700; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.tag { font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; background: rgba(201, 211, 163, 0.12); color: var(--lichen); }
.tag-hand { background: rgba(143, 191, 106, 0.14); color: #b5d99a; }
.tag-bad { background: rgba(217, 83, 74, 0.18); color: #ff9a8f; }
.tag-time { color: var(--stone); }
.ings { display: flex; flex-wrap: wrap; gap: 6px; }
.ing { display: inline-flex; align-items: center; gap: 3px; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.ing img { width: 20px; height: 20px; }
.ing.missing { color: #ff9a8f; }
.recipe-actions { display: flex; gap: 4px; }
.station-note { display: flex; gap: 10px; align-items: center; color: var(--lichen); }
.empty-state { padding: 20px; text-align: center; }

.char { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.skills { display: grid; gap: 10px; }
.skill-top { display: flex; justify-content: space-between; }
.xpbar { height: 6px; background: rgba(236, 231, 218, 0.1); border-radius: 3px; margin: 4px 0; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--lichen); }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ach { padding: 8px; border-radius: 6px; background: rgba(236, 231, 218, 0.04); opacity: 0.45; display: grid; }
.ach small { color: var(--stone); font-size: 0.75rem; }
.ach.got { opacity: 1; border: 1px solid rgba(201, 161, 74, 0.5); }
.ach.got strong { color: #e8c35a; }
@media (max-width: 760px) { .char { grid-template-columns: 1fr; } }

.map-wrap { display: grid; gap: 10px; }
.worldmap { width: 100%; height: auto; border-radius: 8px; cursor: grab; background: #121915; touch-action: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; align-items: center; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid #141a17; }
.lg-you::before { background: var(--ember); } .lg-spawn::before { background: #e8dcb8; } .lg-vendor::before { background: #e8c35a; }
.lg-prop::before { background: #7fcf9a; } .lg-bed::before { background: #8fb3e0; } .lg-death::before { background: var(--danger); }

.props { display: grid; gap: 12px; }
.prop-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.members { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.members li { display: flex; gap: 10px; align-items: center; }
.role { font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: rgba(201, 211, 163, 0.12); }
.role-OWNER { color: #e8c35a; } .role-ADMIN { color: #e8853a; } .role-MEMBER { color: #9fe08a; }
.prop-card .row { justify-content: flex-start; margin-top: 8px; flex-wrap: nowrap; }
.prop-card .row input, .prop-card .row select { padding: 7px 9px; }
.roles-help summary { cursor: pointer; color: var(--lichen); }

/* clan panel */
.clan { display: grid; gap: 12px; }
.clan .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-start; }
.clan .row input { flex: 1 1 140px; min-width: 0; padding: 7px 9px; }
.clan .row input.tag-input { flex: 0 0 84px; text-transform: uppercase; letter-spacing: 0.06em; }
.clan-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.clan-head h4 { margin: 0; font-size: 1.15rem; }
.clan-tag { font: 800 1rem/1 var(--display); color: #8fcaf0; letter-spacing: 0.05em; }
.clan-invite { padding: 10px 12px; border: 1px solid var(--ember); border-radius: 8px; }
.clan-invite p { margin: 0 0 8px; }
.motd { margin: 0; padding: 8px 10px; border-left: 3px solid #8fcaf0; background: rgba(143, 202, 240, 0.07); border-radius: 0 6px 6px 0; }
.motd-input { flex: 1 1 260px; min-width: 0; resize: vertical; font: inherit; color: var(--birch); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.clan-members li .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clan-members li.offline .who { color: #9aa394; }
.clan-members .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #59625a; }
.clan-members li.online .dot { background: #7cc46a; box-shadow: 0 0 6px rgba(124, 196, 106, 0.6); }
.clan-members .btn-link { font-size: 0.82rem; }
.clan-members .btn-link.danger, .btn-link.danger { color: var(--danger); }
.rank-LEADER { color: #e8c35a; } .rank-OFFICER { color: #e8853a; } .rank-MEMBER { color: #9fe08a; } .rank-RECRUIT { color: #b9c2b0; }
.clan-lands h4 { margin: 0 0 6px; }
.clan-lands { display: grid; gap: 6px; }
.clan .row.clan-foot { justify-content: flex-end; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #1b0d0c; }
.btn-danger:hover { background: #e86a61; border-color: #e86a61; }

.settings .field { grid-template-columns: 80px 1fr; align-items: center; }
.keys { grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.88rem; }
.keys dd { margin: 0; color: var(--stone); }

.menu { display: grid; gap: 6px; }
.menu-item { display: flex; justify-content: space-between; align-items: center; font: 700 1.05rem var(--body); color: var(--birch); background: var(--spruce-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; text-align: left; }
.menu-item:hover { border-color: var(--ember); }
.menu-item.danger { color: #ff9a8f; }
.menu-item.admin-toggle { color: #ffd27a; border-style: dashed; }
.menu-item.admin-toggle.on { border-color: var(--ember); background: rgba(232, 128, 58, 0.16); }

.trade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trade-col { min-height: 140px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.trade-items { display: grid; gap: 4px; }
.trade-item { display: flex; align-items: center; gap: 8px; }
.trade-item img { width: 28px; height: 28px; }
.trade-actions, .trade > .muted { grid-column: 1 / -1; }
.ok { font-size: 0.85rem; color: var(--stone); margin: 8px 0 0; }
.ok.yes { color: var(--ok); font-weight: 700; }

.vendor-head, .vendor-row { display: grid; grid-template-columns: 30px 1fr 50px 50px auto auto; gap: 8px; align-items: center; }
.vendor-head { grid-template-columns: 1fr 50px 50px 120px; padding-left: 38px; font-size: 0.78rem; color: var(--stone); }
.vendor-list { display: grid; gap: 4px; }
.vendor-row img { width: 30px; height: 30px; }
.price { font-variant-numeric: tabular-nums; color: #e8c35a; font-weight: 700; }
.price.sell { color: var(--ok); }

.inspect-gear { display: grid; gap: 6px; }
.inspect-item { display: flex; align-items: center; gap: 8px; }
.inspect-item img { width: 28px; height: 28px; }

.ctx-menu { position: absolute; z-index: 300; min-width: 190px; padding: 6px; background: rgba(14, 21, 18, 0.97); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); display: grid; gap: 2px; }
.ctx-title { font: 800 1.1rem/1 var(--display); padding: 6px 8px 8px; color: var(--lichen); }
.ctx-item { display: flex; justify-content: space-between; align-items: center; font: 700 0.92rem var(--body); text-align: left; background: none; border: 0; color: var(--birch); padding: 8px; border-radius: 5px; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: rgba(232, 133, 58, 0.18); outline: none; }
.ctx-item.danger { color: #ff9a8f; }

.build-bar { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 92vw; padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; }
.build-item { display: flex; align-items: center; gap: 6px; font: 700 0.82rem var(--body); color: var(--birch); background: var(--spruce-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px 4px 4px; cursor: pointer; }
.build-item img { width: 30px; height: 30px; }
.build-item:hover { border-color: var(--ember); }

.qty-box { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); z-index: 400; display: grid; gap: 8px; width: 280px; padding: 16px; background: var(--glass); border: 1px solid var(--ember); border-radius: 10px; }

@media (max-width: 900px) {
  .hud-stats { display: none; }
  .hud-chat { width: 46vw; }
  .chat-log { height: 110px; }
  .slot { width: 44px; height: 44px; }
  .inv-grid { grid-template-columns: repeat(6, 44px); }
  .inv-bag .inv-grid { grid-template-columns: repeat(4, 44px); }
  .panel-inventory, .panel-crafting, .panel-trade, .panel-vendor { left: 50%; right: auto; transform: translate(-50%, -50%); }
  .panel-bags { top: auto; bottom: 2vh; left: 50%; transform: translateX(-50%); }
  .panel-bags.two-cols .inv-bags { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hud-vitals { width: 190px; padding: 6px 8px; }
  .minimap { width: 110px; height: 110px; }
  .hud-world { width: 120px; }
  .hotbar .slot.small { display: none; }
}

/* ===================== v0.3.0 — crafting and homes ===================== */
.tab-alt { border-style: dashed; }
.craft-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.craft-search { flex: 1 1 160px; padding: 6px 9px; }
.tag-tier { color: var(--tier); background: color-mix(in srgb, var(--tier) 16%, transparent); font-weight: 700; }
.tag-ok { background: rgba(143, 191, 106, 0.14); color: #b5d99a; }
.tag-quality { color: #e8c35a; background: rgba(232, 195, 90, 0.12); }
.recipe.locked { background: rgba(80, 110, 150, 0.08); }
.recipe-why { color: var(--stone); font-weight: 400; }
.recipe-lock { font-size: 0.78rem; color: #9cc3e6; }
.ing.byproduct { color: var(--lichen); }
.qty-mini { width: 52px; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.recipe-actions { align-items: center; }
.cq-free { display: block; line-height: 1.1; color: #ffd27a; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.craft-admin { margin: 0 0 10px; padding: 8px 10px; border: 1px dashed var(--ember); border-radius: 8px; color: #ffd27a; background: rgba(232, 128, 58, 0.12); font-size: 0.9rem; }
.craft-queue { display: grid; gap: 4px; margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(10, 16, 13, 0.45); }
.cq-head { display: flex; justify-content: space-between; align-items: baseline; }
.cq-job { display: grid; grid-template-columns: 28px minmax(0, 1.2fr) minmax(60px, 1fr) auto auto; gap: 8px; align-items: center; font-size: 0.85rem; }
.cq-job img { width: 26px; height: 26px; }
.cq-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cq-bar { height: 8px; background: rgba(0, 0, 0, 0.45); border-radius: 4px; overflow: hidden; }
.cq-bar i { display: block; height: 100%; width: 0; background: var(--ember); transition: width 0.2s linear; }
.cq-time { font-variant-numeric: tabular-nums; color: var(--lichen); min-width: 64px; text-align: right; }
.queue-hud { font: 700 0.78rem var(--body); color: var(--birch); background: rgba(14, 21, 18, 0.85); border: 1px solid var(--line); border-radius: 11px; padding: 3px 12px; cursor: pointer; }
.queue-hud.hidden { display: none; }
.broken { color: #ff9a8f; }
.tech-tree { display: grid; gap: 8px; }
.tier { padding: 8px 10px; border-radius: 8px; border-left: 4px solid var(--tier); background: rgba(236, 231, 218, 0.03); opacity: 0.7; }
.tier.open { opacity: 1; }
.tier-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tier-head strong { color: var(--tier); }
.tier p { margin: 4px 0; }
.tier-items { display: flex; flex-wrap: wrap; gap: 3px; }
.tier-items img { width: 26px; height: 26px; }
.tier-items img.unknown { filter: grayscale(1) brightness(0.6); }

.slot-q { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 2px; box-shadow: 0 0 0 1px #000; }
.slot.broken img { filter: grayscale(0.8) brightness(0.7); }
.slot-broken { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%) rotate(-12deg); text-align: center; font-size: 0.6rem; font-weight: 700; color: #ff9a8f; text-shadow: 0 1px 2px #000; text-transform: uppercase; letter-spacing: 0.04em; }
.tt-broken { color: #ff9a8f; font-size: 0.8rem; margin: 4px 0; }
.ct-weight { color: var(--lichen); font-weight: 400; }
.ct-weight.full { color: #ffb36b; }

.panel-properties { width: min(760px, 96vw); }
.prop-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.prop-head h4 { margin: 0; font-size: 1.25rem; }
.prop-level { color: #e8c35a; font-weight: 700; font-size: 0.85rem; }
.prop-stats { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 3px 12px; margin: 10px 0; font-size: 0.85rem; }
.prop-stats dt { color: var(--stone); }
.prop-stats dd { margin: 0; }
.sec-bar { display: inline-block; width: 70px; height: 7px; background: rgba(0, 0, 0, 0.45); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.sec-bar i { display: block; height: 100%; background: linear-gradient(90deg, #d9534a, #e0b44a, #8fbf6a); }
.prop-next { padding: 8px; border-radius: 6px; background: rgba(232, 195, 90, 0.06); margin: 6px 0; }
.reqs { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.82rem; color: #ff9a8f; }
.reqs li.ok { color: #b5d99a; }
.prop-card h5 { margin: 10px 0 4px; font-size: 0.95rem; }
.members li .who { min-width: 110px; }
.members li select { padding: 3px 6px; }
.role-CO_OWNER { color: #e8853a; } .role-FRIEND { color: #8fcaf0; } .role-GUEST { color: var(--lichen); } .role-VISITOR { color: var(--stone); }
.perm-wrap summary { cursor: pointer; color: var(--lichen); margin: 8px 0 4px; }
.perm-scroll { overflow-x: auto; }
.perm-table { border-collapse: collapse; font-size: 0.72rem; }
.perm-table th, .perm-table td { padding: 3px 5px; text-align: center; border-bottom: 1px solid rgba(201, 211, 163, 0.08); }
.perm-table thead th { font-weight: 700; font-size: 0.7rem; padding: 4px 6px; }
.perm-table tbody th { text-align: left; white-space: nowrap; font-weight: 400; color: var(--lichen); padding-right: 12px; }
.prop-card .row { flex-wrap: wrap; align-items: center; }
.prop-card .row input { flex: 1 1 150px; width: auto; min-width: 0; }
.prop-card .row select { flex: 0 0 auto; width: auto; }

.penter { position: absolute; top: 22vh; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; justify-items: center; gap: 2px; padding: 8px 18px; min-width: 300px;
  background: var(--glass); border: 1px solid rgba(143, 191, 106, 0.6); border-radius: 10px; text-align: center; transition: opacity 0.4s; pointer-events: none; }
.penter strong { font-size: 1.05rem; }
.penter span { font-size: 0.8rem; color: var(--lichen); }
.penter em { font-style: normal; font-size: 0.78rem; color: #b5d99a; }
.penter.denied { border-color: #d9534a; }
.penter.denied em { color: #ff9a8f; font-weight: 700; letter-spacing: 0.02em; }
.penter.out { opacity: 0; }

.build-bar { align-items: flex-start; max-height: 46vh; overflow-y: auto; }
.build-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 3px 6px; border-left: 2px solid var(--line); }
.build-group > small { width: 100%; color: var(--stone); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.input-prompt input { font-size: 1.2rem; letter-spacing: 0.2em; text-align: center; }

/* ---------------------------------------------------------------- v0.4.0: market, stalls, upkeep, rent, wounds, gunshots */
.panel-market { width: min(760px, 96vw); }
.panel-shop { left: 2vw; transform: translateY(-50%); width: min(520px, 96vw); }
.panel-rent { top: 34%; }
.market { display: grid; gap: 10px; }
.mk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mk-head .muted { flex: 1 1 260px; }
.mk-balance { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.mk-balance img { width: 20px; height: 20px; }
.mk-filters { justify-content: flex-start; margin-bottom: 8px; }
.mk-filters input[type=search] { flex: 1 1 160px; min-width: 0; }
.mk-list { display: grid; gap: 4px; }
.mk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(60px, auto) auto auto; gap: 10px; align-items: center;
  padding: 5px 8px; border-radius: 6px; background: rgba(236, 231, 218, 0.04); }
.mk-row:hover { background: rgba(236, 231, 218, 0.08); }
.mk-item { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mk-item img { width: 30px; height: 30px; flex: none; }
.mk-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-qty, .mk-cond { font-size: 0.78rem; color: var(--stone); }
.mk-price strong { color: #e8c35a; }
.mk-seller { font-size: 0.8rem; color: var(--lichen); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row input[type=number] { width: 84px; }
.mk-pager { margin-top: 8px; }
.mk-sell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.mk-sellgrid { grid-template-columns: repeat(5, 48px); }
.mk-sellgrid .slot { width: 48px; height: 48px; padding: 0; cursor: pointer; }
.mk-sellform { display: grid; gap: 8px; align-content: start; }
.mk-sellform label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.mk-sellform input { width: 110px; }
@media (max-width: 640px) {
  .mk-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .mk-row .mk-seller, .mk-row .mk-left { display: none; }
  .mk-sell { grid-template-columns: 1fr; }
  .panel-shop { left: 50%; transform: translate(-50%, -50%); }
}
.prop-upkeep, .prop-rent { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: rgba(236, 231, 218, 0.04); }
.prop-upkeep.unpaid { background: rgba(217, 83, 74, 0.12); border: 1px solid rgba(217, 83, 74, 0.5); }
.prop-upkeep h5, .prop-rent h5 { margin: 0 0 4px; }
.prop-upkeep input[type=number], .prop-rent input[type=number] { width: 80px; }
.warn { color: #ff9a8f; font-weight: 700; }
.att-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; max-width: 230px; }
.btn-link { background: none; border: 0; color: var(--ember); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
.btn-link.danger { color: #ff9a8f; }
.gunshot { position: absolute; z-index: 55; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px;
  pointer-events: none; animation: gunshot 3.5s ease-out forwards; }
.gunshot i { display: block; width: 26px; height: 26px; background: radial-gradient(circle at 70% 50%, #ffd889 0 18%, transparent 20%),
  conic-gradient(from 60deg at 30% 50%, transparent 0 60deg, rgba(255, 216, 137, 0.85) 60deg 120deg, transparent 120deg); border-radius: 50%; }
.gunshot span { font: 700 0.72rem var(--body); color: #ffe7b0; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.gunshot.muffled span { color: #d8d2c0; }
.gunshot.muffled i { opacity: 0.55; }
@keyframes gunshot { 0% { opacity: 0; } 8% { opacity: 1; } 70% { opacity: 0.9; } 100% { opacity: 0; } }
.mk-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-filters input[type=search], .mk-filters select { width: auto; margin: 0; }
.mk-filters input[type=search] { flex: 1 1 200px; }
.mk-filters select { flex: 0 1 170px; }
.market input, .market select { padding: 7px 9px; }
.market .mk-row input[type=number] { padding: 5px 7px; }
.vendor-row.buy-only .price:not(.sell) { color: var(--stone, #9aa08a); }
.vendor-row.buy-only .muted { white-space: nowrap; }
.wound-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.wound-effects { margin: 6px 0 0; color: #e6a29a; }
.wound { padding: 5px 8px; border-radius: 6px; background: rgba(107, 23, 18, 0.18); border-left: 3px solid #8a2a20; font-size: 0.86rem; }
.wound.sev-2 { background: rgba(120, 25, 18, 0.28); border-left-color: #a8321f; }
.wound.sev-3 { background: rgba(140, 26, 18, 0.38); border-left-color: #c63a26; }

/* ===================== v0.6.1 — HUD buttons, movable windows, friends, drag & drop ===================== */
.hud-icons { position: absolute; top: 14px; left: 272px; display: grid; grid-template-columns: repeat(9, 30px); gap: 3px; padding: 3px; border-radius: 10px;
  background: rgba(14, 21, 18, 0.62); border: 1px solid var(--line); backdrop-filter: blur(4px); }
.hud-icon { position: relative; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 7px;
  background: rgba(236, 231, 218, 0.07); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.hud-icon:hover, .hud-icon:focus-visible { background: rgba(232, 133, 58, 0.22); border-color: rgba(232, 133, 58, 0.55); outline: none; }
.hud-icon:active { transform: translateY(1px); }
.hud-icon svg { width: 18px; height: 18px; }
.hud-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; box-sizing: border-box;
  background: var(--ember); color: #1a1208; font: 800 0.66rem/15px var(--body, sans-serif); text-align: center; box-shadow: 0 0 0 2px rgba(14, 21, 18, 0.9); pointer-events: none; }
@media (max-width: 640px) { .hud-icons { left: 212px; grid-template-columns: repeat(9, 24px); gap: 2px; } .hud-icon { height: 26px; } }
@media (max-width: 520px) { .hud-icons { left: 14px; top: 170px; grid-template-columns: repeat(5, 28px); } }

/* windows: drag by the title bar; "placed" ones keep the position the player gave them */
.panel-head { cursor: move; touch-action: none; }
.panel-head h3 { user-select: none; }
.panel.placed { transform: none !important; }
.panel.dragging { opacity: 0.93; box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65); transition: none; }
.panel.dragging .panel-head { cursor: grabbing; }
@media (max-width: 900px) { .panel.placed { right: auto; } }

/* drag & drop between windows: things you can pick up, and where they can go */
.goods { cursor: grab; }
.goods.lifted { opacity: 0.45; }
.dragging-item, .dragging-item * { cursor: grabbing !important; }
.dragging-item [data-drop] { outline: 2px dashed rgba(201, 211, 163, 0.28); outline-offset: -3px; }
.dragging-item [data-drop].drop-hover { outline: 2px solid var(--ember); outline-offset: -3px; box-shadow: inset 0 0 46px rgba(232, 133, 58, 0.2); }
body.in-game .toasts { top: 60px; }   /* under the HUD buttons */
#game-ui .prompts { top: 150px; z-index: 260; }   /* the questions (trade, clan, friend): under the notices, over the windows */
.dragging-item .hotbar[data-drop].drop-hover { border-radius: 10px; }

/* friends */
.panel-friends { width: min(440px, 94vw); }
.friends { display: grid; gap: 10px; align-content: start; }
.friend-add { display: flex; gap: 6px; }
.friend-add input { flex: 1; min-width: 0; margin: 0; }
.friends .check { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; margin: 0; }
.friends h4 { margin: 6px 0 0; }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.friend { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; background: rgba(236, 231, 218, 0.04); }
.friend.in { background: rgba(232, 133, 58, 0.1); border: 1px solid rgba(232, 133, 58, 0.35); }
.friend-dot { width: 9px; height: 9px; border-radius: 50%; background: #5d645f; flex: none; }
.friend.online .friend-dot { background: #f08fd0; box-shadow: 0 0 6px rgba(240, 143, 208, 0.7); }
.friend-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.friend.online .friend-name { color: #f6b8e2; }
.friend-meta { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.friend-acts { display: flex; gap: 6px; align-items: center; flex: none; }
.lg-friend::before { background: #f08fd0; }

/* logging out (v0.6.2): the 60 s countdown, the character frozen in the world */
.logout-box { position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%); z-index: 260; width: min(440px, calc(100vw - 32px));
  display: grid; gap: 10px; padding: 18px 20px; text-align: center; background: var(--glass); border: 1px solid var(--ember); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); pointer-events: auto; }
.logout-box h3 { margin: 0; font-size: 1.25rem; color: var(--birch); }
.logout-box p { margin: 0; }
.logout-count { font-size: 1.05rem; }
.logout-left { display: inline-block; min-width: 2.2ch; font-size: 1.7rem; color: var(--ember); font-variant-numeric: tabular-nums; }
.logout-bar { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; }
.logout-bar i { display: block; height: 100%; width: 0; background: var(--ember); transition: width 0.25s linear; }
.logout-box .row { justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- v0.7.0 */
.slot-round { position: absolute; left: 3px; top: 2px; font-size: 0.6rem; font-weight: 800; color: #1a1d1a; background: #e8c35a;
  border-radius: 3px; padding: 0 3px; line-height: 1.3; }
.panel-outfit .outfit { display: flex; gap: 18px; flex-wrap: wrap; }
.outfit-left { display: flex; flex-direction: column; gap: 8px; width: 210px; }
.outfit-left .row { display: flex; gap: 8px; }
.outfit-preview { width: 200px; height: 200px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); }
.outfit-right { flex: 1; min-width: 260px; }
.outfit-right h4 { margin: 10px 0 4px; }
.panel-outfit .swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-outfit .swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.5); cursor: pointer; padding: 0; }
.panel-outfit .swatch.on { outline: 3px solid #e8c35a; outline-offset: 1px; }
.panel-outfit .swatch.locked { opacity: 0.35; cursor: not-allowed; position: relative; }
.panel-outfit .swatch.locked::after { content: "🔒"; position: absolute; inset: 0; font-size: 12px; display: grid; place-items: center; }
.outfit-list { display: flex; flex-wrap: wrap; gap: 6px; }
.outfit-list .locked { opacity: 0.55; }
.error { color: #f3a39a; }
@media (max-width: 640px) { .outfit-left { width: 100%; } .outfit-right { min-width: 0; } }

/* ---------------------------------------------------------------- v0.11.0: villages */
.village-banner { border-width: 2px; max-width: min(520px, 92vw); top: auto; bottom: 17vh; }
.village-banner span { max-width: 460px; }
.village-banner .threat { color: #e6b85c; letter-spacing: 0.08em; }
.village-banner .threat.safe { color: #b9e6a8; letter-spacing: 0; }
.village-banner em.found { color: #e8c35a; }
.npc-dialog { display: grid; gap: 8px; min-width: 300px; }
.npc-dialog .row { display: flex; flex-wrap: wrap; gap: 6px; }
.npc-dialog .want-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; }
.npc-dialog .want-row img { width: 28px; height: 28px; }
.tier { font-weight: 700; }
.tier-hostile { color: #ff8a7f; }
.tier-wary { color: #e6b85c; }
.tier-neutral { color: #d8d2c2; }
.tier-friendly { color: #9fe08a; }
.tier-trusted { color: #7fd6f0; }
.settlements { margin-top: 8px; display: grid; gap: 4px; }
.settlements h4 { margin: 4px 0 2px; }
.settle-list { display: grid; gap: 2px; max-height: 150px; overflow-y: auto; }
.settle-row { display: grid; grid-template-columns: 12px 1.4fr auto 1fr auto; gap: 8px; align-items: center; font-size: 0.85rem; }
.settle-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #141a17; }
.settle-row .threat { color: #e6b85c; letter-spacing: 0.05em; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-chip { font-size: 0.78rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,0.18); }
.lg-village::before { background: #c49a64 !important; border-radius: 2px !important; }
.vendor-row.locked { opacity: 0.6; }
.vendor-row .stock-note { font-weight: 400; }
.chat-line b.npc-name { color: #e2cf8a; }

/* v0.14.0 — the first steps (a small card on the left, under the vitals — clear of the notices at the top and of the
   chat). Clicks and drags go through it to the world; only its buttons take them. Windows open over it. */
#game-ui > .tut-card { pointer-events: none; }
#game-ui > .tut-card button { pointer-events: auto; }
.tut-card { position: fixed; top: 200px; left: 14px; z-index: 40; width: min(340px, calc(100vw - 28px));
  background: rgba(20, 26, 22, 0.94); border: 1px solid rgba(232, 212, 160, 0.45); border-radius: 10px; padding: 10px 14px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); color: #f2ead6; font-size: 0.9rem; animation: tut-in 0.25s ease-out; }
@keyframes tut-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px), (max-height: 560px) {
  .tut-card { top: auto; bottom: 150px; left: 50%; transform: translateX(-50%); }
  @keyframes tut-in { from { opacity: 0; } to { opacity: 1; } }
}
.tut-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tut-kicker { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: #c9a14a; }
.tut-skip { background: none; border: 0; color: #b9b3a3; font-size: 0.78rem; text-decoration: underline; cursor: pointer; padding: 2px 4px; }
.tut-skip:hover { color: #f2ead6; }
.tut-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.tut-keys { font: 600 0.74rem 'Atkinson Hyperlegible', sans-serif; background: #33302a; border: 1px solid #6b6252; border-radius: 4px; padding: 1px 6px; color: #f2ead6; }
.tut-text { margin: 4px 0 0; line-height: 1.38; color: #e6dccb; }
.tut-finish { margin-top: 8px; }

/* ---------------------------------------------------------------- v0.15.0: the clan settlement */
.panel-settlement { width: min(760px, 96vw); }
.settlement { display: flex; flex-direction: column; gap: 8px; }
.st-head { display: flex; gap: 10px; align-items: center; }
.st-head h4 { margin: 0; }
.crest { flex: none; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.st-tab { display: flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03); color: inherit; font: inherit; font-size: 0.78rem; cursor: pointer; }
.st-tab img { width: 18px; height: 18px; }
.st-zone-btn img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.st-tab.on { border-color: var(--ember); background: rgba(232, 195, 90, 0.12); }
.st-body { max-height: min(62vh, 640px); overflow: auto; padding-right: 4px; }
.st-body h5 { margin: 12px 0 4px; }
.st-req { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.st-req h6 { margin: 6px 0 0; font-size: 0.78rem; color: var(--lichen); }
.st-notice { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--ember); background: rgba(0, 0, 0, 0.2); white-space: pre-wrap; }
.st-research-now .bar, .workshop .bar { display: block; height: 7px; margin-top: 4px; background: rgba(0, 0, 0, 0.45); border-radius: 4px; overflow: hidden; }
.st-research-now .bar i, .workshop .bar i { display: block; height: 100%; background: var(--ember); }
.st-pieces, .st-fac, .st-techs, .ws-jobs, .ws-recipes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.st-pieces li, .st-fac li, .st-techs li, .ws-jobs li, .ws-recipes li { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center;
  padding: 5px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); }
.st-pieces img, .st-fac img, .st-techs img, .ws-jobs img, .ws-recipes img { width: 36px; height: 36px; }
.st-pieces li.locked, .st-techs li.locked, .ws-recipes li.locked { opacity: 0.6; }
.st-techs li.done { box-shadow: inset 3px 0 0 #8fc070; }
.st-techs li.going { box-shadow: inset 3px 0 0 var(--ember); }
.st-pieces-act { display: flex; gap: 4px; }
.st-map-canvas { display: block; width: 300px; height: 300px; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--line); }
.st-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.st-legend .lg::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; background: var(--c); }
.st-log { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; display: flex; flex-direction: column; gap: 2px; }
.st-log time { color: var(--lichen); font-size: 0.72rem; }
.st-perms td:first-child { text-align: left; white-space: nowrap; color: var(--lichen); }
.st-admin textarea { width: 100%; }
.crest-editor { display: flex; gap: 12px; align-items: flex-start; }
.crest-emblems { display: grid; grid-template-columns: repeat(8, 34px); gap: 3px; margin-bottom: 6px; }
.crest-em { width: 34px; height: 34px; padding: 3px; border-radius: 6px; border: 1px solid var(--line); background: #2b2f2a; cursor: pointer; }
.crest-em img { width: 100%; height: 100%; }
.crest-em.on { border-color: var(--ember); }
.crest-colors { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.crest-col { width: 22px; height: 22px; border-radius: 4px; border: 2px solid rgba(0, 0, 0, 0.4); cursor: pointer; }
.crest-col.on { border-color: #fff; }
.st-toolbar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6; }
.st-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: min(900px, 92vw); padding: 8px 14px; border-radius: 8px;
  background: rgba(40, 52, 44, 0.94); border: 1px solid var(--ember); }
.workshop h5 { margin: 10px 0 4px; }
.ws-recipes .row input { width: 56px; }
.row.wrap { flex-wrap: wrap; }
.settlement .row input.st-coins { width: 90px; flex: 0 0 auto; }

/* ---------------------------------------------------------------- v0.16.0: the grid, the defences, the device window */
.panel-device { width: min(360px, 94vw); }
.device { display: flex; flex-direction: column; gap: 8px; }
.dev-head { display: flex; gap: 10px; align-items: center; }
.dev-head img { width: 40px; height: 40px; }
.dev-read { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 0.84rem; }
.dev-read dt { color: var(--lichen); }
.dev-read dd { margin: 0; }
.dev-set { display: flex; flex-direction: column; gap: 6px; }
.dev-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.dev-row select { max-width: 60%; }
.dev-multi { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dev-multi legend { font-size: 0.78rem; color: var(--lichen); }
.st-dev { width: 100%; font-size: 0.8rem; }
.st-dev img { width: 22px; height: 22px; vertical-align: middle; }
.st-dev tr.bad td { color: #f0a080; }
.st-alerts { list-style: none; padding: 0; margin: 6px 0; font-size: 0.82rem; }
.st-log li.log-alarm { color: #f0b090; }

/* ---------------------------------------------------------------- v0.17.0: the horse's and the wagon's windows */
.panel-horse, .panel-wagon { width: min(440px, 94vw); }
.horse-win, .wagon-win { display: flex; flex-direction: column; gap: 8px; }
.hz-portrait { width: 56px !important; height: 56px !important; }
.hz-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.hz-bar { display: grid; grid-template-columns: 82px 1fr 30px; align-items: center; gap: 6px; font-size: 0.8rem; }
.hz-label { color: var(--lichen); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.hz-fill { display: block; height: 100%; border-radius: 4px; background: var(--ok); }
.hz-bar.bad .hz-fill { background: var(--danger); }
.hz-bar.bad .hz-val { color: #f0a080; }
.hz-val { text-align: right; font-variant-numeric: tabular-nums; }
.hz-list { margin: 0; padding-left: 18px; }
.hz-list li { margin: 1px 0; }
.hz-acts { gap: 6px; }
.btn-tiny { padding: 1px 8px; font-size: 0.74rem; }
.horse-win .ok, .wagon-win .ok { color: var(--ok); }

/* v0.18.0 — homes: the room window, members' portraits */
.panel-room { width: min(400px, 94vw); }
.room-head { margin: 0 0 6px; }
.room-ladder { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 4px 0 8px; }
.room-ladder li { font-size: 0.75rem; padding: 2px 7px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: #9a9c92; }
.room-ladder li.done { color: #c8c3a8; background: rgba(200, 180, 120, 0.14); }
.room-ladder li.on { color: #1c1a14; background: #e0b43c; font-weight: 600; }
.room-kinds { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 0; margin: 0 0 8px; font-size: 0.85rem; }
.room-kinds li { display: flex; justify-content: space-between; gap: 8px; }
.room-kinds li.off { color: #7d7f76; }
.room-kinds li.on b { color: #a8d88a; }
.members li .role-portrait { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); }

/* v0.19.0 — rumours of scavs in a villager's dialog (the areas are on the map) */
.rumour-row { align-items: center; }
.rumour-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px dashed #d8d0b8; flex: none; }
.rumour-dot.rumour-warlord { border-color: #ff6a50; background: #ff6a5033; }
.rumour-dot.rumour-scav_soldier { border-color: #e8a33d; }
.rumour-dot.rumour-scav_hunter { border-color: #c8c060; }
/* v0.22.0: the server's restart countdown */
.restart-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: min(720px, 92vw);
  padding: 8px 16px; border-radius: 10px; background: rgba(30, 24, 16, 0.88); border: 1px solid #c9783a; color: #f3e6cf;
  font-size: 0.92rem; text-align: center; pointer-events: none; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
.restart-banner strong { color: #ffcf8a; }
.restart-banner em { color: #d8c8a8; }
.restart-banner.urgent { border-color: #e0573a; animation: restart-pulse 1.2s ease-in-out infinite; }
@keyframes restart-pulse { 50% { box-shadow: 0 0 0 4px rgba(224, 87, 58, 0.35); } }
@media (prefers-reduced-motion: reduce) { .restart-banner.urgent { animation: none; } }

/* v0.23.0 — premium: the badge, Settings → Premium, the outfit window, a clan founding being signed */
.premium-badge { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  background: linear-gradient(135deg, #d9b453, #a8782a); color: #231a08; vertical-align: middle; }
.premium-box { margin: 12px 0; padding: 10px 12px; border: 1px solid rgba(217,180,83,0.45); border-radius: 8px; background: rgba(217,180,83,0.06); }
.premium-box h4 { margin: 0 0 6px; }
.premium-box .row { display: flex; gap: 8px; align-items: center; }
.premium-box input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.08em; }
.premium-box .ok { color: #9fe08a; }
.premium-box .error { color: #ff8a7a; }
.premium-on { color: #e6c66a; }
.premium-perks { margin: 8px 0 0; padding-left: 18px; }
.premium-perks li { margin: 3px 0; }
.outfit-premium { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.outfit-premium h4 { display: flex; align-items: center; gap: 6px; }
.clan-charter { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #d9b453; background: rgba(217,180,83,0.08); }
.clan-charter p { margin: 2px 0; }
.small.warn { color: #e6b35a; }

/* v0.24.0 — the bug report window */
.bug-form { display: flex; flex-direction: column; gap: 8px; }
.bug-form textarea { width: 100%; resize: vertical; min-height: 110px; font: inherit; color: var(--birch); background: rgba(10, 16, 13, 0.6);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bug-form select { max-width: 100%; }
.bug-form .row { display: flex; gap: 8px; align-items: center; }
.bug-mine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bug-mine li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(236, 231, 218, 0.03); }
.bug-mine .small { overflow-wrap: anywhere; }
.bug-note { color: var(--lichen); margin-top: 4px; }
