.pip-game { --sky:#d9eadf; --bird:#f9b943; --perch:0; background:#fffcf4; border:1px solid #d7caba; }
.pip-game[data-pip="pip-bar"] { --sky:#fce0ce; --bird:#aba2e7; }
.pip-game[data-pip="pip-sing"] { --sky:#e0def8; --bird:#f3ad8a; }
.pip-scene { position:relative; height:90px; border-radius:12px; overflow:hidden; background:radial-gradient(circle at 86% 22%,#fff9da 0 14px,transparent 15px),linear-gradient(150deg,var(--sky),#fff7dd); border-bottom:3px solid #494053; }
.pip-perch { position:absolute; inset:0 auto 0 0; width:20%; transform:translateX(calc(var(--perch)*100%)); transition:transform .32s ease-in-out; display:grid; place-items:end center; padding-bottom:9px; }
.pip-bird { position:relative; display:block; width:43px; height:37px; border-radius:60% 65% 55% 45%; background:var(--bird); box-shadow:inset 0 -4px #30294626; }
.pip-bird b { position:absolute; width:18px; height:12px; background:#3c365b; border-radius:30% 60% 75% 85%; bottom:7px; left:5px; transform:rotate(18deg); }
.pip-bird::before { content:''; position:absolute; top:9px; right:8px; width:5px; height:5px; background:#242138; border-radius:50%; }
.pip-bird::after { content:''; position:absolute; right:-7px; top:14px; border-left:9px solid #82512b; border-bottom:4px solid transparent; border-top:4px solid transparent; }
.pip-meter { position:absolute; inset:auto 0 0; display:flex; height:12px; background:repeating-linear-gradient(90deg,#fff9e2 0 calc(25% - 2px),#62536b calc(25% - 2px) 25%); }
.pip-meter i { background:#7867a8; border-right:2px solid white; }
.pip-prompt { margin:.9rem 0; font-weight:750; }
.pip-keys,.pip-values { display:flex; gap:3px; }
.pip-keys { background:#333146; padding:4px; border-radius:9px; }
.pip-keys button,.pip-values button { position:relative; flex:1; min-width:0; min-height:52px; padding:4px; }
.pip-keys button { padding-top:2rem; height:76px; }
.pip-keys button:is(:nth-child(1),:nth-child(2),:nth-child(4))::after { content:''; position:absolute; z-index:1; pointer-events:none; width:31%; height:40%; top:-1px; left:87%; border-radius:0 0 3px 3px; background:#333146; }
.pip-values small { display:block; font-size:.75rem; }
.pip-game .game-controls { gap:.45rem; }
.pip-game .game-feedback:empty { display:none; }
.pip-game button[aria-current="true"] { background:#ffdb80; }
@media(prefers-reduced-motion:no-preference) { .pip-bird.hop { animation:pip-hop .32s ease-out; } @keyframes pip-hop { 50% { transform:translateY(-13px) rotate(-7deg); } } }
@media(prefers-reduced-motion:reduce) { .pip-perch { transition:none; } }

.pip-staff-lines {position:absolute;inset:18% 0 12%;background:repeating-linear-gradient(to bottom,transparent 0 7px,#5b586a23 7px 8px);height:40px;transform:rotate(-2deg) scaleX(1.03);}
.pip-score-burst {position:absolute;inset:0;z-index:2;pointer-events:none;}
.pip-score-burst i {position:absolute;left:50%;bottom:5px;font:bold 1.6rem/1 Georgia,serif;color:#6c518e;opacity:0;}
.pip-score-burst i:nth-child(1) {--flight:-105px;--rise:-54px;}
.pip-score-burst i:nth-child(2) {--flight:-72px;--rise:-74px;color:#aa5c22;}
.pip-score-burst i:nth-child(3) {--flight:-35px;--rise:-55px;color:#467b65;}
.pip-score-burst i:nth-child(4) {--flight:0px;--rise:-78px;}
.pip-score-burst i:nth-child(5) {--flight:35px;--rise:-53px;color:#aa5c22;}
.pip-score-burst i:nth-child(6) {--flight:70px;--rise:-72px;color:#467b65;}
.pip-score-burst i:nth-child(7) {--flight:100px;--rise:-49px;}
@media(prefers-reduced-motion:no-preference) {
  .pip-bravo .pip-score-burst i {animation:pip-fanfare 1.45s ease-out both;}
  @keyframes pip-fanfare {0% {opacity:0;transform:scale(.45);} 18% {opacity:1;} 72% {opacity:1;} 100% {opacity:0;transform:translate(var(--flight),var(--rise)) rotate(16deg);}}
}
.pip-game .game-feedback:not(:empty) { border-radius:10px;padding:.7rem .9rem;margin:.85rem 0 0;line-height:1.55;font-size:1rem;background:#ece8f6;color:#363342;overflow-wrap:break-word; }
.pip-game .game-feedback[data-kind="success"] { background:#e0efdc;color:#203d2e;border-left:4px solid #4e795c; }
.pip-game .game-feedback[data-kind="success"]::before { content:"✓ "; font-weight:bold; }
.pip-game .game-feedback[data-kind="hint"] { background:#fff0cf;color:#473621;border-left:4px solid #bd8940; }
.pip-game[data-pip="pip-bar"] .pip-values button::before { content:"";display:block;margin:13px auto 5px;width:14px;height:9px;border:2px solid currentColor;border-radius:60%;transform:rotate(-17deg);box-sizing:border-box; }
.pip-game[data-pip="pip-bar"] .pip-values button:not(:last-child)::after { content:"";position:absolute;top:7px;left:calc(50% + 5px);height:15px;border-right:2px solid currentColor; }
.pip-game[data-pip="pip-bar"] .pip-values button:first-child::before { background:currentColor; }
.pip-game[data-pip="pip-bar"] .pip-values button:last-child::before { width:17px;transform:none;border-width:2px 4px; }
@media(max-width:450px) {
  .article-practice:has(.pip-game) { padding:clamp(12px,4vw,18px); }
  .pip-game { padding:.7rem; }
  .pip-game .game-controls { flex-wrap:wrap; }
  .pip-game .game-feedback:not(:empty) { padding:.65rem .75rem; }
}

.pip-game {background:linear-gradient(145deg,#fffdf6,#faf5e7);}
.pip-scene {margin-bottom:5px;}
.pip-values button[data-mark="correct"],.pip-keys button[data-mark="correct"] {background:#dcefd5;color:#274934;box-shadow:inset 0 -2px #87ac7b;}
.pip-values button[data-mark="used"] {background:#eae2f7;}
.pip-values button[data-mark="retry"],.pip-keys button[data-mark="retry"] {background:#fff0cf;}
.pip-beat-labels {position:absolute;inset:auto 0 13px;display:grid;grid-template-columns:repeat(4,1fr);text-align:center;color:#55436e;font:.72rem/1.2 var(--sans);}
.pip-game[data-pip="pip-bar"] .pip-perch {padding-bottom:23px;}
