/* [project]/app/style.css [app-client] (css) */
* {
  box-sizing: border-box;
}

:root {
  --lightningcss-light: ;
  --lightningcss-dark: initial;
  color-scheme: dark;
  --background: #111514;
  --surface: #1c2320;
  --surface-hover: #29352e;
  --text: #edf1ec;
  --muted: #a3afa7;
  --border: #354039;
  --accent: #a5c98a;
  --primary: #365b46;
  --primary-hover: #426f54;
  color: var(--text);
  background: var(--background);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

button {
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 17px 22px;
  font-weight: 600;
}

button:hover {
  background: var(--primary-hover);
}

button span {
  margin-left: 25px;
}

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

.home {
  max-width: 1180px;
  margin: auto;
  padding: 0 40px;
}

header {
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 30px 0;
  display: flex;
}

.home > header {
  height: 56px;
  padding: 0;
}

.logo {
  letter-spacing: -2px;
  font-size: 32px;
  font-weight: 800;
}

.logo span {
  color: var(--accent);
  margin-left: 8px;
}

.eyebrow {
  letter-spacing: 2px;
  font-size: 10px;
  font-weight: 600;
}

.intro {
  padding: 32px 0;
}

form.world-composer {
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 680px;
  color: var(--text);
  border-radius: 28px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "input"
                       "actions";
  gap: 12px;
  margin: 0 auto;
  padding: 18px 18px 8px;
  display: grid;
  box-shadow: 0 6px 20px #0003;
}

.world-composer:has(.image-attachments) {
  grid-template-areas: "images"
                       "input"
                       "actions";
}

.world-composer textarea {
  width: 100%;
  min-height: 72px;
  max-height: 200px;
  color: inherit;
  resize: none;
  background: none;
  border: 0;
  border-radius: 0;
  outline: none;
  grid-area: input;
  margin: 0;
  padding: 0;
  font-weight: 600;
  line-height: 24px;
  display: block;
}

.world-composer textarea::placeholder {
  color: var(--muted);
}

.world-composer:focus-within {
  border-color: #4a5b50;
}

.world-composer button {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  justify-self: end;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
}

.world-composer button:hover {
  background: var(--primary-hover);
}

.intro > p {
  max-width: 680px;
  margin: 12px auto 0;
}

h1 {
  letter-spacing: -4px;
  margin: 22px 0;
  font-size: clamp(48px, 7vw, 82px);
  font-weight: 500;
  line-height: 1.03;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

form {
  gap: 10px;
  max-width: 560px;
  margin-top: 32px;
  display: flex;
}

input {
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
  color: inherit;
  border-radius: 8px;
  flex: 1;
  padding: 16px;
}

.section-title {
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  display: flex;
}

h2 {
  font-size: 18px;
  font-weight: 500;
}

.section-title h2 {
  font-weight: 650;
}

h2 span {
  color: var(--muted);
  margin-left: 10px;
  font-size: 12px;
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 22px;
  margin: 20px 0 50px;
  display: grid;
}

@media (min-width: 701px) {
  .home:has( > .worlds) {
    max-width: none;
    padding: 0;
  }

  .home:has( > .worlds) > :is(header, .intro, footer) {
    width: calc(100% - 80px);
    max-width: 1100px;
    margin-inline: auto;
  }

  .worlds .section-title {
    padding: 20px 16px 0;
  }

  .worlds .section-title h2 {
    margin: 0;
  }

  .worlds .cards {
    gap: 10px;
    margin: 10px 10px 50px;
  }
}

.card {
  border-radius: 12px;
  height: 220px;
  position: relative;
  overflow: hidden;
}

.preview {
  place-items: center;
  display: grid;
  position: absolute;
  inset: 0;
}

.preview:not(:has(img, video)) {
  background: linear-gradient(#87c5f5 0% 49%, #6eaa46 50%, #659b40 100%);
}

.preview:after {
  content: "";
  pointer-events: none;
  background: linear-gradient(#0005, #0000 40% 65%, #0003);
  position: absolute;
  inset: 0;
}

.preview img, .preview video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .preview img, .preview video {
    transition: transform .45s;
  }

  .card:hover .preview img, .card:hover .preview video {
    transform: scale(1.25);
  }
}

.preview small {
  color: var(--text);
  background: #1c2320ed;
  border-radius: 6px;
  padding: 6px 10px;
}

h3 {
  overflow-wrap: anywhere;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
}

.card-title {
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 5px #0008;
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
}

.card-title h3 {
  margin: 0;
  font-size: 15px;
}

.card-title > span {
  opacity: .85;
  margin-top: 5px;
  font-size: 12px;
  display: block;
}

.card-actions {
  gap: 8px;
  display: flex;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.card-enter {
  color: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: #0000004d;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
}

.card-enter:hover {
  background: #00000080;
}

@media (hover: hover) and (pointer: fine) {
  .card-enter {
    opacity: 0;
    pointer-events: none;
  }

  .card:hover .card-enter, .card:focus-within .card-enter {
    opacity: 1;
    pointer-events: auto;
  }
}

.empty {
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  margin: 20px 0 50px;
  padding: 46px 20px;
}

.empty > span {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 30px;
  display: block;
}

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

footer {
  color: var(--muted);
  justify-content: space-between;
  padding: 22px 0;
  font-size: 11px;
  display: flex;
}

.player, .canvas {
  position: fixed;
  inset: 0;
}

.canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  pointer-events: none;
  border: 0;
  padding: 25px;
  font-size: 13px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.hud > span {
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
  overflow: hidden;
}

.welcome {
  text-align: center;
  width: min(90%, 650px);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.welcome h1 {
  letter-spacing: -2px;
  overflow-wrap: anywhere;
  font-size: clamp(36px, 6vw, 60px);
}

.welcome p {
  color: var(--muted);
}

.welcome button {
  margin-top: 12px;
}

.crosshair {
  color: var(--text);
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.controls {
  white-space: nowrap;
  color: var(--muted);
  pointer-events: none;
  background: #1c2320ed;
  border: 1px solid #ffffff80;
  border-radius: 10px;
  gap: 22px;
  padding: 15px 20px;
  font-size: 11px;
  display: flex;
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
}

kbd {
  margin-right: 5px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .home {
    padding: 0 22px;
  }

  .intro {
    padding: 24px 0;
  }

  header .eyebrow, .section-title .eyebrow, .hud .eyebrow {
    display: none;
  }

  form {
    flex-direction: column;
  }

  .controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 90%;
  }
}

textarea {
  background: var(--surface);
  min-width: 0;
  min-height: 100px;
  color: var(--text);
  border: 1px solid var(--border);
  font: inherit;
  resize: vertical;
  border-radius: 8px;
  flex: 1;
  padding: 16px;
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

.asset-status {
  pointer-events: none;
  font-size: 12px;
  position: absolute;
  top: 65px;
  left: 32px;
  right: 32px;
}

.explore {
  text-align: center;
  position: absolute;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
}

.touch-player {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.touch-player .controls {
  display: none;
}

.touch-player .hud {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
}

.touch-player .asset-status {
  color: #fff;
  text-shadow: 0 1px 3px #000;
  top: 52px;
}

.joystick {
  pointer-events: none;
  opacity: 0;
  background: #0003;
  border: 2px solid #ffffff80;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  position: absolute;
  transform: translate(-50%, -50%);
}

.joystick i {
  width: 40px;
  height: 40px;
  transform: translate(var(--stick-x, 0px), var(--stick-y, 0px));
  background: #ffffffb3;
  border-radius: 50%;
  position: absolute;
  top: 33px;
  left: 33px;
}

.touch-hints {
  inset: auto 0 max(20px, env(safe-area-inset-bottom));
  color: #fff;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  justify-content: space-around;
  font-size: 12px;
  display: flex;
  position: absolute;
}

.rotate-phone {
  display: none;
}

@media (orientation: portrait) {
  .touch-player .rotate-phone {
    background: #203b35ed;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    display: flex;
    position: absolute;
    inset: 0;
  }

  .rotate-phone p {
    color: #fff;
  }
}

.touch-jump {
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(50px + env(safe-area-inset-bottom));
  color: #fff;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  background: #203b3577;
  border: 2px solid #ffffff80;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  padding: 0;
  font-size: 40px;
  position: absolute;
}

.course-status {
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  position: absolute;
  top: 64px;
  left: 24px;
  right: 24px;
}

.course-status button {
  pointer-events: auto;
  margin-left: 12px;
  padding: 8px 14px;
}

.auth-form {
  flex-direction: column;
  max-width: 400px;
}

.auth-form label {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.auth-switch {
  color: var(--accent);
  background: none;
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
}

.auth-switch:hover {
  color: var(--text);
  background: none;
}

.auth-modal {
  border: 1px solid var(--border);
  background: var(--background);
  width: min(440px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  color: var(--text);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 24px 80px #0003;
}

.auth-modal::backdrop {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background: #14251d88;
}

.auth-modal h2 {
  margin: 0 32px 0 0;
  font-size: 26px;
}

.auth-close {
  color: inherit;
  background: none;
  padding: 4px 10px;
  font-size: 26px;
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-close:hover {
  background: var(--surface-hover);
}

body:has(.auth-modal[open]) {
  overflow: hidden;
}

.home > header .auth-switch {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  text-decoration: none;
}

.home > header .auth-switch:hover {
  background: var(--primary-hover);
}

.account-menu {
  position: relative;
}

.account-menu summary {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 6px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.account-avatar {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  place-items: center;
  width: 32px;
  height: 32px;
  display: grid;
}

.account-dropdown {
  z-index: 10;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  min-width: 160px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  box-shadow: 0 8px 24px #0005;
}

.account-dropdown button, .account-dropdown a {
  width: 100%;
  color: var(--text);
  text-align: left;
  background: none;
  padding: 10px 12px;
  font-weight: 500;
  display: block;
}

.account-dropdown button:hover, .account-dropdown a:hover {
  background: var(--surface-hover);
}

.account-dropdown p {
  margin: 6px;
  font-size: 12px;
}

.composer-shell {
  position: relative;
}

.composer-error {
  color: #ff9b9b;
  margin: 6px 0;
  font-size: 12px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

.world-editor {
  grid-template: "header header" 56px
                 "chat world" minmax(0, 1fr)
                 / 300px minmax(0, 1fr);
  height: 100dvh;
  display: grid;
}

@media (min-width: 601px) {
  :is(html:has(.world-editor), body:has(.world-editor)) {
    overscroll-behavior: none;
    overflow: hidden;
  }

  .world-editor {
    overflow: hidden;
  }
}

.world-editor header {
  grid-area: header;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  font-size: 13px;
  display: grid;
}

.editor-stage {
  border-radius: 20px;
  grid-area: world;
  min-width: 0;
  min-height: 0;
  margin: 0 12px 12px 0;
  position: relative;
  overflow: hidden;
}

.editor-preview {
  background: var(--background);
  border: 0;
  border-radius: 20px;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.editor-composer {
  grid-area: chat;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0 12px 12px;
}

.editor-composer .composer-shell {
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  display: flex;
}

.editor-composer .edit-conversation {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.editor-composer .world-composer {
  flex: none;
  width: 100%;
}

.editor-composer textarea {
  height: 40px;
  min-height: 40px;
  max-height: 120px;
}

.editor-composer .composer-error {
  margin: 0;
  position: static;
}

@media (max-width: 600px) {
  .world-editor {
    height: calc(100dvh - env(safe-area-inset-bottom));
    grid-template: "header" 56px
                   "world" minmax(180px, 1fr)
                   "chat" minmax(220px, .7fr)
                   / minmax(0, 1fr);
    gap: 12px;
    min-height: 492px;
    padding: 0 12px 12px;
  }

  .world-editor header {
    height: 56px;
    padding: 0;
  }

  .editor-preview {
    width: 100%;
    height: 100%;
  }

  .editor-composer {
    border: 0;
    padding: 0;
  }
}

.editor-controls {
  pointer-events: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  display: flex;
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
}

.editor-controls .controls {
  pointer-events: auto;
  white-space: normal;
  flex-wrap: wrap;
  min-width: 0;
  transition: opacity .4s;
  position: static;
  transform: none;
}

.editor-controls.controls-hidden .controls {
  opacity: 0;
  pointer-events: none;
}

.account-mobile {
  display: none;
}

.account-signout button {
  border-radius: 999px;
  padding: 10px 20px;
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1000px) {
  .account-menu {
    display: none;
  }

  .account-mobile {
    border-radius: 999px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    padding: 6px 12px 6px 6px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
  }

  .account-mobile > span {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .account-mobile .avatar-portrait {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
  }
}

.avatar-portrait {
  background: var(--surface);
  object-fit: cover;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: block;
}

.edit-conversation {
  overscroll-behavior: contain;
  max-height: 300px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black var(--chat-fade, 0px));
  mask-image: linear-gradient(to bottom, transparent, black var(--chat-fade, 0px));
  overflow-y: auto;
}

.edit-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: fit-content;
  max-width: 90%;
  color: var(--text);
  border-radius: 18px;
  margin: 0 0 14px;
  padding: 12px 16px;
  font-size: 14px;
}

.edit-message.user {
  background: var(--surface-hover);
  margin-left: auto;
}

.editor-composer .edit-message.user {
  border-radius: 20px;
}

.edit-message.assistant {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.chat-role {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
}

.edit-thinking {
  margin: 0 0 14px;
  font-size: 14px;
}

.editor-composer :is(.edit-message, textarea, .edit-thinking) {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.editor-composer .edit-message {
  margin-bottom: 8px;
}

.editor-composer .edit-message.assistant {
  padding-top: 4px;
  padding-bottom: 4px;
  font-weight: 400;
}

.editor-composer .edit-message.assistant:has( + .edit-message.assistant) {
  margin-bottom: 6px;
  padding-bottom: 0;
}

.material-gallery {
  max-width: 1100px;
  margin: auto;
  padding: 0 24px 32px;
}

.material-preview {
  border-radius: 20px;
  height: min(58dvh, 600px);
  min-height: 280px;
  overflow: hidden;
}

.material-options {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  display: flex;
}

.material-options button {
  background: var(--surface);
  color: var(--text);
  text-transform: capitalize;
  padding: 10px 16px;
}

.material-options button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.material-controls {
  flex-wrap: wrap;
  gap: 24px;
  display: flex;
}

.material-controls label {
  align-items: center;
  gap: 12px;
  font-size: 14px;
  display: flex;
}

.hud.editor-hud {
  pointer-events: none;
  background: none;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 10px 54px 10px 10px;
  display: flex;
}

.game-title-pill {
  color: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: #0000004d;
  border-radius: 999px;
  max-width: 100%;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
}

.world-title {
  align-items: center;
  gap: 12px;
  min-width: 0;
  display: flex;
}

.world-title a {
  pointer-events: auto;
  flex-shrink: 0;
}

.world-title > span:last-child {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.game-status {
  color: #fff;
  white-space: pre-line;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: min(340px, 100% - 32px);
  max-height: calc(100% - 160px);
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  position: absolute;
  top: 80px;
  left: 25px;
  overflow-y: auto;
}

.touch-player .hud:not(.editor-hud) + .game-status {
  left: max(16px, env(safe-area-inset-left));
}

.editor-hud + .game-status {
  top: 50px;
  left: 10px;
}

.game-status-info {
  background: #18382ce8;
  border-radius: 12px;
  padding: 8px 12px;
}

.game-status summary {
  cursor: pointer;
  color: #ffffffb3;
  margin-top: 4px;
}

.game-status button {
  border-radius: 10px;
  margin: 0;
  padding: 8px 12px;
}

.game-status button:disabled {
  opacity: .55;
}

.editor-stage-split {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  display: grid;
}

.editor-code-panel {
  border: 1px solid var(--border);
  color: #dae5df;
  background: #101914;
  border-radius: 20px;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.editor-code-toolbar {
  color: #90a99b;
  pointer-events: auto;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px 10px;
  font-size: 12px;
  display: flex;
}

.editor-code-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 10px 0;
  display: flex;
}

.editor-code-sidebar {
  border-right: 1px solid #ffffff0d;
  flex-direction: column;
  flex: 0 0 clamp(130px, 25%, 210px);
  min-width: 0;
  display: flex;
}

.editor-file-tree {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 2px 8px 0;
  overflow-y: auto;
}

.editor-file-tree button {
  color: #a8b9af;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;
  font: 500 12px / 18px Arial, sans-serif;
  display: flex;
}

.editor-file-tree button:hover {
  background: #ffffff08;
}

.editor-file-tree button[aria-current="page"] {
  color: #edf1ec;
  background: #ffffff0f;
}

.editor-file-tree button span {
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  overflow: hidden;
}

.editor-file-writing {
  background: #8bddb1;
  border-radius: 50%;
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  margin-left: auto;
}

.editor-code-toolbar [role="status"] {
  white-space: nowrap;
}

.editor-code-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
  min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top, 0px), #000 calc(100% - var(--fade-bottom, 0px)), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top, 0px), #000 calc(100% - var(--fade-bottom, 0px)), transparent);
  tab-size: 2;
  flex: 1;
  margin: 0;
  padding: 0 54px 0 20px;
  font: 12px / 1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden auto;
}

.code-keyword {
  color: #c5a6ef;
}

.code-string {
  color: #a7d99d;
}

.code-number {
  color: #e5bb81;
}

.code-comment {
  color: #799185;
}

.code-waiting-dot {
  vertical-align: middle;
  background: #fff;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  animation: 1.2s ease-in-out infinite code-pulse;
  display: inline-block;
}

@keyframes code-pulse {
  50% {
    opacity: .25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .code-waiting-dot {
    animation: none;
  }
}

@media (max-width: 600px) {
  .editor-stage {
    margin: 0;
  }

  .editor-code-panel pre {
    padding: 0 48px 0 12px;
  }

  .editor-code-toolbar [role="status"] {
    display: none;
  }
}

.world-editor header > a:last-child {
  white-space: nowrap;
  justify-self: end;
}

.editor-play {
  color: #101914;
  background: #fff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 600;
}

.editor-play:hover {
  background: #edf1ec;
}

@media (prefers-reduced-motion: no-preference) {
  .editor-play span {
    color: #0000;
    background: repeating-linear-gradient(90deg, #9b00ff 0%, #ff168c 10%, #ff9500 20%, #00bf63 30%, #008cff 40%, #9b00ff 50%) 0 0 / 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: 4s linear infinite play-shimmer;
  }
}

@keyframes play-shimmer {
  to {
    background-position: 100% 0;
  }
}

.world-editor header .editor-brand {
  white-space: nowrap;
  justify-self: start;
  font-size: 20px;
  font-weight: 700;
}

@media (min-width: 601px) {
  .world-editor header .editor-brand {
    margin-left: -12px;
  }

  .editor-play {
    margin-right: -12px;
  }
}

.editor-world-title {
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
}

.editor-panel-badge {
  color: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: #0000004d;
  border-radius: 14px;
  flex-shrink: 0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.editor-code-toolbar .editor-panel-badge, .editor-code-panel .editor-expand {
  border: 1px solid #ffffff26;
}

@media (max-width: 600px) {
  .world-editor header {
    gap: 8px;
    font-size: 11px;
  }

  .world-editor header .editor-brand {
    font-size: 14px;
  }
}

.editor-test-panel {
  border-radius: 20px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.editor-stage-split[data-expanded="test"] {
  grid-template-rows: minmax(0, 1fr) 56px;
}

.editor-stage-split[data-expanded="code"] {
  grid-template-rows: 56px minmax(0, 1fr);
}

.editor-stage-split[data-expanded="test"] .editor-file-tree, .editor-stage-split[data-expanded="test"] pre {
  visibility: hidden;
}

.editor-expand {
  z-index: 1;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: #0000004d;
  border: 0;
  border-radius: 14px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 7px;
  display: grid;
  position: absolute;
  top: 10px;
  right: 10px;
}

.editor-expand:hover {
  background: #ffffff26;
}

.editor-expand svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7px;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 18px;
  height: 18px;
}

.edit-message.assistant {
  white-space: normal;
}

.edit-message.assistant p {
  color: inherit;
  line-height: inherit;
}

.edit-message.assistant > :not(.chat-role) {
  margin: 0 0 10px;
}

.edit-message.assistant > :last-child {
  margin-bottom: 0;
}

.edit-message.assistant :is(ul, ol) {
  padding-left: 20px;
}

.edit-message.assistant li + li {
  margin-top: 4px;
}

.edit-message.assistant a {
  text-decoration: underline;
}

.edit-message.assistant code {
  background: #ffffff0d;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: .9em;
}

.edit-message.assistant pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #ffffff08;
  border-radius: 8px;
  padding: 10px;
}

.edit-message.assistant pre code {
  background: none;
  padding: 0;
}

.edit-message.assistant blockquote {
  border-left: 2px solid var(--border);
  color: var(--muted);
  padding-left: 12px;
}

.edit-message.assistant :is(h1, h2, h3, h4, h5, h6) {
  font-size: 1em;
}

.game-marker {
  z-index: 2;
  pointer-events: none;
  color: #fff;
  white-space: nowrap;
  background: #10251dcc;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  position: absolute;
  transform: translate(-50%, -50%);
}

.game-connection-message {
  z-index: 20;
  color: #fff;
  text-align: center;
  background: #10251df2;
  border-radius: 20px;
  width: min(360px, 100% - 32px);
  padding: 24px;
  font-size: 16px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.game-connection-message p {
  color: #ccd8d1;
  margin: 12px 0 20px;
  font-size: 14px;
  line-height: 1.5;
}

.creator-reasoning {
  color: #aabbb2;
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.5;
}

.creator-reasoning summary {
  cursor: pointer;
}

.creator-reasoning > div {
  max-height: 140px;
  overflow: auto;
}

.image-attachments {
  flex-wrap: wrap;
  grid-area: images;
  align-items: center;
  gap: 8px;
  display: flex;
}

.image-attachment {
  position: relative;
}

.image-attachment img, .chat-image {
  object-fit: cover;
  border-radius: 8px;
  width: 64px;
  height: 64px;
}

.chat-image {
  margin-top: 8px;
  display: block;
}

.world-composer .image-attachment button {
  background: #24352e;
  width: 20px;
  height: 20px;
  position: absolute;
  top: -5px;
  right: -5px;
}

.attachment-menu {
  grid-area: actions;
  place-self: end start;
  margin-left: -10px;
  position: relative;
}

.world-composer .attach-image {
  color: var(--muted);
  background: none;
}

.world-composer .attach-image:hover {
  background: var(--primary-hover);
}

.attachment-options {
  z-index: 30;
  border: 1px solid var(--border);
  background: #24352e;
  border-radius: 12px;
  min-width: 120px;
  padding: 4px;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  box-shadow: 0 6px 24px #0004;
}

.world-composer .attachment-options button {
  white-space: nowrap;
  background: none;
  border-radius: 6px;
  justify-items: start;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  font-size: 14px;
}

.world-composer .attachment-options button:is(:hover, :focus-visible) {
  background: var(--primary-hover);
}

.world-composer > button[type="submit"] {
  grid-area: actions;
  align-self: end;
  margin-right: -10px;
}

