/* Painted parts share the walnut case's texture and light.
   The box illustration contains the cylinder, comb and crank assembly. */
.gear-floor { filter:drop-shadow(1px 3px 1.6px #2c160db0); }
.painted-gear { animation-duration:5s; }
.painted-gear.cog-two { animation-duration:5s; animation-direction:reverse; }
.painted-gleam { animation:painted-metal-light 3.2s ease-in-out infinite paused; opacity:0; }
.workshop[data-mood="listen"] .painted-gleam,
.workshop[data-mood="repair"] .painted-gleam,
.workshop[data-complete="true"] .painted-gleam { animation-play-state:running; }
@keyframes painted-metal-light {
  0% { transform:translateX(0);opacity:0; }
  25% { opacity:.7; }
  85% { opacity:.7; }
  100% { transform:translateX(260px);opacity:0; }
}
.music-console { top:18%;height:29%; }
.pipes { transform:none; border:0; padding:0; gap:clamp(4px,.65vw,10px); }
.pipe,
.pipe:disabled,
.pipe:hover:not(:disabled),
.pipe:active:not(:disabled),
.pipe:is(.playing,[aria-pressed="true"],.fixed) {
  background:transparent; color:#342819; border:0; border-radius:6px;
  box-shadow:none; min-height:94px; padding:0 0 24px; filter:none; opacity:1; isolation:isolate;
}
.pipe .icon { display:none; }
.pipe::before {
  content:"";position:absolute;inset:0 0 22px;height:auto;z-index:1;pointer-events:none;
  background:url("/game-assets/melody-repair/v3/assets/tube.webp") center bottom / contain no-repeat;
  border-radius:0;filter:drop-shadow(1px 2px 1px #17150d99);opacity:1;
}
.pipe::after {
  content:"";position:absolute;inset:12% 25% 30%;pointer-events:none;z-index:2;
  background:radial-gradient(ellipse,#fff9cc99 0%,#ffdf7959 30%,#e7ba3c00 72%);
  opacity:0;transition:opacity .12s ease;
}
.pipe .index {
  position:absolute;z-index:3;left:50%;bottom:0;transform:translateX(-50%);
  display:block;min-width:25px;padding:0 5px;line-height:21px;font-size:16px;font-weight:850;
  color:#342819;background:#f4e2b6;border:1px solid #9c743d;border-radius:4px;
  box-shadow:0 1px 2px #19100599,inset 0 1px 0 #fff7de;
}
.pipe:hover:not(:disabled)::after { opacity:.3; }
.pipe:active:not(:disabled)::before { transform:translateY(1px); }
.pipe:is(.playing,[aria-pressed="true"],.fixed)::after { opacity:1; }
.pipe:is(.playing,[aria-pressed="true"],.fixed) .index {
  color:#fff6de;background:#315749;border-color:#e3c679;box-shadow:0 1px 2px #19100599;
}
.pipe.fixed .index::after { content:" ✓";font-size:.78em; }
.pipe.playing::before { opacity:1; }
@media (max-width:960px) {
  .music-console { top:auto;bottom:2%;height:33%;min-height:132px; }
  .choices { bottom:39%; }
}
@media (max-width:560px) {
  .music-console { top:auto;bottom:1%;height:33%;min-height:128px; }
  .pipe,.pipe:disabled { min-height:88px; }
  .choices { bottom:42%; }
}
@media (max-width:370px) {
  .music-console { height:auto;min-height:166px; }
  .pipes[data-count="6"] .pipe,.pipes[data-count="7"] .pipe { min-height:66px; }
  .pipes[data-count="6"] .pipe::before,.pipes[data-count="7"] .pipe::before { inset:0 30px 0 0; }
  .pipes[data-count="6"] .pipe::after,.pipes[data-count="7"] .pipe::after { inset:10% 55% 10% 5%; }
  .pipes[data-count="6"] .pipe .index,.pipes[data-count="7"] .pipe .index { left:74%;bottom:22px; }
  .choices { bottom:57%; }
}
@media (prefers-reduced-motion:reduce) {
  .painted-gear,.painted-gleam { animation:none!important; }
  .pipe::after { transition:none; }
}
/* Keep the repaired number and check mark on one brass label. */
.pipe .index { white-space:nowrap; }
