:root {
  --bg-1: #fdfdfe;
  --bg-2: #dde2ea;
  --ink: #171c28;
  --muted: rgba(23, 28, 40, .58);
  --line: rgba(23, 28, 40, .12);
  --panel: rgba(255, 255, 255, .82);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;            /* страница не прокручивается */
  overscroll-behavior: none;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: radial-gradient(ellipse at 40% 45%, var(--bg-1) 0%, var(--bg-2) 75%);
  touch-action: none;
  user-select: none;
}

.stage { position: relative; min-width: 0; min-height: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.title { position: absolute; left: 24px; top: 24px; pointer-events: none; }
.title h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.title p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.parts { position: absolute; left: 16px; bottom: 76px; display: flex; flex-direction: column; gap: 2px; }
.parts button {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 14px; color: var(--muted);
  text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.parts button.on { background: rgba(23, 28, 40, .06); color: var(--ink); }
.parts i { width: 8px; height: 8px; border-radius: 50%; display: block; }

.controls {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
}
.controls button {
  font: inherit; font-size: 12px; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer;
}
.controls button:hover { background: rgba(23, 28, 40, .05); }
.track { width: 160px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.fill { height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }

.panel {
  padding: 32px; overflow: auto;
  background: var(--panel); backdrop-filter: blur(12px);
  border-left: 1px solid var(--line);
}
.panel h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.panel .bar { display: block; width: 40px; height: 4px; border-radius: 4px; margin-bottom: 12px; }
.panel .fn { margin: 8px 0 0; font-size: 15px; line-height: 1.55; }
.panel .desc { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.panel dl { margin: 20px 0 0; font-size: 14px; }
.panel dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; text-align: right; font-weight: 600; }
.panel .hint { max-width: 300px; }

button:focus-visible { outline: 2px solid #2b6cff; outline-offset: 2px; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr 36%; }
  .panel { padding: 18px; border-left: 0; border-top: 1px solid var(--line); }
  .panel h2 { font-size: 20px; }
  .parts { display: none; }
}
