@import url("https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=M+PLUS+Rounded+1c:wght@700&display=swap");

:root {
  color-scheme: light;
  --bg: #efe9e2;
  --panel: #f7f3ee;
  --ink: #1d1b16;
  --accent: #dd6b47;
  --accent-2: #2e7d87;
  --muted: #7a6f64;
  --line: #d2c6ba;
  --shadow: 0 18px 45px rgba(29, 27, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background: radial-gradient(circle at top left, #fdfbf7 0%, #efe9e2 55%, #e6ded5 100%);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: none;
  margin: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero h1 {
  font-family: "M PLUS Rounded 1c", "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: clamp(2.4rem, 3vw, 3.2rem);
  margin: 0 0 12px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero__stats {
  display: grid;
  gap: 16px;
}

.stat {
  padding: 18px 20px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat__label {
  font-size: 0.9rem;
  color: var(--muted);
}

.stat__value {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 600;
}

.panel {
  background: var(--panel);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.controls--summary {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.control--readonly {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.control__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.control__value {
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 600;
}
.control input,
.control select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 1rem;
  background: #fffdfb;
}

.control input[type="range"] {
  accent-color: var(--accent);
}

.control--checkbox {
  gap: 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.control--button {
  align-self: end;
}

.control button {
  padding: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(221, 107, 71, 0.28);
}

.control button.secondary {
  background: var(--accent-2);
  box-shadow: 0 10px 20px rgba(46, 125, 135, 0.24);
}

.readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.readout {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 14px 16px;
}

.readout__label {
  color: var(--muted);
  font-size: 0.85rem;
}

.readout__value {
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 600;
}

.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: 24px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

.viewer__canvas {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #1f2429 0%, #2b2f34 100%);
  position: relative;
}

.viewer__overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  background: rgba(10, 12, 14, 0.78);
  color: #f4f1eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.overlay__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: start;
}

.overlay__stat {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
}

.overlay__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.overlay__value {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.4;
}

.overlay__keys .overlay__value {
  font-size: 0.85rem;
  font-weight: 400;
}

.overlay__actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, auto));
  justify-content: start;
  align-items: center;
}

.overlay__actions button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.overlay__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.overlay__check input {
  accent-color: var(--accent);
}

.overlay__select {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 18, 21, 0.9);
  color: #fff;
  font-size: 0.9rem;
}

.overlay__input {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 18, 21, 0.9);
  color: #fff;
  font-size: 0.9rem;
}

.overlay__range {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}

.viewer__notes {
  background: #fff;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.viewer__notes h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.notes {
  margin: 0 0 16px;
  padding: 0 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.source {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.legend {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.swatch--near {
  background: #dd6b47;
}

.swatch--mid {
  background: #2e7d87;
}

.swatch--far {
  background: #f2c94c;
}

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

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