/* Animated graphics for AP Euro reel — pair with .ap-euro-g--{slideId} */

.ap-euro-reel-graphic-wrap {
    flex: 1 1 42%;
    min-height: 168px;
    max-height: min(42vh, 300px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    pointer-events: none;
}

.ap-euro-g {
    position: relative;
    width: min(100%, 280px);
    height: min(36vh, 240px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- vibe: old → new orbs --- */
.ap-euro-g-vibe__orbs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1;
}

.ap-euro-g-vibe__orb {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: block;
}

.ap-euro-g-vibe__orb--old {
    background: radial-gradient(circle at 30% 30%, #64748b, #334155 60%, #1e293b);
    box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.4);
    animation: apEuroVibePulseOld 3.2s ease-in-out infinite;
}

.ap-euro-g-vibe__orb--new {
    background: radial-gradient(circle at 35% 35%, #57534e, #44403c 55%, #292524);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.45);
    animation: apEuroVibePulseNew 3.2s ease-in-out infinite 0.4s;
}

.ap-euro-g-vibe__arrow {
    font-size: 1.75rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.55);
    animation: apEuroVibeArrow 2.4s ease-in-out infinite;
}

.ap-euro-g-vibe__shimmer {
    position: absolute;
    inset: 10% 5%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.06) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: apEuroShimmer 4s linear infinite;
    border-radius: 20px;
}

@keyframes apEuroVibePulseOld {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(0.92);
        opacity: 1;
    }
}

@keyframes apEuroVibePulseNew {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes apEuroVibeArrow {
    0%,
    100% {
        transform: translateX(0);
        opacity: 0.5;
    }
    50% {
        transform: translateX(6px);
        opacity: 1;
    }
}

@keyframes apEuroShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* --- books + humanism --- */
.ap-euro-g-books {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100px;
    z-index: 1;
    position: relative;
}

.ap-euro-g-books__spine {
    width: 28px;
    border-radius: 4px 3px 0 0;
    animation: apEuroBookFloat 2.8s ease-in-out infinite;
}

.ap-euro-g-books__spine--a {
    height: 72px;
    background: linear-gradient(180deg, #475569, #1e293b);
    animation-delay: 0s;
}
.ap-euro-g-books__spine--b {
    height: 92px;
    background: linear-gradient(180deg, #3f3f46, #27272a);
    animation-delay: 0.15s;
}
.ap-euro-g-books__spine--c {
    height: 64px;
    background: linear-gradient(180deg, #52525b, #3f3f46);
    animation-delay: 0.3s;
}

.ap-euro-g-books__float {
    position: absolute;
    width: 48px;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    top: 28%;
    left: 50%;
    margin-left: -24px;
    animation: apEuroFloatLine 2.2s ease-in-out infinite;
}

@keyframes apEuroBookFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes apEuroFloatLine {
    0%,
    100% {
        opacity: 0.3;
        transform: scaleX(0.6);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* --- art: frame + perspective --- */
.ap-euro-g-art__frame {
    padding: 10px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    animation: apEuroFrameGlow 3s ease-in-out infinite;
}

.ap-euro-g-art__canvas {
    width: 160px;
    height: 110px;
    background: linear-gradient(160deg, #1a1a1c 0%, #0c0c0d 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.ap-euro-g-art__line {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    transform-origin: left bottom;
}

.ap-euro-g-art__line--1 {
    left: 12px;
    bottom: 18px;
    width: 100px;
    height: 2px;
    transform: rotate(-12deg);
    animation: apEuroLinePulse 2.4s ease-in-out infinite;
}
.ap-euro-g-art__line--2 {
    left: 12px;
    bottom: 18px;
    width: 80px;
    height: 2px;
    transform: rotate(28deg);
    animation: apEuroLinePulse 2.4s ease-in-out infinite 0.2s;
}
.ap-euro-g-art__line--3 {
    left: 50px;
    bottom: 50px;
    width: 50px;
    height: 2px;
    transform: rotate(90deg);
    animation: apEuroLinePulse 2.4s ease-in-out infinite 0.4s;
}

.ap-euro-g-art__sun {
    position: absolute;
    right: 18px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, #71717a, #52525b);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
    animation: apEuroSunPulse 2s ease-in-out infinite;
}

@keyframes apEuroFrameGlow {
    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.18);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.32);
    }
}

@keyframes apEuroLinePulse {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.95;
    }
}

@keyframes apEuroSunPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

/* --- explore: compass + ship --- */
.ap-euro-g-explore {
    position: relative;
    width: 200px;
    height: 140px;
}

.ap-euro-g-explore__compass {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    background: radial-gradient(circle, rgba(39, 39, 42, 0.95), rgba(15, 15, 16, 0.98));
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-euro-g-explore__needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 34px;
    margin-left: -2px;
    margin-top: -34px;
    background: linear-gradient(180deg, #71717a, #3f3f46);
    border-radius: 2px;
    animation: apEuroCompassSpin 8s linear infinite;
    transform-origin: 50% 100%;
}

.ap-euro-g-explore__rose {
    font-size: 0.65rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    position: absolute;
    top: 8px;
}

.ap-euro-g-explore__ship {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 52px;
    height: 18px;
    background: linear-gradient(180deg, #94a3b8, #475569);
    border-radius: 0 8px 6px 0;
    clip-path: polygon(0 40%, 18% 0, 100% 15%, 100% 100%, 0 100%);
    animation: apEuroShipRock 2.5s ease-in-out infinite;
}

@keyframes apEuroCompassSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes apEuroShipRock {
    0%,
    100% {
        transform: translateX(0) rotate(-2deg);
    }
    50% {
        transform: translateX(-6px) rotate(3deg);
    }
}

/* --- capitalism: coins --- */
.ap-euro-g-coins {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 100px;
    position: relative;
}

.ap-euro-g-coins__c {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #71717a, #57534e 60%, #292524);
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 4px 0 #292524;
    animation: apEuroCoinStack 2.2s ease-in-out infinite;
}

.ap-euro-g-coins__c:nth-child(1) {
    animation-delay: 0s;
    margin-bottom: 0;
}
.ap-euro-g-coins__c:nth-child(2) {
    animation-delay: 0.12s;
    margin-bottom: 18px;
}
.ap-euro-g-coins__c:nth-child(3) {
    animation-delay: 0.24s;
    margin-bottom: 36px;
}

.ap-euro-g-coins__spark {
    position: absolute;
    top: 20%;
    right: 18%;
    width: 6px;
    height: 6px;
    background: #a1a1aa;
    border-radius: 50%;
    animation: apEuroSpark 1.8s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(161, 161, 170, 0.5);
}

@keyframes apEuroCoinStack {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes apEuroSpark {
    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* --- kings vs peasants --- */
.ap-euro-g-power {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
}

.ap-euro-g-power__crown {
    width: 0;
    height: 0;
    border-left: 36px solid transparent;
    border-right: 36px solid transparent;
    border-bottom: 28px solid #a1a1aa;
    position: relative;
    animation: apEuroCrownBob 2.6s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.ap-euro-g-power__crown::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 28px;
    width: 56px;
    height: 10px;
    background: #57534e;
    border-radius: 2px;
}

.ap-euro-g-power__wheat {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 56px;
}

.ap-euro-g-power__wheat span {
    width: 5px;
    height: 40px;
    background: linear-gradient(180deg, #52525b, #3f3f46);
    border-radius: 3px 3px 0 0;
    animation: apEuroWheatSway 2.4s ease-in-out infinite;
}

.ap-euro-g-power__wheat span:nth-child(2) {
    height: 52px;
    animation-delay: 0.15s;
}
.ap-euro-g-power__wheat span:nth-child(3) {
    height: 36px;
    animation-delay: 0.3s;
}

@keyframes apEuroCrownBob {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes apEuroWheatSway {
    0%,
    100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(4deg);
    }
}

/* --- CER before / now --- */
.ap-euro-g-cer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.ap-euro-g-cer__before,
.ap-euro-g-cer__now {
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    animation: apEuroCerFade 3s ease-in-out infinite;
}

.ap-euro-g-cer__now {
    animation-delay: 0.5s;
}

.ap-euro-g-cer__arrow {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #52525b, #a1a1aa);
    border-radius: 2px;
    position: relative;
    animation: apEuroCerArrow 2.4s ease-in-out infinite;
}

.ap-euro-g-cer__arrow::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -5px;
    border: 6px solid transparent;
    border-left: 10px solid #a1a1aa;
}

@keyframes apEuroCerFade {
    0%,
    100% {
        opacity: 0.65;
    }
    50% {
        opacity: 1;
    }
}

@keyframes apEuroCerArrow {
    0%,
    100% {
        transform: scaleX(0.85);
        opacity: 0.7;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* --- church --- */
.ap-euro-g-church {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: apEuroChurchGlow 3.5s ease-in-out infinite;
}

.ap-euro-g-church__roof {
    width: 0;
    height: 0;
    border-left: 56px solid transparent;
    border-right: 56px solid transparent;
    border-bottom: 48px solid rgba(148, 163, 184, 0.45);
}

.ap-euro-g-church__body {
    width: 88px;
    height: 56px;
    background: linear-gradient(180deg, #475569, #1e293b);
    border-radius: 0 0 6px 6px;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 10px;
}

.ap-euro-g-church__win {
    width: 14px;
    height: 22px;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.12);
    animation: apEuroWinFlicker 4s ease-in-out infinite;
}

.ap-euro-g-church__cross {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 22px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
}

.ap-euro-g-church__cross::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px;
    width: 20px;
    height: 4px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
}

@keyframes apEuroChurchGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.08));
    }
}

@keyframes apEuroWinFlicker {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* --- feudalism pyramid --- */
.ap-euro-g-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ap-euro-g-pyramid__tier {
    display: block;
    height: 22px;
    background: linear-gradient(90deg, #64748b, #334155);
    border-radius: 4px;
    animation: apEuroTierPulse 2.8s ease-in-out infinite;
}

.ap-euro-g-pyramid__tier--3 {
    width: 36px;
    animation-delay: 0s;
}
.ap-euro-g-pyramid__tier--2 {
    width: 72px;
    animation-delay: 0.1s;
}
.ap-euro-g-pyramid__tier--1 {
    width: 120px;
    animation-delay: 0.2s;
}

@keyframes apEuroTierPulse {
    0%,
    100% {
        transform: scaleX(1);
        opacity: 0.75;
    }
    50% {
        transform: scaleX(1.02);
        opacity: 1;
    }
}

/* --- plague rings --- */
.ap-euro-g-plague {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-euro-g-plague__core {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #64748b;
    z-index: 2;
    animation: apEuroCorePulse 2s ease-in-out infinite;
}

.ap-euro-g-plague__ring {
    position: absolute;
    border: 2px solid rgba(148, 163, 184, 0.45);
    border-radius: 50%;
    animation: apEuroRingExpand 3s ease-out infinite;
}

.ap-euro-g-plague__ring--1 {
    width: 40px;
    height: 40px;
    animation-delay: 0s;
}
.ap-euro-g-plague__ring--2 {
    width: 40px;
    height: 40px;
    animation-delay: 1s;
}
.ap-euro-g-plague__ring--3 {
    width: 40px;
    height: 40px;
    animation-delay: 2s;
}

@keyframes apEuroRingExpand {
    0% {
        transform: scale(0.5);
        opacity: 0.9;
    }
    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

@keyframes apEuroCorePulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* --- ottomans: crescent + route --- */
.ap-euro-g-otto {
    position: relative;
    width: 220px;
    height: 120px;
}

.ap-euro-g-otto__crescent {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: 12px -8px 0 0 rgba(161, 161, 170, 0.45);
    transform: rotate(-25deg);
    margin: 0 auto 12px;
    animation: apEuroMoonFloat 3.2s ease-in-out infinite;
}

.ap-euro-g-otto__route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 12px;
}

.ap-euro-g-otto__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.ap-euro-g-otto__line {
    flex: 1;
    min-width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #52525b 0%, #71717a 50%, #52525b 100%);
    background-size: 200% 100%;
    animation: apEuroRouteFlow 2s linear infinite;
}

.ap-euro-g-otto__ship {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 10px solid #94a3b8;
    margin-left: 4px;
    animation: apEuroRouteShip 2s linear infinite;
}

@keyframes apEuroMoonFloat {
    0%,
    100% {
        transform: rotate(-25deg) translateY(0);
    }
    50% {
        transform: rotate(-25deg) translateY(-6px);
    }
}

@keyframes apEuroRouteFlow {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes apEuroRouteShip {
    0%,
    100% {
        transform: translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(4px);
        opacity: 1;
    }
}

/* --- payoff check --- */
.ap-euro-g-payoff {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-euro-g-payoff__ring {
    position: absolute;
    width: 88px;
    height: 88px;
    border: 4px solid rgba(161, 161, 170, 0.45);
    border-radius: 50%;
    animation: apEuroPayoffRing 2.4s ease-in-out infinite;
}

.ap-euro-g-payoff__check {
    font-size: 2.75rem;
    font-weight: 800;
    color: #e4e4e7;
    z-index: 1;
    animation: apEuroPayoffCheck 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
}

@keyframes apEuroPayoffRing {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes apEuroPayoffCheck {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.ap-euro-g-fallback {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .ap-euro-g *,
    .ap-euro-g *::before,
    .ap-euro-g *::after {
        animation: none !important;
    }
}
