/* ============================================================
   Polyglot Parrot — Animated Game Picker Previews
   Every class and keyframe is prefixed with `gp-`.
   Animations use transform and opacity only.
   ============================================================ */

.gp-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    display: block;
    margin-bottom: 10px;
    user-select: none;
    pointer-events: none;
    isolation: isolate;
    font-family: var(--font-head, 'Fredoka', 'Nunito', sans-serif);
    box-shadow:
        0 6px 16px rgba(59, 59, 88, .16),
        inset 0 2px 0 rgba(255, 255, 255, .42),
        inset 0 -4px 0 rgba(0, 0, 0, .16);
}

.gp-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .24);
    pointer-events: none;
    z-index: 20;
}

.gp-paused,
.gp-paused *,
.gp-paused *::before,
.gp-paused *::after {
    animation-play-state: paused !important;
}

/* ============================================================
   1. PARROT'S QUIZ (quiz-show)
   ============================================================ */

.gp-scene-quiz-show {
    background:
        radial-gradient(85% 65% at 50% -10%, rgba(255, 255, 255, .22), transparent 68%),
        linear-gradient(180deg, #2b2b52 0%, #3a3a6e 58%, #2f4f68 100%);
}

.gp-qs-stage {
    position: absolute;
    inset: 0;
    padding: 7% 8% 7%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6%;
}

.gp-qs-top {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 3px 9px 3px 4px;
}

.gp-qs-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--coral, #ff7b54);
    border: 2px solid #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    line-height: 1;
    flex: none;
}

.gp-qs-bar {
    flex: 1;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    overflow: hidden;
    position: relative;
}

.gp-qs-bar-fill {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sun, #ffc93c), var(--leaf, #5fbf77));
    transform-origin: left center;
    transform: scaleX(.82);
    animation: gp-qs-bar-tick 4s ease-in-out infinite -1.85s;
}

.gp-qs-score {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--sun, #ffc93c);
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.gp-qs-crown {
    font-size: 11px;
}

.gp-qs-score-window {
    display: inline-block;
    height: 13px;
    overflow: hidden;
}

.gp-qs-score-reel {
    display: flex;
    flex-direction: column;
    line-height: 13px;
    transform: translateY(-13px);
    animation: gp-qs-score-roll 4s ease-in-out infinite -1.85s;
}

.gp-qs-card {
    position: relative;
    flex: 1;
    background: var(--card, #ffffff);
    border-radius: 14px;
    padding: 7% 7% 6%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

.gp-qs-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gp-qs-pic {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--sky, #c9edf8);
    display: grid;
    place-items: center;
    font-size: 15px;
    flex: none;
}

.gp-qs-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-qs-line {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: var(--ink, #3b3b58);
    opacity: .22;
}

.gp-qs-line-lg { width: 88%; opacity: .35; }
.gp-qs-line-sm { width: 56%; }

.gp-qs-tts {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(62, 193, 211, .2);
    display: grid;
    place-items: center;
    font-size: 10px;
    flex: none;
}

.gp-qs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.gp-qs-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 10px;
    background: #f5f7fc;
    border: 2px solid rgba(59, 59, 88, .1);
    overflow: hidden;
}

.gp-qs-badge {
    position: relative;
    z-index: 2;
    width: 17px;
    height: 17px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex: none;
}

.gp-qs-btn-1 .gp-qs-badge { background: var(--coral, #ff7b54); }
.gp-qs-btn-2 .gp-qs-badge { background: var(--teal, #3ec1d3); }
.gp-qs-btn-3 .gp-qs-badge { background: var(--sun, #ffc93c); color: #5a4300; }
.gp-qs-btn-4 .gp-qs-badge { background: var(--berry, #a06cd5); }

.gp-qs-opt {
    position: relative;
    z-index: 2;
    height: 5px;
    width: 62%;
    border-radius: 999px;
    background: var(--ink, #3b3b58);
    opacity: .32;
}

.gp-qs-btn-1 .gp-qs-opt { width: 58%; }
.gp-qs-btn-2 .gp-qs-opt { width: 66%; }
.gp-qs-btn-3 .gp-qs-opt { width: 52%; }
.gp-qs-btn-4 .gp-qs-opt { width: 64%; }

.gp-qs-btn-1,
.gp-qs-btn-3,
.gp-qs-btn-4 {
    animation: gp-qs-other-dim 4s ease-in-out infinite -1.85s;
}

.gp-qs-target {
    animation: gp-qs-btn-pulse 4s ease-in-out infinite -1.85s;
}

.gp-qs-btn-pick {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: #fff3c4;
    border: 2px solid var(--sun, #ffc93c);
    opacity: 0;
    z-index: 1;
    animation: gp-qs-pick-fade 4s ease-in-out infinite -1.85s;
}

.gp-qs-btn-win {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--leaf, #5fbf77), var(--leaf-deep, #3f9e58));
    opacity: 1;
    z-index: 1;
    animation: gp-qs-win-fade 4s ease-in-out infinite -1.85s;
}

.gp-qs-check {
    position: relative;
    z-index: 2;
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    opacity: 1;
    animation: gp-qs-win-fade 4s ease-in-out infinite -1.85s;
}

.gp-qs-plus {
    position: absolute;
    right: 12%;
    bottom: 34%;
    z-index: 10;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sun, #ffc93c), #ffde7a);
    color: #5a4300;
    font-family: var(--font-head, sans-serif);
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .22);
    transform: translateY(-10px) scale(1);
    opacity: 1;
    animation: gp-qs-plus-float 4s ease-out infinite -1.85s;
}

@keyframes gp-qs-btn-pulse {
    0%, 16%   { transform: scale(1); }
    24%       { transform: scale(1.06); }
    30%       { transform: scale(.98); }
    36%       { transform: scale(1.05); }
    44%, 76%  { transform: scale(1.04); }
    88%, 100% { transform: scale(1); }
}

@keyframes gp-qs-pick-fade {
    0%, 15%   { opacity: 0; }
    22%, 35%  { opacity: 1; }
    42%, 100% { opacity: 0; }
}

@keyframes gp-qs-win-fade {
    0%, 34%   { opacity: 0; transform: scale(.92); }
    42%, 76%  { opacity: 1; transform: scale(1); }
    88%, 100% { opacity: 0; transform: scale(.96); }
}

@keyframes gp-qs-other-dim {
    0%, 36%   { opacity: 1; }
    44%, 76%  { opacity: .52; }
    88%, 100% { opacity: 1; }
}

@keyframes gp-qs-plus-float {
    0%, 36%   { opacity: 0; transform: translateY(6px) scale(.7); }
    45%       { opacity: 1; transform: translateY(-8px) scale(1.08); }
    64%       { opacity: 1; transform: translateY(-18px) scale(1); }
    78%, 100% { opacity: 0; transform: translateY(-26px) scale(.85); }
}

@keyframes gp-qs-bar-tick {
    0%, 38%   { transform: scaleX(.48); }
    50%, 78%  { transform: scaleX(.82); }
    90%, 100% { transform: scaleX(.48); }
}

@keyframes gp-qs-score-roll {
    0%, 38%   { transform: translateY(0); }
    50%, 78%  { transform: translateY(-13px); }
    90%, 100% { transform: translateY(0); }
}


/* ============================================================
   2. MYSTERIES ISLAND (parrot-island)
   ============================================================ */

.gp-scene-parrot-island {
    background:
        radial-gradient(circle at 50% 52%, #68e3f0 0%, var(--teal, #3ec1d3) 54%, var(--teal-deep, #279fb0) 100%);
}

.gp-pi-stage {
    position: absolute;
    inset: 0;
}

.gp-pi-wave {
    position: absolute;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .32);
    animation: gp-pi-ripple 4.2s ease-in-out infinite -2.1s;
}

.gp-pi-wave-1 {
    inset: 7% 9%;
}

.gp-pi-wave-2 {
    inset: 13% 15%;
    border-style: solid;
    border-color: rgba(255, 255, 255, .22);
    animation-delay: -1.1s;
}

.gp-pi-island {
    position: absolute;
    inset: 14% 14% 12% 16%;
    border-radius: 46% 54% 48% 52% / 52% 44% 56% 48%;
    background: linear-gradient(145deg, #fff1ba, #f7d070);
    box-shadow:
        0 8px 0 rgba(21, 115, 133, .38),
        inset 0 -4px 0 rgba(217, 155, 26, .35);
}

.gp-pi-turf {
    position: absolute;
    inset: 11% 10% 13% 10%;
    border-radius: 44% 56% 50% 50% / 50% 46% 54% 50%;
    background:
        radial-gradient(circle at 32% 28%, #8be896 0%, transparent 55%),
        linear-gradient(155deg, var(--leaf, #5fbf77) 0%, var(--leaf-deep, #3f9e58) 100%);
    box-shadow: inset 0 -3px 0 rgba(23, 88, 42, .35);
}

.gp-pi-deco {
    position: absolute;
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2));
}

.gp-pi-palm-1 { top: 8%; left: 16%; font-size: 17px; }
.gp-pi-palm-2 { bottom: 14%; right: 14%; font-size: 16px; }
.gp-pi-chest  { top: 14%; right: 15%; font-size: 14px; }

/* Winding path fields across the island */
.gp-pi-field {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: #fff9e6;
    border: 2.5px solid #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--ink, #3b3b58);
    z-index: 2;
}

.gp-pi-field-green {
    background: #38b858;
    color: #fff;
}

.gp-pi-field-red {
    background: var(--danger, #f25f5c);
    color: #fff;
}

.gp-pi-field-gold {
    background: var(--sun, #ffc93c);
    color: #5a4300;
}

.gp-pi-f1 { left: 20%; top: 76%; }
.gp-pi-f2 { left: 37%; top: 69%; }
.gp-pi-f3 { left: 31%; top: 46%; }
.gp-pi-f4 { left: 50%; top: 37%; }
.gp-pi-f5 { left: 66%; top: 55%; }
.gp-pi-f6 { left: 69%; top: 32%; }
.gp-pi-f7 { left: 84%; top: 25%; }

.gp-pi-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2.5px solid var(--sun, #ffc93c);
    opacity: 0;
    animation: gp-pi-field-glow 4.2s ease-out infinite -2.35s;
}

/* Full-island overlay so percentage transforms match field % coordinates at any width */
.gp-pi-pawn {
    position: absolute;
    inset: 0;
    z-index: 6;
    transform: translate(30%, -39%);
    animation: gp-pi-pawn-path 4.2s ease-in-out infinite -2.35s;
}

.gp-pi-pawn-hop {
    position: absolute;
    left: 20%;
    top: 76%;
    width: 26px;
    height: 26px;
    margin: -16px 0 0 -13px;
    animation: gp-pi-pawn-arc 4.2s ease-in-out infinite -2.35s;
}

.gp-pi-pawn-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--coral, #ff7b54);
    border: 2.5px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .32);
    display: grid;
    place-items: center;
    font-size: 13px;
    line-height: 1;
}

/* Tumbling die badge in top-left */
.gp-pi-die-tray {
    position: absolute;
    top: 8%;
    left: 6%;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gp-pi-die {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #ffffff;
    border: 2.5px solid #e0c36e;
    box-shadow: 0 4px 0 #b89840, 0 6px 12px rgba(0, 0, 0, .25);
    animation: gp-pi-die-tumble 4.2s ease-in-out infinite -2.35s;
}

.gp-pi-pip {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink, #3b3b58);
}

.gp-pi-pip-1 { top: 5px; left: 5px; }
.gp-pi-pip-2 { top: 10px; left: 10px; background: var(--coral, #ff7b54); }
.gp-pi-pip-3 { bottom: 5px; right: 5px; }

.gp-pi-roll-num {
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--sun, #ffc93c);
    color: #5a4300;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
    animation: gp-pi-roll-badge 4.2s ease-out infinite -2.35s;
}

@keyframes gp-pi-ripple {
    0%, 100% { transform: scale(.98); opacity: .55; }
    50%      { transform: scale(1.03); opacity: .9; }
}

@keyframes gp-pi-die-tumble {
    0%, 6%    { transform: rotate(0deg) scale(1); }
    12%       { transform: rotate(-110deg) scale(1.18) translateY(-4px); }
    18%       { transform: rotate(130deg) scale(1.22) translateY(-6px); }
    25%       { transform: rotate(372deg) scale(1.12); }
    30%, 88%  { transform: rotate(360deg) scale(1); }
    100%      { transform: rotate(360deg) scale(1); }
}

@keyframes gp-pi-roll-badge {
    0%, 24%   { opacity: 0; transform: scale(.6) translateX(-4px); }
    32%, 82%  { opacity: 1; transform: scale(1) translateX(0); }
    92%, 100% { opacity: 0; transform: scale(.8); }
}

/* Exact % deltas from Field 1 (20%, 76%) to F2 (37%, 69%), F3 (31%, 46%), F4 (50%, 37%) */
@keyframes gp-pi-pawn-path {
    0%, 28%   { transform: translate(0%, 0%); }
    42%, 47%  { transform: translate(17%, -7%); }
    60%, 65%  { transform: translate(11%, -30%); }
    78%, 90%  { transform: translate(30%, -39%); }
    100%      { transform: translate(0%, 0%); }
}

@keyframes gp-pi-pawn-arc {
    0%, 28%   { transform: translateY(0) scale(1); }
    35%       { transform: translateY(-13px) scale(1.18); }
    42%, 47%  { transform: translateY(0) scale(1); }
    53%       { transform: translateY(-13px) scale(1.18); }
    60%, 65%  { transform: translateY(0) scale(1); }
    71%       { transform: translateY(-15px) scale(1.22); }
    78%, 90%  { transform: translateY(0) scale(1.06); }
    95%       { transform: translateY(-10px) scale(.92); }
    100%      { transform: translateY(0) scale(1); }
}

@keyframes gp-pi-field-glow {
    0%, 75%   { opacity: 0; transform: scale(.75); }
    81%       { opacity: 1; transform: scale(1.35); }
    92%, 100% { opacity: 0; transform: scale(1.7); }
}


/* ============================================================
   3. POP & DROP (pop-drop)
   ============================================================ */

.gp-scene-pop-drop {
    background: linear-gradient(180deg, #2a93e0 0%, #1c7ac9 55%, #14599c 100%);
}

.gp-pd-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 5% 6% 0;
}

.gp-pd-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 3px;
    z-index: 4;
}

.gp-pd-slot {
    height: 15px;
    border-radius: 6px 6px 3px 3px;
    background: rgba(255, 255, 255, .2);
    color: rgba(255, 255, 255, .85);
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.gp-pd-slot-lit {
    background: linear-gradient(180deg, #fff3c4, var(--sun, #ffc93c));
    color: #5a3a00;
    box-shadow: 0 0 10px rgba(255, 201, 60, .8);
}

.gp-pd-board {
    position: relative;
    flex: 1;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, .045) 0 20%,
            transparent 20% 40%
        );
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.gp-pd-bumper {
    position: absolute;
    top: 26%;
    width: 14px;
    height: 36px;
    background: linear-gradient(180deg, #0a427e, #2d82cd);
}

.gp-pd-bumper-l {
    left: 0;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.gp-pd-bumper-r {
    right: 0;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* Pegs */
.gp-pd-peg {
    position: absolute;
    width: 13px;
    height: 13px;
    margin: -6.5px 0 0 -6.5px;
    border-radius: 50%;
    z-index: 3;
}

.gp-pd-peg::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
}

.gp-pd-blue {
    background: #3d8bfd;
    border: 2px solid #12407e;
}

.gp-pd-pink {
    background: #ff7bb0;
    border: 2px solid #b03566;
}

.gp-pd-shk {
    background: #2b2b3d;
    border: 2px solid #11111c;
    border-radius: 3px;
    transform: rotate(45deg);
}

/* Row 1 (y: 22%) */
.gp-pd-p1 { left: 22%; top: 22%; }
.gp-pd-p2 { left: 41%; top: 22%; }
.gp-pd-p3 { left: 60%; top: 22%; }
.gp-pd-p4 { left: 78%; top: 22%; }

/* Row 2 (y: 42%) */
.gp-pd-p5 { left: 31%; top: 42%; }
.gp-pd-p6 { left: 52%; top: 42%; }
.gp-pd-p7 { left: 70%; top: 42%; }

/* Row 3 (y: 61%) */
.gp-pd-p8  { left: 22%; top: 61%; }
.gp-pd-p9  { left: 40%; top: 61%; }
.gp-pd-p10 { left: 57%; top: 61%; }
.gp-pd-p11 { left: 76%; top: 61%; }

/* Hit pegs pop & ring expands */
.gp-pd-peg-hit2 {
    animation: gp-pd-peg-pop 3.8s ease-out infinite -2.1s;
}

.gp-pd-pop-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    opacity: 0;
}

.gp-pd-ring1 {
    border-color: #ff9ec4;
    animation: gp-pd-ring-1 3.8s ease-out infinite -2.1s;
}

.gp-pd-ring2 {
    border-color: #8ec5ff;
    animation: gp-pd-ring-2 3.8s ease-out infinite -2.1s;
}

.gp-pd-ring3 {
    border-color: var(--sun, #ffc93c);
    animation: gp-pd-ring-3 3.8s ease-out infinite -2.1s;
}

.gp-pd-pop-pts {
    position: absolute;
    left: 54%;
    top: 34%;
    z-index: 7;
    font-size: 11px;
    font-weight: 800;
    color: var(--sun, #ffc93c);
    text-shadow: 0 2px 4px rgba(0, 0, 0, .45);
    opacity: 1;
    animation: gp-pd-pts-float 3.8s ease-out infinite -2.1s;
}

/* Full-board wrapper so % translateX/translateY hit exact peg coordinates at any width */
.gp-pd-ball-x {
    position: absolute;
    inset: 0;
    z-index: 6;
    transform: translateX(2%);
    animation: gp-pd-ball-x 3.8s ease-in-out infinite -2.1s;
}

.gp-pd-ball-y {
    position: absolute;
    inset: 0;
    transform: translateY(33%);
    animation: gp-pd-ball-y 3.8s ease-in-out infinite -2.1s;
}

.gp-pd-ball {
    position: absolute;
    left: 50%;
    top: 5%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #ffd2c2 0%, var(--coral, #ff7b54) 45%, var(--coral-deep, #e05a35) 100%);
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}

/* Bottom Baskets */
.gp-pd-baskets {
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: 0;
    height: 23%;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 4px;
    z-index: 5;
}

.gp-pd-basket {
    position: relative;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18);
}

.gp-pd-b1 { background: var(--teal, #3ec1d3); }
.gp-pd-b2 { background: linear-gradient(180deg, #ff9f43, var(--coral, #ff7b54)); }
.gp-pd-b3 { background: var(--berry, #a06cd5); }

.gp-pd-lid {
    position: absolute;
    top: 0;
    left: 3px;
    right: 3px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .75);
}

.gp-pd-bflash {
    position: absolute;
    inset: 0;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #fff8d6, var(--sun, #ffc93c));
    opacity: 0;
    animation: gp-pd-basket-flash 3.8s ease-out infinite -2.1s;
}

.gp-pd-bstar {
    position: absolute;
    top: -11px;
    font-size: 10px;
    color: var(--sun, #ffc93c);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.gp-pd-bval {
    position: relative;
    z-index: 2;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .28);
}

.gp-pd-b-win .gp-pd-bval {
    animation: gp-pd-bval-pop 3.8s ease-out infinite -2.1s;
}

.gp-pd-bplus {
    position: absolute;
    top: -18px;
    z-index: 8;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--leaf, #5fbf77);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
    opacity: 0;
    animation: gp-pd-bplus-rise 3.8s ease-out infinite -2.1s;
}

@keyframes gp-pd-ball-x {
    0%, 10%   { transform: translateX(0%); }
    24%       { transform: translateX(-8%); }
    42%       { transform: translateX(2%); }
    58%       { transform: translateX(6%); }
    72%, 100% { transform: translateX(0%); }
}

@keyframes gp-pd-ball-y {
    0%, 8%    { transform: translateY(0%) scale(1); opacity: 1; }
    24%       { transform: translateY(14%) scale(1.04, .94); opacity: 1; }
    32%       { transform: translateY(9%) scale(.97, 1.03); opacity: 1; }
    42%       { transform: translateY(33%) scale(1.05, .93); opacity: 1; }
    50%       { transform: translateY(27%) scale(.97, 1.03); opacity: 1; }
    58%       { transform: translateY(52%) scale(1.04, .94); opacity: 1; }
    72%, 84%  { transform: translateY(79%) scale(1); opacity: 1; }
    92%, 100% { transform: translateY(79%) scale(.6); opacity: 0; }
}

@keyframes gp-pd-ring-1 {
    0%, 22%   { opacity: 0; transform: scale(.6); }
    26%       { opacity: 1; transform: scale(1.3); }
    38%, 100% { opacity: 0; transform: scale(2.1); }
}

@keyframes gp-pd-peg-pop {
    0%, 40%   { opacity: 1; transform: scale(1); }
    45%       { opacity: 1; transform: scale(1.35); }
    54%, 88%  { opacity: 0; transform: scale(.2); }
    96%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes gp-pd-ring-2 {
    0%, 40%   { opacity: 0; transform: scale(.6); }
    45%       { opacity: 1; transform: scale(1.4); }
    58%, 100% { opacity: 0; transform: scale(2.3); }
}

@keyframes gp-pd-ring-3 {
    0%, 56%   { opacity: 0; transform: scale(.6); }
    61%       { opacity: 1; transform: scale(1.35); }
    74%, 100% { opacity: 0; transform: scale(2.1); }
}

@keyframes gp-pd-pts-float {
    0%, 41%   { opacity: 0; transform: translateY(6px) scale(.7); }
    48%       { opacity: 1; transform: translateY(-4px) scale(1.1); }
    66%       { opacity: 1; transform: translateY(-14px) scale(1); }
    76%, 100% { opacity: 0; transform: translateY(-20px) scale(.8); }
}

@keyframes gp-pd-basket-flash {
    0%, 68%   { opacity: 0; }
    73%, 82%  { opacity: .92; }
    92%, 100% { opacity: 0; }
}

@keyframes gp-pd-bval-pop {
    0%, 68%   { transform: scale(1); }
    75%       { transform: scale(1.32); }
    88%, 100% { transform: scale(1); }
}

@keyframes gp-pd-bplus-rise {
    0%, 69%   { opacity: 0; transform: translateY(8px) scale(.7); }
    76%       { opacity: 1; transform: translateY(-4px) scale(1.12); }
    88%       { opacity: 1; transform: translateY(-12px) scale(1); }
    96%, 100% { opacity: 0; transform: translateY(-18px) scale(.85); }
}


/* ============================================================
   4. JUNGLE RALLY (jungle-rally)
   ============================================================ */

.gp-scene-jungle-rally {
    background:
        radial-gradient(ellipse at 10% 105%, #3e9c60 0 18%, transparent 19%),
        radial-gradient(ellipse at 92% 0%, #22744c 0 16%, transparent 17%),
        linear-gradient(165deg, #9be29b 0%, #52b37c 48%, #287a4e 100%);
}

.gp-jr-stage {
    position: absolute;
    inset: 0;
    padding: 6% 6%;
    display: flex;
}

.gp-jr-board {
    flex: 1;
    border: 3px solid #235c3d;
    border-radius: 13px;
    background: rgba(21, 90, 58, .78);
    box-shadow: inset 0 0 18px rgba(15, 48, 34, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gp-jr-lane {
    position: relative;
    flex: 1;
    display: flex;
    border-bottom: 1.5px solid rgba(178, 220, 137, .22);
}

.gp-jr-lane:last-child {
    border-bottom: 0;
}

.gp-jr-tag {
    width: 8px;
    flex: none;
    background: var(--coral, #ff7b54);
}

.gp-jr-tag-1 { background: var(--coral, #ff7b54); }
.gp-jr-tag-2 { background: var(--sun, #ffc93c); }
.gp-jr-tag-3 { background: var(--teal, #3ec1d3); }

.gp-jr-track {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Wooden plank track along each lane */
.gp-jr-plank {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 11px;
    border-top: 2px solid #c2a368;
    border-bottom: 2.5px solid #604e2f;
    background: repeating-linear-gradient(
        90deg,
        #927443 0 24px,
        #5c4b2a 24px 27px
    );
}

/* 5 tiles per lane, spaced every 19% */
.gp-jr-tile {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18%;
}

.gp-jr-t1 { left: 4%; }
.gp-jr-t2 { left: 23%; }
.gp-jr-t3 { left: 42%; }
.gp-jr-t4 { left: 61%; }
.gp-jr-t5 { left: 80%; }

.gp-jr-pad {
    position: absolute;
    left: 8%;
    width: 84%;
    bottom: 6px;
    height: 14px;
    border: 2px solid #669846;
    border-bottom-width: 3.5px;
    border-radius: 55% 17% 55% 24%;
    background: linear-gradient(155deg, #e4f8a8, #b4d981);
}

.gp-jr-pad-safe {
    background: linear-gradient(150deg, #b8fb69, #4ace63);
    border-color: #278b47;
}

/* Brown-red mud transformation overlay on Lane 2, Tile 3 */
.gp-jr-mud {
    position: absolute;
    left: 6%;
    width: 88%;
    bottom: 5px;
    height: 15px;
    border: 2px solid #773731;
    border-bottom-width: 3.5px;
    border-radius: 41% 57% 35% 55%;
    background:
        radial-gradient(ellipse at 35% 35%, #d78c69 0 20%, transparent 22%),
        #b94e43;
    opacity: 1;
    animation: gp-jr-mud-turn 4.2s ease-out infinite -2.2s;
}

.gp-jr-splat {
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 16px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #d78c69 0 35%, transparent 40%);
    opacity: 0;
    animation: gp-jr-mud-splat 4.2s ease-out infinite -2.2s;
}

/* Gold coin booster tile on Lane 1, Tile 4 */
.gp-jr-coin {
    position: absolute;
    bottom: 12px;
    left: 50%;
    width: 17px;
    height: 17px;
    margin-left: -8.5px;
    border-radius: 50%;
    background: #ffdf5a;
    border: 2px solid #d49619;
    color: #8c5604;
    font-size: 9px;
    font-weight: 900;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    z-index: 2;
    animation: gp-jr-coin-pulse 2.1s ease-in-out infinite -1.1s;
}

.gp-jr-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff9c4;
    box-shadow: 0 0 6px #fff;
}

.gp-jr-sp1 {
    top: -4px;
    right: -4px;
    animation: gp-jr-sparkle-twinkle 1.4s ease-in-out infinite -.4s;
}

.gp-jr-sp2 {
    bottom: -3px;
    left: -4px;
    animation: gp-jr-sparkle-twinkle 1.4s ease-in-out infinite -1.1s;
}

/* Full-track wrapper so 19% steps align with tiles at any card width */
.gp-jr-pawn {
    position: absolute;
    inset: 0;
    z-index: 4;
    filter: drop-shadow(0 2px 2px rgba(15, 45, 30, .45));
}

.gp-jr-pawn-arc {
    position: absolute;
    bottom: 8px;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    display: grid;
    place-items: center;
}

/* Fox starts on T2 (center 32%) and hops +19% -> T3, +38% -> T4 */
.gp-jr-pawn-1 {
    transform: translateX(19%);
    animation: gp-jr-fox-x 4.2s ease-in-out infinite -2.2s;
}
.gp-jr-arc-1 {
    left: 32%;
    animation: gp-jr-fox-y 4.2s ease-in-out infinite -2.2s;
}

/* Frog starts on T1 (center 13%) and hops +19% -> T2, +38% -> T3 (mud!) */
.gp-jr-pawn-2 {
    transform: translateX(38%);
    animation: gp-jr-frog-x 4.2s ease-in-out infinite -2.2s;
}
.gp-jr-arc-2 {
    left: 13%;
    animation: gp-jr-frog-y 4.2s ease-in-out infinite -2.2s;
}

/* Panda starts on T1 (center 13%) and hops +19% -> T2, +38% -> T3 */
.gp-jr-pawn-3 {
    transform: translateX(19%);
    animation: gp-jr-panda-x 4.2s ease-in-out infinite -2.2s;
}
.gp-jr-arc-3 {
    left: 13%;
    animation: gp-jr-panda-y 4.2s ease-in-out infinite -2.2s;
}

@keyframes gp-jr-fox-x {
    0%, 12%   { transform: translateX(0%); }
    28%, 42%  { transform: translateX(19%); }
    58%, 85%  { transform: translateX(38%); }
    100%      { transform: translateX(0%); }
}

@keyframes gp-jr-fox-y {
    0%, 12%   { transform: translateY(0) rotate(0deg); }
    20%       { transform: translateY(-11px) rotate(-6deg); }
    28%, 42%  { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-12px) rotate(-6deg); }
    58%, 85%  { transform: translateY(0) scale(1.06); }
    92%       { transform: translateY(-8px) scale(.94); }
    100%      { transform: translateY(0) rotate(0deg); }
}

@keyframes gp-jr-frog-x {
    0%, 18%   { transform: translateX(0%); }
    34%, 44%  { transform: translateX(19%); }
    60%, 86%  { transform: translateX(38%); }
    100%      { transform: translateX(0%); }
}

@keyframes gp-jr-frog-y {
    0%, 18%   { transform: translateY(0) rotate(0deg); }
    26%       { transform: translateY(-11px) rotate(-5deg); }
    34%, 44%  { transform: translateY(0) rotate(0deg); }
    52%       { transform: translateY(-12px) rotate(-6deg); }
    60%, 86%  { transform: translateY(1px) rotate(4deg); }
    93%       { transform: translateY(-8px) rotate(0deg); }
    100%      { transform: translateY(0) rotate(0deg); }
}

@keyframes gp-jr-panda-x {
    0%, 24%   { transform: translateX(0%); }
    42%, 64%  { transform: translateX(19%); }
    80%, 90%  { transform: translateX(38%); }
    100%      { transform: translateX(0%); }
}

@keyframes gp-jr-panda-y {
    0%, 24%   { transform: translateY(0); }
    33%       { transform: translateY(-10px) rotate(-5deg); }
    42%, 64%  { transform: translateY(0); }
    72%       { transform: translateY(-10px) rotate(-5deg); }
    80%, 90%  { transform: translateY(0); }
    95%       { transform: translateY(-7px); }
    100%      { transform: translateY(0); }
}

@keyframes gp-jr-mud-turn {
    0%, 54%   { opacity: 0; transform: scale(.75) rotate(-4deg); }
    62%, 86%  { opacity: 1; transform: scale(1) rotate(-4deg); }
    94%, 100% { opacity: 0; transform: scale(.85) rotate(-4deg); }
}

@keyframes gp-jr-mud-splat {
    0%, 56%   { opacity: 0; transform: translateY(4px) scale(.5); }
    63%       { opacity: 1; transform: translateY(-6px) scale(1.3); }
    76%, 100% { opacity: 0; transform: translateY(-10px) scale(1.6); }
}

@keyframes gp-jr-coin-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.18) rotate(8deg); }
}

@keyframes gp-jr-sparkle-twinkle {
    0%, 100% { opacity: .25; transform: scale(.6); }
    50%      { opacity: 1; transform: scale(1.35); }
}


/* ============================================================
   Reduced motion — static pleasant frame, no animations
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .gp-preview,
    .gp-preview *,
    .gp-preview *::before,
    .gp-preview *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* ============================================================
   5. TREASURE HUNT (treasure-hunt)
   Three cave doors; the golden one rattles, swings open and a
   crown pops out with a burst of coins. 4 s loop.
   ============================================================ */
.gp-scene-treasure-hunt {
    background:
        linear-gradient(180deg, rgba(14, 10, 30, .15), rgba(14, 10, 30, .55)),
        url(../img/treasure/cave-bg.webp) center 40% / cover no-repeat,
        #1b1430;
}
.gp-th-stage { position: absolute; inset: 0; }
.gp-th-glow {
    position: absolute;
    left: 50%; top: 58%;
    width: 70%; height: 90%;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 210, 110, .55), transparent 62%);
    opacity: 0;
    animation: gpThGlow 4s ease-out infinite;
}
.gp-th-door {
    position: absolute;
    bottom: 6%;
    width: 30%;
    aspect-ratio: 447 / 489;
    perspective: 400px;
}
.gp-th-d0 { left: 3%; scale: .86; transform-origin: 50% 100%; }
.gp-th-d1 { left: 35%; z-index: 2; }
.gp-th-d2 { right: 3%; scale: .86; transform-origin: 50% 100%; }
.gp-th-hole {
    position: absolute;
    left: 24%; right: 24%; top: 22%; bottom: 9.5%;
    border-radius: 50% 50% 0 0 / 28% 28% 0 0;
    overflow: hidden;
    background: #0a0712;
}
.gp-th-light {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 62%, #fff6cf, #ffcc55 35%, transparent 85%);
    opacity: 0;
}
.gp-th-d1 .gp-th-light { animation: gpThLight 4s ease-out infinite; }
.gp-th-leaf {
    position: absolute;
    left: 22.2%; width: 55.6%; top: 19.5%; height: 72%;
    transform-origin: 0 50%;
}
.gp-th-d1 .gp-th-leaf { animation: gpThLeaf 4s ease-in-out infinite; }
.gp-th-arch { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.gp-th-loot {
    position: absolute;
    left: 50%; top: 52%;
    width: 62%;
    translate: -50% -50%;
    opacity: 0;
    z-index: 3;
}
.gp-th-d1 .gp-th-loot { animation: gpThLoot 4s ease-out infinite; }
.gp-th-coin {
    position: absolute;
    left: 50%; top: 50%;
    width: 9%; aspect-ratio: 1;
    background: url(../img/treasure/coin.webp) center / contain no-repeat;
    opacity: 0;
    z-index: 4;
    animation: gpThCoin 4s ease-out infinite;
}
.gp-th-c1 { --dx: -120%; --dy: -230%; }
.gp-th-c2 { --dx: 40%;   --dy: -300%; animation-delay: .08s; }
.gp-th-c3 { --dx: 190%;  --dy: -200%; animation-delay: .16s; }
.gp-th-hero {
    position: absolute;
    left: 1%; bottom: 2%;
    width: 21%;
    z-index: 5;
    transform-origin: 50% 100%;
    animation: gpThHero 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5));
}
@keyframes gpThLeaf {
    0%, 22%   { transform: none; }
    26%       { transform: rotateY(-6deg) rotate(-.8deg); }
    30%       { transform: rotateY(-2deg) rotate(.8deg); }
    34%       { transform: rotateY(-7deg) rotate(-.6deg); }
    38%       { transform: rotateY(-3deg); }
    48%, 84%  { transform: rotateY(-80deg); filter: brightness(.5); }
    96%, 100% { transform: none; }
}
@keyframes gpThLight {
    0%, 22%   { opacity: 0; }
    38%       { opacity: .35; }
    48%, 84%  { opacity: 1; }
    96%, 100% { opacity: 0; }
}
@keyframes gpThLoot {
    0%, 44%   { opacity: 0; transform: scale(.3) translateY(20%); }
    56%       { opacity: 1; transform: scale(1.15) translateY(-14%); }
    62%, 84%  { opacity: 1; transform: scale(1) translateY(-8%); }
    94%, 100% { opacity: 0; transform: scale(.6); }
}
@keyframes gpThGlow {
    0%, 44%   { opacity: 0; }
    56%, 80%  { opacity: 1; }
    100%      { opacity: 0; }
}
@keyframes gpThCoin {
    0%, 52%   { opacity: 0; transform: translate(-50%, 0) scale(.4); }
    58%       { opacity: 1; }
    80%       { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1) rotate(200deg); }
    90%, 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 40%)) scale(.8) rotate(260deg); }
}
@keyframes gpThHero {
    0%, 40%   { transform: none; }
    50%       { transform: translateY(-14%) rotate(-6deg); }
    58%       { transform: none; }
    64%       { transform: translateY(-8%) rotate(4deg); }
    70%, 100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .gp-scene-treasure-hunt * { animation: none !important; }
}
