/* ─── Section Head ─── */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.section-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.7rem;
  border-radius: 5px;
}

.sn-amb { background: var(--amb-light); color: var(--amber); }
.sn-mag { background: var(--mag-light); color: var(--magenta); }
.sn-accent { background: var(--accent-light); color: var(--accent-dim); }
.sn-grn { background: var(--grn-light); color: var(--green); }
.sn-purple { background: var(--purple-light); color: var(--purple); }

.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-intro {
  max-width: 820px;
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.section-intro code {
  background: var(--accent-light);
  color: var(--accent-dim);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 500;
}

/* ─── Controls Panel ─── */
.controls-panel {
  padding: 1.5rem;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--panel);
  overflow-y: auto;
}

.ctrl-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ctrl-row label {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 500;
  white-space: nowrap;
}

.ctrl-row .val {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  font-weight: 500;
}

.ctrl-sep {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.ctrl-info {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Select ─── */
select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280'%3E%3Cpath d='M2 4l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ─── Slider ─── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.3);
}

/* ─── Toggle ─── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-track.on {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-track:not(.on) .toggle-thumb {
  background: var(--border2);
}

.toggle-track.on .toggle-thumb {
  left: 18px;
  background: #fff;
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 500;
}

/* ─── Info Card ─── */
.info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.info-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.info-card p {
  color: var(--text2);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.info-card p:last-child { margin-bottom: 0; }

.info-card code {
  background: var(--accent-light);
  color: var(--accent-dim);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.84em;
  font-weight: 500;
}

.info-card strong {
  color: var(--text);
  font-weight: 700;
}

/* ─── Code Block ─── */
.code-block {
  margin-top: 1rem;
  background: #1e2030;
  border: 1px solid #2d3148;
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.65;
  color: #b8c4da;
  overflow-x: auto;
  white-space: pre-wrap;
}

.kw { color: #7dc4ff; }
.fn { color: #89d0ff; }
.str { color: #a8e4a0; }
.cm { color: #5c6580; }

/* ─── Style Gallery ─── */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 0.5rem;
}

.style-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
}

.style-btn:hover {
  border-color: var(--border2);
  background: var(--bg2);
}

.style-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.style-btn .style-icon {
  font-size: 20px;
  line-height: 1;
}

.style-btn .style-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.01em;
}

.style-btn.active .style-name {
  color: var(--accent-dim);
}

.style-desc-bar {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.5;
  min-height: 40px;
  transition: opacity 0.2s;
}

.style-desc-bar code {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--accent-light);
  color: var(--accent-dim);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ─── Start Page ─── */
.start-page {
  position: relative;
  min-height: 100vh;
}

.start-canvas {
  position: absolute !important;
  inset: 0;
  z-index: 0;
  min-height: 0 !important;
}

.start-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.start-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  pointer-events: none;
}

.start-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.start-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 0.25rem 0.85rem;
  border-radius: 99px;
  backdrop-filter: blur(8px);
  margin-bottom: 1rem;
}

.start-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 20px rgba(37, 99, 235, 0.3);
}

.start-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.65);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.start-cta {
  display: inline-block;
  pointer-events: all;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.7rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.start-cta:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 700px;
  width: 100%;
  pointer-events: all;
}

@media (max-width: 700px) {
  .start-grid { grid-template-columns: repeat(2, 1fr); }
}

.start-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font);
}

.start-card:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.start-card-num {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: var(--mono);
}

.start-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.start-card-desc {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
}
