:root {
  color: #f4f7ee;
  background: #10202b;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, #294f5d 0, transparent 32%),
    linear-gradient(160deg, #10202b, #172f38);
}

main {
  width: min(1180px, 96vw);
}

.panel {
  margin: auto;
  max-width: 480px;
  padding: 44px;
  text-align: center;
  background: rgb(19 43 51 / 92%);
  border: 1px solid #52737a;
  border-radius: 20px;
  box-shadow: 0 22px 70px rgb(0 0 0 / 35%);
}

h1 {
  margin: 0 0 12px;
}

p {
  color: #bfd0d2;
}

button {
  margin-top: 18px;
  padding: 14px 24px;
  border: 0;
  border-radius: 10px;
  color: #102033;
  background: #83e0bd;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgb(77 199 158 / 25%);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  color: #c7d8da;
  font-size: 14px;
}

.world-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #82b8d8;
  border: 1px solid #52737a;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 28%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.inventory-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
  padding: 9px 13px;
  color: #f7fff8;
  background: rgb(18 39 43 / 82%);
  border: 1px solid rgb(211 245 230 / 34%);
  box-shadow: none;
}

.inventory {
  position: absolute;
  top: 58px;
  right: 14px;
  min-width: 170px;
  padding: 13px;
  color: #f7fff8;
  background: rgb(18 39 43 / 78%);
  border: 1px solid rgb(211 245 230 / 28%);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.inventory h2 {
  margin: 0 0 9px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inventory-empty {
  margin: 0;
  font-size: 13px;
}

.inventory-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
}

.pal-swatch {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
}

.interaction {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 11px 17px;
  color: #17302d;
  background: #f8f1ba;
  border: 2px solid #fff8d7;
  border-radius: 11px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
}

.world-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

@media (max-width: 650px) {
  header {
    flex-direction: column;
    gap: 4px;
  }

  .inventory {
    top: 50px;
    right: 8px;
    min-width: 135px;
    padding: 9px;
  }

  .inventory-toggle {
    top: 8px;
    right: 8px;
  }

  .world-wrap {
    aspect-ratio: 4 / 3;
  }
}
