:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: rgba(8, 14, 24, 0.86);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #ecf2fb;
  --muted: #9eabc0;
  --accent: #7fd3ff;
  --accent-strong: #49a7df;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(127, 211, 255, 0.16), transparent 38%),
    radial-gradient(circle at top right, rgba(255, 96, 144, 0.12), transparent 24%),
    linear-gradient(180deg, #07111d 0%, #081520 56%, #04090f 100%);
  padding: 32px 18px 40px;
}

.page-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: end;
  padding: 22px;
  margin-bottom: 18px;
}

.eyebrow,
.meta-row,
label {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
}

h1, h2 {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  margin: 0;
  line-height: 1.04;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5rem);
  max-width: 12ch;
}

.lede {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.05rem;
}

.hero-panel {
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.hero-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.controls {
  padding: 18px;
  margin-bottom: 18px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  grid-column: span 3;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
button {
  font: inherit;
}

input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

input[type="number"]:focus,
button:focus {
  border-color: rgba(127, 211, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(127, 211, 255, 0.12);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: span 12;
}

button {
  border: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #03111b;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover {
  background: var(--accent-strong);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.description {
  flex-basis: 100%;
}

.board {
  padding: 18px;
}

.canvas-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #fdfdfd;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.swatch.red { background: #e34b4b; }
.swatch.blue { background: #4b78ff; }
.swatch.white { background: #ffffff; }
.swatch.black { background: #111111; }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  label {
    grid-column: span 12;
  }
}
