@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "Manrope", sans-serif;
  color: #181817;
  background: #f2efe7;
  font-synthesis: none;
  --ink: #181817;
  --paper: #f2efe7;
  --white: #fffefa;
  --ruby: #ef4162;
  --acid: #d8ff55;
  --muted: #716e67;
  --line: rgba(24, 24, 23, 0.18);
  --soft-line: rgba(24, 24, 23, 0.1);
  --mono: "DM Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 6% 4%, rgba(239, 65, 98, 0.08), transparent 28rem),
    var(--paper);
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ruby);
  outline-offset: 3px;
}

.site-header,
main,
footer {
  width: min(1500px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark small {
  margin-left: 3px;
  padding-left: 13px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wordmark-gem {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  background: var(--ruby);
  clip-path: polygon(50% 0, 100% 28%, 84% 86%, 50% 100%, 16% 86%, 0 28%);
}

.network-pill {
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.network-pill span,
.wallet-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #aaa69d;
}

.network-pill[data-state="connected"] span,
.wallet-button[data-connected="true"] .wallet-dot {
  background: #25a85a;
  box-shadow: 0 0 0 3px rgba(37, 168, 90, 0.13);
}

.wallet-button {
  justify-self: end;
  min-width: 144px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.wallet-button:hover {
  background: var(--white);
}

.studio-intro {
  min-height: 290px;
  padding: 58px 0 48px;
  display: grid;
  grid-template-columns: 1.5fr 0.5fr;
  align-items: end;
  gap: 70px;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  font: 500 10px/1.25 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.studio-intro .eyebrow {
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(51px, 6.3vw, 94px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.072em;
}

h1 em {
  color: var(--ruby);
  font-family: Georgia, serif;
  font-weight: 400;
}

.intro-note {
  max-width: 360px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
}

.intro-note p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
}

.intro-rule {
  height: 1px;
  margin-top: 12px;
  background: var(--ruby);
}

.studio-shell {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(235px, 0.74fr) minmax(500px, 1.62fr) minmax(260px, 0.79fr);
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 12px 12px 0 var(--ink);
}

.collection-panel,
.editor-panel,
.tools-panel {
  min-width: 0;
}

.collection-panel,
.editor-panel {
  border-right: 1px solid var(--ink);
}

.collection-panel {
  display: flex;
  flex-direction: column;
  background: #f8f5ed;
}

.collection-header,
.editor-header {
  min-height: 106px;
  padding: 27px 29px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.collection-header h2,
.editor-header h2 {
  margin: 8px 0 0;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.count-badge {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font: 500 10px/1 var(--mono);
}

.collection-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
  overflow-y: auto;
}

.block-card {
  position: relative;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--white);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.block-card:hover {
  z-index: 1;
  border-color: var(--ink);
  transform: translateY(-2px);
}

.block-card[aria-selected="true"] {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ruby);
}

.block-preview {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  background: #dedad0;
  image-rendering: pixelated;
}

.block-preview span {
  min-width: 0;
}

.block-card-meta {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 500 9px/1 var(--mono);
}

.block-card-meta small {
  color: var(--muted);
  font: inherit;
}

.collection-empty {
  margin: auto;
  padding: 30px;
  text-align: center;
}

.collection-empty > span {
  display: block;
  margin-bottom: 15px;
  color: var(--ruby);
  font-size: 42px;
}

.collection-empty strong {
  font-size: 14px;
}

.collection-empty p {
  max-width: 190px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.collection-footer {
  min-height: 52px;
  margin-top: auto;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 17px;
}

.icon-button:hover {
  background: white;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  background: white;
}

.editor-header {
  padding-inline: 37px;
}

.editor-header h2 span {
  font-family: var(--mono);
  font-weight: 500;
}

.editor-header h2 small {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f0eee8;
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  text-transform: uppercase;
}

.edit-state[data-dirty="true"] {
  background: #fff0b8;
  color: #6f5000;
}

.canvas-stage {
  flex: 1;
  padding: clamp(28px, 4vw, 58px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(24, 24, 23, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(24, 24, 23, 0.025) 1px, transparent 1px),
    white;
  background-size: 22px 22px;
  overflow: auto;
}

.composite-frame {
  min-width: min(100%, 330px);
  max-width: 100%;
  padding: 14px;
  background: var(--ink);
  box-shadow: 9px 9px 0 #c9c4b9;
}

.multi-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  background:
    linear-gradient(45deg, #dedad0 25%, transparent 25%),
    linear-gradient(-45deg, #dedad0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dedad0 75%),
    linear-gradient(-45deg, transparent 75%, #dedad0 75%),
    #ebe8df;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  image-rendering: pixelated;
}

.canvas-tile {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 0;
  outline: 1px solid rgba(24, 24, 23, 0.28);
  outline-offset: -1px;
}

.canvas-tile[data-selected="true"] {
  z-index: 2;
  outline: 4px solid var(--ruby);
  outline-offset: -4px;
}

.canvas-tile::after {
  content: attr(data-label);
  position: absolute;
  top: 6px;
  left: 7px;
  z-index: 3;
  padding: 4px 5px;
  opacity: 0;
  background: var(--ink);
  color: white;
  font: 500 7px/1 var(--mono);
  pointer-events: none;
  transition: opacity 120ms ease;
}

.canvas-tile:hover::after,
.canvas-tile[data-selected="true"]::after {
  opacity: 1;
}

.canvas-tile .pixel {
  min-width: 0;
}

.canvas-frame {
  width: min(100%, 510px);
  padding: 13px;
  background: var(--ink);
  box-shadow: 9px 9px 0 #c9c4b9;
}

.pixel-grid {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.pixel {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: crosshair;
}

.pixel:hover,
.pixel:focus-visible {
  z-index: 1;
  outline: 3px solid white;
  outline-offset: -3px;
}

.canvas-footer {
  min-height: 50px;
  padding: 0 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tools-panel {
  display: flex;
  flex-direction: column;
  background: #f8f5ed;
}

.tool-section,
.save-section {
  padding: 27px 29px;
  border-bottom: 1px solid var(--line);
}

.tool-heading {
  display: flex;
  justify-content: space-between;
}

.tool-heading > span {
  font: 500 10px/1 var(--mono);
}

.palette {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.palette-button {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.13);
}

.palette-button:hover {
  transform: scale(1.09);
}

.palette-button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid white;
  box-shadow: 0 0 0 1px var(--ink);
}

.selected-color-row {
  margin-top: 17px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.selected-swatch {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.selected-color-row div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 500 8px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-color-row strong {
  font-size: 10px;
}

.tool-buttons {
  margin-top: 17px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.tool-buttons button {
  padding: 11px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.tool-buttons button:hover {
  border-color: var(--ink);
  background: white;
}

.tool-buttons button span {
  font: 500 15px/1 var(--mono);
}

.layout-section {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.layout-heading {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.layout-heading > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.layout-heading strong {
  font: 500 12px/1 var(--mono);
}

.layout-heading > span {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

.position-pad {
  width: 81px;
  display: grid;
  grid-template-columns: repeat(3, 25px);
  grid-template-rows: repeat(2, 25px);
  gap: 3px;
}

.position-pad button {
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  font: 500 12px/1 var(--mono);
}

.position-pad button:hover:not(:disabled) {
  border-color: var(--ink);
  background: white;
}

.position-pad button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#move-up { grid-column: 2; }
#move-left { grid-column: 1; grid-row: 2; }
#move-down { grid-column: 2; grid-row: 2; }
#move-right { grid-column: 3; grid-row: 2; }

.save-section {
  margin-top: auto;
  border-bottom: 0;
}

.token-facts {
  margin: 0 0 21px;
}

.token-facts div {
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--soft-line);
  font: 500 9px/1.2 var(--mono);
}

.token-facts dt {
  color: var(--muted);
}

.token-facts dd {
  max-width: 135px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  min-height: 49px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--ruby);
  background: var(--ruby);
}

.primary-button:disabled {
  border-color: #aaa69d;
  background: #aaa69d;
  cursor: not-allowed;
}

.primary-button[data-pending="true"] .button-arrow {
  animation: spin 1s linear infinite;
}

.save-status {
  min-height: 28px;
  margin: 11px 0 0;
  color: var(--muted);
  font: 400 8px/1.55 var(--mono);
}

.save-status a {
  color: var(--ink);
}

.bitmap-strip {
  min-height: 76px;
  margin-top: 25px;
  padding: 17px 21px;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.25);
}

.bitmap-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storage-pill {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--acid);
  font: 500 8px/1 var(--mono);
  text-transform: uppercase;
}

.bitmap-strip code {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font: 400 9px/1 var(--mono);
  text-overflow: ellipsis;
}

.world-section {
  margin-top: 110px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 12px 12px 0 var(--ruby);
}

.world-header {
  min-height: 190px;
  padding: 40px 44px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  align-items: end;
  gap: 60px;
  border-bottom: 1px solid var(--ink);
}

.world-header .eyebrow {
  margin-bottom: 16px;
}

.world-header h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.world-header > p {
  max-width: 390px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.world-toolbar {
  min-height: 70px;
  padding: 0 26px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
}

.world-stat {
  min-width: 115px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-right: 1px solid var(--line);
}

.world-stat strong {
  font: 500 18px/1 var(--mono);
}

.world-stat span,
.world-legend {
  color: var(--muted);
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.world-legend {
  margin-left: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.world-legend span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ruby);
}

.zoom-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoom-controls button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.zoom-controls button:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.zoom-controls span {
  min-width: 42px;
  text-align: center;
  font: 500 9px/1 var(--mono);
}

.world-viewport {
  height: 660px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 255, 85, 0.08), transparent 30rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 28px 28px, 28px 28px, auto;
}

.world-map {
  position: relative;
  width: 1420px;
  height: 760px;
  transform-origin: top left;
  transition: transform 180ms ease;
}

.wallet-island {
  position: absolute;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #f5f1e7;
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.5);
}

.wallet-island[data-current="true"] {
  border: 3px solid var(--ruby);
  box-shadow: 8px 8px 0 var(--ruby);
}

.wallet-island-header {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  font: 500 8px/1 var(--mono);
  text-transform: uppercase;
}

.wallet-island-header span:last-child {
  color: var(--muted);
}

.wallet-island-canvas {
  position: relative;
  background: #dedad0;
  image-rendering: pixelated;
}

.world-tile {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  outline: 1px solid rgba(24, 24, 23, 0.2);
  outline-offset: -1px;
}

.world-tile span {
  min-width: 0;
}

.world-footer {
  min-height: 52px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-button {
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: transparent;
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-button:hover {
  border-color: var(--ink);
  background: white;
}

.activity-section {
  padding: 115px 0 125px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 90px;
}

.section-title h2 {
  max-width: 510px;
  margin: 17px 0 0;
  font-size: clamp(37px, 4vw, 62px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
}

.activity-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.activity-list li {
  min-height: 83px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.activity-list li > span:last-child {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

.activity-dot {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.activity-dot.current {
  border-color: var(--ruby);
  background: var(--ruby);
  box-shadow: 0 0 0 4px rgba(239, 65, 98, 0.12);
}

.activity-list li div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.activity-list strong {
  font-size: 12px;
}

.activity-list small {
  color: var(--muted);
  font: 400 9px/1.2 var(--mono);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100% - 48px));
  padding: 14px 17px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  box-shadow: 5px 5px 0 var(--ruby);
  font: 500 10px/1.45 var(--mono);
}

footer {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--ink);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer a {
  text-decoration: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1120px) {
  .studio-shell {
    grid-template-columns: 210px minmax(460px, 1fr);
  }

  .editor-panel {
    border-right: 0;
  }

  .tools-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--ink);
  }

  .tool-section,
  .save-section {
    margin: 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .save-section {
    border-right: 0;
  }

  .world-viewport {
    height: 580px;
  }
}

@media (max-width: 780px) {
  .site-header,
  main,
  footer {
    width: min(1500px, calc(100% - 28px));
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .network-pill {
    display: none;
  }

  .wordmark small {
    display: none;
  }

  .wallet-button {
    min-width: 0;
  }

  .studio-intro {
    min-height: 0;
    padding: 48px 0 40px;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  h1 {
    font-size: clamp(47px, 14.5vw, 68px);
  }

  .studio-shell {
    display: flex;
    flex-direction: column;
    box-shadow: 7px 7px 0 var(--ink);
  }

  .collection-panel,
  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    overflow-x: auto;
  }

  .collection-footer {
    margin-top: 0;
  }

  .canvas-stage {
    padding: 31px 24px 38px;
  }

  .tools-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .save-section {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .world-section {
    margin-top: 80px;
    box-shadow: 7px 7px 0 var(--ruby);
  }

  .world-header {
    padding: 32px 28px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .world-toolbar {
    padding: 0 12px;
  }

  .world-stat {
    min-width: 85px;
    padding: 0 11px;
  }

  .world-legend {
    display: none;
  }

  .bitmap-strip {
    grid-template-columns: 1fr auto;
  }

  .bitmap-strip code {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .activity-section {
    padding: 85px 0;
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 520px) {
  .site-header {
    height: 74px;
  }

  .wallet-button {
    padding-inline: 11px;
  }

  .studio-intro {
    padding-top: 38px;
  }

  h1 {
    font-size: clamp(43px, 13.4vw, 58px);
    line-height: 0.94;
  }

  .intro-note {
    grid-template-columns: 25px 1fr;
  }

  .collection-header,
  .editor-header {
    min-height: 88px;
    padding: 22px;
  }

  .collection-grid {
    padding: 12px;
    grid-template-columns: repeat(3, 105px);
  }

  .editor-header {
    align-items: flex-end;
  }

  .edit-state {
    max-width: 96px;
    text-align: center;
    line-height: 1.3;
  }

  .canvas-frame {
    padding: 9px;
    box-shadow: 6px 6px 0 #c9c4b9;
  }

  .composite-frame {
    padding: 9px;
    box-shadow: 6px 6px 0 #c9c4b9;
  }

  .canvas-footer {
    padding: 0 20px;
  }

  .canvas-footer span:last-child {
    display: none;
  }

  .tools-panel {
    display: block;
  }

  .layout-section {
    display: grid;
  }

  .tool-section,
  .save-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .palette {
    grid-template-columns: repeat(8, 1fr);
  }

  .bitmap-strip > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .world-header h2 {
    font-size: 42px;
  }

  .world-stat:nth-child(2) {
    border-right: 0;
  }

  .zoom-controls {
    margin-left: auto;
  }

  .world-footer span:last-child {
    display: none;
  }

  footer span:nth-child(2) {
    display: none;
  }
}
