:root {
  --ink: #f3ebe0;
  --muted: #9fb4b6;
  --dim: #6d8589;
  --cyan: #63f0dc;
  --cyan-soft: rgba(99, 240, 220, 0.16);
  --coral: #ff7a66;
  --amber: #ffc46b;
  --violet: #c99bff;
  --glass: rgba(6, 20, 26, 0.66);
  --glass-2: rgba(8, 27, 34, 0.82);
  --line: rgba(160, 220, 218, 0.16);
  --line-hot: rgba(99, 240, 220, 0.48);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --font-ui: "Avenir Next", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: "Didot", "Bodoni 72", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020a0e;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button { color: inherit; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(18, 78, 88, 0.42), transparent 45%),
    #020a0e;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#scene.is-hovering { cursor: pointer; }
#scene.is-dragging { cursor: grabbing; }

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 36%, rgba(0, 6, 10, 0.42) 78%, rgba(0, 5, 8, 0.82) 100%),
    linear-gradient(to top, rgba(1, 7, 10, 0.72), transparent 24%),
    linear-gradient(to bottom, rgba(1, 8, 12, 0.5), transparent 18%);
  z-index: 2;
}

#grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: 0.055;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

.topbar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 26px;
  right: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
}
.brand-mark {
  width: 42px;
  height: 42px;
  color: var(--coral);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 154, 128, 0.38);
  border-radius: 50%;
  background: rgba(10, 24, 29, 0.6);
  box-shadow: inset 0 0 18px rgba(255, 122, 102, 0.13), 0 0 28px rgba(255, 122, 102, 0.12);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 25px;
  letter-spacing: 0.1em;
  line-height: 1;
}
.brand h1 span {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-left: 5px;
}
.brand p {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.3em;
  font-weight: 600;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(4, 16, 21, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.26);
  transition: color 0.25s, border-color 0.25s;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: statusPulse 1.5s ease-in-out infinite;
}
.status-pill.is-paused { color: var(--amber); border-color: rgba(255, 196, 107, 0.3); }
.status-pill.is-paused .status-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: none; }
.status-pill.is-rec { color: #ff9281; border-color: rgba(255, 122, 102, 0.38); }
.status-pill.is-rec .status-dot { background: #ff5f4a; box-shadow: 0 0 12px #ff5f4a; animation: recPulse 0.8s ease-in-out infinite; }
@keyframes statusPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.78); } }
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.scene-hint {
  position: absolute;
  left: 50%;
  top: 88px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(4, 16, 21, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(210, 230, 228, 0.7);
  font-size: 10px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 8;
  pointer-events: none;
  transition: opacity 0.6s, transform 0.6s;
}
.scene-hint.is-hidden { opacity: 0; transform: translate(-50%, -8px); }
.hint-icon { color: var(--cyan); font-size: 15px; line-height: 1; }

.hover-tag {
  position: absolute;
  z-index: 20;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(3, 13, 17, 0.9);
  border: 1px solid var(--line-hot);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 0.12s;
  white-space: nowrap;
}
.hover-tag.is-on { opacity: 1; }
.hover-tag b { color: var(--cyan); font-weight: 600; }

/* ---------------- editor panel ---------------- */
.panel {
  position: absolute;
  top: 84px;
  right: 22px;
  width: min(540px, calc(100vw - 44px));
  z-index: 12;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(18, 48, 55, 0.3), transparent 42%),
    var(--glass);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 16px 18px 14px;
  transform-origin: top right;
  transition: transform 0.32s cubic-bezier(0.22, 0.8, 0.24, 1), opacity 0.28s;
}
.panel.is-collapsed {
  transform: translateX(calc(100% + 26px)) scale(0.96);
  opacity: 0;
  pointer-events: none;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--coral);
  font-weight: 700;
}
.panel h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.panel h2 span {
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-left: 7px;
  font-weight: 600;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: rgba(99, 240, 220, 0.1); border-color: var(--line-hot); }
.icon-btn svg { width: 17px; height: 17px; }

.preset-row { display: flex; gap: 6px; margin: 13px 0 12px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: 0.2s;
}
.chip:hover { border-color: rgba(99, 240, 220, 0.4); color: var(--ink); }
.chip.is-active {
  color: #06231f;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(99, 240, 220, 0.3);
  font-weight: 600;
}

.grid-shell { position: relative; }
.bar-markers {
  display: grid;
  grid-template-columns: 68px 1fr;
  margin-bottom: 5px;
}
.bar-markers .bar-group {
  display: flex;
  justify-content: space-between;
  padding-left: 2px;
}
.bar-markers .bar-group span {
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.seq-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seq-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 6px;
}
.seq-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}
.seq-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--row-color, var(--cyan));
  box-shadow: 0 0 7px var(--row-color, var(--cyan));
}
.seq-label .key {
  margin-left: auto;
  font-size: 7px;
  color: var(--dim);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1;
}
.steps {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  gap: 2px;
}
.step {
  position: relative;
  height: 17px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  background: rgba(168, 215, 213, 0.075);
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.step:nth-child(4n + 1) { background: rgba(168, 215, 213, 0.13); }
.step:hover { background: rgba(99, 240, 220, 0.28); transform: scaleY(1.12); }
.step.v1 { background: color-mix(in srgb, var(--row-color) 24%, rgba(5, 20, 24, 0.7)); }
.step.v2 { background: color-mix(in srgb, var(--row-color) 58%, rgba(5, 20, 24, 0.4)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--row-color) 34%, transparent); }
.step.v3 { background: var(--row-color); box-shadow: 0 0 9px color-mix(in srgb, var(--row-color) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.42); }
.step.is-playing::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  pointer-events: none;
}
.step.is-current { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 12px rgba(99, 240, 220, 0.18); }
.step:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }

.grid-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  font-size: 8px;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.grid-legend span { display: inline-flex; align-items: center; gap: 4px; }
.cell-sample { width: 9px; height: 9px; border-radius: 2px; display: inline-block; background: rgba(168, 215, 213, 0.1); }
.cell-sample.l1 { background: color-mix(in srgb, var(--cyan) 24%, #07171b); }
.cell-sample.l2 { background: color-mix(in srgb, var(--cyan) 58%, #07171b); }
.cell-sample.l3 { background: var(--cyan); }
.legend-tip { margin-left: auto; color: rgba(140, 170, 172, 0.55); }

.take-strip {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(160, 220, 218, 0.1);
}
.take-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}
.record-clock { color: var(--dim); font-variant-numeric: tabular-nums; }
.record-clock.is-rec { color: #ff7a66; }
.take-track {
  position: relative;
  height: 30px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 25%),
    rgba(2, 11, 14, 0.5);
  border: 1px solid rgba(160, 220, 218, 0.09);
  overflow: hidden;
}
.take-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(120, 150, 152, 0.5);
}
.take-hits { position: absolute; inset: 0; }
.take-hit {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  bottom: 5px;
  background: var(--hit-color, var(--cyan));
  box-shadow: 0 0 6px var(--hit-color, var(--cyan));
}
.take-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(99, 240, 220, 0.13), rgba(99, 240, 220, 0.02));
}
.playhead {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: var(--coral);
  box-shadow: 0 0 8px var(--coral);
  opacity: 0;
  transform: translateX(-1px);
}
.playhead.is-on { opacity: 1; }

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 8px;
  color: var(--dim);
}
.keycap-note b { color: var(--muted); letter-spacing: 0.14em; font-weight: 600; }
.text-btn {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--cyan); }

.panel-tab {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(100%);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 14px 8px 14px 10px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, right 0.32s;
}
.panel-tab.is-visible { opacity: 1; pointer-events: auto; }
.panel-tab svg { width: 15px; height: 15px; transform: rotate(180deg); }
.panel-tab:hover { background: rgba(13, 44, 50, 0.9); }

/* ---------------- transport ---------------- */
.transport {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 12px 9px 10px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(30, 62, 66, 0.24), transparent),
    rgba(4, 15, 20, 0.76);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.round-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.round-btn.primary {
  background: var(--cyan);
  color: #04221e;
  box-shadow: 0 0 26px rgba(99, 240, 220, 0.25);
}
.round-btn.primary:hover { transform: scale(1.06); box-shadow: 0 0 34px rgba(99, 240, 220, 0.4); }
.round-btn svg { width: 21px; height: 21px; }
.round-btn .ico-play { display: none; }
.round-btn.is-paused .ico-play { display: block; }
.round-btn.is-paused .ico-pause { display: none; }
.round-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.tempo-control { width: 118px; padding: 0 2px; }
.tempo-label {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 7px;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-bottom: 5px;
}
.tempo-label b { color: var(--ink); font-size: 13px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.tempo-label small { font-size: 6px; color: var(--dim); }
#tempo {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan) var(--fill, 44%), rgba(255, 255, 255, 0.12) var(--fill, 44%));
  outline: none;
  cursor: pointer;
}
#tempo::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(99, 240, 220, 0.5);
}
#tempo::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--cyan);
}
.transport-divider { width: 1px; height: 27px; background: var(--line); }

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 39px;
  padding: 4px 3px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.tool-btn svg { width: 19px; height: 19px; }
.tool-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.tool-btn .tool-label { font-size: 7px; letter-spacing: 0.12em; }
.tool-btn .ico-muted { display: none; }
.tool-btn.is-on { color: var(--coral); }
.tool-btn.is-on .ico-sound { display: none; }
.tool-btn.is-on .ico-muted { display: block; }
.tool-btn.rec-btn { color: #ff9281; }
.tool-btn.rec-btn.is-on .rec-dot { animation: recPulse 0.7s infinite; }
.rec-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ff5f4a;
  box-shadow: 0 0 10px rgba(255, 95, 74, 0.55);
  margin: 2px 0 3px;
}
.tool-btn:disabled { opacity: 0.3; cursor: not-allowed; background: none; }
.tool-btn.replay-active { color: var(--cyan); background: rgba(99, 240, 220, 0.08); }

.shortcut-hint {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  gap: 16px;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: rgba(140, 170, 172, 0.66);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s;
}
.shortcut-hint b { color: rgba(220, 240, 236, 0.86); font-weight: 600; }
.shortcut-hint.is-hidden { opacity: 0; }

.toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translate(-50%, 8px);
  z-index: 30;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(99, 240, 220, 0.3);
  background: rgba(3, 18, 22, 0.86);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: min(80vw, 520px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-warn { border-color: rgba(255, 196, 107, 0.45); color: var(--amber); }

.rotate-note {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  z-index: 9;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(200, 225, 222, 0.62);
  pointer-events: none;
}
.rotate-note svg { width: 20px; height: 20px; }

/* ---------------- intro ---------------- */
.intro {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(7, 33, 40, 0.34), rgba(1, 7, 10, 0.84) 66%, rgba(0, 4, 6, 0.96)),
    linear-gradient(180deg, rgba(1, 8, 11, 0.25), rgba(1, 7, 10, 0.7));
  backdrop-filter: blur(3px) saturate(0.9);
  -webkit-backdrop-filter: blur(3px) saturate(0.9);
  transition: opacity 0.9s ease, visibility 0.9s;
}
.intro.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-glow {
  position: absolute;
  width: min(78vw, 860px);
  height: min(78vw, 860px);
  border-radius: 50%;
  border: 1px solid rgba(99, 240, 220, 0.08);
  box-shadow: inset 0 0 120px rgba(99, 240, 220, 0.06), 0 0 120px rgba(255, 122, 102, 0.03);
  animation: introHalo 9s ease-in-out infinite;
}
.intro-glow::before, .intro-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.06);
}
.intro-glow::before { inset: 9%; }
.intro-glow::after { inset: 22%; border-color: rgba(255, 122, 102, 0.08); }
@keyframes introHalo {
  0%, 100% { transform: scale(0.97) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.03) rotate(4deg); opacity: 1; }
}
.intro-inner {
  position: relative;
  text-align: center;
  padding: 24px;
  max-width: 780px;
}
.intro-kicker {
  margin: 0 0 18px;
  font-size: 9px;
  letter-spacing: 0.44em;
  color: var(--cyan);
  opacity: 0.8;
}
.intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(88px, 17vw, 210px);
  line-height: 0.78;
  letter-spacing: 0.07em;
  color: #f7e9da;
  text-shadow:
    0 0 60px rgba(255, 154, 128, 0.22),
    0 22px 80px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #fff6e9 12%, #f7cdb2 58%, #d1766c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-sub {
  margin: 26px 0 0;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.12em;
  color: rgba(225, 235, 230, 0.72);
}
.mobile-br { display: none; }
.intro-specs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 22px 0 28px;
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--dim);
}
.intro-specs i { width: 3px; height: 3px; border-radius: 50%; background: var(--coral); opacity: 0.7; }
.start-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 24px 15px 27px;
  border: 1px solid rgba(255, 158, 132, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8b72, #f2625c);
  color: #240b09;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 16px 44px rgba(242, 98, 92, 0.24);
  transition: transform 0.2s, box-shadow 0.25s;
}
.start-btn:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 22px 56px rgba(242, 98, 92, 0.35); }
.start-btn:active { transform: translateY(0) scale(0.99); }
.start-btn svg { width: 18px; height: 18px; }
.start-pulse {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 122, 102, 0.28);
  animation: startPulse 2.4s ease-out infinite;
}
@keyframes startPulse {
  0% { transform: scale(0.96); opacity: 0.9; }
  70%, 100% { transform: scale(1.12); opacity: 0; }
}
.intro-note {
  margin: 22px 0 0;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(130, 160, 162, 0.66);
}
.intro-footer {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.24em;
  color: rgba(120, 150, 152, 0.45);
}

@media (max-width: 1100px) {
  .panel { width: min(470px, calc(100vw - 44px)); }
  .scene-hint { top: 78px; }
}

@media (max-width: 820px) {
  .topbar { top: 14px; left: 16px; right: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand h1 { font-size: 20px; }
  .brand h1 span { display: none; }
  .brand p { font-size: 7px; letter-spacing: 0.22em; }
  .status-pill { padding: 7px 10px; font-size: 8px; letter-spacing: 0.08em; }

  .panel {
    top: auto;
    bottom: 94px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(48vh, 420px);
    padding: 13px 13px 11px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform-origin: bottom center;
    border-radius: 16px;
  }
  .panel.is-collapsed { transform: translateY(22px) scale(0.97); }
  .panel h2 { font-size: 15px; }
  .preset-row { margin: 9px 0; }
  .chip { font-size: 9px; padding: 4px 9px; }
  .seq-row { grid-template-columns: 55px 1fr; gap: 5px; }
  .bar-markers { grid-template-columns: 55px 1fr; }
  .seq-label { font-size: 9px; }
  .seq-label .key { display: none; }
  .steps { min-width: 292px; }
  .step { height: 15px; border-radius: 2px; }
  .grid-shell { overflow-x: auto; padding-bottom: 2px; }
  .grid-legend { gap: 8px; margin-top: 6px; }
  .legend-tip { display: none; }
  .take-strip { margin-top: 9px; padding-top: 9px; }
  .panel-foot { display: none; }
  .panel-tab { top: auto; bottom: 104px; right: 12px; transform: none; writing-mode: horizontal-tb; padding: 10px 13px; border-radius: 999px; border: 1px solid var(--line); }
  .panel-tab svg { transform: rotate(-90deg); }
  .panel-tab.is-visible { opacity: 1; pointer-events: auto; }

  .transport {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none;
    gap: 6px;
    padding: 7px 9px 7px 7px;
    border-radius: 18px;
    justify-content: space-between;
  }
  .round-btn { width: 41px; height: 41px; }
  .tempo-control { width: 88px; }
  .tempo-label { font-size: 6px; }
  .tempo-label b { font-size: 11px; }
  .tool-btn { min-width: 32px; }
  .tool-btn svg { width: 17px; height: 17px; }
  .tool-btn .tool-label { font-size: 6px; }
  .transport-divider { display: none; }
  .shortcut-hint { display: none; }
  .scene-hint { display: none; }
  .rotate-note { display: flex; }

  .intro-title { font-size: clamp(74px, 30vw, 140px); }
  .intro-sub { margin-top: 20px; font-size: 11px; line-height: 1.8; }
  .mobile-br { display: block; }
  .intro-specs { margin: 18px 0 24px; }
  .start-btn { font-size: 10px; padding: 14px 20px; letter-spacing: 0.1em; }
  .intro-footer { left: 18px; right: 18px; bottom: 16px; font-size: 6px; }
  .intro-note { font-size: 8px; }
  .toast { top: 16%; font-size: 10px; }
}

@media (max-width: 420px) {
  .tempo-control { width: 70px; }
  .tool-btn { min-width: 29px; padding: 3px 1px; }
  .round-btn { width: 38px; height: 38px; }
  .status-pill { padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
