@font-face { font-family: 'Sofia'; font-weight: 600; font-display: swap; src: url(/fonts/sofia/sofia-sans-extra-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2116, U+2212; }
@font-face { font-family: 'Sofia'; font-weight: 600; font-display: swap; src: url(/fonts/sofia/sofia-sans-extra-condensed-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1; }
@font-face { font-family: 'Sofia'; font-weight: 800; font-display: swap; src: url(/fonts/sofia/sofia-sans-extra-condensed-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2116, U+2212; }
@font-face { font-family: 'Sofia'; font-weight: 800; font-display: swap; src: url(/fonts/sofia/sofia-sans-extra-condensed-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1; }
@font-face { font-family: 'Fira'; font-weight: 400; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2116, U+2212; }
@font-face { font-family: 'Fira'; font-weight: 400; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1; }
@font-face { font-family: 'Fira'; font-weight: 500; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2116, U+2212; }
@font-face { font-family: 'Fira'; font-weight: 500; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1; }
@font-face { font-family: 'Fira'; font-weight: 600; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2116, U+2212; }
@font-face { font-family: 'Fira'; font-weight: 600; font-display: swap; src: url(/fonts/fira/fira-sans-condensed-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1; }

:root {
  --bone: #e9e2cf;
  --bone-2: #bdb6a0;
  --bone-3: #7f7a68;
  --case: rgba(27, 29, 24, 0.95);
  --case-2: #2a2d24;
  --case-3: #353a2e;
  --slot: #1b1d18;
  --line: #464a3b;
  --line-2: #61664f;
  --amber: #e2a03a;
  --amber-dim: #8d6a2e;
  --red: #d24a35;
  --water: #7fb9d6;
  --food: #d8a659;
  --rad: #c6d24a;
  --heat: #e0773a;
  --cold: #8ec3e6;
  --ok: #93b65b;
  --display: 'Sofia', 'Arial Narrow', sans-serif;
  --body: 'Fira', 'Arial Narrow', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #121310; color: var(--bone); font: 15px/1.4 var(--body); }
body { user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn-primary { background: var(--amber); color: #1d1a12; border: 0; padding: 10px 22px; font: 800 24px/1 var(--display); letter-spacing: 0.02em; border-radius: 2px; }
.btn-primary:hover { background: #f0b552; }
.btn-primary:disabled { background: var(--amber-dim); color: #3a3121; cursor: default; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--bone-2); padding: 6px 14px; border-radius: 2px; }
.btn-ghost:hover { border-color: var(--bone-2); color: var(--bone); }
.btn-small { background: var(--case-3); border: 1px solid var(--line-2); color: var(--bone); padding: 3px 10px; border-radius: 2px; font-size: 13px; }
.btn-small:hover:not(:disabled) { border-color: var(--amber); }
.btn-small:disabled { opacity: 0.45; cursor: default; }
.screen { position: fixed; inset: 0; z-index: 30; }

/* Login: the live map of the shared world is the hero. */
#login { background: #1a1c17; }
#login-map { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; transition: opacity 1.2s ease; }
#login-map.ready { opacity: 1; }
.login-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 22, 18, 0.97) 0%, rgba(20, 22, 18, 0.9) 34%, rgba(20, 22, 18, 0.2) 62%, rgba(20, 22, 18, 0.05) 100%); }
.login-col { position: absolute; left: clamp(16px, 6vw, 96px); top: 50%; transform: translateY(-50%); width: min(460px, calc(100vw - 32px)); }
.title { font: 800 clamp(72px, 11vw, 140px)/0.8 var(--display); margin: 0 0 22px; letter-spacing: -0.01em; color: var(--bone); }
.lede { font-size: 17px; line-height: 1.5; color: var(--bone-2); max-width: 44ch; margin: 0 0 28px; }
#login-form { display: grid; gap: 12px; }
#login-form label { display: grid; gap: 4px; font-size: 13px; color: var(--bone-2); }
#login-form input { background: rgba(10, 11, 9, 0.6); border: 1px solid var(--line-2); padding: 10px 12px; font-size: 17px; border-radius: 2px; }
#login-form input:focus { border-color: var(--amber); outline: none; }
#login-form .btn-primary { margin-top: 8px; justify-self: start; }
.hint { margin: 0; font-size: 13px; color: var(--bone-3); }
.error { margin: 0; min-height: 1.4em; color: #ff8a6e; font-weight: 500; }
.online { margin-top: 26px; font: 600 22px/1 var(--display); color: var(--bone-2); }
.online b { color: var(--amber); font-weight: 800; }
.map-legend { position: absolute; right: 20px; bottom: 20px; background: rgba(20, 22, 18, 0.82); border: 1px solid var(--line); padding: 12px 16px; border-radius: 2px; max-width: 280px; }
.legend-title { margin: 0 0 8px; font: 800 20px/1 var(--display); }
.map-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; color: var(--bone-2); }
.map-legend li { display: flex; gap: 8px; align-items: center; }
.map-legend canvas { flex: none; }

#loading { background: #1a1c17; display: grid; place-content: center; text-align: center; gap: 14px; }
.loading-title { margin: 0; font: 800 54px/1 var(--display); }
.loading-bar { width: 320px; height: 6px; background: var(--slot); border: 1px solid var(--line); }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.2s; }
.loading-text { margin: 0; color: var(--bone-3); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: var(--shadow); }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(150, 20, 10, 0.55) 100%); opacity: 0; transition: opacity 0.25s; }
#damage-dir { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; opacity: 0; transition: opacity 0.8s; }
#damage-dir::before { content: ''; position: absolute; left: 50%; top: -6px; width: 70px; height: 14px; margin-left: -35px; background: radial-gradient(ellipse at center bottom, rgba(220, 50, 30, 0.95), transparent 70%); }
#scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0, transparent 33vh, #050505 33.2vh); }
#scope i { position: absolute; left: 50%; top: 50%; width: 66vh; height: 66vh; transform: translate(-50%, -50%); background: linear-gradient(#000, #000) center/100% 1px no-repeat, linear-gradient(#000, #000) center/1px 100% no-repeat; }
#compass { position: absolute; top: 12px; left: 50%; width: 420px; max-width: 60vw; height: 26px; transform: translateX(-50%); overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#compass-strip { position: absolute; top: 0; left: 0; height: 26px; white-space: nowrap; font: 800 18px/26px var(--display); }
#compass-strip span { position: absolute; top: 0; transform: translateX(-50%); color: var(--bone-2); }
#compass-strip span.c { color: var(--bone); }
#compass-strip span.t { color: var(--bone-3); font-size: 12px; }
#compass-strip span.poi { color: var(--amber); font-size: 14px; }
.compass-mark { position: absolute; left: 50%; bottom: 0; width: 2px; height: 6px; background: var(--amber); }
#place { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; font-size: 13px; color: var(--bone-2); }
#place-name { color: var(--bone); font-weight: 500; }
#killfeed { position: absolute; top: 12px; left: 14px; display: grid; gap: 4px; font-size: 14px; }
#killfeed p { margin: 0; background: rgba(20, 22, 18, 0.6); padding: 3px 9px; border-radius: 2px; }
#killfeed .me { border-left: 3px solid var(--amber); }
#killfeed .w { color: var(--bone-3); margin: 0 6px; }
#killfeed .r { color: var(--amber); margin-left: 6px; }
#topright { position: absolute; top: 12px; right: 14px; display: grid; gap: 8px; justify-items: end; }
#tokens { display: flex; align-items: baseline; gap: 6px; background: rgba(20, 22, 18, 0.7); padding: 4px 12px; border-radius: 2px; font-size: 13px; color: var(--bone-2); }
#tokens b { font: 800 26px/1 var(--display); color: var(--amber); }
.tok-glyph { width: 11px; height: 11px; background: var(--amber); transform: rotate(45deg); align-self: center; }
#tokens.bump b { animation: bump 0.5s; }
@keyframes bump { 30% { transform: scale(1.35); color: #ffd27a; } }
#shield { background: rgba(40, 70, 90, 0.75); padding: 4px 10px; border-radius: 2px; font-size: 13px; }
#raid { background: rgba(20, 22, 18, 0.78); border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 8px 12px; min-width: 250px; border-radius: 2px; }
#raid.cleared { border-top-color: var(--ok); }
#raid-name { margin: 0; font: 800 24px/1 var(--display); }
#raid-state { margin: 4px 0 0; font-size: 13px; color: var(--bone-2); }
#boss { margin-top: 8px; font-size: 13px; }
#boss .bar { height: 8px; margin-top: 3px; }
#boss .bar i { --c: var(--red); }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 6px; transition: opacity 0.12s; }
#crosshair i { position: absolute; background: var(--bone); box-shadow: 0 0 2px #000; }
#crosshair i:nth-child(1) { width: 2px; height: 7px; left: -1px; bottom: var(--gap); }
#crosshair i:nth-child(2) { width: 2px; height: 7px; left: -1px; top: var(--gap); }
#crosshair i:nth-child(3) { width: 7px; height: 2px; top: -1px; right: var(--gap); }
#crosshair i:nth-child(4) { width: 7px; height: 2px; top: -1px; left: var(--gap); }
#crosshair.dot i:nth-child(n+2) { display: none; }
#crosshair.dot i:nth-child(1) { width: 3px; height: 3px; left: -1.5px; top: -1.5px; bottom: auto; border-radius: 50%; }
#crosshair.hidden { opacity: 0; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; opacity: 0;
  background: linear-gradient(45deg, transparent 45%, var(--c, #fff) 45%, var(--c, #fff) 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--c, #fff) 45%, var(--c, #fff) 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
#hitmarker.on { animation: hit 0.25s ease-out; }
#hitmarker.kill { --c: var(--red); width: 30px; height: 30px; margin: -15px 0 0 -15px; }
#hitmarker.head { --c: var(--amber); }
@keyframes hit { 0% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1); } }
#prompt { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); background: rgba(20, 22, 18, 0.7); padding: 4px 10px; border-radius: 2px; font-size: 14px; white-space: nowrap; }
#prompt kbd, #build-hint kbd { font: 800 15px/1 var(--display); background: var(--bone); color: #1b1d18; padding: 1px 5px; border-radius: 2px; margin-right: 6px; text-shadow: none; }
#peek { position: absolute; left: calc(50% + 40px); top: calc(50% - 20px); background: rgba(20, 22, 18, 0.8); border-left: 3px solid var(--amber); padding: 6px 10px; font-size: 13px; min-width: 200px; }
#peek b { font: 800 18px/1.1 var(--display); display: block; }
#peek .bar { margin: 4px 0; }
#reload { position: absolute; left: 50%; top: calc(50% + 60px); transform: translateX(-50%); width: 140px; text-align: center; font-size: 12px; color: var(--bone-2); }
#reload .bar { margin-bottom: 3px; }
#biome-card { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; animation: card 4.2s ease forwards; }
#biome-card b { display: block; font: 800 64px/0.95 var(--display); }
#biome-card span { font-size: 15px; color: var(--bone-2); }
@keyframes card { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
#banner { position: absolute; left: 50%; top: 82px; transform: translateX(-50%); background: rgba(20, 22, 18, 0.82); border: 1px solid var(--line); border-left: 4px solid var(--amber); padding: 8px 16px; font-size: 15px; max-width: min(620px, 90vw); text-align: center; }
#toasts { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); display: grid; gap: 4px; justify-items: center; }
#toasts p { margin: 0; background: rgba(20, 22, 18, 0.82); padding: 5px 12px; border-radius: 2px; font-size: 14px; animation: fade 3s forwards; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#pickups { position: absolute; right: 14px; bottom: 190px; display: grid; gap: 3px; justify-items: end; }
#pickups p { margin: 0; display: flex; align-items: center; gap: 8px; background: rgba(20, 22, 18, 0.7); padding: 2px 10px 2px 4px; font-size: 14px; animation: fade 3.2s forwards; }
#pickups img { width: 24px; height: 24px; }
#pickups b { color: var(--ok); font-weight: 600; }
#chat { position: absolute; left: 14px; bottom: 210px; width: min(420px, 40vw); }
#chat-log { display: grid; gap: 2px; font-size: 14px; max-height: 210px; overflow: hidden; align-content: end; }
#chat-log p { margin: 0; transition: opacity 0.6s; }
#chat-log p.old { opacity: 0; }
#chat.open #chat-log p.old { opacity: 1; }
#chat.open #chat-log { background: rgba(20, 22, 18, 0.55); }
#chat-log .n { font-weight: 600; color: var(--amber); }
#chat-log .team .n { color: var(--ok); }
#chat-log .sys { color: var(--bone-2); font-style: italic; }
#chat-input { pointer-events: auto; width: 100%; margin-top: 6px; background: rgba(20, 22, 18, 0.9); border: 1px solid var(--amber); padding: 6px 10px; border-radius: 2px; outline: none; }
#status { position: absolute; left: 14px; bottom: 14px; width: 250px; }
.stat .lbl { font-size: 12px; color: var(--bone-2); }
.stat-hp { display: grid; grid-template-columns: 1fr auto; align-items: end; }
.stat-hp b { font: 800 40px/0.9 var(--display); grid-row: span 1; }
.stat-hp .bar { grid-column: 1 / -1; height: 10px; margin-top: 4px; }
.stat-hp .bar i { --c: var(--bone); }
.stat-hp.low b { color: #ff7b5f; }
.stat-hp.low .bar i { --c: var(--red); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stat.mini .bar { height: 5px; margin-top: 2px; }
.bar { height: 6px; background: rgba(10, 11, 9, 0.7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.bar i { display: block; height: 100%; width: 100%; background: var(--c, var(--amber)); transition: width 0.25s; }
#st-temp { margin: 6px 0 0; font-size: 13px; color: var(--bone-2); }
#st-temp.cold { color: var(--cold); }
#st-temp.hot { color: var(--heat); }
#hotbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; }
#weapon { position: absolute; right: 18px; bottom: 14px; text-align: right; }
#weapon-name { margin: 0; font-size: 14px; color: var(--bone-2); }
#weapon-ammo { margin: 0; font: 800 54px/0.9 var(--display); }
#weapon-ammo small { font-size: 26px; color: var(--bone-2); font-weight: 600; margin-left: 4px; }
#weapon-ammo.empty { color: #ff7b5f; }
#craft-mini { position: absolute; right: 18px; bottom: 96px; font-size: 13px; background: rgba(20, 22, 18, 0.7); padding: 4px 10px; display: flex; align-items: center; gap: 8px; }
#craft-mini .bar { width: 80px; }
#build-hint { position: absolute; right: 18px; bottom: 100px; text-align: right; font-size: 13px; background: rgba(20, 22, 18, 0.7); padding: 6px 10px; line-height: 1.8; }
#build-hint b { font: 800 20px/1 var(--display); display: block; }

/* Slots */
.slot { position: relative; width: 62px; height: 62px; background: rgba(20, 22, 18, 0.72); border: 1px solid var(--line); border-radius: 2px; pointer-events: auto; }
.slot img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); pointer-events: none; image-rendering: auto; }
.slot .n { position: absolute; right: 4px; bottom: 1px; font: 800 17px/1 var(--display); pointer-events: none; }
.slot .k { position: absolute; left: 4px; top: 2px; font: 800 13px/1 var(--display); color: var(--bone-3); pointer-events: none; }
.slot .dur { position: absolute; left: 3px; bottom: 3px; width: 4px; height: calc(100% - 22px); background: rgba(0, 0, 0, 0.5); pointer-events: none; }
.slot .dur i { position: absolute; bottom: 0; left: 0; width: 100%; background: var(--ok); }
.slot .bp { position: absolute; left: 4px; bottom: 3px; font-size: 10px; color: var(--water); pointer-events: none; }
.slot.sel { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.slot.over { border-color: var(--bone); }
.slot.arm-empty::after { content: attr(data-hint); position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--bone-3); pointer-events: none; }
#hotbar .slot { width: 64px; height: 64px; }

/* Panels */
#panel { position: fixed; inset: 0; z-index: 20; background: rgba(12, 13, 11, 0.62); display: grid; grid-template-rows: auto 1fr; padding: 18px clamp(12px, 3vw, 40px) 18px; gap: 10px; }
#tabs { display: flex; gap: 2px; align-items: end; flex-wrap: wrap; padding-right: 110px; }
#tabs button { background: var(--case-2); border: 1px solid var(--line); border-bottom: 0; padding: 8px 16px 6px; font: 800 22px/1 var(--display); color: var(--bone-2); border-radius: 2px 2px 0 0; }
#tabs button.on { background: var(--case); color: var(--bone); box-shadow: inset 0 3px 0 var(--amber); }
#tabs button kbd { font: 600 13px var(--body); color: var(--bone-3); margin-left: 6px; }
#panel-close { position: absolute; right: clamp(12px, 3vw, 40px); top: 22px; }
#panel-body { background: var(--case); border: 1px solid var(--line); padding: 18px; overflow: auto; min-height: 0; border-radius: 0 2px 2px 2px; }
.cols { display: grid; grid-template-columns: auto auto minmax(320px, 1fr); gap: 24px; align-items: start; }
.col h2, .sec h2 { margin: 0 0 10px; font: 800 28px/1 var(--display); }
.col h3, .sec h3 { margin: 14px 0 6px; font: 600 19px/1 var(--display); color: var(--bone-2); }
.grid6 { display: grid; grid-template-columns: repeat(6, 62px); gap: 4px; }
.hotrow { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line-2); }
.armor { display: grid; grid-template-columns: 62px; gap: 4px; }
.charstats { margin-top: 14px; font-size: 13px; color: var(--bone-2); display: grid; gap: 2px; }
.charstats b { color: var(--bone); font-weight: 500; }
.side-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cont-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cont-head h2 { margin: 0; }
.furnace-state { font-size: 13px; color: var(--bone-2); }
.cat-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.cat-row button { background: var(--slot); border: 1px solid var(--line); padding: 3px 10px; border-radius: 2px; color: var(--bone-2); font-size: 13px; }
.cat-row button.on { border-color: var(--amber); color: var(--bone); }
.recipes { display: grid; gap: 4px; max-height: calc(100vh - 290px); overflow: auto; padding-right: 4px; }
.recipe { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: var(--case-2); border: 1px solid transparent; padding: 5px 8px; border-radius: 2px; }
.recipe:hover { border-color: var(--line-2); }
.recipe img { width: 44px; height: 44px; }
.recipe .nm { font-weight: 600; }
.recipe .cost { font-size: 12px; color: var(--bone-2); }
.recipe .cost .miss { color: #ff8a6e; }
.recipe .req { font-size: 12px; color: var(--amber); }
.recipe.locked { opacity: 0.55; }
.recipe .act { display: flex; gap: 4px; }
.queue { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.queue .q { position: relative; width: 52px; height: 52px; background: var(--slot); border: 1px solid var(--line); pointer-events: auto; cursor: pointer; }
.queue .q img { width: 100%; height: 100%; padding: 4px; }
.queue .q .n { position: absolute; right: 3px; bottom: 0; font: 800 15px var(--display); }
.queue .q .t { position: absolute; left: 3px; top: 1px; font-size: 11px; color: var(--amber); }
.muted { color: var(--bone-3); font-size: 13px; }

/* Map */
.map-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 18px; height: 100%; min-height: 0; }
.map-view { position: relative; background: #1b1d18; border: 1px solid var(--line); min-height: 0; overflow: hidden; }
.map-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.map-side { display: grid; gap: 10px; align-content: start; font-size: 14px; }
.map-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.map-side li { display: flex; justify-content: space-between; gap: 8px; background: var(--case-2); padding: 4px 8px; }
.map-side li span:last-child { color: var(--bone-2); }

/* Cases */
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.case-card { background: var(--case-2); border: 1px solid var(--line); padding: 14px; display: grid; gap: 8px; border-top: 4px solid var(--c); border-radius: 2px; }
.case-card h3 { margin: 0; font: 800 28px/1 var(--display); color: var(--bone); }
.case-card p { margin: 0; font-size: 13px; color: var(--bone-2); }
.odds { display: grid; gap: 3px; font-size: 12px; }
.odds div { display: grid; grid-template-columns: 100px 1fr 44px; gap: 6px; align-items: center; }
.odds i { display: block; height: 5px; background: var(--c); }
.case-card .price { font: 800 22px/1 var(--display); color: var(--amber); }
.reel-box { position: relative; margin-top: 16px; height: 170px; overflow: hidden; background: #141511; border: 1px solid var(--line); }
.reel-box::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.reel { position: absolute; left: 0; top: 10px; display: flex; gap: 6px; will-change: transform; }
.rcard { flex: none; width: 140px; height: 150px; background: var(--case-2); border-bottom: 4px solid var(--c); display: grid; grid-template-rows: 1fr auto; padding: 8px; text-align: center; font-size: 12px; }
.rcard img { width: 100%; height: 90px; object-fit: contain; }
.rcard b { font-weight: 600; line-height: 1.2; }
.win-card { margin-top: 16px; display: flex; gap: 18px; align-items: center; background: var(--case-2); padding: 14px 18px; border-left: 4px solid var(--c); animation: winpop 0.5s ease; }
.win-card img { width: 120px; height: 96px; object-fit: contain; }
.win-card h3 { margin: 0; font: 800 34px/1 var(--display); }
.win-card p { margin: 4px 0 0; color: var(--bone-2); }
@keyframes winpop { 0% { transform: scale(0.94); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.coll { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.coll .it { background: var(--case-2); border-bottom: 3px solid var(--c); padding: 8px; display: grid; gap: 4px; font-size: 13px; }
.coll .it img { width: 100%; height: 70px; object-fit: contain; }
.coll .it .on { color: var(--amber); }
.coll .row { display: flex; gap: 4px; flex-wrap: wrap; }

/* Shop, contracts, top */
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.shop .it { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; background: var(--case-2); padding: 6px 8px; }
.shop img { width: 44px; height: 44px; }
.shop .p { color: var(--amber); font-size: 13px; }
.contracts { display: grid; gap: 8px; max-width: 640px; }
.contract { background: var(--case-2); padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; }
.contract b { font: 800 22px/1 var(--display); }
.contract .rw { color: var(--amber); font-weight: 600; text-align: right; }
.contract .bar { grid-column: 1 / -1; }
.contract.done { opacity: 0.6; }
table.top { border-collapse: collapse; min-width: min(560px, 100%); }
table.top th, table.top td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); }
table.top th { font-weight: 500; color: var(--bone-2); font-size: 13px; }
table.top td:first-child { font: 800 20px var(--display); color: var(--bone-3); width: 36px; }

/* Build menu */
#build-menu { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; display: grid; grid-template-columns: repeat(4, 120px); gap: 6px; background: var(--case); border: 1px solid var(--line); padding: 14px; }
#build-menu h2 { grid-column: 1 / -1; margin: 0 0 4px; font: 800 26px/1 var(--display); }
#build-menu button { background: var(--case-2); border: 1px solid var(--line); padding: 10px 6px; display: grid; gap: 4px; justify-items: center; border-radius: 2px; }
#build-menu button.on, #build-menu button:hover { border-color: var(--amber); }
#build-menu button b { font: 800 18px/1 var(--display); }
#build-menu button span { font-size: 12px; color: var(--bone-2); }
#build-menu button canvas { width: 54px; height: 54px; }

/* Death and menu */
#death { background: radial-gradient(ellipse at center, rgba(60, 12, 8, 0.6), rgba(12, 10, 9, 0.94)); display: grid; place-items: center; }
.death-col { width: min(520px, calc(100vw - 32px)); text-align: center; }
.death-title { margin: 0; font: 800 96px/0.9 var(--display); }
.death-sub { margin: 10px 0 4px; font-size: 18px; color: var(--bone); }
.death-sub b { color: var(--amber); }
.death-note { margin: 0 0 22px; color: var(--bone-2); }
#death-spawns { display: grid; gap: 6px; }
#death-spawns button { display: flex; justify-content: space-between; align-items: center; background: var(--case-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 2px; text-align: left; }
#death-spawns button b { font: 800 22px/1 var(--display); }
#death-spawns button span { color: var(--bone-2); font-size: 13px; }
#death-spawns button:hover:not(:disabled) { border-color: var(--amber); }
#death-spawns button:disabled { opacity: 0.5; cursor: default; }
#menu { background: rgba(12, 13, 11, 0.86); display: grid; place-items: center; }
.menu-col { width: min(480px, calc(100vw - 32px)); display: grid; gap: 14px; }
.menu-title { margin: 0; font: 800 72px/0.9 var(--display); }
.menu-sub { margin: 0; color: var(--bone-2); }
.menu-col .btn-primary { justify-self: start; }
.menu-col .btn-ghost { justify-self: start; }
.settings { display: grid; gap: 8px; background: var(--case-2); padding: 12px 14px; }
.settings label { display: grid; grid-template-columns: 1fr 150px 36px; align-items: center; gap: 10px; font-size: 14px; }
.settings select { grid-column: span 2; background: var(--slot); border: 1px solid var(--line-2); padding: 3px 6px; }
.settings output { font-size: 13px; color: var(--bone-2); text-align: right; }
.settings input[type=range] { accent-color: var(--amber); }
.controls summary { cursor: pointer; font: 800 22px/1 var(--display); }
.controls dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 14px; margin: 10px 0 0; }
.controls dt { color: var(--amber); font-weight: 600; }
.controls dd { margin: 0; color: var(--bone-2); }

#click-to-play { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); z-index: 12; background: rgba(20, 22, 18, 0.85); padding: 8px 16px; border: 1px solid var(--line-2); }
#tooltip { position: fixed; z-index: 40; pointer-events: none; max-width: 300px; background: #11120f; border: 1px solid var(--line-2); border-top: 3px solid var(--c, var(--line-2)); padding: 8px 10px; font-size: 13px; }
#tooltip b { display: block; font: 800 20px/1.05 var(--display); }
#tooltip .cat { color: var(--bone-3); font-size: 12px; }
#tooltip p { margin: 4px 0 0; color: var(--bone-2); }
#tooltip .stats { margin-top: 6px; display: grid; grid-template-columns: auto auto; gap: 1px 12px; color: var(--bone); }
#tooltip .stats span:nth-child(odd) { color: var(--bone-3); }
#tooltip .use { margin-top: 6px; color: var(--amber); font-size: 12px; }
#drag-ghost { position: fixed; z-index: 41; width: 56px; height: 56px; pointer-events: none; transform: translate(-50%, -50%); opacity: 0.85; }
#drag-ghost img { width: 100%; height: 100%; }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .map-wrap { grid-template-columns: 1fr; }
  .login-shade { background: rgba(20, 22, 18, 0.88); }
  .map-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
