:root {
  --page: #f7f0d7;
  --ink: #1f2523;
  --muted: #66706c;
  --panel: #f7f0d7;
  --accent: #4a633b;
  --button: #4a633b;
  --shadow: 0 20px 60px rgba(35, 31, 25, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--panel);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.topbar,
.stage {
  background: var(--panel);
}

.topbar {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(31, 37, 35, 0.16);
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.logo-title {
  grid-column: 1;
  height: 42px;
  background: transparent;
}

.logo-title img {
  display: block;
  width: auto;
  height: 100%;
  max-width: min(260px, 58vw);
  background: transparent;
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.world-switcher-wrap {
  grid-column: 2;
  position: relative;
  justify-self: center;
  min-width: 0;
}

.world-switcher-wrap[hidden] {
  display: none;
}

.world-switcher-button {
  max-width: min(420px, 42vw);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #000000;
  font: inherit;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
}

.world-switcher-button:hover,
.world-switcher-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.42);
}

.world-switcher-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-switcher-chevron {
  width: 14px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  flex: 0 0 auto;
}

.world-switcher-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(320px, 82vw);
  max-height: 300px;
  padding: 8px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(35, 31, 25, 0.18);
  opacity: 0;
  overflow: auto;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.world-switcher-wrap.is-open .world-switcher-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.world-switcher-option {
  width: 100%;
  min-height: 46px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.world-switcher-option:hover,
.world-switcher-option:focus-visible,
.world-switcher-option.is-active {
  background: rgba(74, 99, 59, 0.1);
  outline: 0;
}

.world-switcher-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.world-switcher-option span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.profile-menu-wrap[hidden] {
  display: none;
}

.profile-menu-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 100%;
  width: 178px;
  height: 12px;
}

.account-button,
.generate-button,
.clear-button {
  min-width: 78px;
  height: 40px;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 8px;
  color: #fff;
  background: var(--button);
  cursor: pointer;
}

.account-button {
  min-width: 142px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 700;
}

.account-button[hidden] {
  display: none;
}

.generate-button {
  min-width: 132px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 700;
}

.profile-icon-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}

.profile-icon-button[hidden] {
  display: none;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 178px;
  padding: 8px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(35, 31, 25, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.profile-menu-wrap:hover .profile-dropdown,
.profile-menu-wrap.is-open .profile-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-dropdown button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.profile-dropdown button:hover,
.profile-dropdown button:focus-visible {
  background: rgba(74, 99, 59, 0.1);
  outline: 0;
}

.profile-icon-fallback {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.profile-icon-fallback[hidden] {
  display: none;
}

.profile-icon-image,
.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.profile-icon-image[hidden],
.profile-avatar img[hidden] {
  display: none;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 560px;
  overflow: hidden;
}

.sidebar-toggle {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(35, 31, 25, 0.16);
  cursor: pointer;
}

.profile-page {
  min-height: calc(100vh - 82px);
  padding: 36px 32px 72px;
  background: var(--panel);
}

.profile-page[hidden] {
  display: none;
}

.profile-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.profile-back {
  height: 38px;
  margin-bottom: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.profile-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-section-header h2 {
  margin: 0;
  color: #000000;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.profile-overview-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.create-world-button {
  min-width: 180px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(74, 99, 59, 0.2);
}

.edit-profile-button {
  height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.world-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
  padding: 0 4px;
}

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

.world-card {
  margin: 0;
  position: relative;
  border: 1px solid rgba(31, 37, 35, 0.11);
  border-radius: 14px;
  padding: 10px 10px 16px;
  background: rgba(255, 255, 255, 0.46);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(35, 31, 25, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.world-card:hover,
.world-card:focus-visible {
  border-color: rgba(74, 99, 59, 0.28);
  box-shadow: 0 18px 42px rgba(35, 31, 25, 0.13);
  outline: 0;
  transform: translateY(-2px);
}

.world-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 253 / 168;
  border-radius: 10px;
  background:
    radial-gradient(circle at 32% 30%, rgba(117, 162, 68, 0.9) 0 7%, transparent 8%),
    radial-gradient(circle at 42% 42%, rgba(97, 145, 58, 0.82) 0 11%, transparent 12%),
    radial-gradient(circle at 62% 55%, #4e8fc6 0 13%, transparent 14%),
    linear-gradient(135deg, transparent 0 58%, rgba(76, 65, 52, 0.9) 59% 62%, transparent 63%),
    linear-gradient(30deg, #e9cf93 0 26%, #5e934b 27% 65%, #e9cf93 66% 100%);
  background-color: #6d9d59;
  overflow: hidden;
}

.world-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.world-card h3 {
  margin: 14px 4px 0;
  color: #000000;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.world-meta {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.world-card-menu {
  position: absolute;
  right: 10px;
  top: 10px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.world-card:hover .world-card-menu,
.world-card:focus-within .world-card-menu,
.world-card-menu.is-open {
  opacity: 1;
}

.world-menu-button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #000000;
  cursor: pointer;
}

.world-menu-button span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.world-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  width: 116px;
  padding: 6px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(35, 31, 25, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.world-card-menu.is-open .world-menu-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.world-menu-dropdown button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.world-menu-dropdown button:hover,
.world-menu-dropdown button:focus-visible {
  background: rgba(74, 99, 59, 0.1);
  outline: 0;
}

.world-empty {
  grid-column: 1 / -1;
  min-height: 310px;
  display: grid;
  place-items: center;
  padding: 44px;
  border: 1px dashed rgba(74, 99, 59, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
  text-align: center;
}

.world-empty h3 {
  margin: 0;
  color: #000000;
  font-size: 1.8rem;
  font-weight: 800;
}

.world-empty p {
  max-width: 420px;
  margin: 10px auto 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.world-empty button,
.secondary-action,
.danger-action {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.world-empty button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.profile-avatar-stack {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: max-content;
}

.profile-edit {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 24px 60px rgba(35, 31, 25, 0.08);
}

.profile-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  overflow: hidden;
  border: 1px solid rgba(31, 37, 35, 0.1);
}

.profile-image-edit {
  position: absolute;
  right: -12px;
  bottom: 2px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 8px 20px rgba(35, 31, 25, 0.18);
  cursor: pointer;
}

.profile-image-edit img {
  width: 19px;
  height: 19px;
  display: block;
  object-fit: contain;
}

.profile-image-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 8;
  width: 154px;
  padding: 6px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(35, 31, 25, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.profile-avatar-stack.is-image-menu-open .profile-image-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.profile-image-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.profile-image-menu button[hidden] {
  display: none;
}

.profile-image-menu button:hover,
.profile-image-menu button:focus-visible {
  background: rgba(74, 99, 59, 0.1);
  outline: 0;
}

.profile-header h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.profile-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-details {
  display: grid;
  gap: 14px;
  max-width: 560px;
  margin-top: 22px;
}

.profile-details label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 800;
}

.profile-details input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.profile-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-update,
.profile-delete-account {
  width: max-content;
  height: 40px;
  margin-top: 8px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.profile-update {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.profile-update:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.profile-delete-account {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9b2f2f;
}

.delete-world-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.secondary-action {
  border: 1px solid rgba(31, 37, 35, 0.18);
  background: #ffffff;
  color: var(--accent);
}

.danger-action {
  border: 0;
  background: #9b2f2f;
  color: #ffffff;
}

.profile-edit[hidden] {
  display: none;
}

.sidebar-toggle-icon {
  width: 14px;
  height: 14px;
  border-left: 4px solid #000000;
  border-bottom: 4px solid #000000;
  transform: translateX(3px) rotate(45deg);
}

.sidebar-toggle[aria-pressed="true"] .sidebar-toggle-icon {
  transform: translateX(-3px) rotate(225deg);
}

#sandboxCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  cursor: grab;
  touch-action: none;
}

#sandboxCanvas.is-dragging {
  cursor: grabbing;
}

.zoom-controls {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 40px;
  height: 80px;
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: 999px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(35, 31, 25, 0.18);
}

.zoom-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #4a633b;
  background: #ffffff;
  cursor: pointer;
  line-height: 1;
  font-size: 2rem;
  font-weight: 800;
}

.zoom-button:first-child {
  border-radius: 999px 999px 0 0;
}

.zoom-button:last-child {
  border-radius: 0 0 999px 999px;
}

.zoom-button + .zoom-button {
  border-top: 2px solid #e2e8ef;
}

.zoom-button:active {
  background: #f7f9fb;
}

.bottom-toolbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 0 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(35, 31, 25, 0.2);
  transform: translateX(-50%);
  transition: left 180ms ease;
}

.tool-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #000000;
  cursor: pointer;
}

.tool-button[aria-pressed="true"] {
  background: rgba(74, 99, 59, 0.12);
  color: var(--accent);
}

.tool-button img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}

.generator-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 37, 35, 0.34);
}

.generator-modal[hidden] {
  display: none;
}

.generator-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.generator-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  cursor: pointer;
  line-height: 0;
}

.generator-close img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  filter: invert(32%) sepia(16%) saturate(929%) hue-rotate(52deg) brightness(92%) contrast(89%);
}

.generator-panel h2 {
  margin: 0 42px 18px 0;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.upload-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.upload-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.upload-dropzone {
  min-height: 142px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 22px;
  border: 2px dashed rgba(74, 99, 59, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.upload-dropzone.is-drag-over {
  border-color: var(--accent);
  background: #ffffff;
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-dropzone-title {
  font-size: 1rem;
  font-weight: 800;
}

.upload-dropzone-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.upload-category-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.upload-category-field select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.account-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.account-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.account-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.35;
}

.account-switch button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.generator-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.generator-field textarea,
.generator-field select {
  width: 100%;
  border: 1px solid rgba(31, 37, 35, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.generator-field textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
}

.generator-field select {
  height: 42px;
  padding: 0 10px;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.generator-submit {
  width: 100%;
  height: 44px;
  margin-top: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.generator-submit:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.upload-download {
  width: max-content;
  margin: 14px auto 0;
  display: block;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
}

.generator-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(35, 31, 25, 0.18);
  font-weight: 800;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast[hidden] {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.toast-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
}

.toast-check::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .topbar-actions {
    grid-column: 2;
    width: auto;
  }

  .world-switcher-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .world-switcher-button {
    max-width: 100%;
    margin: 0 auto;
    font-size: 1.45rem;
  }

  .stage,
  #sandboxCanvas {
    min-height: 720px;
  }

  .zoom-controls {
    right: 14px;
    top: 14px;
  }

  .bottom-toolbar {
    bottom: 16px;
    gap: 12px;
    padding: 0 16px;
  }

  .profile-page {
    padding: 22px 16px 48px;
  }

  .profile-header {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-edit {
    padding: 24px;
    border-radius: 14px;
  }

  .world-section-header {
    align-items: stretch;
    flex-direction: column;
  }

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