/* Wobble Band: tablet landscape first (1400x750), works on a phone (390x844). Touch targets >= 48 px. Original look:
   a little night stage with paper lanterns, four glowing spots, a row of beat lights; a cream side panel. */
:root { --ink: #2b2540; --paper: #fdf3e1; --card: #fffaf0; --accent: #6b5bd6; --line: #e6dccb; --night: #2b2350; --glow: #ffd36e; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
#app { height: 100%; }
.kit-feature[data-feature=band] { height: 100%; display: flex; flex-direction: column; }

/* ---- top bar ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; }
.bar h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.9rem; letter-spacing: .01em; }
.logo { font-size: 2.1rem; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.stars { min-width: 104px; padding: 8px 20px; border-radius: 999px; background: var(--card); font-size: 1.7rem; font-weight: 900;
  text-align: center; box-shadow: 0 4px 0 rgba(43,37,64,.12); }
.saving { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #eef4ff;
  font-size: 1rem; font-weight: 700; }

/* ---- layout ---- */
.play { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 420px; gap: 18px; padding: 0 24px 20px; }

/* ---- stage ---- */
.stage { position: relative; border-radius: 30px; overflow: hidden; container-type: size;
  background: radial-gradient(120% 80% at 50% 0%, #4a3d8f 0%, var(--night) 60%, #1d1838 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.25); }
.backdrop { position: absolute; inset: 0 0 auto 0; height: 22%; }
.backdrop::before { content: ''; position: absolute; left: -2%; right: -2%; top: 18%; height: 40%; border-bottom: 3px solid rgba(255,255,255,.35);
  border-radius: 0 0 50% 50%; }
.lantern { position: absolute; top: 34%; width: 34px; height: 42px; border-radius: 45% 45% 40% 40%; transform: translate(-50%, 0);
  background: radial-gradient(circle at 50% 40%, #fff3c4, #ffb347 70%); box-shadow: 0 0 22px rgba(255,200,90,.7);
  animation: sway 4s ease-in-out infinite; transform-origin: 50% -20px; }
.lantern::before { content: ''; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; background: rgba(255,255,255,.5); }
.lantern.l0 { left: 8%; top: 22%; } .lantern.l1 { left: 22%; top: 38%; background: radial-gradient(circle at 50% 40%, #ffe0f0, #f28dbb 70%); }
.lantern.l2 { left: 36%; top: 50%; } .lantern.l3 { left: 50%; top: 54%; background: radial-gradient(circle at 50% 40%, #e4f3ff, #7fb8f0 70%); }
.lantern.l4 { left: 64%; top: 50%; } .lantern.l5 { left: 78%; top: 38%; background: radial-gradient(circle at 50% 40%, #eaffdc, #8fd16a 70%); }
.lantern.l6 { left: 92%; top: 22%; }
.lantern:nth-child(even) { animation-delay: -2s; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(#c98b55, #a86c3f); border-top: 6px solid #e0a873; }
.floor::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 11%, rgba(0,0,0,.08) 11% 11.3%); }

.spots { position: absolute; left: 2%; right: 2%; top: 14%; bottom: 13%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1%; }
.spot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.pad { position: absolute; left: 50%; bottom: 52px; width: 92%; height: 14%; transform: translate(-50%, 50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,230,150,.75), rgba(255,230,150,0)); pointer-events: none; }
.musician, .egg { position: relative; width: min(21cqw, 46cqh); padding: 0; border: 0; background: transparent; font: inherit; color: inherit;
  display: flex; flex-direction: column; align-items: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.musician .critter-art, .egg .critter-art { width: 100%; height: auto; overflow: visible; }
.musician .name { margin-top: -6px; padding: 3px 14px; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 1.1rem; font-weight: 800;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 rgba(43,37,64,.15); }
.musician .badge { position: absolute; top: 4%; right: 2%; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; font-size: 1.35rem; box-shadow: 0 3px 0 rgba(43,37,64,.2); }
.musician:focus-visible { outline: 4px solid var(--glow); outline-offset: 4px; border-radius: 20px; }
.musician.hatch { animation: hatch .6s cubic-bezier(.2,1.6,.4,1); }
.musician.muted .critter-art { filter: grayscale(.85) brightness(.75); opacity: .6; }
.musician.muted .badge { font-size: 0; }
.musician.muted .badge::after { content: '🤫'; font-size: 1.35rem; }
.musician.muted .name { opacity: .7; }

/* dance by mood (always on, gently) + a pop on each of its notes */
.musician .bod { transform-box: view-box; transform-origin: 100px 186px; }
.mood-sleepy .bod { animation: sway 3.2s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.mood-happy .bod { animation: wiggle 1.2s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.mood-sneaky .bod { animation: lean 2.4s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.musician.muted .bod { animation: none; }
.musician.hit .critter-art { animation: pop .26s ease-out; filter: drop-shadow(0 0 14px var(--glow)); }
.musician.mood-bouncy.hit .critter-art { animation: hopbeat .28s ease-out; }
.egg .bod { animation: wobble .45s ease-in-out infinite; transform-box: view-box; transform-origin: 100px 186px; }

.tune-btn { min-height: 52px; min-width: 52px; padding: 6px 18px; border: 3px solid rgba(255,255,255,.7); border-radius: 999px;
  background: #fff8e8; color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 900; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); touch-action: manipulation; position: relative; z-index: 2; }
.tune-btn.open { background: var(--glow); border-color: #fff; }
.tune-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }

.puff { position: absolute; left: 50%; top: -6%; transform: translate(-50%, 0); padding: 6px 14px; border-radius: 999px; background: #fff;
  font-size: 1.4rem; font-weight: 900; white-space: nowrap; box-shadow: 0 4px 0 rgba(43,37,64,.12); animation: puff 1.2s ease-out forwards;
  pointer-events: none; z-index: 5; }

.lights { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); display: flex; gap: 12px; padding: 8px 14px;
  border-radius: 999px; background: rgba(43,35,80,.55); }
.light { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .08s, transform .08s; }
.light:nth-child(4n+1) { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.light.on { background: var(--glow); transform: scale(1.3); box-shadow: 0 0 12px var(--glow); }

.empty { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); width: min(80%, 460px); margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 22px; border-radius: 26px;
  background: rgba(255,255,255,.9); font-size: 1.45rem; font-weight: 800; text-align: center; z-index: 3; }
.empty-egg svg { width: 110px; height: 110px; }
.empty-egg .bod { animation: wobble 1.4s ease-in-out infinite; transform-box: view-box; transform-origin: 100px 186px; }

/* ---- side panel: make (default) or the pebble card ---- */
.panel { display: flex; flex-direction: column; padding: 22px; border-radius: 30px; background: var(--card);
  box-shadow: 0 6px 0 rgba(43,37,64,.08); overflow-x: hidden; overflow-y: auto; }
.make-panel, .tune-panel { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.maker { display: flex; flex-direction: column; gap: 12px; }
.label { font-size: 1.5rem; font-weight: 900; }
.idea { min-height: 66px; width: 100%; padding: 0 18px; border: 3px solid #d9d0ea; border-radius: 20px; font: inherit;
  font-size: 1.3rem; font-weight: 600; color: var(--ink); background: #fff; -webkit-user-select: text; user-select: text; }
.idea:focus { outline: none; border-color: var(--accent); }
.make { min-height: 70px; font-size: 1.6rem; }
.or { margin: 4px 0 0; font-size: 1.1rem; font-weight: 700; opacity: .7; }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chip { min-height: 160px; padding: 8px 4px 10px; border: 3px solid var(--line); border-radius: 22px; background: #fff;
  font: inherit; font-size: 1rem; font-weight: 800; color: var(--ink); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 2px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(43,37,64,.08); }
.chip-art { position: relative; width: min(100%, 100px); }
.chip-art svg { width: 100%; height: auto; overflow: visible; display: block; }
.chip-icon { position: absolute; right: -6px; top: -4px; font-size: 1.6rem; }
.chip:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(43,37,64,.08); }
.chip:disabled { opacity: .5; }
.full-note { margin: 0; padding: 10px 14px; border-radius: 16px; background: #fff3d6; font-size: 1.05rem; font-weight: 700; }
.tip { margin: auto 0 0; padding: 12px 16px; border-radius: 18px; background: #efeaff; font-size: 1.1rem; font-weight: 700; }

.card-head { display: flex; align-items: center; gap: 12px; }
.mini { width: 64px; flex: none; }
.mini svg { width: 100%; height: auto; display: block; }
.card-name { flex: 1; font-size: 1.6rem; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sound { font-size: 2rem; }
.tune-tip { margin: 0; font-size: 1.05rem; font-weight: 700; opacity: .8; }
.pebbles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.col { display: grid; grid-template-rows: repeat(5, 1fr) auto; gap: 4px; padding: 4px 2px; border-radius: 14px; transition: background .08s; }
.col:nth-child(4n+1) { background: rgba(107,91,214,.07); }
.col.now { background: rgba(255,211,110,.55); }
.cell { min-height: 60px; padding: 0; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cell .peb { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #bbb); opacity: .3; transition: all .1s; }
.cell.set .peb { width: 38px; height: 32px; border-radius: 48% 52% 45% 55%; opacity: 1; box-shadow: inset -4px -5px 0 rgba(0,0,0,.15), 0 3px 0 rgba(43,37,64,.2); }
.cell.rest { min-height: 44px; margin-top: 4px; border-top: 2px dashed var(--line); border-radius: 0 0 12px 12px; }
.cell.rest .peb { background: transparent; border: 3px solid #b9b0c9; opacity: .5; width: 16px; height: 16px; }
.cell.rest.set .peb { width: 30px; height: 22px; border-radius: 50%; background: transparent; border: 3px dashed #8e85a3; box-shadow: none; opacity: 1; }
.cell:active .peb { transform: scale(.85); }
.done { min-height: 64px; font-size: 1.4rem; margin-top: auto; }

@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes lean { 0%, 100% { transform: skewX(0) translateX(0); } 50% { transform: skewX(-8deg) translateX(6px); } }
@keyframes wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08, .94); } 100% { transform: scale(1); } }
@keyframes hopbeat { 0% { transform: none; } 40% { transform: translateY(-14px) scale(.97, 1.04); } 100% { transform: none; } }
@keyframes hatch { from { transform: scale(.2); opacity: 0; } }
@keyframes puff { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70px); } }

/* ---- phone (portrait): stage on top, panel below ---- */
@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; }
  .kit-feature[data-feature=band] { min-height: 100vh; height: auto; }
  .bar { padding: 8px 14px; }
  .bar h1 { font-size: 1.3rem; gap: 6px; }
  .logo { font-size: 1.5rem; }
  .stars { min-width: 78px; padding: 6px 14px; font-size: 1.35rem; }
  .saving-text { display: none; }
  .play { grid-template-columns: 1fr; grid-template-rows: 330px auto; gap: 12px; padding: 0 14px 14px; }
  .stage { border-radius: 24px; }
  .spots { top: 16%; bottom: 15%; left: 1%; right: 1%; }
  .musician, .egg { width: min(23cqw, 40cqh); }
  .musician .name { font-size: .8rem; padding: 2px 8px; }
  .musician .badge { width: 28px; height: 28px; font-size: 1rem; right: -4%; }
  .musician.muted .badge::after { font-size: 1rem; }
  .pad { bottom: 26px; }
  .tune-btn { min-height: 48px; min-width: 48px; padding: 4px 10px; font-size: 1.1rem; }
  .tune-btn span { display: none; }
  .lights { gap: 8px; padding: 6px 10px; bottom: 2.5%; }
  .light { width: 13px; height: 13px; }
  .lantern { width: 22px; height: 28px; }
  .empty { font-size: 1.1rem; }
  .empty-egg svg { width: 76px; height: 76px; }
  .panel { padding: 16px; overflow: visible; }
  .make-panel, .tune-panel { gap: 10px; }
  .label { font-size: 1.25rem; }
  .idea { min-height: 58px; font-size: 1.15rem; }
  .make { min-height: 60px; font-size: 1.35rem; }
  .chip { min-height: 112px; font-size: .9rem; }
  .chip-art { width: min(100%, 70px); }
  .tip { display: none; }
  .cell { min-height: 44px; }
  .cell.set .peb { width: 30px; height: 26px; }
  .card-name { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bod, .lantern, .musician, .critter-art, .puff { animation: none !important; }
}
