@font-face { font-family: Monocraft; src: url("/font.ttf") format("truetype"); font-display: swap; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f3f2ed; color: #262c2e; font: 13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button { border: 1px solid #d5d6d0; background: #fafaf6; color: #313839; border-radius: 4px; padding: 7px 11px; font-size: 12px; }
button:hover { background: #e9e9e1; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #b94730; outline-offset: 2px; }
header { height: 58px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); grid-template-areas: "examples brand download"; align-items: center; padding: 0 25px; gap: 22px; background: #202224; color: #eee8db; border-bottom: 1px solid #444642; }
.brand img { width: 55px; height: 35px; object-fit: contain; }
.brand { grid-area: brand; justify-self: center; display: inline-flex; align-items: center; gap: 9px; color: #ffd6b7; text-decoration: none; font: 24px/1 Monocraft,monospace; letter-spacing: -.075em; }
header select { grid-area: examples; justify-self: start; max-width: 210px; min-width: 0; background: #202224; color: #e3e2d7; border: 0; padding: 6px; }
#download-world { grid-area: download; justify-self: end; border: 0; border-left: 1px solid #53544e; border-radius: 0; padding: 4px 0 4px 18px; color: #ffcfad; background: none; }
#download-world:enabled:hover { text-decoration: underline; }
main { height: calc(100dvh - 58px); min-height: 450px; display: grid; grid-template-columns: clamp(315px,33vw,520px) minmax(0,1fr); }
.source-panel { background: #202224; color: #eee8db; border-right: 1px solid #444642; padding: 19px 17px; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; }
h1 { margin: 0; font: 18px/1.5 Monocraft,monospace; }
.source-tabs { margin-top: 10px; border-bottom: 1px solid #53544e; }
.source-tabs label { display: inline-block; padding: 9px 6px; color: #ffb387; border-bottom: 2px solid #ffb387; }
.editor { flex: 1; min-height: 140px; position: relative; color: #f4ecdf; background: #191b1d; margin: 12px 0 14px; border: 1px solid #4b4b48; border-radius: 3px; overflow: hidden; }
.editor:focus-within { outline: 1px solid #bc8c68; outline-offset: -1px; }
#line-numbers, #source-editor, #highlight { margin: 0; white-space: pre; font: 13px/1.85 Monocraft,monospace; font-variant-ligatures: none; letter-spacing: 0; tab-size: 2; }
#line-numbers { position: absolute; inset: 0 auto 0 0; width: 3.4ch; overflow: hidden; color: #93958e; text-align: right; padding: 12px 5px 12px 0; user-select: none; }
.code-area { position: absolute; inset: 0 0 0 3.4ch; font: 13px Monocraft,monospace; }
#highlight, #source-editor { position: absolute; inset: 0; width: 100%; height: 100%; padding: 12px 10px; border: 0; scrollbar-gutter: stable; }
#highlight { overflow: hidden; pointer-events: none; }
#source-editor { overflow: auto; resize: none; background: transparent; color: transparent; caret-color: #ffe4b6; outline: 0; }
#source-editor::selection { background: #b5906166; }
.kw { color: #ff9d75; } .operator { color: #9ed4cd; } .literal { color: #f4d783; } .comment { color: #a7aaa2; }
@media (forced-colors: active) { #highlight { visibility: hidden; } #source-editor { color: CanvasText; caret-color: CanvasText; } }
.setting { display: flex; align-items: center; gap: 11px; padding-top: 12px; border-top: 1px solid #484a48; color: #c2c3b9; font-size: 12px; }
.setting input { background: #2c2f30; color: #eee8db; border: 1px solid #565952; border-radius: 3px; width: 95px; padding: 5px 7px; }
.primary { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; font: 14px Monocraft,monospace; background: #ffae82; border-color: #ffae82; color: #231d19; padding: 10px 12px; }
.primary:hover { background: #ffc19f; }
#compile-status { margin-top: 9px; font-size: 12px; color: #c2c3b9; }
#compile-error { color: #ffac99; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 150px; }
.scene-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #e7eae3; }
.scene-toolbar { height: 50px; flex-shrink: 0; display: flex; align-items: center; padding: 8px 13px; gap: 7px; background: #f5f6ef; border-bottom: 1px solid #d9ddd2; }
.segmented, .zoom { display: flex; }
.segmented button, .zoom button { border-radius: 0; }
.segmented button:first-child, .zoom button:first-child { border-radius: 3px 0 0 3px; }
.segmented button:last-child, .zoom button:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
.segmented [aria-pressed=true] { background: #e3e5dd; border-color: #b7bdb4; }
.zoom { margin-left: auto; }
#viewer { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#design-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; outline-offset: -4px; }
#design-canvas:active { cursor: grabbing; }
#viewer-empty { position: absolute; top: 46%; width: 100%; text-align: center; color: #53614e; pointer-events: none; }
.caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 9px 13px; background: #f5f6ef; color: #54604e; font-size: 11px; border-top: 1px solid #d9ddd2; }
#view-stats { color: #354334; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  header { height: auto; min-height: 54px; padding: 8px; gap: 6px; }
  header .brand { font-size: 17px; gap: 6px; } header .brand img { width: 40px; height: 28px; } header select { max-width: 132px; font-size: 12px; }
  #download-world { font-size: 11px; padding-left: 5px; }
  main { height: auto; min-height: 0; grid-template-columns: minmax(0,1fr); }
  .source-panel { height: 55dvh; min-height: 360px; padding: 12px; }
  .scene-panel { height: 58dvh; min-height: 350px; }
}

@media (max-width: 525px) {
  header { grid-template-columns: 1fr 1fr; grid-template-areas: "brand brand" "examples download"; }
}

.demo-worlds { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; border-top: 1px solid #53544e; margin-top: 14px; padding-top: 12px; }
.demo-worlds strong { font-weight: 500; color: #c1bfb5; }
.demo-worlds a { color: #ffcfad; text-underline-offset: 3px; }
