/* Original toy-and-jelly studio. Every interactive sticker has a touch target. */
body[data-game="bopbeats"] #stage-wrap {
  max-width: 980px;
  background: #f1faff;
}
body[data-game="bopbeats"] #controls:empty,
body[data-game="bopbeats"] #options:empty { display: none; }
.bop-beats {
  --bop-ink: #243f60;
  padding: clamp(12px, 2vw, 22px);
  color: var(--bop-ink);
  background: radial-gradient(circle at 2px 2px, #d5eaf6 1px, transparent 1.5px) 0 0 / 18px 18px, #f1faff;
  overflow-wrap: anywhere;
  container-type: inline-size;
}
.bop-beats *, .bop-beats *::before, .bop-beats *::after { box-sizing: border-box; }
.bop-beats button, .bop-beats input { font: inherit; }
.bop-beats button {
  min-width: 44px;
  min-height: 44px;
  color: var(--bop-ink);
  cursor: pointer;
  touch-action: manipulation;
}
.bop-beats button:focus-visible, .bop-beats input:focus-visible {
  outline: 3px solid #2364af;
  outline-offset: 3px;
}
.bop-beats button:disabled { cursor: default; opacity: .55; }
.bop-beats button:not(:disabled):active { transform: translateY(1px); }
.bop-beats-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.bop-beats-heading-copy { flex: 1; min-width: 0; }
.bop-beats-eyebrow { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.bop-beats-title { margin: 0; font-family: var(--display-font, inherit); font-size: clamp(22px, 3vw, 30px); line-height: 1.15; letter-spacing: -.7px; }
.bop-beats-intro { max-width: 550px; margin: 8px 0 0; font-size: 12px; line-height: 1.65; }
.bop-beats-tempo { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; width: 65px; height: 65px; border: 2px solid var(--bop-ink); border-radius: 20px; background: #ffdfb7; box-shadow: 0 3px 0 #c6dded; transform: rotate(4deg); }
.bop-beats-tempo strong { font-size: 24px; line-height: 1; }
.bop-beats-tempo span { font-size: 10px; font-weight: 800; margin-top: 4px; }
.bop-beats-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.bop-beats-start, .bop-beats-button { padding: 8px 13px; border: 2px solid var(--bop-ink); border-radius: 13px; font-size: 12px !important; font-weight: 800 !important; white-space: nowrap; background: #fffef9; box-shadow: 0 3px 0 #c6dded; }
.bop-beats-start { min-width: 108px !important; background: #b7e8ce; box-shadow: 0 3px 0 #80b9a5; }
.bop-beats-start[data-playing="true"] { background: #ffc496; box-shadow: 0 3px 0 #d1a57f; }
.bop-beats-start:hover:not(:disabled) { background: #caf4dd; }
.bop-beats-button:hover:not(:disabled) { background: #e7f4ff; }
.bop-beats-volume { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid #aac5d8; border-radius: 13px; background: #fffef9; font-size: 11px; font-weight: 750; }
.bop-beats-volume-input { min-width: 44px; width: 83px; height: 44px; margin: 0; accent-color: #2364af; }
.bop-beats-volume-value { width: 32px; font-size: 11px; }
.bop-beats-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: stretch; padding: 13px 10px 11px; border: 2px solid var(--bop-ink); border-radius: 24px; background: linear-gradient(#fffef9 0 71%, #dbeaf7 71%); box-shadow: 0 5px 0 #bdd4e7; }
.bop-beats-slot { min-width: 0; padding: 0 5px 6px; border: 1px dashed #b4c8d9; border-radius: 15px; background: #ffffff8c; transition: background .15s; }
.bop-beats-slot.has-sound { border: 1px solid var(--bop-ink); background: #fffef9; box-shadow: 0 3px 0 #abc4d9; }
.bop-beats-slot.is-solo { outline: 3px solid #eaad48; outline-offset: 1px; }
.bop-beats-slot.is-drop-target { outline: 3px solid #2364af; outline-offset: 1px; background: #e5f5ff; }
.bop-beats-assign { display: flex; align-items: center; flex-direction: column; width: 100%; min-width: 0 !important; padding: 0 0 8px; border: 0; border-radius: 12px; background: transparent; }
.bop-beats-character-wrap { display: block; width: 100%; max-width: 132px; aspect-ratio: 120/128; transform-origin: center 88%; }
.bop-beats-character { display: block; width: 100%; height: auto; overflow: visible; }
.bop-beats-character-name { display: block; margin-top: 4px; font-size: 12px; letter-spacing: -.2px; }
.bop-beats-sound-name { display: block; min-height: 27px; max-width: 100%; margin-top: 5px; padding: 3px 5px; border-radius: 8px; font-size: 10px; line-height: 1.3; color: #4b617b; }
.has-sound .bop-beats-sound-name { background: var(--bop-track-color); color: var(--bop-ink); font-weight: 800; }
.bop-beats-slot-actions { display: grid; grid-template-columns: repeat(2, minmax(44px, 1fr)); gap: 4px; }
.bop-beats-slot-button { min-width: 44px; min-height: 44px; padding: 4px 2px; border: 1px solid var(--bop-ink); border-radius: 9px; font-size: 10px !important; line-height: 1.15; font-weight: 750 !important; background: #eef8ff; }
.bop-beats-slot-button[aria-pressed="true"] { background: #ffdfb7; box-shadow: inset 0 0 0 1px var(--bop-ink); }
.bop-beats-remove { grid-column: 1 / -1; min-height: 44px; background: #fff6f1; }
.bop-beats-meters { display: flex; justify-content: center; align-items: center; gap: 3px; height: 14px; margin-top: -2px; }
.bop-beats-meters i { width: 4px; height: 4px; border-radius: 2px; background: #b0c3d3; }
.is-playing .has-sound:not(.is-muted) .bop-beats-meters i { background: #2364af; animation: bop-beats-meter .555556s ease-in-out infinite alternate; }
.is-playing .has-sound:not(.is-muted) .bop-beats-meters i:nth-child(2) { animation-delay: -.18s; }
.is-playing .has-sound:not(.is-muted) .bop-beats-meters i:nth-child(3) { animation-delay: -.36s; }
.is-playing .has-sound:not(.is-muted) .bop-beats-meters i:nth-child(4) { animation-delay: -.12s; }
.is-playing .has-sound:not(.is-muted) .bop-beats-meters i:nth-child(5) { animation-delay: -.3s; }
.is-playing .has-sound:not(.is-muted) .bop-beats-character-wrap { animation: bop-beats-bounce .555556s ease-in-out infinite; }
.is-playing .bop-beats-slot:nth-child(even) .bop-beats-character-wrap { animation-delay: -.277778s; }
.bop-beats-slot.is-muted .bop-beats-character-wrap { opacity: .5; }
.bop-beats-timeline { display: flex; gap: 5px; justify-content: center; max-width: 330px; margin: 17px auto 0; }
.bop-beats-step { flex: 1; height: 5px; border-radius: 4px; background: #c3d7e8; }
.bop-beats-step.is-beat { background: #93b7d3; }
.bop-beats-step.is-current { background: #2364af; }
.bop-beats-message { min-height: 36px; padding: 0 4px; margin: 12px 0 15px; font-size: 12px; line-height: 1.65; text-align: center; font-weight: 650; }
.bop-beats-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 2px solid var(--bop-ink); border-radius: 22px; background: #fffef9; box-shadow: 0 4px 0 #c6dded; }
.bop-beats-palette-heading { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px; margin-bottom: 1px; }
.bop-beats-palette-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.35px; }
.bop-beats-palette-heading > span { font-size: 10px; font-weight: 650; line-height: 1.6; }
.bop-beats-sound-group { min-width: 0; }
.bop-beats-group-title { margin: 0 0 7px; padding: 6px 8px; border: 1px solid var(--bop-ink); border-radius: 9px; background: var(--bop-group-color); font-size: 11px; font-weight: 800; }
.bop-beats-sound-grid { display: grid; gap: 6px; }
.bop-beats-sound { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0 !important; min-height: 47px !important; padding: 7px; border: 1px solid #aec5d7; border-radius: 10px; background: #f6fbff; text-align: left; }
.bop-beats-sound[aria-pressed="true"] { border: 2px solid var(--bop-ink); padding: 6px; background: var(--bop-group-color); box-shadow: 0 2px 0 #b9cdda; }
.bop-beats-sound:hover:not(:disabled) { border-color: #2364af; }
.bop-beats-sound-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 25px; width: 25px; height: 27px; border: 1px solid #243f6070; border-radius: 8px; background: var(--bop-group-color); font-size: 17px; line-height: 1; }
.bop-beats-sound-icon svg { width: 20px; height: 20px; }
.bop-beats-sound-label { flex: 1; min-width: 0; font-size: 10px; line-height: 1.3; font-weight: 750; }
.bop-beats-sound-mark { width: 9px; flex-shrink: 0; color: var(--bop-ink); font-size: 12px; font-weight: 800; }
.bop-beats-note { margin: 15px 2px 0; font-size: 10px; text-align: center; line-height: 1.8; color: #4b617b; }
@keyframes bop-beats-bounce { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-5px) scale(.98, 1.03); } 65% { transform: translateY(0) scale(1.03, .98); } }
@keyframes bop-beats-meter { from { height: 4px; } to { height: 13px; } }
@container (min-width: 760px) {
  .bop-beats-band { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@container (min-width: 580px) {
  .bop-beats-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (min-width: 520px) and (max-width: 759px) {
  .bop-beats-slot-actions { grid-template-columns: repeat(3, minmax(44px, 1fr)); }
  .bop-beats-remove { grid-column: auto; }
}
@container (max-width: 440px) {
  .bop-beats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 260px) {
  .bop-beats-band { gap: 6px; padding: 8px 4px; }
  .bop-beats-slot { padding-left: 3px; padding-right: 3px; }
}
@media (max-width: 700px) {
  .bop-beats-band { gap: 7px; padding: 10px 7px; }
}
@media (max-width: 480px) {
  .bop-beats-tempo { width: 53px; height: 58px; border-radius: 17px; }
  .bop-beats-tempo strong { font-size: 21px; }
  .bop-beats-title { font-size: 23px; }
  .bop-beats-eyebrow { font-size: 9px; letter-spacing: .8px; }
  .bop-beats-heading { align-items: flex-start; }
  .bop-beats-transport { gap: 7px; }
  .bop-beats-start, .bop-beats-button { flex: 1 0 calc(50% - 7px); }
  .bop-beats-volume { flex: 1 0 calc(50% - 7px); justify-content: space-between; padding: 0 7px; gap: 4px; }
  .bop-beats-volume-input { width: 45px; flex: 1; }
  .bop-beats-volume > span { font-size: 10px; }
  .bop-beats-palette { gap: 10px 8px; padding: 10px; }
  .bop-beats-sound { padding: 6px; gap: 5px; }
  .bop-beats-sound[aria-pressed="true"] { padding: 5px; }
  .bop-beats-sound-icon { flex-basis: 23px; width: 23px; font-size: 15px; }
  .bop-beats-message { font-size: 11px; }
}
@media (max-width: 350px) {
  .bop-beats { padding: 10px; }
  .bop-beats-heading { gap: 8px; }
  .bop-beats-title { font-size: 21px; }
  .bop-beats-intro { font-size: 11px; }
  .bop-beats-character-wrap { max-width: 105px; }
  .bop-beats-sound-mark { width: 6px; }
  .bop-beats-sound-icon { flex-basis: 20px; width: 20px; }
}
body.wide-play[data-game="bopbeats"] #stage-wrap { width: 100% !important; overflow: auto; max-height: calc(100dvh - 154px); }
body.wide-play[data-game="bopbeats"] .bop-beats { min-height: 0; }
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  body.focus-play[data-game="bopbeats"] .play-panel { display: block; }
  body.focus-play[data-game="bopbeats"] #stage-wrap { width: 100%; max-width: 100%; max-height: calc(100dvh - 130px); overflow: auto; }
}
@media (max-height: 480px) and (orientation: landscape) {
  body.wide-play[data-game="bopbeats"] #stage-wrap { max-height: calc(100dvh - 112px); }
}
@media (prefers-reduced-motion: reduce) {
  .bop-beats-slot { transition: none; }
  .bop-beats-character-wrap, .bop-beats-meters i { animation: none !important; }
  .is-playing .has-sound:not(.is-muted) .bop-beats-meters i { height: 9px; }
  .bop-beats button:not(:disabled):active { transform: none; }
}
