:root {
  --bg: #08101a;
  --panel: #101b29;
  --panel-2: #162437;
  --line: #29425f;
  --text: #e7edf6;
  --muted: #a2b4c7;
  --accent: #ffb449;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 10%, #122640 0%, var(--bg) 52%);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100%;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-right: 1px solid var(--line);
  padding: 16px;
  overflow: auto;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
}

h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #f9d39a;
}

.hint {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(8, 16, 26, 0.35);
}

label {
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

label:last-child {
  margin-bottom: 0;
}

input[type="range"] {
  width: 100%;
}

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

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

button {
  border: 1px solid #c58a39;
  border-radius: 8px;
  color: #fff8ee;
  background: linear-gradient(180deg, #ffb449 0%, #c77f22 100%);
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

button:last-child {
  border-color: var(--line);
  background: #23364f;
}

#stats {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.progress {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 16, 26, 0.45);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #0a1523;
  overflow: hidden;
  border: 1px solid #1f3551;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffcc74 0%, #ff9f2f 100%);
  transition: width 140ms linear;
}

.viewer {
  position: relative;
  min-height: 100vh;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 940px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 55vh;
  }

  .viewer {
    min-height: 45vh;
  }
}
