:root {
  color-scheme: dark;
  --text: #f4f8ec;
  --muted: #b8c5ad;
  --panel: rgba(14, 22, 20, 0.88);
  --panel-2: rgba(25, 36, 31, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --green: #58d36f;
  --mint: #48e3c2;
  --blue: #46a9ff;
  --purple: #9c63ff;
  --gold: #f1bd4d;
  --wood: #9b6331;
  --stone: #8d979c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08120f;
  color: var(--text);
}

button {
  font: inherit;
}

.client {
  min-height: 100vh;
  padding: 14px;
  background:
    linear-gradient(rgba(8, 18, 15, 0.04), rgba(8, 18, 15, 0.22)),
    url("./assets/world.png") center / cover fixed;
}

.topbar,
.panel,
.hotbar {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

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

.brand__cube {
  width: 46px;
  height: 46px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.28) 0 34%, transparent 35%),
    linear-gradient(145deg, var(--green), #267b43);
  box-shadow: inset -9px -9px 0 rgba(0, 0, 0, 0.18);
}

.brand strong,
.panel-title span {
  display: block;
  font-weight: 950;
}

.brand small,
.resources,
.meter span,
.recipe span,
.market small {
  color: var(--muted);
}

.resources {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.resources span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.resources b {
  color: var(--gold);
}

.primary {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: linear-gradient(180deg, var(--mint), #16936f);
  color: #04130f;
  font-weight: 950;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(560px, 1fr) 290px;
  gap: 14px;
  min-height: calc(100vh - 100px);
  margin-top: 14px;
}

.panel {
  padding: 14px;
}

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

.panel-title b {
  color: var(--mint);
  font-size: 12px;
  text-transform: uppercase;
}

.skin {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(70, 169, 255, 0.14), rgba(88, 211, 111, 0.1));
}

.head,
.body,
.arm,
.leg {
  position: absolute;
  display: block;
  box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.16);
}

.head {
  left: 50%;
  top: 46px;
  width: 62px;
  height: 62px;
  transform: translateX(-50%);
  background: #f1b58c;
}

.body {
  left: 50%;
  top: 112px;
  width: 70px;
  height: 76px;
  transform: translateX(-50%);
  background: var(--blue);
}

.arm {
  top: 120px;
  width: 26px;
  height: 72px;
  background: #f1b58c;
}

.arm--left {
  left: 62px;
}

.arm--right {
  right: 62px;
}

.leg {
  top: 190px;
  width: 30px;
  height: 44px;
  background: #2e5d3b;
}

.leg--left {
  left: 86px;
}

.leg--right {
  right: 86px;
}

.meter {
  margin-top: 12px;
}

.meter span {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 850;
}

.meter i {
  display: block;
  height: 9px;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.world {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.world-view {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(8, 18, 15, 0.02), rgba(8, 18, 15, 0.1)),
    url("./assets/world.png") center / cover;
}

.marker,
.plot,
.player {
  position: absolute;
}

.marker {
  min-width: 70px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 12, 9, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.marker--base {
  left: 48%;
  top: 43%;
}

.marker--mine {
  left: 13%;
  top: 29%;
}

.marker--market {
  right: 16%;
  top: 49%;
}

.marker--farm {
  right: 34%;
  bottom: 27%;
}

.plot {
  width: 98px;
  height: 64px;
  border: 3px solid rgba(72, 227, 194, 0.82);
  background: rgba(72, 227, 194, 0.08);
  transform: skewY(-18deg);
}

.plot--one {
  left: 38%;
  bottom: 26%;
}

.plot--two {
  right: 19%;
  bottom: 31%;
  border-color: rgba(156, 99, 255, 0.82);
}

.plot--three {
  left: 22%;
  bottom: 22%;
  border-color: rgba(241, 189, 77, 0.82);
}

.player {
  left: 52%;
  top: 55%;
  width: 34px;
  height: 46px;
  background: linear-gradient(180deg, #f2c08e 0 34%, #2f88df 35% 100%);
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 8px rgba(72, 227, 194, 0.16), 0 12px 24px rgba(0, 0, 0, 0.28);
}

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

.hotbar button {
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.hotbar b {
  color: var(--gold);
  font-size: 12px;
}

.block,
.tool,
.slot {
  display: block;
}

.block,
.tool {
  width: 32px;
  height: 32px;
}

.block--grass,
.slot--grass {
  background: linear-gradient(180deg, var(--green) 0 35%, #7a4a25 36%);
}

.block--stone,
.slot--stone {
  background: var(--stone);
}

.block--wood,
.slot--wood {
  background: linear-gradient(90deg, #6d3d1d, var(--wood));
}

.block--crystal,
.slot--crystal {
  background: linear-gradient(135deg, var(--purple), var(--mint));
  clip-path: polygon(50% 4%, 88% 34%, 72% 96%, 28% 96%, 12% 34%);
}

.tool--pick,
.tool--axe {
  background: linear-gradient(135deg, transparent 0 37%, #d9e2e5 38% 56%, #6d3d1d 57%);
}

.tool--seed,
.slot--seed {
  background: radial-gradient(circle, var(--green) 0 38%, #2d6b3b 39%);
  border-radius: 50%;
}

.tool--key {
  background: radial-gradient(circle at 33% 43%, transparent 0 13%, var(--gold) 14% 26%, transparent 27%), linear-gradient(90deg, var(--gold), #8f5b12);
}

.recipe {
  padding: 14px;
  border: 1px solid rgba(72, 227, 194, 0.35);
  background: rgba(72, 227, 194, 0.09);
}

.recipe-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, transparent 0 37%, var(--mint) 38% 55%, #71451f 56%);
  border: 1px solid var(--line);
}

.recipe strong,
.recipe span,
.market strong,
.market span {
  display: block;
}

.recipe strong {
  font-size: 22px;
}

.recipe .primary {
  width: 100%;
  margin-top: 14px;
}

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

.slot {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background-color: var(--panel-2);
}

.slot--ore {
  background: linear-gradient(135deg, #50595f, #1d2022);
}

.market {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(241, 189, 77, 0.35);
  background: rgba(241, 189, 77, 0.1);
}

.market strong {
  margin: 4px 0;
  font-size: 24px;
  color: var(--gold);
}

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

@media (max-width: 760px) {
  .client {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .world-view {
    min-height: 520px;
  }

  .hotbar {
    grid-template-columns: repeat(4, 1fr);
  }
}
