:root {
  color-scheme: dark;
  --bg: #151516;
  --panel: #222325;
  --raised: #303133;
  --line: #393a3d;
  --ink: #f4f3ee;
  --muted: #b9bab9;
  --accent: #f5bb70;
  --deep: #333436;
  --mint: #aacea7;
  --danger: #ffb2b1;
  --display: "Bricolage Grotesque","DM Sans",sans-serif;
  font: 16px/1.45 "DM Sans",system-ui,sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.room-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: .78rem;
  color: var(--muted);
}

.room-picker select,.hub-room-select {
  min-height: 34px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  font-size: .78rem;
  color: var(--ink);
}

.room-picker select:focus-visible,.hub-room-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.room-id {
  display: block;
  color: var(--mint);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .room-picker label { display: none; }
  .room-picker select { max-width: 126px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

button,a,input,select,textarea {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

button:disabled {
  opacity: .45;
  cursor: default;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none!important;
}

h1,h2,h3,p,figure {
  margin: 0;
}

h1,h2,h3,.wordmark {
  font-family: var(--display);
}

h1,h2 {
  letter-spacing: -.04em;
  line-height: 1.1;
}

button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  font-weight: 650;
}

button:hover:enabled {
  filter: brightness(1.14);
}

.button,.icon-button,.small-icon-button,.zoom-readout,.scene-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}

.button-primary,.button-publish {
  background: var(--accent);
  color: #292117;
  border-color: transparent;
}

.button-quiet {
  background: transparent;
}

.icon-button,.small-icon-button {
  width: 44px;
  padding: 0;
}

.is-active.icon-button {
  border-color: var(--accent);
  color: var(--accent);
}

.visually-hidden,.tile-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 26px;
  letter-spacing: -.065em;
  font-weight: 800;
  white-space: nowrap;
}

.brand-suffix {
  color: var(--accent);
}

.builder-mark { width: 36px; height: 36px; flex: none; object-fit: contain; }
body.gstratch-studio-page #top-right-auth-region { display: none !important; }
body.gstratch-hosted-game #top-right-auth-region #connection-status { display: none !important; }

.site-head,.dashboard-header,.studio-header {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.auth-gate,.dashboard {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 15% 80%,#30273d,transparent 60%),var(--bg);
}

.welcome-layout {
  width: min(1160px,100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(310px,.9fr);
  gap: clamp(32px,5vw,88px);
  align-items: center;
  padding: clamp(34px,7vh,96px) 28px;
}

.welcome-copy h1,.dashboard-heading h1 {
  font-size: clamp(44px,6vw,88px);
  font-weight: 800;
  letter-spacing: -.075em;
}

.welcome-copy>p {
  max-width: 36ch;
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: clamp(17px,1.65vw,22px);
}

.starter-art {
  overflow: hidden;
  position: relative;
  border-radius: 18px;
  border: 1px solid #595169;
  box-shadow: 8px 8px 0 #332c42;
}

.starter-art img {
  width: 100%;
  height: auto;
  display: block;
}

.starter-art figcaption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  border-radius: 6px;
  background: #1c2632ed;
  padding: 5px 12px;
  font-size: 14px;
}

.account-card,.dialog,.worlds-drawer {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.account-card h2,.dialog h2 {
  margin: 20px 0;
  font-size: 34px;
}

.auth-tabs,.scene-buttons,.dialog-actions,.copy-row,.dashboard-actions,.header-actions,.canvas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-tabs button {
  min-height: 43px;
  padding: 6px 12px;
  font-size: 15px;
}

.auth-tabs {
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.auth-tabs button {
  border: 0;
  background: transparent;
  padding: 6px 0;
  border-radius: 0;
  color: var(--muted);
}

.auth-tabs [aria-pressed=true] {
  color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
}

form label,.panel-section>label,.field-label {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  margin: 12px 0 6px;
}

input:not([type=checkbox],[type=radio],[type=range]),select,textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid #545557;
  border-radius: 8px;
  padding: 9px 12px;
  background: #222325;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input[type=checkbox],input[type=radio],input[type=range] {
  accent-color: var(--accent);
}

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

.consent input {
  margin-top: 5px;
}

.account-card .button-primary {
  width: 100%;
  margin-top: 20px;
}

.account-card p,.form-error {
  margin-top: 14px;
}

.form-error,.danger {
  color: var(--danger);
}

.loading-state {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 10px;
}

.dashboard-header,.studio-header {
  justify-content: space-between;
}

.dashboard-main {
  width: min(1160px,100%);
  margin: 0 auto;
  padding: 52px 28px;
}

.dashboard-heading,.panel-heading,.inspector-heading,.drawer-header,.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-heading {
  margin-bottom: 28px;
}

.world-count,.account-name,.panel-count,.instruction,.panel-hint,.field-caption,.inspector-footer,#region-bounds {
  color: var(--muted);
}

.world-list {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(235px,1fr));
  gap: 16px;
}

.world-card,.world-empty {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

.world-card {
  position: relative;
  padding: 0 16px 16px;
}

.world-card-open {
  display: block;
  height: 115px;
  width: calc(100% + 32px);
  margin: 0 -16px 16px;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(45deg,#514168 0 8px,#413452 8px 16px);
  color: #eee0ff;
  font-size: 28px;
}

.world-card-open:after {
  content: "";
  position: absolute;
  inset: 0;
}

.world-card h2 {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.world-card-meta {
  margin-top: 8px;
  color: var(--muted);
}

.world-empty {
  padding: 36px;
  background: linear-gradient(100deg,#242230 35%,#24223080),url(starter.webp) center/cover;
}

.world-empty>*+* {
  margin-top: 14px;
}

.empty-map-mark,.dialog-mark {
  color: var(--accent);
  font-size: 24px;
}

.studio {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-header {
  justify-content: start;
  flex: none;
  gap: 16px;
}

.world-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 28vw;
  padding: 9px 14px;
  min-height: 42px;
}

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

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--muted);
}

.save-indicator,.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

.save-state[data-state=saving] .save-indicator {
  background: #ffcf88;
}

.save-state[data-state=error] .save-indicator {
  background: var(--danger);
}

.header-actions {
  margin-left: auto;
}

.action-divider {
  height: 24px;
  border-left: 1px solid var(--line);
  margin: 0 3px;
}

.tool-rail {
  padding: 5px clamp(8px, 2vw, 24px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  flex: none;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
}

.rail-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  min-height: 36px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
}

.rail-tool:focus-visible {
  outline-offset: -2px;
}

.rail-tool i {
  color: var(--accent);
}

.rail-tool[data-panel=objects] i {
  color: #f1b88c;
}

.rail-tool[data-panel=regions] i {
  color: var(--mint);
}

.rail-tool[data-panel=hud] i {
  color: #8fc9fe;
}

.rail-tool[data-panel=logic] i {
  color: #ffcb74;
}

.rail-tool[aria-pressed=true] {
  border-color: #74624e;
  background: #403a33;
  color: var(--ink);
}

.rail-tool[data-tool][aria-pressed=true] {
  border-color: transparent;
  background: var(--accent);
  color: #292117;
}

.rail-tool[data-tool][aria-pressed=true] i {
  color: inherit;
}

.studio-body {
  display: grid;
  grid-template-columns: clamp(264px,23vw,344px) minmax(0,1fr);
  min-height: 0;
  flex: 1;
  position: relative;
}

.tool-panel {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  scrollbar-color: #57585a transparent;
}

.panel-heading,.inspector-heading {
  padding: 22px 18px 16px;
}

.panel-heading h1,.inspector-heading h1 {
  font-size: 30px;
}

.panel-heading>span {
  font-size: 14px;
  color: var(--muted);
}

.panel-section,.inspector-section {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.section-title {
  margin-bottom: 10px;
}

.section-title h2 {
  font-size: 19px;
}

.layer-list {
  display: grid;
  gap: 4px;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 43px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
}

.layer-select {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  min-height: 41px;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.layer-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-visibility {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.layer-row.is-hidden .layer-symbol,
.layer-row.is-hidden .layer-select strong {
  color: var(--muted);
  opacity: .62;
}

.layer-select strong {
  font-size: 15px;
}

.layer-select small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.layer-row.is-active {
  border-color: #76644c;
  background: #403b35;
}

.layer-symbol,.selection-label {
  color: var(--accent);
}

.layer-opacity,.brush-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin: 14px 0;
  font-size: 14px;
}

.brush-range {
  margin-top: 0;
}

.layer-opacity input,.brush-range input {
  grid-column: span 2;
  width: 100%;
  margin: 2px 0;
  height: 24px;
}

.tile-palette {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 5px;
  max-height: 340px;
  overflow: auto;
  margin: 10px 0;
}

.tile-choice {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border-radius: 5px;
  background: #1a1a23;
}

.tile-sample {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url('/tilesheet_complete.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.erase-sample { background: linear-gradient(45deg, transparent 48%, #868681 49% 51%, transparent 52%); }
.tile-number {
  position: absolute;
  bottom: 0;
  right: 0;
  color: white;
  background: #181818d9;
  font-size: 10px;
  padding: 0 3px;
}

.tile-choice.is-active,.object-library button[aria-pressed=true] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.panel-hint,.instruction,.field-caption {
  font-size: 14px;
  line-height: 1.5;
}

.tool-panel .button {
  margin-top: 12px;
}

.object-library {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  margin-top: 12px;
}

.object-library button {
  display: grid;
  grid-template-rows: 48px auto;
  place-items: center;
  gap: 5px;
  padding: 7px;
  background: #323335;
  font-size: 14px;
}

.object-library img {
  max-width: 58px;
  max-height: 44px;
}

.scene-buttons {
  margin-top: 12px;
}

.scene-buttons button {
  flex: 1;
}

.map-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #1b1c1d;
}

.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #292a2c;
}

.canvas-mode {
  font-size: 14px;
  color: var(--muted);
}

.canvas-controls {
  gap: 4px;
  margin-left: auto;
}

.canvas-controls button {
  border-color: transparent;
  background: #303133;
}

.canvas-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#map-canvas.is-pan {
  cursor: grab;
}

#map-canvas.is-dragging {
  cursor: grabbing;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.canvas-empty {
  display: grid;
  place-content: center;
  color: var(--muted);
}

.canvas-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 5px 14px;
  background: #1b1c1d;
  font-size: 13px;
  color: var(--muted);
}

.statusbar-spacer {
  flex: 1;
}

.network-status {
  color: var(--mint);
}

.studio.is-focused .tool-panel {
  display: none;
}

.studio.is-focused .studio-body {
  grid-template-columns: 1fr;
}

.tool-pane .danger,.inspector-footer {
  margin: 12px 18px;
}

.inspector-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.property-row,.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.property-row,.setting-row {
  min-height: 44px;
}

.setting-row small {
  display: block;
  color: var(--muted);
}

.setting-row input {
  width: 22px;
  height: 22px;
}

.switch {
  display: none;
}

.color-swatches {
  display: flex;
  gap: 12px;
}

.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--swatch);
}

.color-swatch.is-active {
  outline: 3px solid var(--ink);
}

.logic-node {
  background: #333435;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.logic-node {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logic-node small,.logic-node strong {
  display: block;
}

.logic-node small {
  color: var(--accent);
  font-size: 12px;
}

.logic-connector {
  height: 16px;
  margin-left: 24px;
  border-left: 2px solid var(--accent);
}

.dialog-backdrop,.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #101018bf;
}

.dialog,.worlds-drawer {
  width: min(460px,100%);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 16px 80px #0007;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

.starter-options {
  margin: 15px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.starter-options label {
  margin: 4px 0 9px;
}

.drawer-world {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 8px 0;
  min-height: 46px;
  padding: 8px 12px;
}

.drawer-world.is-active {
  border-color: var(--accent);
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
}

.toast-region {
  position: fixed;
  bottom: 44px;
  right: 15px;
  z-index: 25;
}

.toast {
  background: #343537;
  border-radius: 10px;
  border: 1px solid #555658;
  padding: 10px 14px;
  max-width: min(380px,85vw);
}

.toast.is-error {
  color: var(--danger);
}

.toast button {
  margin-left: 10px;
}

.network-status.is-error {
  color: var(--danger);
}

.source-chip,.section-kicker {
  display: none;
}

.release-state {
  font-size: 14px;
  color: var(--mint);
}

.color-swatch[data-accent="#d49a45"] {
  --swatch: #d49a45;
}

.color-swatch[data-accent="#4f7468"] {
  --swatch: #4f7468;
}

.color-swatch[data-accent="#b95a4c"] {
  --swatch: #b95a4c;
}

.color-swatch[data-accent="#6c92a4"] {
  --swatch: #6c92a4;
}

@media(max-width:1100px) {
  .canvas-mode {
    display: none;
  }
  .studio-header {
    gap: 10px;
  }
  .wordmark {
    font-size: 23px;
  }
  .studio-body {
    grid-template-columns: 258px minmax(0,1fr);
  }
  .studio.is-focused .studio-body {
    grid-template-columns: 1fr;
  }
  .canvas-toolbar {
    justify-content: flex-start;
  }
  .canvas-controls {
    margin-left: auto;
  }
}

@media(max-width:760px) {
  .welcome-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 18px;
  }
  .welcome-copy>p {
    margin: 10px 0 18px;
  }
  .starter-art img {
    max-height: 180px;
    object-fit: cover;
  }
  .account-card {
    padding: 20px;
  }
  .site-head,.studio-header,.dashboard-header {
    padding: 10px 12px;
    min-height: 58px;
  }
  .studio-header {
    flex-wrap: wrap;
    gap: 7px;
  }
  .studio-brand {
    flex: 1;
  }
  .studio-header .builder-mark { width: 28px; height: 28px; }
  .header-actions {
    width: 100%;
    margin: 0;
  }
  .header-actions .button-publish {
    margin-left: auto;
  }
  .world-switcher {
    max-width: 42vw;
  }
  .save-state {
    font-size: 12px;
  }
  .revision-label {
    display: none;
  }
  .studio-body {
    display: flex;
    flex-direction: column;
  }
  .map-workspace {
    flex: 1;
  }
  .tool-panel {
    display: none;
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    width: min(350px,88%);
    max-height: min(62dvh,530px);
    border: 1px solid var(--line);
    border-radius: 0 0 12px 0;
    box-shadow: 4px 8px 24px #0008;
  }
  .tool-panel.is-open {
    display: block;
  }
  .canvas-toolbar {
    padding: 5px 7px;
    gap: 4px;
  }
  .canvas-controls {
    gap: 2px;
  }
  .canvas-controls button {
    min-height: 40px;
    width: 38px;
  }
  .canvas-controls .zoom-readout {
    width: auto;
    padding: 0 5px;
  }
  .canvas-controls .action-divider {
    display: none;
  }
  .canvas-statusbar {
    font-size: 12px;
    gap: 6px;
  }
  .dashboard-header {
    flex-wrap: wrap;
  }
  .account-name {
    display: none;
  }
  .dashboard-main {
    padding: 32px 16px;
  }
  .world-count {
    font-size: 14px;
  }
  .network-status i {
    display: none;
  }
}

@media(max-width:470px) {
  .canvas-toolbar {
    justify-content: space-between;
  }
  .canvas-controls button {
    width: 33px;
  }
  .header-actions .button,.header-actions .icon-button {
    min-height: 41px;
  }
  .dashboard-actions .button {
    padding: 0 10px;
  }
}

.cue {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #ffcb74;
  border-radius: 10px;
}
.cue legend { padding: 0 5px; font-weight: 700; }
.cue label { display: block; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.cue input { margin-top: 4px; }

.game-interface { position: absolute; inset: 0; z-index: 2; overflow: hidden; }

.developer-modes { display: flex; gap: 4px; align-items: center; padding: 6px 20px; border-bottom: 1px solid var(--line); background: #252628; overflow-x: auto; flex: none; }
.developer-modes button { flex: none; min-height: 38px; padding: 7px 13px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); background: transparent; white-space: nowrap; }
.developer-modes i { margin-right: 6px; }
.developer-modes button[aria-pressed="true"] { border-color: #5b5549; color: var(--ink); background: #3b3832; }
.studio.mode-play .tool-panel { display: none; }
.studio.mode-play {
  position: fixed;
  z-index: 30;
  inset: 0;
  height: 100dvh;
  background: #171819;
}
.studio.mode-play .studio-header,
.studio.mode-play .developer-modes,
.studio.mode-play .canvas-toolbar,
.studio.mode-play .canvas-statusbar { display: none; }
.studio.mode-play .studio-body { display: grid; grid-template-columns: minmax(0,1fr); flex: 1; min-height: 0; }
.studio.mode-play .map-workspace { width: 100%; height: 100%; min-height: 0; }
.studio.mode-play .canvas-viewport { min-height: 0; }
.studio.mode-play .canvas-controls #zoom-out,
.studio.mode-play .canvas-controls #zoom-readout,
.studio.mode-play .canvas-controls #zoom-in,
.studio.mode-play .canvas-controls #pan-mode,
.studio.mode-play .canvas-controls .action-divider { display: none; }
body.gstratch-studio-game-mode #top-right-auth-region { display: none !important; }
.color-swatch[data-accent="#8faec7"] { --swatch: #8faec7; }
.game-interface[hidden] { display: none; }
@media (max-width: 760px) {
  .developer-modes { padding: 5px 8px; gap: 3px; }
  .developer-modes button { min-height: 36px; padding: 5px 6px; font-size: 13px; }
  .developer-modes i { margin-right: 4px; }
}

#map-canvas:focus-visible { outline: 0; }
.canvas-viewport:has(#map-canvas:focus-visible)::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  pointer-events: none;
}
.canvas-statusbar, .zoom-readout, .revision-label { font-variant-numeric: tabular-nums; }
.studio-header { min-height: 60px; padding: 8px clamp(12px, 2vw, 26px); background: #242526; }
.studio-header .icon-button, .canvas-controls .icon-button, .small-icon-button { width: 38px; min-height: 38px; }
.revision-label { color: #aaa; }
.panel-heading h1, .inspector-heading h1 { font-size: 26px; }
.panel-section > .setting-row { display: flex; margin: 0; }
.setting-row input { flex: none; }
.layer-select:focus-visible, .tile-choice:focus-visible { outline-offset: -2px; }

.close-tools { display: none; }
@media (max-width: 760px) {
  .tool-panel { max-height: min(100%, 62dvh, 530px); overscroll-behavior: contain; }
  .tool-panel .panel-heading, .tool-panel .inspector-heading { padding-right: 54px; }
  .close-tools { display: grid; place-items: center; position: absolute; top: 12px; right: 10px; width: 36px; height: 36px; }
}
:root {
  --gstratch-code-bg: #121315;
}
#data-detail {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  color: #e1e0db;
  background: var(--gstratch-code-bg);
}
#data-detail header { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#data-title { font-size: 19px; overflow-wrap: anywhere; }
#data-json { margin: 10px 0 0; flex: 1; min-height: 0; overflow: auto; font: 13px/1.6 ui-monospace, monospace; tab-size: 2; }
.data-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.data-controls > input { flex: 1; min-width: 0; }
.data-controls label { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
#record-actions { padding: 10px 0; border-bottom: 1px solid var(--line); }
#record-actions select, #record-actions input { max-width: min(40vw, 220px); }
#record-editor { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
#record-json { flex: 1; min-height: 64px; resize: none; font: 13px/1.6 ui-monospace, monospace; tab-size: 2; }
#record-status { margin: 0; }
#data-record { height: 165px; }
#source-repositories { margin: 18px 0 0; font-size: 14px; }
#source-repositories summary { cursor: pointer; }
#source-repositories ul { list-style: none; padding: 0; }
#source-repositories li { margin-bottom: 6px; }
.studio.mode-data .canvas-toolbar, .studio.mode-data .canvas-statusbar { display: none; }
#entity-transform fieldset { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
#entity-transform legend { padding: 0 5px; font-size: 14px; }
#entity-transform label { font-size: 13px; margin: 0; min-width: 0; }
#entity-transform button { align-self: end; }
#entity-count, #data-count { font-size: 13px; color: var(--muted); margin: 8px 0; }
#brush-shape { margin-bottom: 12px; }
