/* Appearance only: both skins render the same MusicBox controls. */
.retro-only { display: none; }
.skin-switch { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 18px; font-size: 12px; letter-spacing: .12em; }
.skin-switch select { font: inherit; padding: 8px; }
button:focus-visible, select:focus-visible { outline: 3px solid #e17937; outline-offset: 4px; }
body[data-skin="retro"] { background: radial-gradient(ellipse at top, #44413b, #171717 75%); color: #ded6c8; }
body[data-skin="retro"] .skin-switch { color: #d2c1a3; }
body[data-skin="retro"] .skin-switch select { background: #252525; color: #eee0c8; border: 1px solid #827460; }
body[data-skin="retro"] main {
  position: relative; box-sizing: border-box; max-width: 1000px; margin: 12px auto 40px; padding: 30px 38px;
  display: grid; grid-template-columns: minmax(280px, 1.3fr) minmax(260px, 1fr); gap: 26px 40px;
  text-align: left; border: 1px solid #555; border-left: 18px solid #68432d; border-right: 18px solid #68432d;
  border-radius: 5px; background: repeating-linear-gradient(0deg, #ffffff03 0 1px, transparent 1px 3px), linear-gradient(120deg, #303131, #161818);
  box-shadow: inset 0 1px #ffffff28, 0 18px 35px #0009, inset 4px 0 5px #0008, inset -4px 0 5px #0008;
}
body[data-skin="retro"] main::before, body[data-skin="retro"] main::after { content: '⊕'; position: absolute; top: 8px; color: #92938b; text-shadow: 1px 2px #000; }
body[data-skin="retro"] main::before { left: 8px; }
body[data-skin="retro"] main::after { right: 8px; }
body[data-skin="retro"] h1 { grid-column: 1 / -1; margin: 0; padding-bottom: 18px; border-bottom: 2px solid #bcaa87; font-size: 23px; letter-spacing: .18em; color: #e2d6ba; }
body[data-skin="retro"] .retro-only { display: block; }
body[data-skin="retro"] .retro-displays { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.retro-displays > div > span { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .18em; color: #c1bba9; }
.retro-displays output { display: flex; gap: 5px; justify-content: center; padding: 14px 10px; background: #130d0b; border: 3px solid #0a0b0b; border-radius: 3px; box-shadow: inset 0 2px 6px #000, 0 1px #ffffff25; }
.digit { position: relative; width: 24px; height: 42px; flex: 0 0 24px; }
.segment { position: absolute; background: #ff542b; opacity: .09; }
.segment.on { opacity: 1; filter: drop-shadow(0 0 3px #ef481a); }
.segment.a, .segment.g, .segment.d { left: 4px; width: 16px; height: 4px; clip-path: polygon(15% 0, 85% 0, 100% 50%, 85% 100%, 15% 100%, 0 50%); }
.segment.a { top: 0; } .segment.g { top: 19px; } .segment.d { bottom: 0; }
.segment.b, .segment.c, .segment.e, .segment.f { width: 4px; height: 17px; clip-path: polygon(50% 0, 100% 15%, 100% 85%, 50% 100%, 0 85%, 0 15%); }
.segment.b { right: 0; top: 3px; } .segment.c { right: 0; bottom: 3px; }
.segment.f { left: 0; top: 3px; } .segment.e { left: 0; bottom: 3px; }
body[data-skin="retro"] #song, body[data-skin="retro"] #track, body[data-skin="retro"] #page, body[data-skin="retro"] #tempo { display: none; }
body[data-skin="retro"] button {
  position: relative; margin: 4px; padding: 12px 14px; border: 1px solid #111; border-top-color: #73716c; border-radius: 3px;
  color: #e4ded1; background: linear-gradient(#565652, #30312f); font-size: 12px; font-weight: 650; letter-spacing: .04em;
  box-shadow: inset 0 1px #ffffff16, 0 4px 0 #101111, 0 5px 5px #0009;
}
body[data-skin="retro"] button:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 5px #0009, 0 1px #111; }
body[data-skin="retro"] button:disabled { color: #99958b; }
body[data-skin="retro"] button.active::before { content: ''; position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #ff3923; box-shadow: 0 0 7px #ff3923; }
body[data-skin="retro"] .song-controls { grid-column: 1; grid-row: 3; }
body[data-skin="retro"] #song-state { margin: 0 4px 12px; font-size: 11px; letter-spacing: .13em; color: #bdb9ad; }
body[data-skin="retro"] #song-state::before { content: ''; display: inline-block; margin-right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #531f16; }
body[data-skin="retro"] #song-state.dirty::before { background: #ff3923; box-shadow: 0 0 8px #ff3923; }
#retro-empty { margin: 8px 4px 0; font-size: 11px; letter-spacing: .13em; color: #e08051; }
body[data-skin="retro"] .tempo-controls { grid-column: 2; grid-row: 3 / 5; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px; }
body[data-skin="retro"] #tempo-knob { display: block; flex: 0 0 112px; height: 112px; margin: 0 50px; border-radius: 50%; touch-action: none; user-select: none; cursor: ns-resize;
  border: 5px solid #111; background: repeating-conic-gradient(#242525 0deg 5deg, #454643 5deg 8deg); box-shadow: 0 6px 10px #000a, 0 0 0 3px #82745b, inset 0 0 0 9px #151616;
}
body[data-skin="retro"] #tempo-knob span { position: absolute; inset: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #555651, #171918 75%); box-shadow: inset 0 1px 2px #ffffff38; transform: rotate(var(--knob-angle, -45deg)); }
body[data-skin="retro"] #tempo-knob span::before { content: ''; position: absolute; left: calc(50% - 2px); top: 4px; width: 4px; height: 19px; background: #e1c699; border-radius: 1px; }
body[data-skin="retro"] #tempo-knob:active { transform: none; }
body[data-skin="retro"] #tempo-knob:disabled { opacity: .45; cursor: default; }
body[data-skin="retro"] .knob-caption { flex: 0 0 100%; text-align: center; font-size: 11px; letter-spacing: .2em; }
body[data-skin="retro"] .track-controls { grid-column: 1; grid-row: 4; }
body[data-skin="retro"] .track-controls::before { content: 'TRACK'; margin-right: 12px; font-size: 11px; letter-spacing: .16em; }
body[data-skin="retro"] #steps { grid-column: 1; grid-row: 5 / 7; gap: 12px; padding: 16px; background: #131414; border: 1px solid #484941; border-radius: 4px; }
body[data-skin="retro"] .step { min-width: 0; min-height: 78px; margin: 0; padding: 12px 3px; font-size: 10px; color: #cbc0ae;
  background: linear-gradient(145deg, #ffffff25, #ffffff05 45%, #ff592b0b), #292724; border: 2px solid #8d7f7044; border-bottom: 6px solid #3c302a;
  border-radius: 6px; box-shadow: inset 0 0 0 3px #ffffff0c, inset 0 1px 3px #ffffff48, 0 4px 3px #000b;
}
body[data-skin="retro"] .step.filled { color: #ffd2a6; background: linear-gradient(145deg, #ffab6460, #ff4d2545 65%, #d4321460), #38231d; border-color: #e7824866; border-bottom-color: #8d4027; box-shadow: inset 0 0 0 3px #ffffff12, inset 0 0 18px #ff70224d, 0 0 8px #ff4b1629, 0 4px 3px #000b; }
body[data-skin="retro"] .step::after { content: ''; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: #4e211a; }
body[data-skin="retro"] .step.playing { outline: 3px solid #ff5536; outline-offset: 3px; }
body[data-skin="retro"] .step.playing::after { background: #ff3c23; box-shadow: 0 0 8px 2px #ff3923; }
body[data-skin="retro"] .transport-controls { grid-column: 2; grid-row: 5; align-self: center; }
body[data-skin="retro"] #play, body[data-skin="retro"] #play-page { background: linear-gradient(#c67c4d, #8e4b2d); color: #fff0d6; }
body[data-skin="retro"] #stop { background: linear-gradient(#a84734, #6a2920); color: #fff0d6; }
body[data-skin="retro"] #pads { grid-column: 2; grid-row: 6; display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
body[data-skin="retro"] .pad { min-width: 0; min-height: 66px; }
body[data-skin="retro"] .pad.held { background: #993c26; color: #ffddbb; box-shadow: inset 0 0 16px #ff592b99, 0 3px #111; }
body[data-skin="retro"] .keyboard-hint { grid-column: 1 / -1; margin: 0; font-size: 11px; color: #aaa698; }
body[data-skin="retro"] #message { grid-column: 1 / -1; margin: 0; min-height: 1.4em; padding-top: 16px; border-top: 1px solid #575348; font-size: 12px; color: #b9b19e; }
body[data-skin="retro"] .phrase-label { grid-column: 1 / -1; margin: 0; font-size: 12px; letter-spacing: .17em; color: #c3b598; }
body[data-skin="retro"] #phrase { grid-column: 1 / -1; margin: 0; max-height: 160px; overflow: auto; color: #d3936b; font-size: 12px; }
@media (max-width: 700px) {
  body[data-skin="retro"] main { margin: 8px; padding: 20px 14px; border-left-width: 9px; border-right-width: 9px; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  body[data-skin="retro"] .retro-displays { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-skin="retro"] main > * { grid-column: 1; grid-row: auto; }
  body[data-skin="retro"] .step { min-height: 72px; }
  body[data-skin="retro"] #steps { gap: 9px; padding: 12px; }
}
@media (max-width: 700px) {
  body[data-skin="retro"] h1,
  body[data-skin="retro"] .retro-displays,
  body[data-skin="retro"] .song-controls,
  body[data-skin="retro"] .tempo-controls,
  body[data-skin="retro"] .track-controls,
  body[data-skin="retro"] .transport-controls,
  body[data-skin="retro"] #steps,
  body[data-skin="retro"] #pads,
  body[data-skin="retro"] .keyboard-hint,
  body[data-skin="retro"] #message,
  body[data-skin="retro"] .phrase-label,
  body[data-skin="retro"] #phrase { grid-column: 1 / -1; grid-row: auto; }
}
