.tone606{
  max-width: 860px;
  border: 1px solid #b9b6aa;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.15);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

.t606-top{
  background: linear-gradient(#dedacc, #cfcab8);
  padding: 14px 14px 10px;
  border-bottom: 4px solid #1b1b1b;
  position: relative;
}

.t606-badge{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 4px 10px;
  color:#1a1a1a;
}
.t606-brand{
  font-weight: 800;
  letter-spacing: .12em;
}
.t606-sub{
  font-size: 12px;
  opacity: .8;
}

.t606-knobrow{
  display:grid;
  grid-template-columns: 1fr 0.8fr 0.8fr 1fr;
  gap: 12px;
  align-items: start;
}

.t606-knobblock{
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.t606-label{
  font-size: 12px;
  letter-spacing: .08em;
  color:#222;
  margin-bottom: 8px;
  opacity: .9;
}

.t606-readout{
  margin-top: 8px;
  background:#0f0f0f;
  color:#d9ff9d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: .12em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  text-align: center;
}

.t606-knob{
  width: 68px;
  height: 68px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
}
.t606-knob-big{ width: 92px; height: 92px; }

.t606-knob-face{
  position:absolute; inset:0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #f7f7f7, #b9b9b9 55%, #8a8a8a 100%);
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,.5),
    inset 0 -8px 16px rgba(0,0,0,.35),
    0 4px 10px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.25);
}

.t606-knob-pointer{
  position:absolute;
  left:50%; top:50%;
  width: 3px; height: 42%;
  background: #1b1b1b;
  transform-origin: 50% 90%;
  transform: translate(-50%, -90%) rotate(var(--angle, -135deg));
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}

.t606-controlblock{
  grid-column: 1 / -1;
  max-width: 520px;
  justify-self: start;
  margin-top: 6px;

  position: relative;

  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 10px;
  /* reserve space for bottom-right modules */
  padding-bottom: 132px;
}

/* Bass note module (bottom-right) */
.t606-bass{
  position: absolute;
  right: 122px; /* leaves room for the tanuki */
  bottom: 8px;
  width: 300px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.t606-bass-title{
  font-weight: 900;
  letter-spacing: .10em;
  font-size: 12px;
  opacity: .9;
  margin-bottom: 6px;
}
.t606-bass-grid{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.t606-bass-btn{
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 7px;
  padding: 8px 0 7px;
  font-weight: 900;
  letter-spacing: .06em;
  font-size: 12px;
  background: linear-gradient(#f2f2f2, #bfbfbf);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.20);
}
.t606-bass-btn:active{ transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.20); }
.t606-bass-btn.is-on{
  background: linear-gradient(#e8fff0, #8ad1a3);
  box-shadow: 0 2px 0 rgba(0,0,0,.20), 0 0 12px rgba(140,255,190,.25);
}
.t606-bass-readout{
  margin-top: 8px;
  font-size: 12px;
}

/* prevent text from hiding under bottom-right modules */
.t606-status, .t606-now{ padding-right: 420px; }

/* Mascot (tanuki) */
.t606-mascot{
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 96px;
  height: 96px;
  opacity: .96;
  pointer-events: auto;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
}
.t606-mascot img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 85%;
}

.tone606.is-running .t606-mascot img{
  animation: t606-tanuki-dance .62s infinite ease-in-out;
}

@keyframes t606-tanuki-dance{
  0%   { transform: translateY(0) rotate(-3deg) scale(1); }
  22%  { transform: translateY(-5px) rotate(3deg) scale(1.02); }
  50%  { transform: translateY(0) rotate(-2deg) scale(1); }
  78%  { transform: translateY(-4px) rotate(4deg) scale(1.02); }
  100% { transform: translateY(0) rotate(-3deg) scale(1); }
}

@media (prefers-reduced-motion: reduce){
  .tone606.is-running .t606-mascot img{ animation: none; }
}

.t606-mode{
  font-size: 12px;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.t606-run{
  width: 100%;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  background: linear-gradient(#f2f2f2, #bfbfbf);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-run:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

.t606-status{
  margin-top: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  font-size: 12px;
  opacity: .85;
}
.t606-now{
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.3;
  opacity: .85;
}
.t606-hidden{ display:none; }

.t606-bottom{
  background: #141414;
  color: #e6e6e6;
  padding: 12px 14px 14px;
}

.t606-stepbar{
  display:flex;
  align-items: center;
  gap: 12px;
}

.t606-steplabels{
  width: 56px;
  font-weight: 800;
  letter-spacing: .2em;
  font-size: 12px;
  opacity: .75;
}

.t606-steps{
  display:grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 8px;
  flex: 1;
}

.t606-step{
  position: relative;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  background: linear-gradient(#bfbfbf, #7f7f7f);
  color:#111;
  padding: 10px 0 8px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 rgba(0,0,0,.35);
}
.t606-step:active{ transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 rgba(0,0,0,.35); }

.t606-step.is-disabled{
  opacity: .25;
  cursor: not-allowed;
}

.t606-led{
  display:block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 auto 6px;
  background: rgba(255,60,60,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.t606-step.is-selected .t606-led{
  background: rgba(255,80,80,.9);
  box-shadow: 0 0 10px rgba(255,80,80,.6), inset 0 0 0 1px rgba(0,0,0,.25);
}

.t606-step.is-playhead .t606-led{
  background: rgba(255,210,60,.95);
  box-shadow: 0 0 12px rgba(255,210,60,.65), inset 0 0 0 1px rgba(0,0,0,.25);
}

.t606-stepnum{
  display:block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
}

.t606-note{
  margin-top: 10px;
  font-size: 12px;
  opacity: .7;
}

.t606-kick{
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(#f7f7f7, #cfcfcf);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-kick.is-on{
  background: linear-gradient(#fff6d8, #d7c07a);
}
.t606-kick:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

.t606-stepmode{
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(#f2f2f2, #bfbfbf);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-stepmode.is-kick{
  background: linear-gradient(#e8fff0, #8ad1a3);
}
.t606-stepmode:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

/* Kick pattern step highlight */
.t606-step.is-kick .t606-led{
  background: rgba(120,255,170,.9);
  box-shadow: 0 0 10px rgba(120,255,170,.55), inset 0 0 0 1px rgba(0,0,0,.25);
}

/* In PRESET mode, steps without preset look disabled, but remain clickable for KICK mode */
.t606-step.is-disabled{
  opacity: .25;
}

/* Kick編集モードでは、全16ステップを見やすく */
.tone606.is-kickmode .t606-step.is-disabled{ opacity: 1; }
.tone606.is-kickmode .t606-step{ cursor: pointer; }

/* Playheadが最優先で見えるように上書き */
.t606-step.is-playhead .t606-led{
  background: rgba(255,210,60,.95);
  box-shadow: 0 0 12px rgba(255,210,60,.65), inset 0 0 0 1px rgba(0,0,0,.25);
}

.t606-trig{
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(#f7f7f7, #cfcfcf);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-trig.is-on{ background: linear-gradient(#fff6d8, #d7c07a); }
.t606-trig:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

.t606-track{
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(#f2f2f2, #bfbfbf);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-track:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

/* Step highlights per track while editing */
.t606-step.is-kick .t606-led{
  background: rgba(120,255,170,.9);
  box-shadow: 0 0 10px rgba(120,255,170,.55), inset 0 0 0 1px rgba(0,0,0,.25);
}
.t606-step.is-snare .t606-led{
  background: rgba(140,190,255,.9);
  box-shadow: 0 0 10px rgba(140,190,255,.55), inset 0 0 0 1px rgba(0,0,0,.25);
}
.t606-step.is-hat .t606-led{
  background: rgba(255,160,120,.9);
  box-shadow: 0 0 10px rgba(255,160,120,.55), inset 0 0 0 1px rgba(0,0,0,.25);
}

.t606-step.is-bass .t606-led{
  background: rgba(220,170,255,.9);
  box-shadow: 0 0 10px rgba(220,170,255,.55), inset 0 0 0 1px rgba(0,0,0,.25);
}

.t606-relax{
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 900;
  letter-spacing: .10em;
  background: linear-gradient(#f1f1f1, #bdbdbd);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.22);
}
.t606-relax.is-on{
  background: linear-gradient(#e9fff2, #aee2c2);
  box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 0 14px rgba(170,255,210,.35);
}
.t606-relax:active{ transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }

/* Mixer (per-track levels) */
.t606-mix{ margin-top: 10px; }
.t606-mixrow{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 720px){
  .t606-knobrow{ grid-template-columns: 1fr 1fr; }
  .t606-controlblock{ grid-column: 1 / -1; max-width: none; }
  .t606-controlblock{ padding-bottom: 10px; }
  .t606-bass{ position: static; width: auto; margin-top: 10px; }
  .t606-status, .t606-now{ padding-right: 0; }
  .t606-mascot{ width: 76px; height: 76px; right: 10px; bottom: 6px; }
  .t606-mixrow{ grid-template-columns: repeat(2, 1fr); }
  .t606-steps{ grid-template-columns: repeat(8, 1fr); }
}
.t606-mini{
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.t606-mini-label{
  font-weight: 900;
  letter-spacing: .06em;
  font-size: 12px;
  opacity: .9;
  margin-bottom: 6px;
}
.t606-knob.is-mini{
  width: 64px;
  height: 64px;
  margin: 0 auto;
}
.t606-readout.is-mini{
  width: 100%;
  margin: 8px auto 0;
  font-size: 12px;
  padding: 6px 8px;
}


/* Mascot link */
.t606-mascot-link{
  display:block;
  text-decoration:none;
}
.t606-mascot-link img{
  display:block;
}
.t606-mascot{
  cursor:pointer;
}
.t606-mascot-link:focus-visible{
  outline:2px solid rgba(94, 252, 141, 0.9);
  outline-offset:4px;
  border-radius:12px;
}
.t606-mascot-link:hover{
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.18));
  transform: translateY(-1px);
}

