:root {
  --p0: #1a1c2c;
  --p1: #5d275d;
  --p2: #b13e53;
  --p3: #ef7d57;
  --p4: #ffcd75;
  --p5: #a7f070;
  --p6: #38b764;
  --p7: #257179;
  --p8: #29366f;
  --p9: #3b5dc9;
  --p10: #41a6f6;
  --p11: #73eff7;
  --p12: #f4f4f4;
  --p13: #94b0c2;
  --p14: #566c86;
  --p15: #333c57;
  --bg: #141624;
  --panel: #1a1c2c;
  --line: #333c57;
  --text: #f4f4f4;
  --muted: #94b0c2;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--p15) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--p15);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 2px solid var(--p10);
  outline-offset: 2px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
label.btn {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.boot-note {
  margin: auto;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.boot-note::after {
  content: "";
  animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-note::after,
  .lobby-tile.selected .lobby-name::after {
    animation: none;
  }
}

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}

.wordmark {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.tagline {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

/* The editor has additional source actions; reserve each tab's actual width
   so a wrapped tier badge cannot cover the last tabs' hit targets. */
.editor .tabs {
  flex: 1 0 auto;
  min-width: max-content;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--p4);
  border-bottom-color: var(--p4);
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.code-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 6px; }
.code-tools select { max-width: min(45vw, 280px); min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 7px 8px; }
.code-find { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.code-find input { min-width: 0; width: 150px; background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 8px; }
.code-find [role="status"] { font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--p15);
  color: var(--text);
  border: 1px solid var(--p14);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:not(:disabled):hover {
  border-color: var(--p10);
  color: var(--p11);
}

.btn:not(:disabled):active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--p4);
  border-color: var(--p4);
  color: var(--p0);
  font-weight: 700;
}

.btn.primary:not(:disabled):hover {
  color: var(--p0);
  background: var(--p3);
  border-color: var(--p3);
}

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

.icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
}

.content {
  flex: 1;
  min-height: 0;
  display: flex;
}

.statusbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.spacer {
  flex: 1;
}

.ok-text {
  color: var(--p5);
}

.err-text {
  color: var(--p3);
}

.dim {
  color: var(--muted);
}

.panel-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.code-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
}

.project-code-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.project-module-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 12px 0;
}

.project-module-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 12px;
}

.project-module-editor .code { min-height: 0; width: 100%; }

.project-generated-code {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--p5);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

.project-asset-browser {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.project-asset-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.project-asset-row .toolrow { margin-top: 6px; }

.code {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--p5);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  resize: none;
  tab-size: 2;
}

.code:focus {
  border-color: var(--p9);
}

.code-edit {
  position: relative;
  flex: 1;
  min-width: 0;
}

.code-edit .code {
  position: absolute;
  inset: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--p12);
}

.code-edit .code::selection {
  background: rgba(65, 166, 246, 0.35);
}

.hl {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

.hl code {
  display: block;
  padding: 12px;
  white-space: pre;
  tab-size: 2;
}

.tok-c {
  color: var(--p13);
  font-style: italic;
}

.tok-s {
  color: var(--p6);
}

.tok-n {
  color: var(--p3);
}

.tok-k {
  color: var(--p4);
}

.tok-g {
  color: var(--p11);
}

.tok-o {
  color: var(--p13);
}

.sprites {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 12px;
  overflow: auto;
}

.sprites-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolrow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolrow.wrap {
  flex-wrap: wrap;
}

.tool-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 0 2px;
}

.group-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tool.icon-only-tool {
  padding: 4px 7px;
  line-height: 1;
}

.btn.icon-only {
  padding: 4px 7px;
  line-height: 1;
}

.btn.icon-only:disabled {
  opacity: 0.45;
}

.map-canvas.panning {
  cursor: grab;
}

.map-canvas.grabbing {
  cursor: grabbing;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 22, 36, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  min-width: 360px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.shortcut-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 20px;
  font-size: 13px;
  align-items: baseline;
}

.shortcut-keys {
  color: var(--p4);
  white-space: nowrap;
}

.shortcut-desc {
  color: var(--muted);
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--p14);
  border-radius: 4px;
  color: var(--muted);
  padding: 6px 10px;
  cursor: pointer;
}

.tool:not(:disabled):hover {
  color: var(--text);
  border-color: var(--p10);
}

.tool:not(:disabled):active {
  transform: translateY(1px);
}

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

.tool.active {
  color: var(--p4);
  border-color: var(--p4);
}

.tool.active:not(:disabled):hover {
  color: var(--p4);
  border-color: var(--p4);
}

.tool-note {
  color: var(--muted);
  font-size: 12px;
}

.sprite-canvas {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
  width: 192px;
  height: 192px;
  cursor: crosshair;
  touch-action: none;
}

.palette {
  display: grid;
  grid-template-columns: repeat(8, 24px);
  gap: 4px;
}

.swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--p0);
  border-radius: 3px;
  cursor: pointer;
}

.swatch.selected {
  outline: 2px solid var(--p12);
  outline-offset: 1px;
}

.palette.ladder {
  display: block;
}

.ladder-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ladder-row {
  display: flex;
  gap: 2px;
}

.ladder-row .swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.sprites-right {
  flex: 1;
  min-width: 0;
}

.picker {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
  cursor: pointer;
  touch-action: manipulation;
}

.anim-panel {
  margin-top: 12px;
}

.anim-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.anim-input {
  width: 52px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 5px;
}

.anim-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.anim-canvas {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
  flex: none;
}

.mesh {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 12px;
  overflow: auto;
}

.mesh-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 430px;
  max-width: 560px;
}

.mesh-face-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
}

.mesh-face-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--p13);
}

.mesh-face-row:hover {
  border-color: var(--line);
}

.mesh-face-row.active {
  border-color: var(--p10);
  color: var(--p12);
}

.mesh-face-idx {
  color: var(--p10);
  min-width: 3ch;
}

.mesh-face-sum {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mesh-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mesh-table {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--p13);
}

.mesh-table th {
  font-weight: 400;
  color: var(--muted);
  padding: 2px 6px;
  text-align: left;
}

.mesh-vtx {
  color: var(--p10);
  padding: 2px 6px;
}

.mesh-input {
  width: 72px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 5px;
}

.mesh-uv-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.mesh-uv-canvas {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
  width: 128px;
  height: 128px;
}

.mesh-ranges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mesh-name-input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 6px;
  width: 140px;
}

.mesh-range-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.mesh-range-name {
  font-family: var(--mono);
  color: var(--p10);
}

.mesh-range-span {
  color: var(--muted);
}

.mesh-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.mesh-preview {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
  width: 640px;
  max-width: 100%;
  height: auto;
  touch-action: none;
  cursor: grab;
}

.mesh-preview:focus {
  outline: 2px solid var(--p10);
  outline-offset: 2px;
}

.maptab {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 12px;
  min-height: 0;
}

.map-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-wrap {
  flex: 1;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.map-canvas {
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
}

.sfx {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 12px;
  overflow: auto;
}

.audio-editors {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.audio-editors .sfx {
  flex: 0 0 auto;
  overflow: visible;
}

.sample-bank-editor {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.sfx-slots {
  max-height: 100%;
  overflow: auto;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: 4px;
}

.slot {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 0;
  cursor: pointer;
}

.slot:hover {
  color: var(--text);
  border-color: var(--p14);
}

.slot.filled {
  color: var(--p4);
  border-color: var(--p14);
}

.slot.active {
  border-color: var(--p11);
  color: var(--p11);
}

.sfx-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notestrip {
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.noteedit {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.noteedit label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.noteedit input[type="range"] {
  width: 160px;
  accent-color: var(--p4);
}

.wavebtns {
  display: flex;
  gap: 6px;
}

.music .sfx-edit {
  max-width: 640px;
}

.music-tracks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-track {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.music-track .tool {
  width: 86px;
  justify-content: center;
  font-size: 11px;
}

.track-grid {
  grid-template-columns: repeat(16, 22px);
}

.track-grid .slot {
  padding: 3px 0;
  font-size: 9px;
}

.player {
  align-items: center;
}

.player-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.player .bar {
  width: 100%;
}

.stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(41, 54, 111, 0.14), transparent 65%);
}

.stage.dragging {
  outline: 2px dashed var(--p10);
  outline-offset: -12px;
}

.screen-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.screen-wrap::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0 1px,
    transparent 1px var(--spx, 4px)
  );
  border-radius: 2px;
}

.screen-wrap[data-scan-off]::after {
  display: none;
}

.screen {
  display: block;
  width: 512px;
  height: 512px;
  image-rendering: pixelated;
  background: var(--p0);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 2px dashed var(--p14);
  border-radius: 8px;
  padding: 48px 64px;
}

.drop-hint {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.controls .tool-sep {
  height: 20px;
  align-self: center;
}

.readout {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  color: var(--muted);
  white-space: nowrap;
}

.readout span:not(.dim):not(.hash) {
  color: var(--text);
}

.readout .hash {
  color: var(--p11);
}

.err-line {
  color: var(--p3);
  font-size: 12px;
  padding: 0 16px 6px;
  text-align: center;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0 16px 12px;
  text-align: center;
}

.lobby {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px 24px;
  width: min(880px, calc(100vw - 48px));
  max-height: calc(100vh - 220px);
}

.lobby-title {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lobby-list {
  overflow: auto;
  padding: 4px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 12px;
}

.lobby-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
  text-align: center;
}

.lobby .err-line {
  padding: 0;
  text-align: left;
}

.lobby-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px;
  cursor: pointer;
  text-align: center;
}

.lobby-tile:hover {
  color: var(--text);
  border-color: var(--p14);
  background: color-mix(in srgb, var(--p9) 8%, transparent);
}

.lobby-tile.selected {
  color: var(--p4);
  border-color: var(--p4);
  box-shadow: 0 0 0 1px var(--p4);
}

.lobby-thumb {
  aspect-ratio: 160 / 173;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.lobby-thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.lobby-tier {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(26, 28, 44, 0.85);
  border: 1px solid var(--p10);
  color: var(--p10);
}

.lobby-tier.o16 {
  border-color: #ff77aa;
  color: #ff77aa;
}

.lobby-tier.o32 {
  border-color: #8b5fd6;
  color: #8b5fd6;
}

.lobby-tile.selected .lobby-name::after {
  content: "_";
  margin-left: 3px;
  animation: lobby-blink 1.06s steps(1) infinite;
}

@keyframes lobby-blink {
  50% { opacity: 0; }
}

.lobby-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.remix-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.remix-note .remix-hash {
  color: var(--p11);
}

.tier-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--p10);
  color: var(--p10);
  white-space: nowrap;
}

.tier-badge.o16 {
  border-color: #ff77aa;
  color: #ff77aa;
}

.tier-badge.o32 {
  border-color: #8b5fd6;
  color: #8b5fd6;
}

.new-tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.new-tier {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
}

.new-tier:hover {
  border-color: var(--p10);
}

.new-tier.o16:hover {
  border-color: #ff77aa;
}

.new-tier.o32:hover {
  border-color: #8b5fd6;
}

.new-tier-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--p10);
}

.new-tier.o16 .new-tier-name {
  color: #ff77aa;
}

.new-tier.o32 .new-tier-name {
  color: #8b5fd6;
}

.new-tier-desc {
  font-size: 12px;
  color: var(--muted);
}

.embed-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 0;
  position: relative;
}

.embed .screen-wrap {
  padding: 6px;
}

.embed .screen {
  width: min(512px, calc(100vw - 28px), calc(100vh - 64px));
  height: auto;
  max-width: none;
  max-height: none;
  cursor: pointer;
}

.embed .screen.paused {
  opacity: 0.65;
}

.embed-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.embed-footer {
  display: flex;
  justify-content: center;
  padding: 4px 8px 8px;
}

.embed-footer .wordmark {
  font-size: 12px;
  opacity: 0.75;
}

.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

.share-link {
  color: var(--p11);
}

.share-note {
  color: var(--p5);
  font-size: 12px;
  padding: 0 16px 6px;
  text-align: center;
}

.share-note .hash {
  color: var(--p11);
}

.replay-note {
  color: var(--p4);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0 16px 6px;
  text-align: center;
}

.replays-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 16px;
  width: min(680px, calc(100vw - 48px));
  max-height: 240px;
}

.replays-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
}

.replays-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}

.replay-row-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.replay-row-wrap .replay-row {
  flex: 1;
  min-width: 0;
}

.replay-watch {
  color: var(--p3);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: underline;
  white-space: nowrap;
}

.replay-watch:hover {
  color: var(--text);
}

.replay-row {
  display: grid;
  grid-template-columns: 24px minmax(80px, 1fr) 72px 56px 90px 84px;
  gap: 8px;
  align-items: baseline;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  text-align: left;
}

.replay-row:hover {
  border-color: var(--line);
}

.replay-rank,
.replay-frames,
.replay-date {
  color: var(--muted);
}

.replay-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-score {
  color: var(--p4);
  text-align: right;
}

.replay-hash {
  color: var(--p11);
  text-align: right;
}

.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.tc-dpad {
  position: absolute;
  left: 14px;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 4px;
  pointer-events: none;
}

.tc-actions {
  position: absolute;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.tc-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.tc-btn.down {
  background: color-mix(in srgb, var(--p4) 40%, transparent);
  border-color: var(--p4);
  color: var(--text);
}

.tc-up { grid-area: 1 / 2; }
.tc-left { grid-area: 2 / 1; }
.tc-right { grid-area: 2 / 3; }
.tc-down { grid-area: 3 / 2; }

.tc-a,
.tc-b {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.tc-extra {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-right: 4px;
}

.tc-x,
.tc-y {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 13px;
}

.tc-y {
  margin-top: 26px;
}

.tc-a {
  margin-bottom: 24px;
}

.tc-chev {
  width: 18px;
  height: 18px;
}

.tc-left .tc-chev { transform: rotate(-90deg); }
.tc-right .tc-chev { transform: rotate(90deg); }
.tc-down .tc-chev { transform: rotate(180deg); }

.embed .tc-dpad {
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(3, 42px);
  gap: 3px;
  left: 8px;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

.embed .tc-actions {
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  gap: 8px;
}

.embed .tc-a,
.embed .tc-b {
  width: 46px;
  height: 46px;
  font-size: 13px;
}

.embed .tc-x,
.embed .tc-y {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.embed .tc-y {
  margin-top: 20px;
}

.embed .tc-a {
  margin-bottom: 18px;
}

@media (pointer: coarse) {
  .touch-controls {
    display: block;
  }
}

.run-pane {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.run-pane-bar {
  flex-wrap: nowrap;
  gap: 16px;
  padding: 8px 16px;
}

.run-pane-title {
  color: var(--p4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.run-pane-bar .readout {
  font-size: 12px;
  /* the bar never wraps: under width pressure the stats clip, not the controls */
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  white-space: nowrap;
}

.run-pane-err {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40%;
}

.run-pane-hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.run-pane-bar .spacer {
  flex: 1 1 0;
  min-width: 8px;
}

.run-pane .stage {
  min-height: 0;
}

@media (max-width: 1120px) {
  .editor .bar .btn:not(.primary) .btn-label {
    display: none;
  }

  .editor .bar .btn:not(.primary) {
    padding: 6px 8px;
  }

  .editor .bar .remix-note {
    display: none;
  }
}

@media (max-width: 620px) {
  .editor .bar { gap: 8px; padding: 8px; }
  .editor .bar .actions { flex-wrap: wrap; width: 100%; gap: 6px; }
  .editor .bar .actions .btn, .editor .bar .actions label.btn { min-height: 40px; }
  .editor .bar .actions .primary { margin-left: auto; }
  .editor .tabs { flex-basis: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; }
  .player .bar .tagline {
    display: none;
  }

  .controls .tool-sep {
    display: none;
  }
}

/* cart page (/cart/<hash>) */

.cartpage .stage {
  flex: 0 0 auto;
  /* the game is the point of this page: give the screen most of the viewport
     and let fit() letterbox the canvas inside it */
  min-height: min(72vh, 860px);
  padding: 16px 16px 8px;
}

@media (max-width: 720px) {
  .cartpage .stage {
    min-height: 56vh;
  }
}

.stage:fullscreen {
  background: #000;
  padding: 0;
}

.stage-fs {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
}

.cart-missing {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 16px;
}

.cart-missing-title {
  color: var(--p4);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cart-missing-note {
  color: var(--muted);
  font-size: 12px;
}

.cart-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 16px 0;
}

.cart-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.cart-creator {
  color: var(--p11);
  font-size: 12px;
}

.cart-date {
  color: var(--muted);
  font-size: 12px;
}

.cart-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px 16px;
}

.cart-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 16px;
  width: min(680px, calc(100vw - 48px));
  margin: 8px auto;
}

.cart-tree-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
}

.cart-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-left: 2px solid var(--line);
  border-radius: 0 3px 3px 0;
}

.tree-row.current {
  border-left-color: var(--p4);
}

.tree-name {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.tree-name:hover {
  color: var(--p11);
}

.tree-row.current .tree-name {
  color: var(--p4);
  font-weight: 700;
}

.tree-row.current .tree-name::after {
  content: "_";
  animation: lobby-blink 1.06s steps(1) infinite;
}

.tree-creator {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

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

.comment-form .btn {
  align-self: flex-end;
}

.comment-name {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 8px;
  width: 180px;
}

.comment-text {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 8px;
  resize: vertical;
}

.comment-name:focus,
.comment-text:focus {
  border-color: var(--p10);
  outline: none;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.comment {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.comment-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.comment-author {
  color: var(--p11);
  font-size: 12px;
}

.comment-date {
  color: var(--muted);
  font-size: 11px;
}

.comment-body {
  color: var(--text);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* jam pages (/jams, /jams/<id>) */

.jamspage .player-main {
  align-items: center;
}

.jam-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(680px, calc(100vw - 48px));
  padding: 20px 0;
}

.jam-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jam-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 8px;
}

.jam-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 16px 0;
}

.jam-row {
  display: grid;
  grid-template-columns: 76px minmax(120px, 1fr) minmax(80px, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 14px;
  text-decoration: none;
  text-align: left;
}

.jam-row:hover {
  border-color: var(--p10);
}

.jam-row-title {
  color: var(--p4);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.jam-row-theme {
  color: var(--p11);
  overflow-wrap: anywhere;
}

.jam-row-when {
  color: var(--muted);
  white-space: nowrap;
}

.jam-countdown {
  color: var(--p5);
  font-variant-numeric: tabular-nums;
}

.jam-state {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  justify-self: start;
}

.jam-state.active {
  border-color: var(--p5);
  color: var(--p5);
}

.jam-state.upcoming {
  border-color: var(--p10);
  color: var(--p10);
}

.jam-window {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: center;
  padding: 4px 16px 0;
  font-size: 12px;
}

.jam-seed {
  color: var(--p11);
  font-variant-numeric: tabular-nums;
}

.jam-rules {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.jam-seed-panel {
  gap: 10px;
}

.jam-seed-stage {
  flex: 0 0 auto;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

.jam-submit-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.jam-hash-input {
  width: 150px;
  text-transform: lowercase;
}

.jam-recent {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.jam-recent-label {
  color: var(--muted);
  font-size: 11px;
}

.jam-entries {
  max-height: 420px;
}

.jam-entry-row {
  cursor: default;
}

.jam-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--p5);
  color: var(--p5);
  text-decoration: none;
  white-space: nowrap;
}

a.jam-badge:hover {
  border-color: var(--p4);
  color: var(--p4);
}

@media (max-width: 620px) {
  .jam-row {
    grid-template-columns: 76px minmax(120px, 1fr) auto;
  }

  .jam-row-theme {
    grid-column: 2 / 4;
    grid-row: 2;
  }
}

/* share modal (the share moment) */
.share-modal {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-modal-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.share-name-input {
  background: #14162a;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}

.share-name-input:focus {
  outline: none;
  border-color: var(--p10);
}

.share-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.share-modal-link {
  color: var(--p11);
  font-size: 13px;
  word-break: break-all;
}

.shortcut-guide {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 10px;
  font-size: 13px;
}

/* run errors: shown over the game area, not only in the top bar */
.screen-err {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 16px);
  background: rgba(26, 28, 44, 0.92);
  border: 1px solid var(--p2);
  border-radius: 4px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}

.screen-err-title {
  color: var(--p2);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.screen-err-msg {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

/* agent modal + lobby shelf */
.agent-modal {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-field-label {
  color: var(--p4);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agent-key {
  background: #14162a;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

.agent-connect-url {
  background: #14162a;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--p11);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

.agent-instructions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.agent-cli {
  background: #14162a;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

.agent-hint {
  color: var(--muted);
  font-size: 12px;
}

.agent-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.agent-shelf {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-shelf-list {
  display: grid;
  gap: 6px;
}

.agent-shelf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  background: var(--panel);
}

.agent-shelf-name {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.agent-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1px dashed var(--p14);
  background: transparent;
  border-radius: 6px;
  padding: 14px 16px;
  cursor: pointer;
  width: 100%;
  font: inherit;
}

.agent-card:hover {
  border-color: var(--p10);
}

.agent-card-title {
  font-size: 13px;
  color: var(--text);
}

.agent-card-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Local projects and recoverable revisions. */
.project-name-row { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px;border-bottom:1px solid var(--slate,#333c57);font:11px var(--mono,monospace); }
.project-name-row label {display:flex;align-items:center;gap:9px;min-width:0;}
.project-name-row input {background:transparent;color:var(--white,#f4f4f4);border:1px solid var(--steel,#566c86);padding:5px 8px;font:inherit;width:230px;max-width:55vw;}
.projects-modal {width:min(780px,calc(100vw - 32px));max-height:85vh;overflow-y:auto;}
.projects-heading {display:flex;align-items:center;justify-content:space-between;gap:20px;}
.project-list {display:grid;gap:12px;margin-top:18px;}
.project-row {display:flex;align-items:center;flex-wrap:wrap;gap:10px;border:1px solid var(--steel,#566c86);padding:14px;}
.project-row>div:first-child {display:flex;flex-direction:column;gap:6px;flex:1;min-width:160px;overflow-wrap:anywhere;}
.project-row strong {font-size:13px;}.project-row .dim {font-size:10px;}
.project-history {width:100%;display:grid;gap:8px;border-top:1px solid var(--steel,#566c86);padding-top:12px;font-size:11px;}
.project-history>div {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;}
@media(max-width:700px){.project-name-row>span{display:none;}.project-row{padding:10px;}}

/* code-tab autocomplete */
.ac-menu {
  position: absolute;
  z-index: 30;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  min-width: 120px;
  max-height: 196px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ac-item {
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.ac-item.g {
  color: var(--p11);
}

.ac-item.sel {
  background: var(--p9);
  color: var(--p12);
}

/* sfx keyboard-entry focus ring */
.sfx-edit:focus-visible {
  outline: 1px solid var(--p10);
  outline-offset: 4px;
  border-radius: 4px;
}

/* run-pane lua repl (immediate mode in the live vm) */

.run-console {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  max-height: 220px;
}

.run-console-note {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-console-out {
  overflow-y: auto;
  padding: 6px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  min-height: 24px;
  white-space: pre-wrap;
  word-break: break-all;
}

.repl-in {
  color: var(--muted);
}

.repl-in::before {
  content: "> ";
}

.repl-out {
  color: var(--text);
}

.repl-err {
  color: var(--p2);
}

.run-console-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
  border-top: 1px solid var(--line);
}

.repl-prompt {
  color: var(--p4);
  font-family: var(--mono);
  font-size: 12px;
}

.run-console-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
}

.run-console-input:focus {
  outline: none;
  border-color: var(--p4);
}

/* lobby search + favorites */

.lobby-search {
  margin: 10px 4px 4px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.lobby-search:focus {
  outline: none;
  border-color: var(--p4);
}

.lobby-fav-section {
  margin-bottom: 14px;
}

.lobby-fav-section .lobby-title,
.lobby-all-section .lobby-title {
  display: block;
  margin: 6px 0;
}

.lobby-fav {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: rgba(26, 28, 44, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  z-index: 1;
}

.lobby-fav .icon {
  width: 12px;
  height: 12px;
}

.lobby-fav:hover {
  color: var(--p4);
  border-color: var(--p4);
}

.lobby-fav.on {
  color: var(--p4);
  border-color: var(--p4);
}

/* sfx waveform + music per-channel strips */

.wavestrip {
  border: 1px solid var(--line);
  border-radius: 4px;
  image-rendering: pixelated;
}

.music-strips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.music-strip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-strip-label {
  width: 86px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.chstrip {
  border: 1px solid var(--line);
  border-radius: 3px;
  image-rendering: pixelated;
  max-width: 100%;
}

/* sprites tab png import dialog */

.sheet-import-modal {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-import-modal .imp-preview {
  image-rendering: pixelated;
  max-width: 100%;
  align-self: flex-start;
}

.sheet-import-modal .imp-start {
  width: 72px;
  margin-left: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 6px;
}

.sheet-import-modal .imp-start:focus {
  outline: none;
  border-color: var(--p4);
}

.game-save-controls { font-size: 12px; max-width: 42rem; padding: 8px; }
.game-save-controls summary { cursor: pointer; }
.game-save-controls .btn { margin: 3px; }
.game-save-controls p { line-height: 1.5; }
.stage { min-width: 0; min-height: 0; }
.screen-wrap { flex-shrink: 0; }

.cart-report { margin: 1rem 0; }
.cart-report summary { cursor: pointer; }
.cart-report textarea { display: block; width: 100%; min-height: 6rem; margin: .5rem 0; }
