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

:root {
  --red: #b92b1d;
  --dark-red: #7e1710;
  --gold: #f2c35f;
  --cream: #fff0c8;
  --dark: #120804;
  --panel: rgba(18, 8, 3, 0.84);
  --panel-solid: #1b0d06;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--dark);
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

/* SHARED */

.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.04), rgba(0,0,0,0.48)),
    url("backround.png");
  background-size: cover;
  background-position: center;
}

.shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 38%, rgba(0,0,0,0.28)),
    linear-gradient(to right, rgba(0,0,0,0.25), transparent 32%, transparent 72%, rgba(0,0,0,0.34));
  pointer-events: none;
}

button {
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  transition: 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 5px;
  border: 2px solid rgba(242, 195, 95, 0.65);
  background: rgba(0,0,0,0.55);
  color: var(--cream);
  font-weight: 900;
  outline: none;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* BRAND */

.brand,
.top-left-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crest {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 4px 4px 10px 10px;
  border: 2px solid var(--gold);
  background: linear-gradient(#d9442e, #76150e);
  font-family: Georgia, serif;
  font-weight: 900;
  color: #ffe4a6;
}

.crest.small {
  width: 35px;
  height: 40px;
}

.brand strong,
.top-left-brand strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 26px;
  color: #ffe4a6;
  text-shadow: 2px 2px 0 #55130c;
}

.brand span,
.top-left-brand span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
}

/* START */

.start-card {
  position: absolute;
  z-index: 2;
  left: 7%;
  top: 50%;
  transform: translateY(-50%);
  width: min(450px, 86vw);
  padding: 26px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.62);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 18px 48px rgba(0,0,0,0.42);
  backdrop-filter: blur(5px);
}

.start-card h1 {
  margin-top: 22px;
  font-family: Georgia, serif;
  color: #ffe4a6;
  font-size: 48px;
  text-shadow: 3px 3px 0 #55130c;
}

.start-card p {
  margin-top: 10px;
  color: rgba(255,240,200,0.86);
  line-height: 1.5;
  font-weight: 800;
}

.main-btn {
  width: 100%;
  margin-top: 18px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  background: linear-gradient(#d9442e, #8e1c13);
  border: 2px solid var(--gold);
  box-shadow: 0 5px 0 #3b0a05;
  font-size: 16px;
}

.start-mascot {
  position: absolute;
  z-index: 2;
  right: 15%;
  bottom: 10%;
  width: min(310px, 32vw);
  max-height: 62vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,0.55));
  animation: floaty 3.4s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

/* LOBBY */

.top-left-brand {
  position: absolute;
  z-index: 5;
  top: 18px;
  left: 18px;
  padding: 10px 13px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.55);
  backdrop-filter: blur(4px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.28);
}

.world-card {
  position: absolute;
  z-index: 5;
  top: 86px;
  right: 24px;
  width: 275px;
  padding: 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.55);
  backdrop-filter: blur(4px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.28);
}

.lobby-player {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 17%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lobby-player img {
  width: min(285px, 30vw);
  max-height: 50vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,0.55));
  animation: floaty 3.4s ease-in-out infinite;
}

.name-tag {
  margin-bottom: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(15, 8, 3, 0.86);
  border: 2px solid rgba(242, 195, 95, 0.6);
  color: #ffe4a6;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.profile-card {
  position: absolute;
  z-index: 4;
  left: 24px;
  bottom: 112px;
  width: 375px;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.65);
  box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 14px 28px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}

.profile-card img {
  width: 68px;
  height: 68px;
  max-width: 68px;
  max-height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(242, 195, 95, 0.35);
}

.profile-card strong {
  display: block;
  color: #ffe4a6;
  font-size: 23px;
  text-shadow: 1px 1px 0 #000;
}

.profile-card span {
  display: block;
  margin-top: 6px;
  color: rgba(255,240,200,0.88);
  font-size: 15px;
  font-weight: 800;
}

.lobby-actions {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 48px));
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.lobby-actions button {
  min-width: 120px;
  max-width: 145px;
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff0c8;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.55);
  border-radius: 5px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.28);
  font-size: 14px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
}

.lobby-actions .big-play {
  min-width: 140px;
  background: linear-gradient(#d9442e, #8e1c13);
  border-color: var(--gold);
  color: white;
}

.mail-btn {
  position: relative;
}

#mailDot {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e33a2d;
  border: 2px solid white;
  box-shadow: 0 0 8px rgba(227, 58, 45, 0.8);
}

/* GAME */

.game-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #203b1c;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
}

.game-hud {
  position: absolute;
  z-index: 5;
  left: 18px;
  bottom: 18px;
  top: auto;
  min-width: 350px;
  padding: 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.58);
  box-shadow: 0 6px 0 rgba(0,0,0,0.28), 0 14px 30px rgba(0,0,0,0.32);
  backdrop-filter: blur(4px);
  color: var(--cream);
}

.game-hud strong {
  display: block;
  color: #ffe4a6;
  font-size: 20px;
  text-shadow: 1px 1px 0 #000;
}

.game-hud span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,240,200,0.8);
  font-weight: 800;
}

.level-row,
.health-row,
.day-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.xp-bar,
.hp-bar,
.day-bar {
  flex: 1;
  height: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(242, 195, 95, 0.35);
  overflow: hidden;
}

.xp-bar i,
.hp-bar i,
.day-bar i {
  display: block;
  height: 100%;
  width: 0%;
}

.xp-bar i {
  background: linear-gradient(90deg, #d9442e, #f2c35f);
}

.hp-bar i {
  background: linear-gradient(90deg, #1fb860, #7eff9d);
}

.day-bar i {
  background: linear-gradient(90deg, #f2c35f, #80d7ff);
}

.resource-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.resource-row b {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(242,195,95,0.35);
  color: #ffe4a6;
  font-size: 14px;
  text-align: center;
}

.resource-row img {
  width: 26px;
  height: 26px;
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.camp-row {
  margin-top: 9px;
  padding: 7px 9px;
  border-radius: 4px;
  background: rgba(0,0,0,0.24);
  border: 1px solid rgba(242,195,95,0.28);
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.controls {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.48);
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
  color: rgba(255,240,200,0.84);
  font-size: 13px;
  line-height: 1.45;
}

.back-lobby {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  padding: 12px 15px;
  border-radius: 5px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.48);
  box-shadow: 0 5px 0 rgba(0,0,0,0.25);
  color: var(--cream);
  font-weight: 900;
}

.interact-prompt {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%);
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--panel);
  border: 2px solid rgba(242, 195, 95, 0.55);
  box-shadow: 0 6px 0 rgba(0,0,0,0.22);
  color: #ffe4a6;
  font-size: 14px;
  font-weight: 900;
}

.game-bottom-actions {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.icon-action {
  width: 132px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(18, 8, 3, 0.88);
  border: 2px solid rgba(242, 195, 95, 0.65);
  color: var(--cream);
  box-shadow: 0 5px 0 rgba(0,0,0,0.28);
  text-shadow: 1px 1px 0 #000;
  overflow: hidden;
}

.icon-action img {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.icon-action span {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.text-action {
  font-size: 15px;
}

.inventory-action {
  width: 150px;
}

/* PANELS */

.side-panel {
  position: absolute;
  z-index: 15;
  right: 24px;
  top: 92px;
  width: 460px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 16px;
  border-radius: 6px;
  background: rgba(18, 8, 3, 0.94);
  border: 3px solid rgba(242, 195, 95, 0.7);
  box-shadow: 0 9px 0 rgba(0,0,0,0.35), 0 25px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(5px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h2 {
  color: var(--gold);
  font-size: 26px;
  text-shadow: 2px 2px 0 #000;
}

.panel-header button {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: var(--red);
  color: white;
  border: 2px solid var(--gold);
}

.inventory-stats,
.stat-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-summary {
  grid-template-columns: 1fr;
}

.inventory-stats div,
.stat-summary div {
  padding: 10px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(242,195,95,0.35);
  font-size: 14px;
  font-weight: 900;
}

.inventory-stats img {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  image-rendering: pixelated;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

.inventory-slot {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(0,0,0,0.26);
  border: 2px solid rgba(242,195,95,0.35);
}

.inventory-slot.empty {
  opacity: 0.35;
}

.inventory-slot img {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
}

.inventory-slot span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 1px 1px 0 #000;
}

.quest-panel,
.stats-panel,
.camp-panel {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, calc(100vw - 40px));
}

.quest-body {
  padding: 14px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(242,195,95,0.35);
  white-space: pre-line;
  color: rgba(255,240,200,0.9);
  line-height: 1.55;
  font-size: 15px;
  font-weight: 800;
}

.claim-btn {
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border-radius: 4px;
  background: linear-gradient(#d9442e, #8e1c13);
  color: white;
  border: 2px solid var(--gold);
}

.claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats-list {
  display: grid;
  gap: 9px;
}

.stat-line {
  display: grid;
  grid-template-columns: 1fr 60px 42px;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(242,195,95,0.35);
}

.stat-line strong {
  color: #ffe4a6;
}

.stat-line span {
  color: rgba(255,240,200,0.82);
  font-size: 13px;
}

.stat-line button {
  width: 42px;
  height: 34px;
  border-radius: 4px;
  background: linear-gradient(#d9442e, #8e1c13);
  color: white;
  border: 2px solid var(--gold);
}

.stat-line button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* CAMP PANEL */

.camp-body {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.camp-card {
  padding: 12px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(242,195,95,0.35);
  color: rgba(255,240,200,0.9);
  line-height: 1.5;
  font-size: 14px;
  font-weight: 800;
}

.camp-card strong {
  display: block;
  color: #ffe4a6;
  font-size: 17px;
  margin-bottom: 5px;
  text-shadow: 1px 1px 0 #000;
}

.camp-benefit-list {
  display: grid;
  gap: 6px;
}

.camp-benefit {
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(242,195,95,0.25);
  color: rgba(255,240,200,0.88);
  font-size: 13px;
}

.camp-benefit.unlocked {
  color: #d8ffb0;
  border-color: rgba(126,255,157,0.35);
}

.camp-cost {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.camp-cost div {
  padding: 9px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(242,195,95,0.3);
  text-align: center;
  font-size: 13px;
  color: #ffe4a6;
}

/* MODAL + TOAST */

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.65);
  padding: 18px;
}

.modal-card {
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 6px;
  background: #1d0d05;
  border: 3px solid var(--gold);
  box-shadow: 0 20px 70px rgba(0,0,0,0.6);
}

.modal-card h2 {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 30px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 0 #4a170b;
}

.modal-card p {
  color: rgba(255,240,200,0.86);
  line-height: 1.55;
  font-weight: 800;
  margin-bottom: 18px;
  white-space: pre-line;
}

.modal-card button {
  padding: 11px 16px;
  border-radius: 5px;
  background: linear-gradient(#d9442e, #8e1c13);
  color: white;
  border: 2px solid var(--gold);
  font-weight: 900;
}

.fullscreen-prompt {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.72);
}

.fullscreen-card {
  width: min(470px, 100%);
  padding: 26px;
  border-radius: 8px;
  text-align: center;
  background: #1d0d05;
  border: 3px solid var(--gold);
  box-shadow: 0 20px 70px rgba(0,0,0,0.65);
}

.fullscreen-card h2 {
  margin-bottom: 10px;
  font-family: Georgia, serif;
  color: #ffe4a6;
  font-size: 32px;
  text-shadow: 2px 2px 0 #4a170b;
}

.fullscreen-card p {
  color: rgba(255,240,200,0.88);
  line-height: 1.5;
  margin-bottom: 18px;
}

.fullscreen-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 13px;
}

.fullscreen-actions .main-btn {
  margin-top: 0;
}

.skip-fullscreen-btn {
  width: 42%;
  padding: 12px 12px;
  border-radius: 5px;
  color: var(--cream);
  background: rgba(0,0,0,0.28);
  border: 2px solid rgba(242,195,95,0.5);
}

.fullscreen-card span {
  color: rgba(255,240,200,0.65);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(140px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 6px;
  background: #160b05;
  color: var(--cream);
  border: 2px solid var(--gold);
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  transition: transform 0.25s, opacity 0.25s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* MOBILE */

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .screen,
  .game-screen {
    min-height: 100vh;
    height: auto;
  }

  .start-screen,
  .lobby-screen {
    display: flex;
    flex-direction: column;
    padding: 20px;
  }

  .start-card,
  .start-mascot,
  .top-left-brand,
  .world-card,
  .lobby-player,
  .profile-card,
  .lobby-actions {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    margin: 14px auto;
  }

  .start-card {
    margin-top: 80px;
  }

  .start-mascot,
  .lobby-player img {
    width: 220px;
  }

  .world-card,
  .profile-card {
    width: min(380px, 100%);
  }

  .lobby-actions {
    width: min(520px, 100%);
    flex-wrap: wrap;
    gap: 10px;
  }

  .lobby-actions button {
    min-width: 145px;
  }

  .controls {
    display: none;
  }

  .game-hud {
    width: min(350px, calc(100vw - 32px));
    min-width: 0;
  }

  .resource-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-bottom-actions {
    bottom: 16px;
    gap: 8px;
  }

  .icon-action {
    width: 108px;
  }

  .inventory-action {
    width: 128px;
  }

  .side-panel,
  .camp-panel {
    left: 16px;
    right: 16px;
    top: 80px;
    transform: none;
    width: auto;
  }

  .inventory-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* =====================================================
   PHASE 3D: NPC SHOP + BUY/SELL
===================================================== */

.npc-dialogue {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 6px;
  background: rgba(18, 8, 3, 0.94);
  border: 3px solid rgba(242, 195, 95, 0.75);
  box-shadow: 0 8px 0 rgba(0,0,0,0.35), 0 22px 50px rgba(0,0,0,0.45);
}

.npc-text {
  min-height: 48px;
  padding: 12px;
  border-radius: 4px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(242,195,95,0.35);
  color: #ffe4a6;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 900;
}

.npc-options {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.npc-options button {
  min-width: 110px;
  height: 42px;
  border-radius: 5px;
  background: rgba(18, 8, 3, 0.88);
  border: 2px solid rgba(242, 195, 95, 0.65);
  color: var(--cream);
  box-shadow: 0 4px 0 rgba(0,0,0,0.28);
}

.shop-panel {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px));
}

.shop-gold {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 auto 14px auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(242,195,95,0.5);
  color: #ffe4a6;
  font-weight: 900;
}

.shop-gold img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-items {
  display: grid;
  gap: 10px;
}

.shop-item {
  display: grid;
  grid-template-columns: 58px 1fr 105px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 5px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(242,195,95,0.35);
}

.shop-item img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-item strong {
  display: block;
  color: #ffe4a6;
  font-size: 16px;
  margin-bottom: 3px;
}

.shop-item span {
  color: rgba(255,240,200,0.82);
  font-size: 13px;
}

.shop-item button {
  height: 42px;
  border-radius: 5px;
  background: linear-gradient(#d9442e, #8e1c13);
  color: white;
  border: 2px solid var(--gold);
}

.shop-item button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .npc-dialogue {
    bottom: 86px;
  }

  .shop-panel {
    left: 16px;
    right: 16px;
    top: 80px;
    transform: none;
    width: auto;
  }

  .shop-item {
    grid-template-columns: 48px 1fr;
  }

  .shop-item button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* =====================================================
   PHASE 3E: COMPACT MENU + HOTBAR / EQUIPMENT
===================================================== */

.game-bottom-ui {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}

.hotbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border-radius: 7px;
  background: rgba(18, 8, 3, 0.9);
  border: 2px solid rgba(242, 195, 95, 0.62);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3);
}

.hotbar-slot {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(0,0,0,0.27);
  border: 2px solid rgba(242,195,95,0.3);
  color: var(--cream);
}

.hotbar-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(242,195,95,0.72);
}

.hotbar-slot.equipped {
  border-color: #8de277;
  box-shadow: inset 0 0 0 1px rgba(141,226,119,0.35);
}

.hotbar-slot img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.hotbar-key {
  position: absolute;
  left: 4px;
  top: 3px;
  color: rgba(255,240,200,0.72);
  font-size: 10px;
  font-weight: 900;
}

.hotbar-count {
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: white;
  font-size: 11px;
  text-shadow: 1px 1px 0 #000;
}

.game-menu-wrap {
  position: relative;
}

.menu-toggle {
  width: 62px;
  height: 70px;
  padding: 0;
  border-radius: 7px;
  background: rgba(18, 8, 3, 0.92);
  border: 2px solid rgba(242,195,95,0.65);
  box-shadow: 0 6px 0 rgba(0,0,0,0.3);
  color: var(--cream);
  font-size: 12px;
}

.game-menu {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: 142px;
  display: grid;
  gap: 7px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(18, 8, 3, 0.95);
  border: 2px solid rgba(242,195,95,0.62);
  box-shadow: 0 8px 0 rgba(0,0,0,0.25);
}

.menu-action {
  width: 100%;
  height: 43px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(242,195,95,0.38);
  color: var(--cream);
}

.menu-action img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  image-rendering: pixelated;
}

.inventory-help {
  margin: -3px 0 12px;
  color: rgba(255,240,200,0.65);
  font-size: 12px;
  line-height: 1.4;
}

.inventory-slot.assignable {
  cursor: pointer;
}

.inventory-slot.assignable:hover {
  border-color: rgba(242,195,95,0.78);
}

.inventory-slot.hotbar-linked {
  border-color: rgba(141,226,119,0.55);
}

.inventory-slot.hotbar-linked::before {
  content: "BAR";
  position: absolute;
  top: 3px;
  left: 4px;
  color: #caffb4;
  font-size: 9px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .game-bottom-ui {
    bottom: 14px;
    gap: 6px;
  }

  .hotbar {
    gap: 4px;
    padding: 5px;
  }

  .hotbar-slot {
    width: 46px;
    height: 46px;
  }

  .hotbar-slot img {
    width: 32px;
    height: 32px;
  }

  .menu-toggle {
    width: 54px;
    height: 60px;
  }
}



/* PHASE 5B — CRAFTING FOUNDATION */
.crafting-action {
  color: #ffe4a6;
}

.crafting-panel {
  position: absolute;
  z-index: 45;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100% - 44px));
  max-height: min(620px, calc(100% - 42px));
  overflow: hidden;
  border-radius: 10px;
  border: 3px solid #f2c35f;
  background: linear-gradient(180deg, rgba(44, 24, 13, 0.98), rgba(19, 11, 7, 0.98));
  box-shadow: 0 20px 60px rgba(0,0,0,0.58);
  color: #fff0c8;
}

.crafting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px 12px;
  border-bottom: 2px solid rgba(242,195,95,0.35);
  background: rgba(0,0,0,0.22);
}

.crafting-header h2 {
  margin: 0;
  color: #ffe4a6;
  font-size: 25px;
}

.crafting-header p {
  margin: 3px 0 0;
  color: rgba(255,240,200,0.72);
  font-size: 12px;
}

.crafting-close {
  min-width: 37px;
  height: 37px;
  border-radius: 5px;
  border: 2px solid #f2c35f;
  color: #fff;
  background: #962a1b;
  font-weight: 900;
  cursor: pointer;
}

.crafting-layout {
  display: grid;
  grid-template-columns: minmax(405px, 1.72fr) minmax(250px, 1fr);
  min-height: 454px;
}

.crafting-browser {
  padding: 14px;
  border-right: 2px solid rgba(242,195,95,0.28);
}

.crafting-search {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  margin-bottom: 11px;
  color: #ffe4a6;
  background: rgba(0,0,0,0.27);
  border: 2px solid rgba(242,195,95,0.38);
  border-radius: 6px;
  outline: none;
}

.crafting-search:focus {
  border-color: #f2c35f;
}

.crafting-categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.craft-category {
  padding: 7px 9px;
  border-radius: 5px;
  border: 1px solid rgba(242,195,95,0.38);
  background: rgba(0,0,0,0.26);
  color: rgba(255,240,200,0.86);
  font-size: 11px;
  cursor: pointer;
}

.craft-category.active {
  background: #a02c1c;
  border-color: #f2c35f;
  color: #ffe4a6;
}

.crafting-recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 9px;
  align-content: start;
  min-height: 290px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 3px;
}

.craft-recipe {
  height: 94px;
  border: 2px solid rgba(242,195,95,0.26);
  border-radius: 7px;
  background: rgba(0,0,0,0.22);
  color: #fff0c8;
  cursor: pointer;
  padding: 7px 5px 5px;
}

.craft-recipe:hover,
.craft-recipe.selected {
  border-color: #f2c35f;
  background: rgba(134,45,26,0.47);
}

.craft-recipe img {
  display: block;
  width: 45px;
  height: 45px;
  margin: 0 auto 4px;
  object-fit: contain;
  image-rendering: pixelated;
}

.craft-recipe span {
  display: block;
  text-align: center;
  font-size: 10px;
  line-height: 1.18;
}

.craft-empty {
  grid-column: 1 / -1;
  padding: 38px 12px;
  text-align: center;
  border: 2px dashed rgba(242,195,95,0.28);
  border-radius: 7px;
  color: rgba(255,240,200,0.65);
  font-size: 13px;
}

.crafting-details {
  padding: 16px;
  background: rgba(0,0,0,0.13);
  display: flex;
  flex-direction: column;
}

.crafting-details.hidden {
  display: flex !important;
}

.crafting-details.hidden::before {
  content: "Select a recipe to view its materials.";
  margin: auto;
  max-width: 190px;
  text-align: center;
  color: rgba(255,240,200,0.54);
  line-height: 1.45;
}

.craft-detail-name {
  margin: 0 0 12px;
  color: #ffe4a6;
  font-size: 21px;
}

.craft-requirements {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 13px;
}

.craft-material {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid rgba(242,195,95,0.24);
  background: rgba(0,0,0,0.22);
  color: rgba(255,240,200,0.72);
}

.craft-material.met {
  color: #e3ffb5;
  border-color: rgba(118,190,75,0.45);
}

.craft-material img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.craft-material b {
  margin-left: auto;
  font-size: 12px;
}

.craft-output {
  margin-top: auto;
  text-align: center;
}

.craft-output img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  image-rendering: pixelated;
  margin-bottom: 5px;
}

.craft-output p {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255,240,200,0.76);
}

.craft-button {
  width: 100%;
  padding: 12px;
  border: 2px solid #f2c35f;
  border-radius: 6px;
  background: linear-gradient(#55b94f, #277b30);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

.craft-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.43;
}

@media (max-width: 790px) {
  .crafting-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
  }

  .crafting-browser {
    border-right: none;
    border-bottom: 2px solid rgba(242,195,95,0.28);
  }

  .crafting-details {
    min-height: 330px;
  }
}


.crafting-panel.no-selection {
  width: min(640px, calc(100% - 44px));
}

.crafting-panel.no-selection .crafting-layout {
  grid-template-columns: 1fr;
}

.crafting-panel.no-selection .crafting-browser {
  border-right: none;
}

.crafting-panel.no-selection .crafting-details {
  display: none !important;
}


/* PHASE 6A — CAMPFIRE PLACEMENT */
.game-canvas.placing-campfire {
  cursor: crosshair;
}

.camp-placement-guide {
  position: absolute;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 90;
  width: min(420px, calc(100% - 28px));
  padding: 10px 14px;
  border: 2px solid #f2c35f;
  border-radius: 7px;
  background: rgba(29, 17, 10, 0.94);
  color: #ffe4a6;
  text-align: center;
  pointer-events: none;
}

.camp-placement-guide strong { display: block; font-size: 16px; margin-bottom: 4px; }
.camp-placement-guide span { display: block; color: rgba(255,240,200,0.9); font-size: 13px; }
.camp-placement-guide small { display: block; margin-top: 5px; color: rgba(255,240,200,0.65); }

.camp-placement-confirm {
  position: absolute;
  right: 18px;
  bottom: 105px;
  z-index: 100;
  width: 270px;
  padding: 13px;
  border: 2px solid #f2c35f;
  border-radius: 8px;
  background: rgba(27, 15, 9, 0.97);
  color: #ffe4a6;
  box-shadow: 0 7px 18px rgba(0,0,0,0.42);
}

.camp-placement-confirm strong { display: block; font-size: 16px; margin-bottom: 6px; }
.camp-placement-confirm p { margin: 0 0 11px; color: rgba(255,240,200,0.84); font-size: 12px; line-height: 1.42; }
.camp-placement-confirm div { display: flex; gap: 7px; }
.camp-placement-confirm button { flex: 1; padding: 8px 6px; font-size: 12px; }

@media (max-width: 760px) {
  .camp-placement-confirm { right: 50%; transform: translateX(50%); bottom: 150px; }
}


/* PHASE 6B — SMELTING FOUNDATION */
.smelting-action {
  color: #ffd48e;
}

.smelting-panel {
  position: absolute;
  z-index: 46;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(690px, calc(100% - 44px));
  padding-bottom: 16px;
  border-radius: 10px;
  border: 3px solid #f2c35f;
  background: linear-gradient(180deg, rgba(44, 24, 13, 0.98), rgba(19, 11, 7, 0.98));
  box-shadow: 0 20px 60px rgba(0,0,0,0.58);
  color: #fff0c8;
}

.smelting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 17px 12px;
  border-bottom: 2px solid rgba(242,195,95,0.35);
  margin-bottom: 14px;
}

.smelting-header h2 {
  margin: 0;
  color: #ffe4a6;
  font-size: 25px;
}

.smelting-header p {
  margin: 3px 0 0;
  color: rgba(255,240,200,0.72);
  font-size: 12px;
}

.smelting-close {
  min-width: 37px;
  height: 37px;
  border-radius: 5px;
  border: 2px solid #f2c35f;
  color: #fff;
  background: #962a1b;
  font-weight: 900;
}

.smelting-recipes {
  padding: 0 16px;
  display: grid;
  gap: 12px;
}

.smelt-card {
  display: grid;
  grid-template-columns: 96px 1fr 135px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid rgba(242,195,95,0.25);
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
}

.smelt-card.ready {
  border-color: rgba(116, 193, 79, 0.56);
}

.smelt-title {
  color: #ffe4a6;
  font-size: 18px;
}

.smelt-flow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smelt-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255,240,200,0.76);
}

.smelt-item img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  object-fit: contain;
}

.smelt-arrow {
  color: #f2c35f;
  font-size: 24px;
}

.smelt-item.output span {
  color: #e9ffba;
}

.smelt-button {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  border: 2px solid #f2c35f;
  background: linear-gradient(#e47834, #9b341c);
  color: #fff;
  font-weight: 900;
}

.smelt-button:disabled {
  filter: grayscale(1);
  opacity: .45;
}

@media (max-width: 660px) {
  .smelt-card {
    grid-template-columns: 1fr;
  }
}


/* PHASE 6C — HOME TERRITORY FOUNDATION */

.location-banner {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  text-align: center;
  color: rgba(255, 237, 194, 0.96);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.88);
  pointer-events: none;
  transition: color 0.2s ease;
}

.location-banner.home-land {
  color: #ffe4a6;
}

.territory-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 28;
  width: min(500px, calc(100% - 34px));
  transform: translate(-50%, -50%);
  padding: 18px;
  border-radius: 9px;
  color: var(--cream);
  background: rgba(18, 8, 3, 0.97);
  border: 2px solid rgba(242, 195, 95, 0.68);
  box-shadow: 0 16px 32px rgba(0,0,0,0.44);
}

.territory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.territory-header h2 {
  margin: 0 0 3px;
  color: #ffe4a6;
  font-size: 22px;
}

.territory-header p {
  margin: 0;
  color: rgba(255, 238, 200, 0.7);
  font-size: 12px;
}

.territory-close {
  width: 34px;
  height: 34px;
  padding: 0;
}

.territory-status,
.territory-rule {
  margin-top: 10px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(242,195,95,0.28);
  line-height: 1.45;
  font-size: 13px;
}

.territory-status strong {
  display: block;
  margin-bottom: 5px;
  color: #ffe4a6;
  font-size: 16px;
}

.territory-rule {
  color: rgba(255, 238, 200, 0.8);
}

.territory-rule.locked {
  opacity: 0.7;
}

.territory-map-tag {
  margin-top: 12px;
  text-align: center;
  color: #ffe4a6;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
}


/* PHASE 8A.1 — TEST BUTTON + FURNACE POLISH */
.test-camp-teleport {
  position: absolute;
  z-index: 8;
  right: 18px;
  top: 66px;
  min-width: 92px;
  height: 34px;
  border-radius: 5px;
  color: #fff0c8;
  background: rgba(18, 8, 3, 0.88);
  border: 2px solid rgba(242,195,95,0.62);
  box-shadow: 0 4px 0 rgba(0,0,0,0.28);
  font-size: 12px;
}

.furnace-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 2px solid rgba(242,195,95,0.28);
  border-radius: 7px;
  background: rgba(0,0,0,0.18);
  color: #ffe4a6;
}

.furnace-title-row span {
  color: rgba(255,240,200,0.72);
  font-size: 12px;
}

.smelt-empty {
  padding: 22px;
  border: 2px dashed rgba(242,195,95,0.35);
  border-radius: 8px;
  text-align: center;
  color: rgba(255,240,200,0.76);
}

.smelt-card.active-job {
  grid-template-columns: 1fr 1.1fr 130px;
}

.furnace-flow {
  justify-content: center;
}

.furnace-progress-wrap {
  display: grid;
  gap: 7px;
}

.furnace-progress-text {
  color: #ffe4a6;
  font-size: 12px;
  text-align: center;
}

.furnace-progress {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(242,195,95,0.45);
  background: rgba(0,0,0,0.38);
}

.furnace-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8b2d1b, #e47834, #ffe4a6);
  transition: width 0.18s linear;
}

@media (max-width: 760px) {
  .inventory-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .test-camp-teleport {
    top: 108px;
  }
}

/* PHASE 8B — INVENTORY POLISH */
#inventoryPanel {
  width: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#inventoryPanel .panel-header,
#inventoryPanel .inventory-stats,
#inventoryPanel .inventory-help,
#inventoryPanel .inventory-category-tabs,
#inventoryPanel .inventory-item-details {
  flex: 0 0 auto;
}

.inventory-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 10px;
}

.inventory-category-tab {
  flex: 1 1 auto;
  min-width: 70px;
  padding: 8px 9px;
  border-radius: 4px;
  color: #fff0c8;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(242,195,95,0.38);
  font-size: 12px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.25);
}

.inventory-category-tab.active {
  color: #1b0d06;
  background: #f2c35f;
  border-color: #ffe4a6;
}

#inventoryPanel .inventory-grid {
  grid-template-columns: repeat(5, 1fr);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(335px, calc(100vh - 420px));
  min-height: 190px;
  padding: 2px 6px 8px 2px;
  margin-right: -4px;
  scrollbar-width: thin;
}

#inventoryPanel .inventory-slot {
  min-height: 63px;
}

#inventoryPanel .inventory-item-details {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: 10px;
  background: rgba(18, 8, 3, 0.98);
  border-color: rgba(242,195,95,0.68);
  box-shadow: 0 -10px 22px rgba(0,0,0,0.34);
}

#inventoryPanel .inventory-item-actions button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.camp-mini-action {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  color: white;
  background: linear-gradient(#d9442e, #8e1c13);
  border: 2px solid #f2c35f;
  font-weight: 900;
}

.camp-mini-action:disabled {
  opacity: 0.58;
  filter: grayscale(0.2);
  cursor: default;
}

.starter-cost {
  margin-top: 10px;
}

@media (max-width: 760px) {
  #inventoryPanel {
    width: min(420px, calc(100vw - 30px));
  }

  #inventoryPanel .inventory-grid {
    grid-template-columns: repeat(5, 1fr);
    max-height: min(300px, calc(100vh - 430px));
  }
}

/* PHASE 8C.1 — STORAGE CHEST */
.storage-panel {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100vw - 34px));
  max-height: min(650px, calc(100vh - 38px));
  padding: 16px;
  border-radius: 7px;
  background: rgba(18, 8, 3, 0.93);
  border: 2px solid rgba(242, 195, 95, 0.68);
  box-shadow: 0 7px 0 rgba(0,0,0,0.35), 0 20px 52px rgba(0,0,0,0.48);
  backdrop-filter: blur(5px);
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 13px;
}

.storage-header h2 {
  color: #ffe4a6;
  font-family: Georgia, serif;
  font-size: 28px;
  text-shadow: 2px 2px 0 #55130c;
}

.storage-header p,
.storage-help {
  margin-top: 4px;
  color: rgba(255,240,200,0.78);
  font-size: 12px;
  line-height: 1.35;
}

.storage-close {
  min-width: 38px;
  height: 34px;
  color: #fff0c8;
  background: rgba(40,22,14,0.95);
  border: 2px solid rgba(242,195,95,0.55);
  border-radius: 5px;
}

.storage-layout {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 10px;
  align-items: start;
}

.storage-side {
  min-height: 330px;
  padding: 12px;
  border-radius: 6px;
  border: 2px solid rgba(242,195,95,0.35);
  background: rgba(0,0,0,0.23);
}

.storage-side h3 {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.storage-swap-hint {
  align-self: center;
  text-align: center;
  color: #ffe4a6;
  font-size: 24px;
  text-shadow: 2px 2px 0 #000;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  gap: 8px;
  align-content: start;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.storage-slot {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(0,0,0,0.34);
  border: 2px solid rgba(242,195,95,0.32);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.storage-slot img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.storage-slot span {
  position: absolute;
  right: 3px;
  bottom: 2px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0,0,0,0.7);
  color: #fff0c8;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

.storage-slot.dragging {
  opacity: 0.45;
}

.storage-slot.drop-target {
  border-color: #80ef78;
  box-shadow: 0 0 12px rgba(128,239,120,0.35), inset 0 0 0 2px rgba(128,239,120,0.22);
}

.storage-empty-note {
  grid-column: 1 / -1;
  padding: 14px;
  color: rgba(255,240,200,0.65);
  font-size: 12px;
  border: 2px dashed rgba(242,195,95,0.25);
  border-radius: 5px;
}

@media (max-width: 760px) {
  .storage-layout {
    grid-template-columns: 1fr;
  }

  .storage-swap-hint {
    display: none;
  }

  .storage-grid {
    grid-template-columns: repeat(5, 52px);
  }
}

/* PHASE 8D — DRAG HOTBAR / GROUND ITEM POLISH */
.inventory-slot.draggable-inventory-item {
  cursor: grab;
}

.inventory-slot.dragging,
.hotbar-slot.dragging,
.storage-slot.dragging {
  opacity: 0.52;
  transform: scale(0.96);
}

.hotbar-slot.hotbar-drag-ready {
  outline: 1px dashed rgba(242, 195, 95, 0.35);
  outline-offset: -5px;
}

.hotbar-slot.drop-target,
.storage-slot.drop-target {
  box-shadow: inset 0 0 0 3px rgba(242, 195, 95, 0.7), 0 0 14px rgba(242, 195, 95, 0.28);
  transform: translateY(-2px) scale(1.03);
}
