:root {
  --bg: #0b100d;
  --panel: #111814;
  --panel-2: #151f19;
  --panel-3: #0e1511;
  --border: #28352d;
  --border-strong: #3b4e41;
  --text: #f2f7f3;
  --muted: #9eafa3;
  --muted-2: #6f8175;
  --accent: #7ee787;
  --accent-strong: #43c95b;
  --danger: #ff7b72;
  --warning: #f2cc60;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% -20%, rgba(74, 222, 128, .09), transparent 35rem), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.site-header { height: 68px; padding: 0 clamp(18px, 4vw, 52px); border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; justify-content: space-between; background: rgba(11,16,13,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { color: var(--text); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #071108; display: grid; place-items: center; }
.brand-mark svg { width: 21px; fill: currentColor; }
.github-link { text-decoration: none; color: var(--text); height: 38px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.github-link:hover { border-color: var(--border-strong); background: var(--panel-2); }
.github-link svg { width: 18px; fill: currentColor; }

main { width: min(1480px, calc(100% - 36px)); margin: 0 auto; }
.intro { padding: 48px 0 25px; }
.intro h1 { margin: 0; font-size: clamp(31px, 4vw, 48px); line-height: 1.06; letter-spacing: -.045em; }
.intro p { margin: 13px 0 0; max-width: 820px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.intro code { color: #b8f3bd; font-size: .94em; }

.generator-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr); gap: 18px; align-items: start; }
.controls-panel, .preview-panel { min-width: 0; }
.controls-panel { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(17,24,20,.93); box-shadow: var(--shadow); overflow: hidden; }
.control-section { padding: 23px; border-bottom: 1px solid var(--border); }
.control-section:last-child { border-bottom: 0; }
.control-section-primary { padding-top: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 17px; }
.simple-heading { margin-bottom: 14px; }
.section-heading h2, .preview-header h2, .below-tool h2 { margin: 3px 0 0; font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .105em; color: var(--accent); font-size: 10px; font-weight: 800; }
.compact-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.compact-field select { width: 104px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .compact-field > span { font-size: 12px; font-weight: 700; color: #b8c5bc; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted-2); }
.field small { color: var(--muted-2); line-height: 1.4; font-size: 11px; }
.full-field { width: 100%; }
input, select { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-3); color: var(--text); padding: 0 11px; transition: border-color .15s, background .15s, box-shadow .15s; }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus { border-color: #4f7659; background: #111b15; box-shadow: 0 0 0 3px rgba(126,231,135,.08); }
input::placeholder { color: #59675e; }
select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,#74867a 50%),linear-gradient(135deg,#74867a 50%,transparent 50%); background-position: calc(100% - 15px) 18px,calc(100% - 11px) 18px; background-size: 4px 4px,4px 4px; background-repeat: no-repeat; padding-right: 30px; }
.input-with-icon { position: relative; }
.input-with-icon svg { position: absolute; width: 17px; left: 12px; top: 12px; fill: none; stroke: var(--muted-2); stroke-width: 1.7; }
.input-with-icon input { padding-left: 37px; }
.axis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-column-section { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.rotation-grid { margin-bottom: 10px; }
.custom-axis { margin-top: 10px; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 30px; }
.suffix-input span { position: absolute; right: 12px; top: 10px; color: var(--muted); }
.toggle-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; user-select: none; }
.toggle-control input { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.block-states { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.block-states:empty { display: none; }
.custom-states-field { margin-top: 14px; }
.entity-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.secondary-button { height: 42px; padding: 0 17px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: #c7d3ca; font-weight: 700; }
.secondary-button:hover { background: var(--panel-2); border-color: var(--border-strong); }

.preview-panel { position: sticky; top: 86px; display: grid; gap: 12px; }
.preview-card, .command-card, .status-panel { border: 1px solid var(--border); background: rgba(17,24,20,.94); border-radius: var(--radius); }
.preview-card { padding: 20px; overflow: hidden; }
.preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.preview-header h2 { max-width: 330px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.version-chip { border: 1px solid #31533a; color: #a5edae; background: rgba(67,201,91,.08); border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.scene { height: 290px; margin: 17px 0; position: relative; overflow: hidden; border-radius: 12px; border: 1px solid rgba(255,255,255,.06); background: radial-gradient(circle at 50% 35%, #1d2b22 0, #0d1410 58%, #090d0b 100%); perspective: 680px; }
.floor-grid { position: absolute; left: -35%; right: -35%; height: 210px; bottom: -100px; transform: rotateX(65deg); transform-origin: center top; background-image: linear-gradient(rgba(126,231,135,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(126,231,135,.1) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), transparent 75%); }
.origin-dot { width: 7px; height: 7px; position: absolute; left: calc(50% - 3px); top: calc(58% - 3px); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(126,231,135,.1),0 0 20px rgba(126,231,135,.7); z-index: 1; }
.cube-wrap { --cube-size: 116px; --block-hue: 115; position: absolute; width: var(--cube-size); height: var(--cube-size); left: calc(50% - var(--cube-size)/2); top: calc(50% - var(--cube-size)/2 - 10px); transform-style: preserve-3d; transition: transform .16s ease; }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-24deg) rotateY(34deg); }
.cube-face { position: absolute; inset: 0; border: 1px solid hsla(var(--block-hue),35%,76%,.18); background-color: hsl(var(--block-hue), 28%, 42%); background-image: linear-gradient(45deg,rgba(255,255,255,.045) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.045) 75%),linear-gradient(45deg,rgba(255,255,255,.045) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.045) 75%); background-size: 26px 26px; background-position: 0 0,13px 13px; box-shadow: inset 0 0 35px rgba(0,0,0,.12); }
.cube-face.front { transform: translateZ(calc(var(--cube-size)/2)); filter: brightness(1.03); }
.cube-face.back { transform: rotateY(180deg) translateZ(calc(var(--cube-size)/2)); filter: brightness(.75); }
.cube-face.right { transform: rotateY(90deg) translateZ(calc(var(--cube-size)/2)); filter: brightness(.85); }
.cube-face.left { transform: rotateY(-90deg) translateZ(calc(var(--cube-size)/2)); filter: brightness(.7); }
.cube-face.top { transform: rotateX(90deg) translateZ(calc(var(--cube-size)/2)); filter: brightness(1.18); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size)/2)); filter: brightness(.65); }
.transform-readout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.transform-readout > div { min-width: 0; padding: 10px 11px; background: #0d1410; border: 1px solid rgba(255,255,255,.05); border-radius: 9px; display: grid; gap: 4px; }
.transform-readout span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.transform-readout strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #d9e6dc; }
.status-panel { padding: 13px 15px; display: flex; align-items: center; gap: 11px; border-radius: 12px; }
.status-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(126,231,135,.12); color: var(--accent); font-weight: 900; }
.status-panel > div { display: grid; gap: 2px; }
.status-panel strong { font-size: 12px; }
.status-panel div span { font-size: 11px; color: var(--muted); }
.status-error { border-color: rgba(255,123,114,.35); }
.status-error .status-icon { background: rgba(255,123,114,.12); color: var(--danger); }
.status-error strong { color: #ffc0bb; }
.command-stack { display: grid; gap: 9px; }
.command-card { padding: 14px; border-radius: 12px; min-width: 0; }
.command-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.command-heading > div { display: grid; gap: 2px; }
.command-heading span { font-size: 12px; font-weight: 800; }
.command-heading small { color: var(--muted-2); font-size: 10px; }
.copy-button { border: 1px solid #31533a; background: rgba(67,201,91,.08); color: #b8f3bd; border-radius: 8px; height: 31px; padding: 0 11px; font-size: 11px; font-weight: 800; }
.copy-button:hover { background: rgba(67,201,91,.14); }
.command-output { display: block; min-height: 40px; max-height: 106px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; background: #090e0b; border: 1px solid rgba(255,255,255,.05); border-radius: 8px; color: #c9d8ce; font-size: 10.5px; line-height: 1.5; }
.copy-feedback { height: 18px; text-align: right; color: var(--accent); font-size: 11px; padding-right: 2px; }

.below-tool { margin: 58px 0 70px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 48px; border-top: 1px solid var(--border); padding-top: 35px; }
.below-tool h2 { font-size: 24px; max-width: 380px; margin-top: 7px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
.steps li { counter-increment: step; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(17,24,20,.5); display: grid; align-content: start; gap: 8px; }
.steps li::before { content: "0" counter(step); color: var(--accent); font: 800 11px "SFMono-Regular", Consolas, monospace; }
.steps strong { font-size: 13px; }
.steps span { color: var(--muted); font-size: 12px; line-height: 1.55; }
footer { border-top: 1px solid rgba(255,255,255,.06); color: var(--muted-2); padding: 25px 18px 32px; text-align: center; font-size: 12px; }

@media (max-width: 1050px) {
  .generator-shell { grid-template-columns: minmax(0, 1fr) 410px; }
  .two-column-section { grid-template-columns: 1fr; }
  .scene { height: 260px; }
}
@media (max-width: 800px) {
  .site-header { height: 60px; padding: 0 16px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; }
  .github-link span { display: none; }
  .github-link { width: 38px; padding: 0; justify-content: center; }
  main { width: min(100% - 24px, 700px); }
  .intro { padding: 32px 0 20px; }
  .intro h1 { font-size: clamp(29px, 9vw, 38px); }
  .intro p { font-size: 14px; }
  .generator-shell { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-card { order: 0; }
  .controls-panel { order: 0; }
  .preview-panel { order: 1; }
  .below-tool { grid-template-columns: 1fr; gap: 22px; margin-top: 42px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .control-section, .preview-card { padding: 17px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 15px; }
  .compact-field { display: grid; gap: 4px; }
  .compact-field > span { display: none; }
  .compact-field select { width: 92px; }
  .axis-grid, .block-states { gap: 7px; }
  .two-column-section { gap: 19px; }
  .entity-section { grid-template-columns: 1fr; }
  .secondary-button { width: 100%; }
  .scene { height: 245px; }
  .transform-readout { grid-template-columns: 1fr 1fr; }
  .command-card { padding: 12px; }
  .below-tool { margin-bottom: 50px; }
}
