#ipl-intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0d0d;
    z-index: 999999;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* AUDIO UNLOCK OVERLAY REFINED */
.ipl-audio-unlock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100; /* highest within intro */
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.4s ease-out;
    -webkit-tap-highlight-color: transparent;
}
.ipl-unlock-content {
    text-align: center;
    animation: scaleInLoad 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.15s ease-out;
    padding: 30px;
    z-index: 101; /* Above ripple */
}
/* Scale down when the user actively taps the screen anywhere */
.ipl-audio-unlock:active .ipl-unlock-content {
    transform: scale(0.94);
}
@keyframes scaleInLoad {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* CTA Typography details */
.ipl-unlock-text {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}
.ipl-gradient-text {
    font-size: 3rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    margin-bottom: 5px;
}
.ipl-ready-text {
    font-size: 1.6rem;
    color: #ffcc00;
    display: block;
    margin-top: 10px;
}

/* Tappable floating button look */
.ipl-tap-cue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 40px;
    font-weight: 600;
    letter-spacing: 1.5px;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    animation: subtlePulse 2s infinite ease-in-out;
}
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 255, 255, 0.3); }
}
.ipl-pulse-dot {
    width: 12px;
    height: 12px;
    background: #FFCC00;
    border-radius: 50%;
    margin-right: 15px;
    box-shadow: 0 0 10px #FFCC00;
    animation: dotPulse 1s infinite alternate;
}
@keyframes dotPulse {
    from { opacity: 0.4; transform: scale(0.8); filter: blur(1px); }
    to { opacity: 1; transform: scale(1.2); filter: blur(0px); }
}

/* Flash/Ripple */
.ipl-ripple-effect {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}
.ipl-ripple-effect.active {
    animation: fastRipple 0.5s ease-out forwards;
}
@keyframes fastRipple {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(60); opacity: 0; }
}

/* Base background */
.ipl-intro-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-out;
    z-index: 1;
}
.ipl-intro-bg.active { opacity: 1; }

.ipl-intro-glow {
    position: absolute;
    width: 50%;
    height: 100%;
    opacity: 0.15; /* minimal glow */
}
.ipl-intro-glow.left { left: 0; background: linear-gradient(to right, var(--team1-color, #ff0000), transparent); }
.ipl-intro-glow.right { right: 0; background: linear-gradient(to left, var(--team2-color, #0000ff), transparent); }

/* MATCH HEADER (Top centered) */
.ipl-match-header {
    position: absolute;
    top: 8%;
    width: 100%;
    text-align: center;
    z-index: 2;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s ease-out;
}
.ipl-match-header.active {
    opacity: 1;
    transform: translateY(0);
}
.ipl-match-header h3 {
    font-size: 1.5rem;
    color: #ffcc00;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}
.ipl-match-header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin: 5px 0;
    font-weight: 800;
}
.ipl-match-header p {
    font-size: 1.2rem;
    color: #aaa;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* PLAYERS */
/* PLAYERS REFACTORED FOR EQUAL VISUAL FRAMES */
.players-wrapper {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    pointer-events: none;
}

.player-container {
    flex: 1 !important; /* Equal visual halves */
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-end !important;
    height: 100%;
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease-out;
}

/* Slide Initial Positions (Applied to Container) */
.left-player { 
    transform: translateX(-100%); 
    transform-origin: bottom center; 
}
.right-player { 
    transform: translateX(100%); 
    transform-origin: bottom center; 
}

/* Slide Final Positions (When Active) */
.ipl-players-anim.active .left-player { 
    opacity: 1; 
    transform: translateX(0) !important; 
}
.ipl-players-anim.active .right-player { 
    opacity: 1; 
    transform: translateX(0) !important; 
}

/* Dimming Logic */
.ipl-players-anim.dimmed .player-container {
    filter: brightness(0.4) blur(1px);
}

/* THUNDER FLASH */
.ipl-thunder-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}
.ipl-thunder-flash.flash {
    animation: flashAnim 0.3s ease-out forwards;
}
@keyframes flashAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.ipl-shake {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shakeAnim {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
    40%, 60% { transform: translate3d(7px, 0, 0); }
}

/* VS SCREEN (Only VS) */
.ipl-vs-screen {
    position: absolute;
    z-index: 5;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.ipl-vs-screen.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.ipl-vs-screen.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
}
.ipl-vs-center {
    font-size: 8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 30px #ffcc00, 0 0 60px #ffcc00;
    font-style: italic;
    margin: 0;
    letter-spacing: 5px;
    line-height: 1;
}

/* PROMO SCREEN (Separate Layer) */
.ipl-promo-screen {
    position: absolute;
    z-index: 6;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    opacity: 0;
    transition: all 0.6s ease-out;
    width: 90%;
    pointer-events: none;
}
.ipl-promo-screen.active {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}
.ipl-promo-txt {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    background: radial-gradient(circle, rgba(0,0,0,0.8) 0%, transparent 80%);
    padding: 30px;
    border-radius: 20px;
    line-height: 1.4;
}
.ipl-promo-sub {
    color: #ffcc00;
    display: block;
    font-size: 1.8rem;
    margin-top: 15px;
}

/* BOXING PUNCH EXIT */
.ipl-boxing-punch {
    animation: punchExit 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes punchExit {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0; pointer-events: none; }
}

/* SKIP */
.ipl-skip-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
.ipl-skip-btn.active { opacity: 1; }
.ipl-skip-btn:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 768px) {
    .ipl-match-header h3 { font-size: 1.2rem; }
    .ipl-match-header h1 { font-size: 1.8rem; }
    .ipl-match-header p { font-size: 1rem; }
    .ipl-vs-center { font-size: 6rem; }
    .ipl-promo-txt { font-size: 1.6rem; padding: 15px; }
    .ipl-promo-sub { font-size: 1.3rem; margin-top: 10px; }
    .player-cutout { height: 50vh; }
    .ipl-gradient-text { font-size: 2.2rem; }
    .ipl-unlock-text { font-size: 1.5rem; margin-bottom: 25px; }
    .ipl-tap-cue { font-size: 1rem; padding: 10px 20px; }
    .ipl-ready-text { font-size: 1.2rem; }
}

/* ENHANCED PLAYER RENDERING SYSTEM (SAFE) */
.player-container {
    position: relative !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.player-container img {
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;

    transform: translateX(-50%) scale(var(--player-scale, 1)) !important;
    transform-origin: bottom center !important;

    max-height: 85% !important;  /* limit size */
    width: auto !important;
    height: auto !important;

    object-fit: contain !important; /* preserve ratio */
    pointer-events: none;
    transition: transform 0.3s ease;
}
