/* style.css — интерфейс в духе Minecraft Java Edition.
 *
 * Панели, слоты и кнопки собраны из плоских цветов и «фасок» на box-shadow:
 * так каждый элемент выглядит выдавленным пикселями, без единой картинки.
 * Все размеры завязаны на --slot, поэтому интерфейс масштабируется целиком.
 */

:root {
  --slot: 44px;
  --gui-bg: #c6c6c6;
  --gui-dark: #555555;
  --gui-light: #ffffff;
  --gui-shadow: #8b8b8b;
  --slot-bg: #8b8b8b;
  --text: #ffffff;
  --text-dark: #3f3f3f;
  --accent: #7bb03a;
  --danger: #b03a3a;
  --gold: #fcdc5f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #101418;
  color: var(--text);
  font-family: 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: none;
}

body { position: relative; }

canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  image-rendering: pixelated;
}

[hidden] { display: none !important; }
.hidden { display: none !important; }

/* Пиксельный акцент для заголовков и цифр — без внешних шрифтов. */
.pixel, .game-title, .panel-title, .btn, .count, #xplevel, .boot-title,
.world-name, .menu-footer, .loading-title, #debug, #held-name, .chat-line {
  font-family: 'Lucida Console', 'DejaVu Sans Mono', 'Courier New', monospace;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Загрузчик
   ───────────────────────────────────────────────────────────────────────── */

#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(#12181f, #060a0e);
  z-index: 200;
  transition: opacity .4s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-box { text-align: center; }
.boot-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #e8f0d8;
  text-shadow: 4px 4px 0 #2a3a1a;
  margin-bottom: 22px;
}
.boot-bar, .loading-bar {
  width: 340px;
  height: 14px;
  background: #1c242c;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #0c1116;
  overflow: hidden;
}
.boot-bar i, .loading-bar i {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(#9ad14a, #63933a);
  transition: width .2s linear;
}
.boot-bar i { animation: boot-slide 1.4s ease-in-out infinite; }
@keyframes boot-slide {
  0% { width: 8%; } 50% { width: 92%; } 100% { width: 8%; }
}
.boot-note, .loading-hint {
  margin-top: 14px;
  font-size: 13px;
  color: #8ea0ac;
}

/* ─────────────────────────────────────────────────────────────────────────
   Меню
   ───────────────────────────────────────────────────────────────────────── */

#menus {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: auto;
}
#menus.hidden { display: none; }

.menu-screen {
  min-height: 100%;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background:
    linear-gradient(rgba(8, 12, 16, .72), rgba(8, 12, 16, .86)),
    repeating-linear-gradient(45deg, #2b2118 0 12px, #322619 12px 24px);
}
.menu-screen.dim { background: rgba(8, 10, 14, .68); }
.menu-screen.death {
  background: linear-gradient(rgba(90, 8, 8, .55), rgba(30, 4, 4, .82));
}

/* Главное меню в раскладке Java-версии. */
.mc-title { justify-content: center; gap: 34px; position: relative; }
.mc-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 84vw);
}
.mc-buttons .btn { padding: 11px 16px; }
.splash {
  margin-top: 6px;
  color: #ffff55;
  font-family: 'Lucida Console', monospace;
  font-size: 17px;
  text-shadow: 2px 2px 0 #3f3f15;
  transform: rotate(-14deg);
  animation: splash-pulse 1.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes splash-pulse {
  0%, 100% { transform: rotate(-14deg) scale(1); }
  50% { transform: rotate(-14deg) scale(1.08); }
}
.corner {
  position: absolute;
  bottom: 10px;
  font-size: 12px;
  color: #dcdcdc;
  text-shadow: 1px 1px 0 #000;
}
.corner.left { left: 12px; }
.corner.right { right: 12px; }

.mc-list { justify-content: flex-start; padding-top: 30px; }
.screen-title {
  font-family: 'Lucida Console', monospace;
  font-size: 22px;
  color: #fff;
  text-shadow: 2px 2px 0 #2a2a2a;
}
.mc-row { display: flex; gap: 8px; width: min(620px, 92vw); }
.mc-row .btn { flex: 1; }
.about p { font-size: 13px; line-height: 1.6; color: #3f3f3f; }

.title-block { text-align: center; }
.game-title {
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: 10px;
  color: #f2f7e6;
  text-shadow: 5px 5px 0 #24331a, 0 0 30px rgba(140, 200, 80, .25);
}
.subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: #a9b8a0;
  letter-spacing: 1px;
}

.menu-columns {
  display: flex;
  gap: 22px;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: center;
  width: min(1000px, 100%);
}
.menu-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  justify-content: flex-start;
}
.menu-col.wide {
  flex: 1;
  min-width: 320px;
  background: rgba(12, 14, 18, .72);
  border: 2px solid #000;
  box-shadow: inset 0 0 0 2px #4a4a4a;
  padding: 16px;
}
.menu-col.wide h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #d8e2c8;
  letter-spacing: 1px;
}
.menu-footer {
  font-size: 12px;
  color: #7f8c96;
}

/* Кнопки в стиле GUI. */
.btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  color: #f6f6f6;
  text-shadow: 2px 2px 0 #2a2a2a;
  background: #6b6b6b;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a0a0a0, inset -2px -2px 0 #3a3a3a;
  cursor: pointer;
  transition: background .1s;
}
.btn:hover { background: #7f8b6a; }
.btn:active {
  box-shadow: inset -2px -2px 0 #a0a0a0, inset 2px 2px 0 #3a3a3a;
  transform: translateY(1px);
}
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: #5c8a3a; }
.btn.primary:hover { background: #6ea245; }
.btn.danger { background: #8a3a3a; }
.btn.danger:hover { background: #a24545; }
.btn.small { width: auto; padding: 7px 12px; font-size: 13px; }

/* Список миров. */
.world-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; }
.world-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .05);
  border: 2px solid transparent;
  cursor: pointer;
}
.world-row:hover { background: rgba(255, 255, 255, .12); border-color: #8b8b8b; }
.world-name { font-size: 15px; color: #fff; }
.world-meta { font-size: 12px; color: #9aa6b0; margin-top: 3px; }
.world-actions { display: flex; gap: 6px; }
.empty { color: #8b98a2; font-size: 13px; padding: 18px; text-align: center; }

/* Панели форм. */
.panel {
  background: var(--gui-bg);
  border: 2px solid #000;
  box-shadow:
    inset 3px 3px 0 var(--gui-light),
    inset -3px -3px 0 var(--gui-shadow),
    0 12px 40px rgba(0, 0, 0, .55);
  color: var(--text-dark);
  min-width: 280px;
}
.panel-title {
  padding: 10px 14px 4px;
  font-size: 15px;
  color: #3f3f3f;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .5);
}
.panel-title.red { color: #8a1a1a; }
.panel-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.form-panel { width: min(560px, 94vw); }
.form-panel.narrow { width: min(360px, 94vw); }
.form-panel.wide { width: min(720px, 94vw); }
.form-panel .btn { color: #fff; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #3f3f3f; }
.field input[type=text], .field input[type=number], .field select {
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
  color: #e8e8e8;
  background: #2a2a2a;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #101010;
  outline: none;
}
.field input:focus { box-shadow: inset 2px 2px 0 #101010, 0 0 0 2px #7bb03a; }
.field .hint { font-size: 11px; color: #5c5c5c; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 18px;
}
.settings-grid label { font-size: 13px; color: #3f3f3f; display: block; }
.settings-grid input[type=range] { width: 100%; margin-top: 6px; accent-color: #5c8a3a; }
.settings-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: #5c8a3a; }

.keybinds { border-top: 2px solid #8b8b8b; padding-top: 10px; }
.keybinds-title { font-size: 12px; color: #4a4a4a; margin-bottom: 8px; }
.keybind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 5px 12px;
  margin-bottom: 10px;
  max-height: 26vh;
  overflow: auto;
}
.keybind-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-name { font-size: 12px; color: #3f3f3f; }
.kb-key { min-width: 84px; text-align: center; }
.kb-key.capturing { background: #5c8a3a; }

.keys { font-size: 13px; line-height: 1.9; color: #3f3f3f; }
.keys b { color: #1e1e1e; }

.death-cause { font-size: 14px; color: #5a1a1a; }
.death-score { font-size: 13px; color: #3f3f3f; margin-bottom: 6px; }

.loading-box { text-align: center; }
.loading-title { font-size: 20px; margin-bottom: 16px; color: #e8f0d8; text-shadow: 3px 3px 0 #24331a; }

/* ─────────────────────────────────────────────────────────────────────────
   HUD
   ───────────────────────────────────────────────────────────────────────── */

#ui { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#ui > * { pointer-events: none; }

#hud { position: absolute; inset: 0; }

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  background:
    linear-gradient(#fff, #fff) 50% 50% / 2px 20px no-repeat,
    linear-gradient(#fff, #fff) 50% 50% / 20px 2px no-repeat;
  opacity: .85;
}

#hotbar-wrap {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

#statusbars {
  display: flex;
  justify-content: space-between;
  width: calc(var(--slot) * 9);
  padding: 0 2px;
}
.bar { display: flex; gap: 1px; flex-wrap: wrap-reverse; max-width: 50%; }
.bar.right { justify-content: flex-end; }

.heart, .drumstick, .bubble {
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .8));
}
.heart {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23202020' d='M2 3h4v1h4V3h4v6h-1v2h-1v2h-1v1H9v1H7v-1H5v-1H4v-2H3V9H2z'/%3E%3C/svg%3E");
}
.heart.full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ff2b2b' d='M2 3h4v1h4V3h4v6h-1v2h-1v2h-1v1H9v1H7v-1H5v-1H4v-2H3V9H2z'/%3E%3Cpath fill='%23ff8080' d='M3 4h2v1h1v1H4V5H3z'/%3E%3C/svg%3E");
}
.heart.half {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23202020' d='M2 3h4v1h4V3h4v6h-1v2h-1v2h-1v1H9v1H7v-1H5v-1H4v-2H3V9H2z'/%3E%3Cpath fill='%23ff2b2b' d='M2 3h4v1h2v11H7v-1H5v-1H4v-2H3V9H2z'/%3E%3C/svg%3E");
}
.heart.low { animation: heart-beat .5s ease-in-out infinite; }
.heart.absorb { filter: drop-shadow(1px 1px 0 rgba(0,0,0,.8)) hue-rotate(35deg) saturate(1.6); }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }

.drumstick {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23202020' d='M4 3h7v2h2v3h-2v3H8v2H5v-2H3V8h1V5h1z'/%3E%3C/svg%3E");
}
.drumstick.full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238a5a2a' d='M4 3h7v2h2v3h-2v3H8v2H5v-2H3V8h1V5h1z'/%3E%3Cpath fill='%23e8e0d0' d='M4 10h3v3H5v-1H4z'/%3E%3C/svg%3E");
}
.drumstick.half {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23202020' d='M4 3h7v2h2v3h-2v3H8v2H5v-2H3V8h1V5h1z'/%3E%3Cpath fill='%238a5a2a' d='M4 3h4v10H5v-2H3V8h1V5h1z'/%3E%3C/svg%3E");
}
.bubble.full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%23202020'/%3E%3Ccircle cx='8' cy='8' r='5' fill='%2380d0ff'/%3E%3Ccircle cx='6' cy='6' r='1.5' fill='%23fff'/%3E%3C/svg%3E");
}
.bubble.empty { display: none; }

#xpbar {
  position: relative;
  width: calc(var(--slot) * 9);
  height: 10px;
  background: #1b1b1b;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #0a0a0a;
}
#xpfill { height: 100%; background: linear-gradient(#a4f04a, #62b81e); transition: width .12s linear; }
#xplevel {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  font-size: 15px;
  color: #7bfa3f;
  text-shadow: 2px 2px 0 #0d2a05;
}

#hotbar {
  display: flex;
  background: rgba(20, 20, 20, .72);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .18), inset -2px -2px 0 rgba(0, 0, 0, .5);
}

.slot {
  position: relative;
  width: var(--slot);
  height: var(--slot);
  background: var(--slot-bg);
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff;
  display: grid;
  place-items: center;
}
.hotbar-slot { background: rgba(139, 139, 139, .55); }
.hotbar-slot.selected {
  outline: 3px solid #fff;
  outline-offset: -1px;
  box-shadow: inset 2px 2px 0 #4a4a4a, inset -2px -2px 0 #e8e8e8, 0 0 12px rgba(255,255,255,.35);
  z-index: 2;
}
.slot.disabled { visibility: hidden; }
.slot[data-label]::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: rgba(255, 255, 255, .35);
  pointer-events: none;
}
.slot.filled[data-label]::after { content: ''; }
.slot:hover { background: #a8a8a8; }

.item-icon {
  width: 78%;
  height: 78%;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35));
}
.slot.enchanted::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: linear-gradient(120deg, rgba(180, 80, 255, .0), rgba(200, 120, 255, .45), rgba(180, 80, 255, .0));
  background-size: 220% 100%;
  animation: ench 2.4s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes ench { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 13px;
  color: #fff;
  text-shadow: 2px 2px 0 #202020;
}
.durability {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 3px;
  background: #000;
}
.durability > div { height: 100%; }

#held-name {
  position: absolute;
  left: 50%;
  bottom: calc(var(--slot) + 52px);
  transform: translateX(-50%);
  font-size: 15px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  opacity: 0;
  transition: opacity .35s;
}
#held-name.visible { opacity: 1; }

#effects {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.effect {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  background: rgba(20, 20, 20, .72);
  border: 2px solid #000;
  font-size: 12px;
  color: #fff;
}
.effect-time { color: #b0c0a0; font-size: 11px; }

#debug {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  background: rgba(10, 10, 10, .4);
  padding: 6px 9px;
  white-space: pre;
  max-width: 46vw;
}

#chat-log {
  position: absolute;
  left: 10px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 46vw;
}
.chat-line {
  font-size: 13px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  background: rgba(0, 0, 0, .35);
  padding: 2px 6px;
  transition: opacity .8s;
}
.chat-line.fade { opacity: 0; }

#damage-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 0, 0, 0) 30%, rgba(160, 0, 0, .55) 100%);
  opacity: 0;
  transition: opacity .35s;
}
#damage-flash.active { opacity: 1; transition: opacity .05s; }

#water-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s;
}
#water-overlay.water { background: rgba(24, 78, 160, .42); opacity: 1; }
#water-overlay.lava { background: rgba(200, 70, 10, .72); opacity: 1; }

/* Полоса здоровья босса. */
#bossbar {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: min(460px, 70vw);
  text-align: center;
}
#bossbar .boss-name {
  font-size: 14px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 4px;
}
#bossbar .boss-track {
  height: 12px;
  background: #2a0a2a;
  border: 2px solid #000;
}
#bossbar .boss-fill { height: 100%; background: linear-gradient(#e05aff, #8c1fb0); transition: width .2s; }

/* ─────────────────────────────────────────────────────────────────────────
   Экраны контейнеров
   ───────────────────────────────────────────────────────────────────────── */

#screens { position: absolute; inset: 0; }
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 12, .55);
  pointer-events: auto;
  overflow: auto;
  padding: 20px;
}
.overlay.nodim { background: transparent; }
.overlay .panel { pointer-events: auto; }

.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.slot-grid { display: grid; gap: 2px; }
.slot-grid.inv-main { margin-bottom: 8px; }
.craft-wrap { display: flex; align-items: center; gap: 10px; }
.craft-arrow, .arrow {
  width: 26px;
  height: 18px;
  background: #3f3f3f;
  clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%);
}
.armor-wrap { display: flex; flex-direction: column; gap: 8px; }

.furnace-layout { display: flex; align-items: center; gap: 16px; }
.furnace-left { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flame {
  width: 22px;
  height: 26px;
  background: linear-gradient(#ffcf4a, #ff6a10);
  clip-path: polygon(50% 0, 78% 34%, 66% 44%, 88% 74%, 50% 100%, 12% 74%, 34% 44%, 22% 34%);
  transform-origin: bottom;
  transition: transform .1s;
}
.furnace-progress, .brew-progress {
  width: 60px;
  height: 16px;
  background: #6a6a6a;
  box-shadow: inset 2px 2px 0 #444;
  position: relative;
  overflow: hidden;
}
.furnace-progress > i, .brew-progress > i {
  position: absolute;
  inset: 0;
  width: 0;
  background: #e8e8e8;
  display: block;
}

.brewing-layout { display: flex; align-items: center; gap: 16px; }
.anvil-layout { display: flex; align-items: center; gap: 14px; }
.anvil-name {
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #2a2a2a;
  color: #eee;
  border: 2px solid #000;
  width: 190px;
}
.anvil-cost { font-size: 13px; color: #1d6b1d; }
.anvil-cost.too-expensive { color: #a01414; }

.enchant-layout { display: flex; gap: 16px; align-items: flex-start; }
.enchant-options { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.enchant-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #6b6b6b;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #8f8f8f, inset -2px -2px 0 #4a4a4a;
  cursor: pointer;
  color: #f0f0f0;
  font-size: 12px;
}
.enchant-option:hover { background: #7a8a5a; }
.enchant-option.disabled { opacity: .5; cursor: not-allowed; }
.enchant-option .lvl { color: #7bfa3f; text-shadow: 1px 1px 0 #0d2a05; font-size: 14px; }
.enchant-option .txt { flex: 1; text-align: left; }
.enchant-option .cost { color: #cfe9a0; }
.enchant-info, .enchant-hint { font-size: 12px; color: #4a4a4a; }

.creative-search {
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #2a2a2a;
  color: #eee;
  border: 2px solid #000;
  width: 100%;
}
.creative-list {
  display: grid;
  grid-template-columns: repeat(9, var(--slot));
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 6px;
}
/* Прилавок жителя. */
.trade-list { display: flex; flex-direction: column; gap: 3px; max-height: 40vh; overflow-y: auto; margin-bottom: 8px; }
.trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #9c9c9c;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #bdbdbd, inset -2px -2px 0 #6b6b6b;
  cursor: pointer;
}
.trade-row:hover { background: #a8b48a; }
.trade-row.disabled { opacity: .55; cursor: not-allowed; }
.trade-row.locked { filter: grayscale(1); opacity: .4; }
.trade-item { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: #1e1e1e; }
.trade-item .item-icon { width: 26px; height: 26px; }
.trade-uses { margin-left: auto; font-size: 11px; color: #3f3f3f; }

.creative-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.creative-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-size: 11px;
  color: #2a2a2a;
  background: #9c9c9c;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #bdbdbd, inset -2px -2px 0 #6b6b6b;
  cursor: pointer;
}
.creative-tab .item-icon { width: 18px; height: 18px; }
.creative-tab.active {
  background: var(--gui-bg);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8b8b8b;
  color: #000;
}
.creative-count { font-size: 11px; color: #4a4a4a; margin-top: 4px; }

/* Инвентарь: слева броня и «кукла» игрока, справа сетка крафта. */
.inv-top { align-items: flex-start; gap: 10px; }
.player-doll {
  width: calc(var(--slot) * 2);
  height: calc(var(--slot) * 4 + 6px);
  background: linear-gradient(#2a2a2a, #161616);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #3f3f3f, inset -2px -2px 0 #0d0d0d;
  padding: 4px;
}
.player-doll svg { width: 100%; height: 100%; display: block; }

#tooltip {
  position: fixed;
  z-index: 120;
  background: rgba(16, 0, 32, .94);
  border: 2px solid #2b0a5a;
  box-shadow: 0 0 0 2px #120225;
  padding: 6px 9px;
  font-size: 13px;
  color: #fff;
  pointer-events: none;
  max-width: 280px;
}
.tt-name { color: #fff; margin-bottom: 3px; }
.tt-ench { color: #a8a8f0; font-size: 12px; }
.tt-line { color: #9a9a9a; font-size: 12px; }

#cursor-stack {
  position: fixed;
  z-index: 130;
  width: var(--slot);
  height: var(--slot);
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: grid;
  place-items: center;
}
#cursor-stack img { width: 78%; height: 78%; image-rendering: pixelated; }

/* Мелкие экраны — уменьшаем слоты. */
@media (max-width: 900px), (max-height: 700px) {
  :root { --slot: 36px; }
  .creative-list { grid-template-columns: repeat(9, var(--slot)); }
}
@media (max-width: 620px) {
  :root { --slot: 30px; }
  .game-title { letter-spacing: 5px; }
}
