/* =====================================================================
 * PM FOOTBALL ANIMATION — anim-futebol.css
 * Drone descent from aerial stadium view to live match play
 * Shortcode: [pm_futebol]
 * ===================================================================== */

/* ── Wrapper ────────────────────────────────────────────────── */
.pm-futanim {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 640px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 120px rgba(0,80,0,0.2);
    background: #040810;
    margin: 0 auto 2rem;
    user-select: none;
}

/* Night theme */
.pm-futanim--noite {
    background: radial-gradient(ellipse at 50% 30%, #0d1b2a 0%, #040810 100%);
}

/* Day theme */
.pm-futanim--dia {
    background: radial-gradient(ellipse at 50% 20%, #1a6faf 0%, #0a3d62 50%, #051d2e 100%);
}

/* ── Night sky (stars) ─────────────────────────────────────── */
.pm-futanim__sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: futSkyFade 28s ease-in-out infinite;
}

@keyframes futSkyFade {
    0%, 15%  { opacity: 1; }
    50%, 85% { opacity: 0; }
    100%     { opacity: 1; }
}

.pm-futanim__star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: futTwinkle var(--tw-dur, 2s) var(--tw-delay, 0s) ease-in-out infinite alternate;
}

@keyframes futTwinkle {
    from { opacity: 0.2; transform: scale(0.8); }
    to   { opacity: 1;   transform: scale(1.4); }
}

/* ── Stadium floodlight glow ───────────────────────────────── */
.pm-futanim__lights {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 14%, rgba(255,248,180,0.18) 0%, transparent 35%),
        radial-gradient(circle at 88% 14%, rgba(255,248,180,0.18) 0%, transparent 35%),
        radial-gradient(circle at 12% 86%, rgba(255,248,180,0.18) 0%, transparent 35%),
        radial-gradient(circle at 88% 86%, rgba(255,248,180,0.18) 0%, transparent 35%);
    animation: futLightFlicker 0.12s ease-in-out infinite alternate;
}

@keyframes futLightFlicker {
    from { opacity: 0.85; }
    to   { opacity: 1.0; }
}

/* ── Scene container — drone camera movement ───────────────── */
.pm-futanim__scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: futDrone 28s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: 50% 50%;
    will-change: transform;
}

@keyframes futDrone {
    0%    { transform: scale(0.20) translateY(-6%); filter: blur(3px); }
    6%    { transform: scale(0.25) translateY(-4%); filter: blur(2px); }
    18%   { transform: scale(0.42);                 filter: blur(1px); }
    34%   { transform: scale(0.68);                 filter: blur(0.5px); }
    48%   { transform: scale(0.90);                 filter: blur(0); }
    60%   { transform: scale(1.08);                 filter: blur(0); }
    72%   { transform: scale(1.22);                 filter: blur(0); }
    82%   { transform: scale(1.38) translateY(4%);  filter: blur(0); }
    90%   { transform: scale(1.50) translateY(6%);  filter: blur(0); }
    94%   { transform: scale(1.50) translateY(6%);  filter: blur(0); opacity: 1; }
    98%   { transform: scale(0.20) translateY(-6%); filter: blur(4px); opacity: 0.2; }
    99%   { transform: scale(0.20) translateY(-6%); filter: blur(4px); opacity: 0.2; }
    100%  { transform: scale(0.20) translateY(-6%); filter: blur(3px); opacity: 1; }
}

/* ── SVG field ─────────────────────────────────────────────── */
.pm-futanim__svg {
    width: 100%;
    height: 100%;
    max-width: 920px;
    max-height: 580px;
}

/* ── Vignette overlay ──────────────────────────────────────── */
.pm-futanim__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0,0,0,0.65) 100%);
    pointer-events: none;
    z-index: 2;
}

/* ── Match HUD ─────────────────────────────────────────────── */
.pm-futanim__hud {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-16px);
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 7px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'Bebas Neue', 'Montserrat', sans-serif;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: futHudAppear 28s infinite;
}

@keyframes futHudAppear {
    0%, 35%          { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    45%, 92%         { opacity: 1; transform: translateX(-50%) translateY(0); }
    96%, 100%        { opacity: 0; transform: translateX(-50%) translateY(-16px); }
}

.pm-futanim__hud-team {
    font-size: 0.85rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

.pm-futanim__hud-score {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--pm-gold, #f0b90b);
    min-width: 54px;
    text-align: center;
}

.pm-futanim__hud-sep {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.25);
}

.pm-futanim__hud-time {
    font-size: 0.8rem;
    opacity: 0.65;
    letter-spacing: 1px;
}

/* ── GOAL flash animation ──────────────────────────────────── */
.pm-futanim__goal-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    animation: futGoalFlash 28s infinite;
    background: radial-gradient(circle at 8% 50%, rgba(255,215,0,0.55) 0%, transparent 65%);
}

@keyframes futGoalFlash {
    0%, 82%  { opacity: 0; }
    84%      { opacity: 1; }
    86%      { opacity: 0.4; }
    88%      { opacity: 0.95; }
    92%      { opacity: 0; }
    100%     { opacity: 0; }
}

/* ── GOAL label ────────────────────────────────────────────── */
.pm-futanim__goal-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-family: 'Bebas Neue', 'Montserrat', sans-serif;
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 900;
    color: var(--pm-gold, #f0b90b);
    text-shadow: 0 0 40px rgba(240,185,11,0.9), 0 0 80px rgba(240,185,11,0.5);
    letter-spacing: 8px;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    animation: futGoalLabel 28s infinite;
}

@keyframes futGoalLabel {
    0%, 83.5% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    85%       { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    87%       { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
    91%       { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
    94%       { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
    100%      { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
}

/* ── Crowd noise label ─────────────────────────────────────── */
.pm-futanim__drone-label {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: futDroneLabel 28s infinite;
}

.pm-futanim__drone-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--pm-red, #e63946);
    border-radius: 50%;
    animation: futRecDot 1s ease-in-out infinite alternate;
}

@keyframes futRecDot {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0.3; transform: scale(0.7); }
}

@keyframes futDroneLabel {
    0%, 18%  { opacity: 0; }
    25%, 95% { opacity: 1; }
    98%, 100%{ opacity: 0; }
}

/* ── Scanline effect ───────────────────────────────────────── */
.pm-futanim::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.06) 4px
    );
    pointer-events: none;
    z-index: 3;
}

/* ── Responsive adjustments ────────────────────────────────── */
@media (max-width: 600px) {
    .pm-futanim__hud { font-size: 0.8rem; padding: 5px 14px; gap: 10px; }
    .pm-futanim__hud-score { font-size: 1.2rem; }
    .pm-futanim__hud-team  { display: none; }
    .pm-futanim__goal-label { font-size: clamp(2.5rem, 16vw, 5rem); }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .pm-futanim__scene { animation: none; transform: scale(0.9); filter: none; }
    .pm-futanim__sky   { animation: none; opacity: 0; }
    .pm-futanim__hud   { animation: none; opacity: 1; transform: translateX(-50%); }
    .pm-futanim__goal-flash, .pm-futanim__goal-label { animation: none; opacity: 0; }
}
