/* Jungle Rally. All selectors, custom properties and animations stay local. */
.jr-game {
    --jr-forest: #174c39;
    --jr-dark: #123c30;
    --jr-paper: #fffbee;
    --jr-step: 96px;
    --jr-lane-h: max(78px, calc((100dvh - var(--topbar-h, 64px) - 210px) / var(--jr-lanes, 1)));
    --jr-pawn: clamp(50px, calc(var(--jr-lane-h) - 44px), 100px);
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: calc(var(--topbar-h, 64px) + 12px) 18px 12px;
    overflow: hidden;
    color: var(--jr-dark);
    background:
        radial-gradient(ellipse at 8% 105%, #3e9c60 0 15%, transparent 15.2%),
        radial-gradient(ellipse at 94% 110%, #268452 0 21%, transparent 21.2%),
        radial-gradient(ellipse at 100% 0, #22744c 0 12%, transparent 12.2%),
        radial-gradient(ellipse at 0 8%, #287e50 0 10%, transparent 10.2%),
        linear-gradient(165deg, #c3efbd, #81cda0 48%, #399767);
    font-family: var(--font-body, sans-serif);
}
.jr-game::before, .jr-game::after {
    content: '';
    position: absolute;
    width: 170px;
    height: 65px;
    border: 3px solid #ffffff1a;
    border-radius: 100% 0 100% 0;
    background: repeating-linear-gradient(35deg, transparent 0 20px, #ffffff14 21px 23px), #247f4e;
    pointer-events: none;
    z-index: -1;
}
.jr-game::before { top: 77px; left: -70px; transform: rotate(38deg); }
.jr-game::after { bottom: 0; right: -50px; transform: rotate(-25deg); }
.jr-header { position: relative; flex: none; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }
.jr-heading { display: flex; gap: 12px; align-items: center; min-width: 0; }
.jr-heading > span { font-size: 32px; }
.jr-heading h1 { font-family: var(--font-title, sans-serif); font-size: clamp(24px, 2.6vw, 36px); line-height: 1; margin: 0; }
.jr-round { border-radius: 14px; padding: 7px 12px; background: var(--jr-paper); white-space: nowrap; font-size: 18px; box-shadow: 0 3px 0 #174c3922; }
.jr-order { display: flex; gap: 8px; grid-column: 1 / -1; list-style: none; margin: 0; padding: 0 0 3px; overflow-x: auto; }
.jr-order-team { flex: 0 1 auto; min-width: 95px; max-width: 240px; display: flex; align-items: center; gap: 8px; background: #ffffffa8; border: 2px solid transparent; border-radius: 12px; padding: 5px 10px; font-size: 15px; }
.jr-order-team > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-order-team b { margin-left: auto; }
.jr-order-active { background: #fffbee; border-color: var(--jr-team, #df9424); box-shadow: 0 2px 0 #174c3930; }
.jr-btn { border: 0; border-radius: 16px; background: var(--jr-forest); color: white; padding: 12px 22px; font-size: 20px; font-weight: 800; line-height: 1.2; min-height: 48px; box-shadow: 0 4px 0 #092d23; transition: transform 160ms ease-out, filter 160ms ease-out; }
.jr-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }
.jr-btn:active:not(:disabled), .jr-card:active, .jr-answer:active:not(:disabled), .jr-read:active { transform: scale(.97); }
.jr-btn:disabled { opacity: .65; cursor: default; }
.jr-btn-gold { background: var(--sun, #ffc93c); color: #483311; box-shadow: 0 4px 0 #bd8523; }
.jr-btn-quiet { color: var(--jr-forest); background: var(--jr-paper); box-shadow: 0 3px 0 #174c3930; }
.jr-exit { padding: 9px 15px; min-height: 42px; font-size: 17px; }
.jr-btn:focus-visible, .jr-answer:focus-visible, .jr-card:focus-visible, .jr-read:focus-visible { outline: 4px solid #352a82; outline-offset: 3px; }

/* A shared camera scrolls every lane; only a small tile window is rendered. */
.jr-board { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; border: 4px solid #2c6746; border-radius: 24px; background: #155a3abf; box-shadow: 0 7px 0 #164a35, inset 0 0 30px #173e382b; isolation: isolate; scrollbar-color: #97d68e #20573e; }
.jr-lane { position: relative; display: flex; min-height: 78px; height: var(--jr-lane-h); border-bottom: 2px solid #b2dc8929; background: #153e222b; transition: background 200ms ease-out; }
.jr-lane:last-child { border-bottom: 0; }
.jr-lane-active { background: #fffca82b; box-shadow: inset 0 0 0 3px #fff3a1; }
.jr-lane-label { z-index: 2; width: 140px; flex: none; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 10px 12px; background: linear-gradient(90deg, #174e39 90%, #174e39ed); border-left: 7px solid var(--jr-team, #ffc93c); color: white; }
.jr-lane-label strong { font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; max-height: 44px; overflow: hidden; }
.jr-lane-label > span { font-size: 14px; color: #e8ffcb; }
.jr-viewport { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.jr-viewport::before { content: ''; position: absolute; left: 0; right: 0; height: 22px; bottom: 10px; border-top: 3px solid #c2a368; border-bottom: 4px solid #604e2f; background: repeating-linear-gradient(90deg, #927443 0 calc(var(--jr-step) - 3px), #5c4b2a calc(var(--jr-step) - 3px) var(--jr-step)); box-shadow: 0 6px 0 #152d272b; }
.jr-viewport::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; border-bottom: 3px solid #81bc59; pointer-events: none; }
.jr-track { position: absolute; inset: 0; transition: transform 520ms ease-in-out; }
.jr-tile { position: absolute; top: 0; bottom: 0; }
.jr-pad { position: absolute; bottom: 12px; left: 8%; width: 84%; height: 32px; border: 2px solid #669846; border-bottom-width: 5px; border-radius: 55% 17% 55% 24%; background: linear-gradient(155deg, #e4f8a8, #b4d981); box-shadow: 0 3px 0 #243c2922; }
.jr-pad::after { content: ''; position: absolute; left: 18%; right: 15%; top: 47%; border-top: 2px solid #6f9f4e55; transform: rotate(-15deg); }
.jr-tile-green .jr-pad { background: linear-gradient(150deg, #b8fb69, #4ace63); border-color: #278b47; }
.jr-tile-mud .jr-pad { background: radial-gradient(ellipse at 35% 30%, #d78c69 0 11%, transparent 12%), radial-gradient(ellipse at 70% 60%, #9c3b37 0 18%, transparent 19%), #b94e43; border-color: #773731; border-radius: 41% 57% 35% 55%; transform: rotate(-4deg); }
.jr-tile-mud .jr-pad::after { border-color: #ffd9a344; }
.jr-tile-start .jr-pad { border-radius: 8px; border-color: #725028; background: repeating-conic-gradient(#fff4ce 0 25%, #8c693b 0 50%) 0 0 / 18px 18px; }
.jr-number { position: absolute; top: 3px; left: 0; width: 100%; text-align: center; color: #ffface; font-size: 15px; font-weight: 900; text-shadow: 0 1px 2px #143d2f; }
.jr-special { position: absolute; z-index: 1; width: 28px; height: 28px; top: -3px; left: 50%; margin-left: -14px; display: grid; place-items: center; border: 3px solid; border-radius: 50%; font-size: 18px; line-height: 1; box-shadow: 0 2px 3px #352b2533; }
.jr-special-bronze { color: #663b1c; background: #e2a36c; border-color: #a36631; }
.jr-special-silver { color: #3e5764; background: #e0edf2; border-color: #8aabb8; }
.jr-special-gold { color: #8c5604; background: #ffdf5a; border-color: #d49619; }
.jr-special-lightning { background: #fdf6b3; border-color: #efc144; }
.jr-mud-dots { position: absolute; top: -4px; left: 26%; font-size: 12px; color: #ffc69b; }
.jr-pawn { position: absolute; bottom: 20px; width: calc(var(--jr-pawn) + 10px); margin-left: calc(var(--jr-pawn) / -2 - 5px); z-index: 2; display: flex; align-items: center; flex-direction: column; transition: left 300ms ease-in-out; }
.jr-pawn-body { height: var(--jr-pawn); transform-origin: 50% 100%; filter: drop-shadow(0 3px 2px #15332755); }
.jr-avatar { font-size: calc(var(--jr-pawn) * .85); display: block; line-height: var(--jr-pawn); }
.jr-pawn-name { position: absolute; top: calc(var(--jr-pawn) - 6px); font-size: 12px; font-weight: 900; line-height: 15px; max-width: 95px; padding: 0 5px; background: var(--jr-paper); border: 1px solid #537c48; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-shield, .jr-vines { position: absolute; top: 17px; right: -5px; font-size: 25px; filter: drop-shadow(0 2px 0 white); }
.jr-vines { left: -8px; right: auto; }
.jr-edge { position: absolute; z-index: 3; bottom: 14px; display: flex; align-items: center; gap: 4px; border: 2px solid #f9eeb9; border-radius: 12px; background: #174c39; color: white; padding: 6px 8px; font-size: 16px; box-shadow: 0 3px 6px #183e3544; }
.jr-edge-left { left: 4px; }
.jr-edge-right { right: 4px; }
.jr-controls { flex: none; min-height: 72px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-radius: 20px; background: var(--jr-paper); box-shadow: 0 4px 0 #25623b44; }
.jr-status { flex: 1; min-width: 200px; }
.jr-status strong { display: block; font-size: 21px; }
.jr-status small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.25; }
.jr-actions { display: flex; gap: 12px; }
.jr-notes { flex-basis: 100%; font-weight: 800; font-size: 15px; }
.jr-notes p { margin: 0; }

/* Large, scrollable panels keep six answers and long quiz content usable. */
.jr-overlay { position: absolute; z-index: 5; inset: calc(var(--topbar-h, 64px) + 108px) 12px 10px; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: 24px; background: #143e2dde; backdrop-filter: blur(5px); overflow: auto; }
.jr-panel { flex: 0 1 1100px; max-width: 100%; max-height: 100%; overflow-y: auto; padding: 22px 26px; border: 3px solid #ffedb3; border-radius: 26px; background: var(--jr-paper); box-shadow: 0 12px 36px #0b2f3266; text-align: center; animation: jr-enter 200ms ease-out; }
.jr-panel h2 { font-family: var(--font-title, sans-serif); font-size: clamp(26px, 3vw, 38px); line-height: 1.2; margin: 5px 0 10px; }
.jr-panel p { font-size: 18px; line-height: 1.4; margin: 6px 0 16px; }
.jr-question-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 18px; color: #416344; }
.jr-timer { min-width: 86px; border-radius: 12px; background: #e5efcd; color: #24472d; padding: 6px 10px; font-size: 22px; font-weight: 900; white-space: nowrap; }
.jr-timer-urgent { color: #972b25; background: #ffe0cb; }
.jr-question .jr-question-text { margin: 12px 0 16px; font-family: var(--font-head, sans-serif); font-size: clamp(25px, 2.5vw, 34px); overflow-wrap: anywhere; }
.jr-question-body { display: grid; gap: 20px; align-items: center; }
.jr-with-image { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.5fr); }
.jr-question-image { display: block; width: 100%; max-height: 250px; object-fit: contain; border-radius: 18px; }
.jr-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.jr-answer-row { display: flex; min-width: 0; align-items: center; gap: 5px; }
.jr-answer { display: flex; flex: 1; min-width: 0; min-height: 64px; align-items: center; gap: 10px; border: 3px solid #c8d8ba; border-radius: 16px; padding: 10px 12px; color: var(--ink, #3b3b58); background: white; font-size: clamp(20px, 1.8vw, 25px); font-weight: 800; text-align: left; transition: transform 160ms ease-out, background 160ms ease-out, border-color 160ms ease-out; }
.jr-answer > span:nth-child(2) { flex: 1; overflow-wrap: anywhere; }
.jr-answer:hover:not(:disabled) { background: #f0fadb; border-color: #649e54; }
.jr-answer:disabled { cursor: default; }
.jr-letter { flex: none; display: grid; place-items: center; width: 30px; height: 34px; border-radius: 9px; background: #e5efce; color: #315838; font-size: 18px; }
.jr-answer-row:nth-child(4n+2) .jr-letter { background: #d8f1fa; color: #2c6478; }
.jr-answer-row:nth-child(4n+3) .jr-letter { background: #fff0b8; color: #7a5821; }
.jr-answer-row:nth-child(4n+4) .jr-letter { background: #ebdffb; color: #694286; }
.jr-answer-correct { background: #c7f6a7; border-color: #29813e; color: #164e2a; }
.jr-answer-wrong { background: #ffdfd1; border-color: #bf493c; color: #8b2b23; }
.jr-answer-dim { opacity: .48; }
.jr-read { border: 0; border-radius: 50%; background: #dfefe4; width: 38px; height: 38px; flex: none; font-size: 19px; vertical-align: middle; transition: transform 160ms ease-out; }
.jr-reveal { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; margin-top: 16px; padding-top: 12px; border-top: 2px solid #d6dfbe; }
.jr-reveal strong { font-size: 20px; }
.jr-reveal p { font-size: 18px; margin: 3px 0 0; }
.jr-reveal .jr-btn { flex: none; }

.jr-overlay-dice { background: #143e2dbb; }
.jr-dice-panel { flex-basis: 440px; }
.jr-die-stage { height: 210px; display: grid; place-items: center; }
.jr-lottie { width: 220px; height: 210px; }
.jr-die { display: grid; place-items: center; width: 140px; height: 140px; border: 6px solid #d0b263; border-radius: 30px; background: #fffef5; box-shadow: 0 10px 0 #aa934e, 0 15px 26px #3d421c33; font-size: 82px; font-weight: 900; color: #315837; }
.jr-die-ten { background: #ffdf59; border: 0; border-radius: 20px; clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%); box-shadow: none; }
.jr-die-rolling { animation: jr-die-tumble 240ms ease-out infinite; }
.jr-dice-panel > strong { display: block; font-size: 27px; }
.jr-dice-panel > p { margin-top: 10px; }
.jr-card-panel { flex-basis: 1000px; }
.jr-booster { display: inline-block; padding: 6px 16px; border: 2px solid; border-radius: 999px; font-size: 16px; font-weight: 900; }
.jr-cards, .jr-rivals { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 20px 0; }
.jr-card { flex: 1 1 200px; max-width: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 240px; padding: 20px 16px; border: 3px solid #d4b766; border-radius: 22px; background: linear-gradient(150deg, #fffdf4, #fff0bd); box-shadow: 0 5px 0 #b39853; color: var(--jr-dark); transition: transform 180ms ease-out, box-shadow 180ms ease-out; }
.jr-card:hover { transform: translateY(-4px); box-shadow: 0 9px 0 #b39853; }
.jr-card-icon { display: block; font-size: 68px; line-height: 1.2; }
.jr-card strong { font-family: var(--font-head, sans-serif); font-size: 25px; line-height: 1.1; }
.jr-card > span:last-child { font-size: 18px; line-height: 1.35; }
.jr-rival { border-color: var(--jr-team, #a3c376); background: white; max-width: 220px; min-height: 190px; }
.jr-wheel-panel { flex-basis: 690px; }
.jr-wheel-panel h2 { margin-bottom: 0; }
.jr-wheel-panel p { margin-bottom: 8px; }
.jr-wheel-wrap { position: relative; width: min(330px, 48vh); aspect-ratio: 1; margin: 14px auto 18px; }
.jr-wheel { position: absolute; inset: 0; border-radius: 50%; border: 8px solid #936639; box-shadow: 0 6px 0 #5d4529, inset 0 0 0 5px #fff6c2; transition: transform 4s cubic-bezier(.12, .65, .12, 1); }
.jr-wheel-label { position: absolute; display: flex; align-items: center; flex-direction: column; justify-content: center; transform: translate(-50%, -50%); width: 32%; line-height: 1.05; color: #233e33; }
.jr-wheel-label > span { font-size: 30px; }
.jr-wheel-label b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; overflow-wrap: anywhere; }
.jr-wheel-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 54px; height: 54px; border: 4px solid #936639; border-radius: 50%; background: #ffefb1; font-size: 30px; }
.jr-pointer { position: absolute; z-index: 2; top: -7px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 34px solid #ad3735; filter: drop-shadow(0 3px 0 #fff3c9); }
.jr-punishment { flex-basis: 650px; }
.jr-punishment .jr-card-icon { margin: 12px 0; }
.jr-outcome { display: block; margin: 12px 0 20px; font-size: 24px; color: #8e452b; }

/* Effects live on the lanes, so their targets remain visible during play. */
.jr-projectile { position: absolute; z-index: 4; pointer-events: none; font-size: 48px; margin: -24px; animation: jr-coconut-flight 850ms ease-out both; }
.jr-splat { position: absolute; z-index: 4; bottom: 12px; font-size: 42px; pointer-events: none; animation: jr-splat-land 240ms ease-out both; }
.jr-shaking { animation: jr-stampede 650ms ease-out both; }
@keyframes jr-enter { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes jr-die-tumble { 0%, 100% { transform: rotate(-10deg) translateY(-6px); } 50% { transform: rotate(12deg) translateY(5px); } }
@keyframes jr-coconut-flight { 0% { transform: translate(0, 0) rotate(0); } 45% { transform: translate(calc(var(--jr-dx) * .45), calc(var(--jr-dy) * .45 - 65px)) rotate(170deg); } 100% { transform: translate(var(--jr-dx), var(--jr-dy)) rotate(360deg); } }
@keyframes jr-splat-land { from { opacity: 0; transform: translate(-50%, -28px) scale(.3); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes jr-stampede { 0%, 100% { transform: translate(0, 0); } 15%, 45%, 75% { transform: translate(-8px, 4px); } 30%, 60%, 90% { transform: translate(8px, -3px); } }

@media (max-width: 900px) {
    .jr-game { padding-left: 10px; padding-right: 10px; gap: 8px; }
    .jr-heading { gap: 8px; }
    .jr-heading h1 { font-size: 26px; }
    .jr-round { font-size: 16px; }
    .jr-lane-label { width: 118px; padding-left: 8px; }
    .jr-lane-label strong { font-size: 16px; }
    .jr-order-team { min-width: 78px; font-size: 13px; padding: 4px 6px; }
    .jr-controls { padding: 9px 12px; }
    .jr-status strong { font-size: 19px; }
    .jr-status small { max-width: 300px; font-size: 13px; }
    .jr-btn { font-size: 18px; padding: 12px 15px; }
    .jr-exit { font-size: 15px; padding: 8px 12px; }
    .jr-panel { padding: 18px; }
    .jr-overlay { inset-inline: 6px; }
    .jr-with-image { grid-template-columns: 160px minmax(0, 1fr); gap: 12px; }
    .jr-answer { font-size: 20px; padding: 8px; gap: 6px; }
    .jr-answers { gap: 8px; }
    .jr-answer-row { gap: 3px; }
    .jr-answer-row .jr-read { width: 30px; height: 34px; font-size: 15px; }
    .jr-card { min-height: 220px; padding: 16px 10px; }
    .jr-card strong { font-size: 22px; }
    .jr-card > span:last-child { font-size: 17px; }
    .jr-cards { gap: 12px; }
}
@media (max-height: 740px) {
    .jr-panel { padding-top: 14px; padding-bottom: 14px; }
    .jr-wheel-wrap { width: min(285px, 40vh); margin-top: 10px; margin-bottom: 14px; }
    .jr-wheel-label > span { font-size: 25px; }
    .jr-wheel-label b { font-size: 14px; }
    .jr-question .jr-question-text { margin: 8px 0 12px; }
    .jr-card { min-height: 215px; }
    .jr-card-icon { font-size: 58px; }
    .jr-question-image { max-height: 210px; }
}
@media (max-width: 620px) {
    .jr-heading { flex-wrap: wrap; }
    .jr-heading > span { display: none; }
    .jr-heading h1 { font-size: 22px; }
    .jr-round { font-size: 14px; padding: 5px 8px; }
    .jr-lane-label { width: 88px; }
    .jr-lane-label strong { font-size: 14px; }
    .jr-pawn-name { max-width: 58px; }
    .jr-overlay { top: calc(var(--topbar-h, 64px) + 120px); }
    .jr-panel { padding: 14px 10px; }
    .jr-with-image { grid-template-columns: 1fr; }
    .jr-question-image { max-height: 120px; }
    .jr-answers { grid-template-columns: 1fr; }
    .jr-answer { min-height: 52px; }
    .jr-reveal { flex-direction: column; align-items: stretch; }
    .jr-actions { width: 100%; }
    .jr-actions .jr-btn { flex: 1; }
    .jr-card { min-height: 190px; }
}
.jr-reduced *, .jr-reduced *::before, .jr-reduced *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
    .jr-game *, .jr-game *::before, .jr-game *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- round 2: hops, suspense and tile effects ---------- */
.jr-hop-1 .jr-pawn-body { animation: jr-hop-a 430ms ease-in-out; }
.jr-hop-2 .jr-pawn-body { animation: jr-hop-b 430ms ease-in-out; }
.jr-hop-3 { transition: left 850ms ease-in-out; }
.jr-hop-3 .jr-pawn-body { animation: jr-fly 900ms ease-in-out; }
@keyframes jr-hop-a {
    0%   { transform: translateY(0) scale(1.08, .9); }
    18%  { transform: translateY(-8px) scale(.94, 1.08); }
    50%  { transform: translateY(-38px) scale(1, 1) rotate(-6deg); }
    80%  { transform: translateY(-4px) scale(.98, 1.03); }
    90%  { transform: translateY(0) scale(1.12, .86); }
    100% { transform: translateY(0) scale(1, 1); }
}
@keyframes jr-hop-b {
    0%   { transform: translateY(0) scale(1.08, .9); }
    18%  { transform: translateY(-8px) scale(.94, 1.08); }
    50%  { transform: translateY(-38px) scale(1, 1) rotate(6deg); }
    80%  { transform: translateY(-4px) scale(.98, 1.03); }
    90%  { transform: translateY(0) scale(1.12, .86); }
    100% { transform: translateY(0) scale(1, 1); }
}
@keyframes jr-fly {
    0%   { transform: translateY(0) scale(1); }
    45%  { transform: translateY(-70px) scale(1.15) rotate(-12deg); }
    85%  { transform: translateY(-6px) scale(1.02); }
    92%  { transform: translateY(0) scale(1.12, .86); }
    100% { transform: translateY(0) scale(1); }
}
/* active team: a soft glowing spot under the pawn */
.jr-pawn-active::before {
    content: ''; position: absolute; z-index: -1; bottom: -6px; left: 50%;
    width: 120%; height: 18px; margin-left: -60%; border-radius: 50%;
    background: radial-gradient(ellipse, #fff6a8cc, #fff6a800 70%);
    animation: jr-glow 1.6s ease-in-out infinite;
}
@keyframes jr-glow { 50% { opacity: .45; transform: scaleX(.85); } }
.jr-steps {
    position: absolute; z-index: 3; top: -30px;
    min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--sun, #ffc93c); color: #4a3405; border: 3px solid #fff;
    font-size: 19px; font-weight: 900; box-shadow: 0 3px 0 #b88a1f;
}
/* tiles change with a splat / a leaf pop */
.jr-fx-mud .jr-pad { animation: jr-mud-in 650ms ease-out; }
.jr-fx-green .jr-pad { animation: jr-leaf-in 550ms ease-out; }
@keyframes jr-mud-in {
    0%   { transform: scale(.3) rotate(-4deg); opacity: .4; }
    45%  { transform: scale(1.3, .8) rotate(-4deg); opacity: 1; }
    70%  { transform: scale(.92, 1.1) rotate(-4deg); }
    100% { transform: scale(1) rotate(-4deg); }
}
@keyframes jr-leaf-in {
    0%   { transform: scale(1); filter: brightness(1); }
    40%  { transform: scale(1.25) translateY(-6px); filter: brightness(1.25); }
    100% { transform: scale(1); filter: brightness(1); }
}
/* specials gently bob; a reached special flashes before its effect */
.jr-special { animation: jr-coin 2.6s ease-in-out infinite; }
.jr-tile:nth-child(3n) .jr-special { animation-delay: -.9s; }
.jr-tile:nth-child(3n+1) .jr-special { animation-delay: -1.7s; }
@keyframes jr-coin { 50% { transform: translateY(-4px) rotate(8deg); } }
.jr-tile-flash .jr-special { animation: jr-flash 1s ease-out both; z-index: 3; }
@keyframes jr-flash {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 #fff6a8; }
    35%  { transform: scale(2.1) translateY(-14px) rotate(-10deg); box-shadow: 0 0 0 14px #fff6a855; }
    70%  { transform: scale(1.8) translateY(-10px) rotate(8deg); box-shadow: 0 0 0 26px #fff6a800; }
    100% { transform: scale(2.4) translateY(-30px); opacity: 0; }
}
/* answer suspense */
.jr-answer-checking {
    border-color: var(--sun, #ffc93c); background: #fff8d6;
    animation: jr-check 450ms ease-in-out infinite alternate;
}
@keyframes jr-check {
    from { transform: scale(1); box-shadow: 0 0 0 0 #ffc93c66; }
    to   { transform: scale(1.045); box-shadow: 0 0 0 10px #ffc93c22; }
}
.jr-answer-waiting { opacity: .55; }
.jr-answer-correct { animation: jr-correct 600ms ease-out; }
.jr-answer-wrong { animation: jr-wrong 500ms ease-out; }
@keyframes jr-correct { 0% { transform: scale(1); } 35% { transform: scale(1.1); } 60% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes jr-wrong { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.jr-reveal { animation: jr-enter 300ms ease-out; }
.jr-reveal-good strong { color: #217a3a; }
.jr-reveal-bad strong { color: #a5382f; }
/* power-up cards are dealt one by one */
.jr-card-deal { animation: jr-deal 480ms ease-out backwards; animation-delay: calc(var(--jr-deal, 0) * 160ms + 120ms); }
@keyframes jr-deal {
    from { opacity: 0; transform: translateY(40px) rotateY(80deg) scale(.9); }
    to   { opacity: 1; transform: none; }
}
.jr-punishment .jr-card-icon { animation: jr-deal 520ms ease-out both; }
