:root {
  --bg: #e9e9e9;
  --paper: #f2f2f2;
  --ink: #111;
  --muted: #4d4d4d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 10%, #f1f1f1 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.shell {
  width: min(1400px, 100vw - 18px);
  height: calc(100vh - 14px);
  margin: 7px auto;
  border-radius: 20px;
  background: linear-gradient(90deg, #efefef 0%, #e8e8e8 100%);
  padding: 14px;
}

.hero {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 12px;
}

.copy {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  gap: 10px;
  align-content: start;
  background: #f3f3f3b3;
  border-radius: 14px;
  padding: 12px;
}

h1 {
  margin: 4px 0 0;
  line-height: 1.1;
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: 0;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 50ch;
}

.repo-line {
  margin: -2px 0 0;
}

.repo-link {
  display: inline-block;
  font-size: 12px;
  color: #2c2c2c;
  text-decoration: none;
  border-bottom: 1px solid #8f8f8f;
  padding-bottom: 1px;
}

.repo-link:hover {
  color: #111;
  border-bottom-color: #111;
}

.actions,
.footer-ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
  min-height: 38px;
  box-shadow: 0 1px 2px #00000014;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.dark {
  background: var(--ink);
  color: #f0f0f0;
}

.btn.ghost {
  background: #ececec;
}

.btn.file {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.btn.file input:disabled {
  cursor: not-allowed;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  background: #ffffff8f;
  padding: 10px;
  border-radius: 6px;
}

.controls label {
  font-size: 12px;
  white-space: nowrap;
}

.hint {
  grid-column: 1 / -1;
  margin: -2px 0 6px;
  font-size: 11px;
  line-height: 1.35;
  color: #666;
}

.hint.inline {
  width: 100%;
  margin: 0 0 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: #111;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.status {
  margin: 0;
  font-size: 12px;
  color: #111;
  border-top: 1px dashed #b1b1b1;
  padding-top: 8px;
}

.visual {
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  background: transparent;
  padding: 8px;
  display: grid;
  place-items: center;
}

.stage-wrap {
  position: relative;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 2px 8px #0000001f;
}

#glCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 6px;
  background: #f4f4f4cc;
  border-radius: 4px;
  font-size: 11px;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    min-height: calc(100vh - 14px);
  }

  .hero {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(20px, 5vw, 28px);
  }
}
