:root {
  --ink: #efe3c4;
  --muted: #b7a987;
  --panel: rgba(24, 24, 23, 0.88);
  --panel-strong: rgba(47, 41, 34, 0.94);
  --slot: rgba(13, 17, 18, 0.9);
  --line: rgba(222, 190, 126, 0.72);
  --gold: #d6a34b;
  --cyan: #54c9da;
  --green: #3d7a5a;
  --danger: #9a3432;
  --shadow: 0 12px 0 rgba(0, 0, 0, 0.38);
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #10171d;
  color: var(--ink);
  overflow: hidden;
  user-select: none;
}

button,
input {
  color: inherit;
  font: inherit;
}

input,
textarea,
select {
  user-select: text;
}

button {
  cursor: pointer;
}

body.game-cursor-hidden,
body.game-cursor-hidden .game-shell,
body.game-cursor-hidden #gameCanvas {
  cursor: none;
}

.game-shell {
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

#gameCanvas {
  display: block;
  height: 100dvh;
  inset: 0;
  position: fixed;
  width: 100vw;
}

.mini-map {
  background:
    radial-gradient(circle at center, rgba(84, 201, 218, 0.1), transparent 62%),
    rgba(8, 11, 12, 0.82);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: 160px;
  image-rendering: pixelated;
  position: fixed;
  right: 16px;
  top: 16px;
  width: 160px;
  z-index: 4;
}

.top-hud,
.left-panel,
.touch-pad,
.hotbar-panel,
.crosshair,
.inventory-overlay,
.title-overlay {
  position: fixed;
  z-index: 3;
}

.title-overlay {
  background:
    radial-gradient(circle at 50% 8%, rgba(84, 201, 218, 0.18), transparent 32%),
    rgba(6, 8, 9, 0.92);
  display: grid;
  inset: 0;
  place-items: center;
  z-index: 12;
}

.title-overlay[hidden] {
  display: none;
}

.title-window {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 360px) minmax(320px, 560px);
  max-height: calc(100dvh - 28px);
  max-width: min(980px, calc(100vw - 28px));
  overflow: auto;
}

.story-window {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 330px) minmax(320px, 560px);
  max-height: calc(100dvh - 28px);
  max-width: min(940px, calc(100vw - 28px));
}

.story-window[hidden] {
  display: none;
}

.story-banner {
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: min(70dvh, 520px);
  object-fit: cover;
  width: 100%;
}

.story-panel {
  align-content: start;
  backdrop-filter: blur(10px);
  background:
    linear-gradient(180deg, rgba(84, 201, 218, 0.1), transparent 42%),
    var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  min-height: 420px;
  overflow: hidden;
  padding: 18px;
}

.story-panel h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.9;
}

.story-scroll {
  border-block: 1px solid rgba(214, 163, 75, 0.42);
  color: var(--ink);
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 850;
  height: 210px;
  line-height: 1.45;
  overflow: hidden;
  position: relative;
}

.story-scroll p {
  animation: story-scroll 42s linear forwards;
  margin: 0;
  padding-block: 220px 36px;
}

@keyframes story-scroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

.title-banner {
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 44px);
  object-fit: cover;
  width: 100%;
}

.title-content,
.designer-panel {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.title-content {
  align-content: start;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.title-copy h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.9;
}

.title-line {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
  margin: 10px 0 0;
}

.connect-panel {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(84, 201, 218, 0.13), transparent 48%, rgba(214, 163, 75, 0.16)),
    rgba(8, 12, 13, 0.84);
  border: 2px solid rgba(84, 201, 218, 0.52);
  border-radius: 8px;
  box-shadow:
    inset 0 0 18px rgba(84, 201, 218, 0.12),
    0 8px 0 rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 12px;
  grid-template-columns: 78px minmax(0, 1fr);
  margin-top: 12px;
  overflow: hidden;
  padding: 10px 12px;
  position: relative;
}

.connect-panel::before {
  animation: connect-sweep 1.8s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(239, 227, 196, 0.22), transparent);
  content: "";
  height: 100%;
  left: -45%;
  position: absolute;
  top: 0;
  width: 38%;
}

.connect-panel[data-state="retrying"] {
  border-color: rgba(214, 163, 75, 0.72);
}

.connect-panel[data-state="connected"] {
  border-color: rgba(91, 188, 124, 0.78);
}

.connect-panel[data-state="failed"] {
  border-color: rgba(154, 52, 50, 0.86);
}

.connect-gate {
  align-items: end;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(6, 1fr);
  height: 42px;
}

.connect-gate span {
  animation: connect-pulse 0.95s ease-in-out infinite;
  background: linear-gradient(180deg, #efe3c4, #54c9da 46%, #1b454d);
  border: 1px solid rgba(239, 227, 196, 0.44);
  border-radius: 4px 4px 2px 2px;
  min-height: 12px;
}

.connect-gate span:nth-child(2) {
  animation-delay: 0.1s;
}

.connect-gate span:nth-child(3) {
  animation-delay: 0.2s;
}

.connect-gate span:nth-child(4) {
  animation-delay: 0.3s;
}

.connect-gate span:nth-child(5) {
  animation-delay: 0.4s;
}

.connect-gate span:nth-child(6) {
  animation-delay: 0.5s;
}

.connect-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.connect-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.connect-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes connect-pulse {
  0%,
  100% {
    filter: brightness(0.75);
    height: 14px;
    opacity: 0.58;
  }

  50% {
    filter: brightness(1.25);
    height: 42px;
    opacity: 1;
  }
}

@keyframes connect-sweep {
  to {
    left: 112%;
  }
}

.designer-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.designer-field {
  display: grid;
  gap: 6px;
}

.designer-field span,
.color-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.color-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.color-grid label {
  display: grid;
  gap: 6px;
}

.color-grid input {
  background: #111718;
  border: 2px solid rgba(222, 190, 126, 0.48);
  border-radius: 6px;
  height: 38px;
  padding: 3px;
  width: 100%;
}

.player-preview {
  background: rgba(10, 13, 14, 0.76);
  border: 2px solid rgba(222, 190, 126, 0.32);
  border-radius: 8px;
  display: grid;
  height: 128px;
  justify-content: center;
  padding-top: 14px;
  position: relative;
}

.player-preview span {
  display: block;
  image-rendering: pixelated;
  position: absolute;
}

.preview-head {
  background: var(--preview-skin, #c58d72);
  border-top: 10px solid var(--preview-hair, #4f3426);
  height: 42px;
  top: 16px;
  width: 42px;
}

.preview-body {
  background: var(--preview-shirt, #3f7da0);
  height: 46px;
  top: 58px;
  width: 48px;
}

.preview-leg {
  background: var(--preview-pants, #3d4d86);
  height: 30px;
  top: 104px;
  width: 20px;
}

.preview-leg.left {
  transform: translateX(-12px);
}

.preview-leg.right {
  transform: translateX(12px);
}

.designer-actions,
.title-actions,
.version-actions {
  display: grid;
  gap: 10px;
}

.designer-actions {
  grid-template-columns: 1fr 1fr;
}

.title-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.version-panel {
  background: rgba(14, 18, 18, 0.62);
  border: 2px solid rgba(222, 190, 126, 0.4);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.version-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.version-button {
  background: rgba(13, 17, 18, 0.9);
  border: 2px solid rgba(222, 190, 126, 0.56);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 950;
  min-height: 42px;
  padding: 10px;
}

.version-button:hover,
.version-button:focus-visible {
  border-color: rgba(255, 238, 186, 0.92);
}

.version-button.current {
  background: linear-gradient(180deg, rgba(84, 201, 218, 0.2), rgba(13, 17, 18, 0.9));
  border-color: rgba(84, 201, 218, 0.72);
  color: #dff9ff;
  cursor: default;
}

.primary-button {
  background: linear-gradient(180deg, #d6a34b, #8b5d24);
  border-color: rgba(255, 238, 186, 0.78);
  color: #19130b;
  min-height: 48px;
}

.danger-button {
  background: linear-gradient(180deg, #9a3432, #4c1718);
  border: 2px solid rgba(255, 196, 170, 0.74);
  border-radius: 6px;
  color: #fff1df;
  font-weight: 950;
  min-height: 42px;
  padding: 10px 12px;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: rgba(255, 230, 205, 0.95);
  filter: brightness(1.08);
}

[hidden] {
  display: none !important;
}

.top-hud {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(300px, 540px) minmax(300px, 520px);
  left: 16px;
  right: 16px;
  top: 16px;
}

.identity-panel,
.world-panel,
.left-panel,
.inventory-window {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.identity-panel {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 190px);
  min-width: 0;
  padding: 12px;
}

.title-stack {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: 116px minmax(0, 1fr);
}

.geezer-banner {
  aspect-ratio: 2 / 3;
  border: 2px solid rgba(222, 190, 126, 0.9);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(65, 194, 214, 0.18);
  height: 150px;
  object-fit: cover;
  object-position: top center;
  width: 116px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.95;
  margin-top: 4px;
  text-wrap: balance;
}

h2 {
  font-size: 18px;
  line-height: 1.12;
}

.skin-form {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.skin-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.input-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-row input {
  background: #0f1416;
  border: 2px solid var(--line);
  border-radius: 6px;
  font-weight: 850;
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
}

.local-player-link {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.icon-text-button,
.secondary-button,
.touch-pad button,
.icon-button {
  border: 2px solid var(--line);
  border-radius: 6px;
  font-weight: 950;
  min-height: 42px;
}

.icon-text-button {
  align-items: center;
  background: #a87935;
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 12px;
}

.icon-text-button span {
  align-items: center;
  background: rgba(255, 255, 255, 0.56);
  border: 2px solid var(--line);
  display: flex;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 22px;
}

.skin-card {
  align-items: center;
  background: var(--panel-strong);
  border: 2px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 84px;
  min-width: 0;
  padding: 8px;
}

.skin-card img {
  background:
    linear-gradient(45deg, #d6d6d6 25%, transparent 25% 75%, #d6d6d6 75%),
    linear-gradient(45deg, #d6d6d6 25%, #ffffff 25% 75%, #d6d6d6 75%);
  background-position:
    0 0,
    8px 8px;
  background-size: 16px 16px;
  border: 2px solid var(--line);
  image-rendering: pixelated;
}

.skin-card span {
  display: block;
  font-size: 15px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skin-card strong {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.world-panel {
  align-self: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
}

.stat-tile {
  background: var(--panel-strong);
  border: 2px solid var(--line);
  border-radius: 6px;
  min-width: 0;
  padding: 9px 10px;
}

.stat-tile span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-tile strong {
  display: block;
  font-size: clamp(18px, 2.4vw, 30px);
  line-height: 1;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.left-panel {
  display: grid;
  gap: 12px;
  left: 16px;
  padding: 14px;
  top: 276px;
  width: min(340px, calc(100vw - 32px));
}

.panel-heading {
  display: grid;
  gap: 5px;
}

.action-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.secondary-button {
  background: var(--panel-strong);
  padding: 9px 10px;
}

.secondary-button.ready,
.secondary-button.active-choice {
  background: #9a7132;
  box-shadow: inset 0 0 0 3px rgba(239, 227, 196, 0.18);
}

.secondary-button:active,
.icon-text-button:active,
.icon-button:active,
.touch-pad button:active {
  transform: translateY(2px);
}

.message-log {
  background: #101517;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: #f8f3df;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  min-height: 74px;
  padding: 10px;
}

.touch-pad {
  bottom: 16px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 58px);
  left: 16px;
}

.touch-pad button {
  background: rgba(28, 27, 24, 0.92);
  font-size: 22px;
  height: 58px;
  line-height: 1;
  width: 58px;
}

.touch-pad button[data-control="forward"] {
  grid-column: 2;
}

.touch-pad button[data-control="left"] {
  grid-column: 1;
}

.touch-pad button[data-control="back"] {
  grid-column: 2;
}

.touch-pad button[data-control="right"] {
  grid-column: 3;
}

.crosshair {
  color: rgba(239, 227, 196, 0.82);
  font-size: 26px;
  font-weight: 900;
  left: 50%;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  top: 50%;
  transform: translate(-50%, -50%);
}

.mining-swing {
  background:
    linear-gradient(135deg, rgba(245, 215, 166, 0.42), transparent 42%),
    #c58d72;
  border: 4px solid rgba(64, 40, 28, 0.86);
  border-radius: 5px;
  bottom: 7vh;
  box-shadow:
    inset -10px -12px 0 rgba(80, 48, 32, 0.26),
    0 10px 18px rgba(0, 0, 0, 0.5);
  height: min(24vh, 190px);
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 8vw;
  transform: rotate(22deg) translate(42px, 72px);
  transform-origin: 50% 100%;
  width: min(8vw, 62px);
  z-index: 2;
}

.mining-swing.swinging {
  animation: mining-swing 180ms cubic-bezier(0.15, 0.72, 0.2, 1) both;
}

@keyframes mining-swing {
  0% {
    opacity: 0.92;
    transform: rotate(26deg) translate(44px, 74px);
  }

  45% {
    opacity: 1;
    transform: rotate(-18deg) translate(-18px, 16px);
  }

  100% {
    opacity: 0;
    transform: rotate(24deg) translate(40px, 72px);
  }
}

.hotbar-panel {
  bottom: 18px;
  display: grid;
  gap: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.hunger-meter,
.air-meter {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(10, 18px);
  justify-content: center;
  pointer-events: none;
}

.air-meter {
  min-height: 16px;
}

.hunger-pip,
.air-pip {
  background: rgba(20, 16, 12, 0.76);
  border: 2px solid rgba(222, 190, 126, 0.52);
  border-radius: 3px;
  height: 16px;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.28);
}

.hunger-pip.full {
  background: #c08b42;
}

.hunger-pip.low.full {
  background: #a54840;
}

.air-pip.full {
  background: #54c9da;
}

.air-pip.low.full {
  background: #d65f51;
}

.hotbar {
  backdrop-filter: blur(10px);
  background: rgba(15, 18, 18, 0.72);
  border: 2px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(9, 56px);
  padding: 7px;
}

.slot-grid {
  display: grid;
  gap: 6px;
}

.inventory-main-grid,
.chest-grid {
  grid-template-columns: repeat(9, 48px);
}

.hotbar-inventory-grid {
  grid-template-columns: repeat(9, 48px);
}

.craft-grid.two-by-two {
  grid-template-columns: repeat(2, 48px);
  width: max-content;
}

.craft-grid.three-by-three {
  grid-template-columns: repeat(3, 48px);
  width: max-content;
}

.furnace-grid {
  grid-template-columns: 48px;
  width: max-content;
}

.horse-grid {
  grid-template-columns: repeat(2, 48px);
  width: max-content;
}

.slot-button {
  align-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%),
    var(--slot);
  border: 2px solid rgba(222, 190, 126, 0.66);
  border-radius: 6px;
  display: grid;
  height: 48px;
  justify-items: center;
  min-height: 0;
  padding: 3px;
  position: relative;
  width: 48px;
}

.slot-button[data-tooltip]:hover::after,
.slot-button[data-tooltip]:focus-visible::after {
  background: rgba(9, 12, 13, 0.96);
  border: 2px solid rgba(222, 190, 126, 0.8);
  border-radius: 6px;
  bottom: calc(100% + 7px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.42);
  color: #fff5d8;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 850;
  left: 50%;
  line-height: 1.25;
  max-width: 220px;
  min-width: 132px;
  padding: 7px 8px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  transform: translateX(-50%);
  white-space: normal;
  z-index: 20;
}

.hotbar .slot-button {
  height: 56px;
  width: 56px;
}

.slot-button.selected {
  border-color: var(--cyan);
  box-shadow:
    inset 0 0 0 2px rgba(84, 201, 218, 0.28),
    0 0 18px rgba(84, 201, 218, 0.28);
}

.slot-button.has-item {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 42%),
    #161b1b;
}

.item-glyph {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 35%),
    var(--item-color, #777873);
  border: 2px solid rgba(0, 0, 0, 0.42);
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.18);
  height: 28px;
  image-rendering: pixelated;
  width: 28px;
}

.item-glyph.textured {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 36%),
    var(--item-texture),
    var(--item-color, #777873);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%;
  border-radius: 2px;
  box-shadow:
    inset -4px -4px 0 rgba(0, 0, 0, 0.2),
    inset 2px 2px 0 rgba(255, 255, 255, 0.16);
}

.item-glyph.apple,
.item-glyph.stick,
.item-glyph.egg,
.item-glyph.meat,
.item-glyph.hide,
.item-glyph.gem {
  border-radius: 50%;
}

.item-glyph.stick {
  border-radius: 2px;
  height: 30px;
  transform: rotate(35deg);
  width: 8px;
}

.item-glyph.egg {
  border-radius: 50% 50% 45% 45%;
  height: 30px;
  width: 24px;
}

.item-glyph.seeds {
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.item-glyph.wheat {
  border-radius: 10px 10px 2px 2px;
  height: 30px;
  transform: rotate(-10deg);
  width: 14px;
}

.item-glyph.bread {
  border-radius: 16px 16px 8px 8px;
  height: 24px;
  width: 32px;
}

.item-glyph.feather {
  border-radius: 50% 8px 50% 8px;
  height: 30px;
  transform: rotate(28deg);
  width: 12px;
}

.item-glyph.hide {
  border-radius: 8px 10px 7px 11px;
  height: 24px;
  width: 30px;
}

.item-glyph.gem {
  border-radius: 4px 11px 4px 11px;
  box-shadow:
    inset -5px -4px 0 rgba(0, 0, 0, 0.22),
    inset 4px 3px 0 rgba(255, 255, 255, 0.28);
  height: 25px;
  transform: rotate(45deg);
  width: 25px;
}

.item-glyph.flower {
  background:
    radial-gradient(circle at 50% 28%, var(--item-color, #c83f4f) 0 32%, transparent 34%),
    linear-gradient(90deg, transparent 44%, #3c8b52 46% 54%, transparent 56%);
  border: 0;
  box-shadow: none;
  height: 32px;
  width: 22px;
}

.item-glyph.dye {
  border-radius: 4px 11px 4px 11px;
  box-shadow:
    inset -5px -4px 0 rgba(0, 0, 0, 0.22),
    inset 4px 3px 0 rgba(255, 255, 255, 0.26);
  height: 22px;
  transform: rotate(45deg);
  width: 22px;
}

.item-glyph.ingot {
  border-radius: 4px;
  box-shadow:
    inset -6px -5px 0 rgba(0, 0, 0, 0.18),
    inset 3px 3px 0 rgba(255, 255, 255, 0.28);
  height: 16px;
  transform: skewX(-14deg);
  width: 34px;
}

.item-glyph.armor,
.item-glyph.horse-armor,
.item-glyph.saddle,
.item-glyph.boat,
.item-glyph.bucket,
.item-glyph.fishing-rod,
.item-glyph.fish,
.item-glyph.string {
  border-radius: 7px 7px 3px 3px;
  height: 28px;
  position: relative;
  width: 30px;
}

.item-glyph.armor::before,
.item-glyph.horse-armor::before,
.item-glyph.saddle::before {
  background: rgba(9, 12, 12, 0.72);
  border-radius: 0 0 6px 6px;
  content: "";
  height: 9px;
  left: 8px;
  position: absolute;
  top: 4px;
  width: 14px;
}

.item-glyph.horse-armor {
  border-radius: 12px 5px 7px 7px;
  width: 34px;
}

.item-glyph.saddle {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%),
    linear-gradient(90deg, transparent 15%, #5d3520 16% 26%, transparent 27% 73%, #5d3520 74% 84%, transparent 85%),
    var(--item-color, #7d4f31);
  border-radius: 12px 12px 7px 7px;
  height: 22px;
  width: 34px;
}

.item-glyph.boat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%),
    linear-gradient(90deg, #5e3a20 0 16%, transparent 17% 83%, #5e3a20 84%),
    var(--item-color, #8a5c35);
  border-radius: 5px 5px 15px 15px;
  height: 18px;
  transform: perspective(40px) rotateX(18deg);
  width: 36px;
}

.item-glyph.bucket {
  border-radius: 5px 5px 10px 10px;
  box-shadow:
    inset -5px -5px 0 rgba(0, 0, 0, 0.2),
    inset 3px 3px 0 rgba(255, 255, 255, 0.28);
  height: 28px;
  width: 26px;
}

.item-glyph.bucket::before {
  background: transparent;
  border: 2px solid rgba(232, 224, 207, 0.78);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  content: "";
  height: 12px;
  left: 3px;
  position: absolute;
  top: -9px;
  width: 16px;
}

.item-glyph.fishing-rod {
  background: #9b6a3a;
  border-radius: 3px;
  height: 34px;
  transform: rotate(38deg);
  width: 6px;
}

.item-glyph.fishing-rod::before {
  background: rgba(232, 224, 207, 0.9);
  content: "";
  height: 22px;
  left: 9px;
  position: absolute;
  top: 5px;
  width: 2px;
}

.item-glyph.fish {
  border-radius: 50% 35% 35% 50%;
  height: 18px;
  width: 32px;
}

.item-glyph.fish::before {
  background: var(--item-color, #6aa7b8);
  border: 2px solid rgba(0, 0, 0, 0.36);
  border-left: 0;
  content: "";
  height: 14px;
  position: absolute;
  right: -8px;
  top: 0;
  transform: rotate(45deg);
  width: 14px;
}

.item-glyph.string {
  background: transparent;
  border: 3px solid var(--item-color, #e8e0cf);
  border-radius: 50%;
  box-shadow: none;
  height: 26px;
  width: 26px;
}

.item-glyph.tool {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 35%),
    #9b6a3a;
  border-radius: 3px;
  height: 32px;
  position: relative;
  transform: rotate(35deg);
  width: 7px;
}

.item-glyph.tool::before,
.item-glyph.tool::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 38%),
    var(--item-color, #777873);
  border: 2px solid rgba(0, 0, 0, 0.36);
  border-radius: 3px;
  content: "";
  position: absolute;
}

.item-glyph.tool::after {
  background: #9b6a3a;
  border-width: 1px;
  bottom: -5px;
  height: 7px;
  left: -4px;
  width: 15px;
}

.item-glyph.tool-sword {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 35%),
    var(--item-color, #777873);
  border-radius: 3px 3px 1px 1px;
  height: 34px;
  width: 8px;
}

.item-glyph.tool-sword::before {
  height: 7px;
  left: -10px;
  top: 21px;
  width: 28px;
}

.item-glyph.tool-pickaxe::before {
  height: 7px;
  left: -13px;
  top: -2px;
  width: 33px;
}

.item-glyph.tool-axe::before {
  border-radius: 3px 10px 10px 3px;
  height: 20px;
  left: 3px;
  top: -1px;
  width: 18px;
}

.item-glyph.tool-shovel::before {
  border-radius: 50% 50% 45% 45%;
  height: 18px;
  left: -7px;
  top: -9px;
  width: 18px;
}

.item-glyph.tool-hoe::before {
  height: 7px;
  left: -4px;
  top: -3px;
  width: 28px;
}

.item-glyph.tier-stone::before {
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.2);
}

.item-glyph.tier-iron::before,
.item-glyph.tier-gold::before,
.item-glyph.tier-diamond::before {
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.18),
    inset 2px 2px 0 rgba(255, 255, 255, 0.24);
}

.item-glyph.sapling {
  background:
    linear-gradient(90deg, transparent 40%, #7a4a2d 40% 60%, transparent 60%),
    radial-gradient(circle at 50% 28%, #3c8b52 0 36%, transparent 37%),
    radial-gradient(circle at 35% 48%, #2f6b42 0 28%, transparent 29%),
    radial-gradient(circle at 65% 50%, #4fa663 0 28%, transparent 29%);
  border-color: rgba(10, 18, 10, 0.58);
  border-radius: 4px 4px 10px 10px;
}

.slot-count {
  bottom: 3px;
  color: #fff7da;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  position: absolute;
  right: 4px;
  text-shadow:
    0 2px 0 #000,
    1px 0 0 #000,
    -1px 0 0 #000;
}

.slot-index {
  color: rgba(239, 227, 196, 0.52);
  font-size: 10px;
  font-weight: 900;
  left: 4px;
  line-height: 1;
  position: absolute;
  top: 3px;
}

.inventory-overlay {
  background: rgba(7, 10, 12, 0.56);
  display: grid;
  inset: 0;
  place-items: center;
  z-index: 8;
}

.settings-overlay {
  background: rgba(7, 10, 12, 0.68);
  display: grid;
  inset: 0;
  place-items: center;
  position: fixed;
  z-index: 13;
}

.inventory-overlay[hidden],
.settings-overlay[hidden] {
  display: none;
}

.craft-section[hidden],
.chest-section[hidden],
.furnace-section[hidden],
.horse-section[hidden] {
  display: none !important;
}

.inventory-window,
.settings-window {
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 32px);
  max-width: min(760px, calc(100vw - 32px));
  overflow: auto;
  padding: 14px;
}

.settings-window {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: min(620px, calc(100vw - 32px));
}

.inventory-header,
.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.inventory-header h2 {
  font-size: 26px;
}

.icon-button {
  align-items: center;
  background: #2b3535;
  display: flex;
  font-size: 18px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 42px;
}

.craft-section,
.chest-section,
.furnace-section,
.horse-section,
.storage-section,
.settings-section {
  background: rgba(14, 18, 18, 0.62);
  border: 2px solid rgba(222, 190, 126, 0.4);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.settings-range {
  accent-color: var(--gold);
  height: 32px;
  width: 100%;
}

.settings-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-actions.single-action {
  grid-template-columns: 1fr;
}

.keybind-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-row {
  align-items: center;
  background: rgba(8, 12, 13, 0.72);
  border: 1px solid rgba(222, 190, 126, 0.24);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
}

.toggle-row input {
  accent-color: var(--gold);
  height: 18px;
  width: 18px;
}

.toggle-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.keybind-row {
  align-items: center;
  background: rgba(8, 12, 13, 0.72);
  border: 1px solid rgba(222, 190, 126, 0.24);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 112px;
  min-height: 44px;
  padding: 6px 8px;
}

.keybind-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keybind-button {
  background: #253034;
  border-color: rgba(84, 201, 218, 0.58);
  border-radius: 6px;
  color: #f8f3df;
  font-size: 12px;
  font-weight: 950;
  height: 32px;
  overflow: hidden;
  padding: 0 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 112px;
}

.keybind-button.listening {
  background: #3a2f1a;
  border-color: var(--gold);
  color: #fff3c6;
}

.section-heading span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.section-heading strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cursor-item {
  background: #101517;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: #f8f3df;
  font-size: 14px;
  font-weight: 900;
  min-height: 42px;
  padding: 10px;
}

.chat-panel {
  bottom: 112px;
  display: grid;
  gap: 8px;
  left: 18px;
  max-width: min(560px, calc(100vw - 36px));
  pointer-events: none;
  position: fixed;
  width: 44vw;
  z-index: 9;
}

.chat-messages {
  display: grid;
  gap: 5px;
  max-height: 176px;
  overflow: hidden;
}

.chat-panel.chat-open {
  pointer-events: auto;
}

.chat-panel.chat-open .chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  pointer-events: auto;
}

.chat-message {
  background: rgba(7, 10, 11, 0.74);
  border: 1px solid rgba(222, 190, 126, 0.18);
  border-radius: 6px;
  color: #f8f3df;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  opacity: var(--chat-opacity, 1);
  padding: 7px 9px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  transition: opacity 0.8s ease;
}

.chat-message strong {
  color: #54c9da;
  font-weight: 950;
}

.chat-input {
  background: rgba(7, 10, 11, 0.94);
  border: 2px solid rgba(84, 201, 218, 0.62);
  border-radius: 6px;
  color: #fff7dd;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  min-height: 42px;
  outline: none;
  padding: 9px 11px;
  pointer-events: auto;
  width: 100%;
}

@media (max-width: 1180px) {
  .top-hud {
    grid-template-columns: 1fr;
  }

  .left-panel {
    top: 440px;
  }
}

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

  .title-window,
  .story-window {
    grid-template-columns: 1fr;
  }

  .title-banner,
  .story-banner {
    max-height: 52dvh;
    object-position: top center;
  }

  .title-copy h1,
  .story-panel h1 {
    font-size: clamp(36px, 13vw, 54px);
  }

  .story-scroll {
    height: 180px;
  }

  .color-grid,
  .designer-actions,
  .title-actions,
  .version-actions,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  #gameCanvas {
    height: 100dvh;
    position: fixed;
  }

  .game-shell {
    min-height: 1200px;
    overflow: visible;
  }

  .top-hud,
  .left-panel,
  .touch-pad,
  .hotbar-panel {
    position: absolute;
  }

  .top-hud {
    left: 10px;
    right: 180px;
    top: 10px;
  }

  .mini-map {
    height: 138px;
    right: 10px;
    top: 10px;
    width: 138px;
  }

  .identity-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .title-stack {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .geezer-banner {
    height: 118px;
    width: 88px;
  }

  .world-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .left-panel {
    left: 10px;
    top: 560px;
    width: calc(100vw - 20px);
  }

  .touch-pad {
    bottom: auto;
    left: 10px;
    top: 780px;
  }

  .hotbar-panel {
    bottom: auto;
    left: 10px;
    right: 10px;
    top: 990px;
    transform: none;
  }

  .hotbar,
  .inventory-main-grid,
  .hotbar-inventory-grid,
  .chest-grid {
    grid-template-columns: repeat(9, minmax(30px, 1fr));
  }

  .hotbar {
    overflow-x: auto;
  }

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

  .slot-button,
  .hotbar .slot-button {
    height: 40px;
    width: 40px;
  }

  .item-glyph {
    height: 22px;
    width: 22px;
  }

  .item-glyph.ingot {
    height: 13px;
    width: 28px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 34px;
  }

  .title-stack {
    grid-template-columns: 1fr;
  }

  .geezer-banner {
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 150px;
    width: 100%;
  }

  .input-row,
  .action-buttons {
    grid-template-columns: 1fr;
  }

  .top-hud {
    right: 10px;
    top: 158px;
  }

  .mini-map {
    height: 132px;
    left: 10px;
    right: auto;
    width: 132px;
  }

  .touch-pad {
    gap: 6px;
    grid-template-columns: repeat(3, 50px);
  }

  .touch-pad button {
    height: 50px;
    width: 50px;
  }
}
