.pr-shell {
  width: 100%; margin: 0 auto; padding: clamp(10px, 2vw, 22px); border-radius: 26px; scroll-margin-top: 86px;
  color: #fff7ea; background: radial-gradient(circle at 90% 0, #845aa84a, transparent 35%), #151b32;
  border: 1px solid #d9b2e42d; box-shadow: 0 20px 70px #080e2870;
}
.pr-shell * {box-sizing: border-box;}
.pr-shell button {cursor: pointer; touch-action: manipulation;}
.pr-shell button:focus-visible {outline: 3px solid #ffe7a2; outline-offset: 2px;}
.pr-shell button:disabled {cursor: not-allowed; opacity: .48;}
.pr-top {display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 13px;}
.pr-eyebrow {font: 900 .68rem system-ui; letter-spacing: .2em; color: #ffce79;}
.pr-top h2 {font-size: clamp(1.65rem, 3.1vw, 2.6rem); letter-spacing: -.045em; margin: 3px 0 4px; line-height: 1;}
.pr-top p {margin: 0; max-width: 70ch; color: #d4cbe3; font-size: .88rem; line-height: 1.4;}
.pr-top #prLevels {white-space: nowrap; border-color: #f3c48a5c; color: #ffe7bd;}
.pr-hud {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px;}
.pr-hud > div {min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 9px 12px; border-radius: 12px; background: #ffffff0c; border: 1px solid #e9c8ef22;}
.pr-hud small {font-size: .61rem; letter-spacing: .13em; font-weight: 900; color: #d2bdd9;}
.pr-hud strong {font-size: .88rem; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.pr-layout {display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 265px); gap: 11px; align-items: stretch;}
.pr-stage {position: relative; overflow: hidden; border-radius: 18px; background: #48315f; border: 1px solid #f5d6ff45; min-width: 0; display: flex; flex-direction: column; box-shadow: inset 0 0 35px #ffd5ff1a, 0 17px 40px #09092055;}
.pr-stage canvas {display: block; width: 100%; height: clamp(450px, 59vw, 690px); min-width: 0; outline: none; touch-action: none;}
.pr-underbar {display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 9px 0 15px; background: #251d38; color: #ead0e3; font: 900 .62rem system-ui; letter-spacing: .12em;}
.pr-underbar button {width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #f7dcaa55; border-radius: 8px; color: #ffedc0; background: #533960; font-size: 1.2rem; line-height: 1;}
.pr-toast {display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 5px 12px; text-align: center; color: #ffe8ad; background: #271f38; border-top: 1px solid #ffe7ba1c; font: 800 .73rem/1.2 system-ui;}
.pr-toast[data-kind="reaction"] {background: linear-gradient(90deg, #236872, #3a4673); color: #e5fff6; box-shadow: inset 0 3px 15px #a5fff544;}
.pr-toast[data-kind="danger"] {background: #743b52; color: #fff1e7;}
.pr-mobile-tools {display: none;}
.pr-overlay {position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 14px; overflow: auto; background: #19182bc7; backdrop-filter: blur(6px);}
.pr-overlay[hidden] {display: none;}
.pr-card {width: min(100%, 620px); max-height: 100%; overflow: auto; text-align: center; padding: clamp(15px, 2vw, 25px); border-radius: 22px; border: 1px solid #f3d3b067; background: linear-gradient(145deg, #3d315a, #242643); box-shadow: 0 23px 75px #0c0b24a9; scrollbar-width: thin;}
.pr-card-kicker {color: #ffdb91; font: 900 .64rem system-ui; letter-spacing: .17em;}
.pr-card h3 {font-size: clamp(1.35rem, 2.8vw, 2rem); line-height: 1.08; letter-spacing: -.04em; margin: 7px 0 9px;}
.pr-card p {color: #e0d4e8; font-size: .86rem; line-height: 1.5; margin: 0 auto 15px; max-width: 54ch;}
.pr-card button {border: 1px solid #e7cad656; background: #503d67; color: #fff2e5; font-weight: 800; min-height: 40px; border-radius: 10px; padding: 7px 13px; margin: 3px;}
.pr-card button:hover {background: #745386; border-color: #ffe7ba;}
.pr-card .pr-primary {background: linear-gradient(110deg, #ffe599, #ffc08c); color: #492b3b; border: 0; box-shadow: 0 7px 19px #e7a2524a;}
.pr-card .pr-primary:hover {background: #ffedbe;}
.pr-world-tabs {display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; border-top: 1px solid #eacbda3a; margin-top: 14px; padding-top: 12px;}
.pr-world-tabs button {min-width: 0; min-height: 47px; margin: 0; padding: 5px 3px; font-size: .65rem; line-height: 1.1;}
.pr-world-tabs button small {display: block; color: #ffdc94; font: 900 .58rem system-ui; margin-bottom: 3px;}
.pr-world-tabs button[aria-pressed="true"] {border-color: #ffe6a1; background: #80618b; box-shadow: inset 0 0 0 1px #ffe5a15e;}
.pr-level-grid {display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 9px;}
.pr-level-grid button {min-width: 0; min-height: 43px; margin: 0; padding: 3px 1px; display: flex; flex-direction: column; justify-content: center; align-items: center;}
.pr-level-grid button[hidden] {display: none;}
.pr-level-grid small {font: 900 .83rem system-ui;}
.pr-level-grid span {font: 700 .55rem system-ui; color: #ffd893; overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis;}
.pr-result {border-color: #ffe1a7; box-shadow: 0 23px 75px #0c0b24a9, 0 0 45px #ffdf8b3d; animation: pr-result-enter .34s cubic-bezier(.2, 1.3, .38, 1) both;}
.pr-result-icon {display: block; font-size: 3.5rem; line-height: 1.2; margin: 0 0 4px; filter: drop-shadow(0 5px 13px #ffd68183);}
@keyframes pr-result-enter {from {transform: translateY(14px) scale(.93); opacity: .4;} to {transform: translateY(0) scale(1); opacity: 1;}}
.pr-side {display: flex; flex-direction: column; min-width: 0; padding: 15px; background: linear-gradient(180deg, #383153, #292b49); border: 1px solid #e3c5d52a; border-radius: 18px;}
.pr-side-title > span {font: 900 .66rem system-ui; letter-spacing: .13em; color: #ffd591;}
.pr-side-title b {display: block; font: 900 1.38rem system-ui; letter-spacing: -.02em; color: #fff7ec; margin-top: 4px;}
.pr-side-title p {color: #d9cddd; font-size: .83rem; line-height: 1.45; margin: 6px 0 12px;}
.pr-legend {display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 0; border-block: 1px solid #edcddd2e;}
.pr-legend span {border-radius: 6px; padding: 4px 6px; font: 700 .69rem system-ui; color: #f9dfd8; background: #ffffff12;}
.pr-pin-list {display: grid; grid-template-columns: 1fr; gap: 5px; align-content: start; max-height: 248px; overflow: auto; padding: 10px 1px; scrollbar-width: thin;}
.pr-pin-list button {display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 35px; padding: 5px 7px; border-radius: 9px; border: 1px solid #ffe1c233; color: #fff2e7; background: #ffffff0b; font-size: .72rem; font-weight: 800;}
.pr-pin-list button:hover:not(:disabled) {background: #ffe2ab2b; border-color: #ffd99f;}
.pr-pin-list button > span {font-size: .95rem; color: #ffce7a;}
.pr-pin-list button small {margin-left: auto; color: #d9c5db; font-size: .62rem; font-weight: 700;}
.pr-actions {display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 10px;}
.pr-actions button {min-width: 0; min-height: 38px; padding: 5px 4px; border-radius: 8px; border: 1px solid #ffe0bf49; background: #6b4d77; color: #fff0df; font-size: .69rem; font-weight: 800;}
.pr-actions #prHint {grid-column: 1 / -1;}
.pr-actions #prSideLevels {grid-column: 1 / -1;}
.pr-actions button:hover:not(:disabled) {background: #895b81;}
.pr-message {min-height: 2.3em; color: #ffdf96; font-size: .76rem; line-height: 1.3; margin: 10px 0 0;}
@media (max-width: 780px) {
  .pr-shell {padding: 9px; border-radius: 17px;}
  .pr-top {gap: 8px; margin-bottom: 8px;}
  .pr-top h2 {font-size: 1.5rem;}
  .pr-top p {display: none;}
  .pr-top #prLevels {font-size: .71rem; padding: 6px 8px;}
  .pr-hud {gap: 4px; margin-bottom: 6px;}
  .pr-hud > div {display: block; min-height: 39px; padding: 4px 6px;}
  .pr-hud small {display: block; font-size: .5rem;}
  .pr-hud strong {display: block; text-align: left; font-size: .7rem; margin-top: 3px;}
  .pr-layout {grid-template-columns: 1fr; gap: 7px;}
  .pr-stage canvas {height: clamp(390px, 108vw, 560px);}
  .pr-underbar {font-size: .5rem; letter-spacing: .07em; min-height: 44px;}
  .pr-toast {min-height: 30px; font-size: .68rem;}
  .pr-mobile-tools {display: flex; gap: 5px; padding: 5px; background: #252035;}
  .pr-mobile-tools button {flex: 1; min-width: 0; min-height: 44px; border: 1px solid #ffe0b957; border-radius: 9px; background: #654a74; color: #fff2e1; font: 800 .66rem system-ui;}
  .pr-mobile-tools button:active {background: #a16a86;}
  .pr-overlay {inset: 0;}
  .pr-side {padding: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px;}
  .pr-side-title {grid-column: 1;}
  .pr-side-title b {font-size: 1rem;}
  .pr-side-title p {font-size: .69rem; margin-bottom: 0;}
  .pr-legend {grid-column: 1 / -1; padding: 5px 0;}
  .pr-pin-list {grid-column: 1; grid-row: 2; display: flex; max-height: 80px; overflow-x: auto; overflow-y: hidden; padding: 3px 0;}
  .pr-pin-list button {width: 112px; flex: 0 0 auto; font-size: .61rem; min-height: 52px;}
  .pr-pin-list button small {display: none;}
  .pr-actions {display: none;}
  .pr-actions button {min-height: 32px; padding-inline: 5px;}
  .pr-message {grid-column: 1 / -1; margin: 0; min-height: 0;}
  .pr-world-tabs {grid-template-columns: repeat(3, minmax(0, 1fr));}
  .pr-world-tabs button {min-height: 37px; font-size: .62rem;}
}
@media (max-width: 430px) {
  .pr-shell[data-pr-mode="play"] .pr-top {display: none;}
  .pr-stage canvas {height: 390px;}
  .pr-shell[data-pr-rows="4"] .pr-stage canvas {height: 420px;}
  .pr-shell[data-pr-rows="5"] .pr-stage canvas {height: 450px;}
  .pr-shell[data-pr-rows="6"] .pr-stage canvas {height: 470px;}
  .pr-card {padding: 14px;}
  .pr-card p {font-size: .75rem;}
  .pr-card h3 {font-size: 1.3rem;}
  .pr-level-grid button {min-height: 37px;}
  .pr-legend span {font-size: .6rem;}
}
@media (max-width: 360px) and (max-height: 700px) {
  .pr-shell:not(:fullscreen) .pr-stage canvas {height: 330px;}
}
.pr-shell:fullscreen {width: 100%; height: 100dvh; max-width: none; padding: 7px; border: 0; border-radius: 0; overflow: auto; display: flex; flex-direction: column;}
.pr-shell:fullscreen .pr-top {display: none;}
.pr-shell:fullscreen .pr-layout {min-height: 0; flex: 1;}
.pr-shell:fullscreen .pr-stage {min-height: 0;}
.pr-shell:fullscreen canvas {height: 100%; min-height: 0; flex: 1;}
.pr-shell:fullscreen[data-pr-rows] canvas {height: 100%;}
.pr-shell:fullscreen .pr-side {overflow: auto;}
@media (max-width: 780px) {
  .pr-shell:fullscreen .pr-layout {display: flex; flex-direction: column;}
  .pr-shell:fullscreen .pr-stage {flex: 1;}
  .pr-shell:fullscreen .pr-side {flex: 0 0 auto; max-height: 125px;}
  .pr-shell:fullscreen .pr-side-title p, .pr-shell:fullscreen .pr-legend, .pr-shell:fullscreen .pr-pin-list, .pr-shell:fullscreen .pr-message {display: none;}
  .pr-shell:fullscreen .pr-mobile-tools {flex: 0 0 auto;}
}
@media (max-height: 520px) and (orientation: landscape) {
  .pr-shell:fullscreen .pr-top, .pr-shell:fullscreen .pr-hud {display: none;}
  .pr-shell:fullscreen .pr-stage {overflow: hidden;}
  .pr-shell:fullscreen .pr-stage canvas {height: 100%; min-height: 0; flex: 1 1 auto;}
  .pr-shell:fullscreen .pr-underbar {position: absolute; top: 3px; right: 3px; z-index: 1; min-height: 0; padding: 0; background: transparent;}
  .pr-shell:fullscreen .pr-underbar span, .pr-shell:fullscreen .pr-toast, .pr-shell:fullscreen .pr-mobile-tools {display: none;}
  .pr-shell:fullscreen .pr-underbar button {width: 44px; height: 44px; background: #322844d9;}
  .pr-shell:fullscreen .pr-side {overflow: hidden; padding: 9px;}
  .pr-shell:fullscreen .pr-side-title p, .pr-shell:fullscreen .pr-legend, .pr-shell:fullscreen .pr-pin-list {display: none;}
  .pr-shell:fullscreen .pr-actions {display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px;}
  .pr-shell:fullscreen .pr-actions button {min-height: 44px;}
  .pr-shell:fullscreen .pr-message {font-size: .7rem;}
}
@media (prefers-reduced-motion: reduce) {.pr-shell *, .pr-shell *::before, .pr-shell *::after {transition-duration: .01ms !important; animation-duration: .01ms !important;}}
.pr-challenge {min-height:44px;margin:12px auto 0;border-color:#ffd88e!important;color:#ffe4a4!important;background:#79552933!important;}
.pr-challenge[aria-pressed="true"] {box-shadow:inset 0 0 0 2px #ffd88e;}
.pr-challenge-note {display:block;margin:7px auto;color:#ccb5df;font-size:11px;}
.pr-mastery {display:block;margin-bottom:10px;color:#ffe39c;letter-spacing:.08em;font-size:12px;}
