@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Noto+Sans+Thai:wght@700;900&family=Rajdhani:wght@500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: transparent;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: transparent;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}



/*-------------------  set icon status */
.icon-svg {
    width: 35px;
    height: 35px;
    vertical-align: middle;
    margin: 0 6px;
}

/*-------------------  set icon hand */
.icon-hand-svg {
    width: 45px;
    height: 45px;
    vertical-align: middle;
    margin: 0 6px;
}



/* ─── Container ─────────────────────────────────── */
.pk-container {
    width: 100%;
    max-width: 1100px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Duo ⇄ Multi layout toggle ─────────────────────
   The overlay ships two roots: .pk-container (duo, 2 players) and #pk-multi
   (multi-PK, 3–8). core/styles.js sets body[data-layout] from the active style;
   we show exactly one. Default (no attr) = duo, so nothing regresses. */
#pk-multi {
    display: none;
}

body[data-layout="multi"] .pk-container {
    display: none;
}

body[data-layout="multi"] #pk-multi {
    display: block;
    position: relative;
    width: 1077px;
    height: 372px;
    flex-shrink: 0;
}

/* Shared multi-PK chrome (header pill + divider). Always loaded (base.css) so
   both theme CSS files only carry their own board layout. Transparent — colour
   lives on the pill/segments/tiles, never the page. */
.mpk {
    position: absolute;
    inset: 0;
    font-family: 'Noto Sans Thai', sans-serif;
    color: #fff;
}

/* Divider line (Figma Rectangle 1692). */
.mpk::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 47px;
    height: 2px;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #fff 31%, #fff 73%, rgba(255, 255, 255, 0) 100%);
}

.mpk-header {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.98) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04), 0 0 15px rgba(139, 92, 246, 0.06);
    z-index: 10;
    backdrop-filter: blur(12px);
}

.mpk-round {
    display: flex;
    align-items: center;
    padding: 0 22px;
    font-weight: 700;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.25);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.mpk-time {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    min-width: 120px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 30px;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.mpk-time.disconnected {
    opacity: 0.45;
    text-shadow: none;
}

/* Display toggle: operation.show_avatars=false hides the avatar tiles on both
   multi layouts (rings .mpk-avatar / bars .mpk-seg-avatar). The round-pill
   toggle is handled in JS (multi-base.js paintHeader). */
.mpk.hide-avatars .mpk-avatar,
.mpk.hide-avatars .mpk-seg-avatar {
    display: none;
}

.mpk-time.timeup {
    font-size: 22px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ff758c 0%, #ff88ff 50%, #8e2de2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.pk-top-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 0;
    /* Removed padding to let them go to absolute edges */
    z-index: 10;
    position: relative;
    /* Added for absolute centering of round-info */
}

.pk-team-label-col {
    display: flex;
    flex-direction: column;
    width: 320px;
    position: relative;
}

.pk-team-label-col.right {
    align-items: flex-end;
}

.pk-main-card {
    width: calc(100% + 70px);
    margin-left: -35px;
    margin-right: -35px;
    height: 275px;
    /* absolute height based on SVG */
    min-height: 275px;
    /* Increased opacity and darkened rgb from SVG's default 0.6 for the pink side */
    background: linear-gradient(90deg, rgba(5, 120, 220, 0.4) 0%, rgba(197, 22, 87, 0.4) 100%);
    border: 5px solid rgba(227, 227, 227, 0.4);
    border-radius: 17.5px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); */
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
    overflow: hidden;

}

.pk-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 50px 16.5px 0 16.5px;
    height: 128px;
    position: relative;
    overflow: hidden;
}

.pk-card-side {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.pk-card-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}



/* Timer pulse + scale */
@keyframes timer-warning {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    40% {
        opacity: 0.4;
        transform: scale(1.12);
    }

    70% {
        opacity: 0.8;
        transform: scale(1.04);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pk-container.warning .pk-timer {
    color: #ff2d2d;
    font-size: 100px;
    letter-spacing: 0;
    -webkit-text-stroke: 3px rgba(255, 0, 0, 0.8);
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    animation: timer-warning 0.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Container shake */
@keyframes warning-shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    15% {
        transform: translate(-2px, 1px);
    }

    35% {
        transform: translate(2px, -1px);
    }

    55% {
        transform: translate(-1px, 0);
    }

    75% {
        transform: translate(1px, 1px);
    }
}

.pk-container.warning {
    animation: warning-shake 0.6s ease-in-out infinite;
}


/* Score bar heartbeat */
@keyframes warning-heartbeat {

    0%,
    100% {
        transform: scaleY(1);
    }

    15% {
        transform: scaleY(1.06);
    }

    30% {
        transform: scaleY(1);
    }

    45% {
        transform: scaleY(1.04);
    }

    60% {
        transform: scaleY(1);
    }
}

.pk-container.warning .pk-score-bar {
    animation: warning-heartbeat 0.8s ease-in-out infinite;
}


/* ─── HEADER ─────────────────────────────────────── */
.pk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 40px;
}

.pk-team-column {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transform: scale(0.7);
}

.pk-team-column.left {
    align-items: center;
    transform-origin: left center;
}

.pk-team-column.right {
    align-items: center;
    transform-origin: right center;
}

.team-label-top {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #fff;
    font-weight: 900;
    margin-bottom: 5px;
    /* Moved up by 10px (was -5px) */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    z-index: 5;
    position: relative;
}

.pk-team-column.left .team-label-top {
    margin-left: 0;
    /* Fully flush to the left edge */
}

.pk-team-column.right .team-label-top {
    margin-right: 0;
    /* Fully flush to the right edge */
}

.pk-team-profile {
    display: flex;
    align-items: center;
}

/* Redesigned Name Boxes (Top Row) */
.idol-name-box {
    background: rgba(28, 30, 41, 0.95);
    border-radius: 10px;
    padding: 0;
    width: 320px;
    min-width: 320px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.idol-name-box.left {
    border: 4px solid #00B9C7;
    box-shadow: 0 0 20px rgba(0, 185, 199, 0.9), 0 0 35px rgba(0, 185, 199, 0.5);
    margin-right: -40px;
    /* Tuck under avatar */
}

.idol-name-box.right {
    border: 4px solid #FF55AF;
    box-shadow: 0 0 20px rgba(255, 85, 175, 0.9), 0 0 35px rgba(255, 85, 175, 0.5);
    margin-left: -40px;
    /* Tuck under avatar */
}

.idol-name {
    font-family: 'Noto Sans Thai', sans-serif;
    font-weight: 900;
    font-size: 28px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    display: inline-block;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.idol-name.marquee-active {
    width: auto;
    text-align: left;
    padding-left: 100%;
    animation: scroll-text-left 10s linear infinite;
}

@keyframes scroll-text-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Wings + Avatar Container */
.avatar-container {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    overflow: visible;
    flex-shrink: 0;
}

.pk-team-profile.left .avatar-container {
    filter: drop-shadow(0 0 10px rgba(0, 185, 199, 1)) drop-shadow(0 0 25px rgba(0, 185, 199, 0.8));
}

.pk-team-profile.right .avatar-container {
    filter: drop-shadow(0 0 10px rgba(255, 85, 175, 1)) drop-shadow(0 0 25px rgba(255, 85, 175, 0.8));
}

/* ── Avatar Frame Overlay (SVG ring + wings) ── */
.avatar-frame {
    position: absolute;
    width: 153px;
    /* Scaling the 118px SVG to fit its inner 61px ring over the 80px avatar */
    pointer-events: none;
    z-index: 4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.team-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    background: #888;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Idol Name Box */
/* Score labels have been moved inside the progress bars below */

.score-section {
    position: absolute;
    bottom: 24px;
    /* Increased 15px bottom space */
    left: 21.5px;
    right: 21.5px;
    height: 80px;
    z-index: 10;
}

.score-bar-wrapper {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: stretch;
}

.pk-score-bar {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.score-side {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    /* Bar width = pure score proportion (dp%/ap% set inline by render.js).
       min-width:0 so neither side reserves extra space nor lets a long number
       (e.g. 10000001) shrink the other side via flex-shrink. The number itself
       can overflow the colored area (overflow: visible) without moving the seam. */
    min-width: 0;
    overflow: visible;
}

/* Defender Bar: Purple to Pink */
.score-side.blue {
    background: linear-gradient(90deg, #00C7F0 0%, #2FFEFB 100%);
    justify-content: flex-start;
    padding-left: 27px;
    /* matches x=51 SVG text start */
    border-radius: 40px 0 0 40px;
}

/* Attacker Bar: Blue to Green */
.score-side.pink {
    background: linear-gradient(90deg, #EA45A7 0%, #FE1494 100%);
    justify-content: flex-end;
    padding-right: 27px;
    border-radius: 0 40px 40px 0;
}

.score-label-left,
.score-label-right {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 60px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.clash-indicator {
    display: none;
}

.idol-name {
    font-family: 'Noto Sans Thai', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

/* Round Info */
.pk-round-info {
    display: none;
    /* Hidden per user request, was flex */
    align-items: center;
    gap: 16px;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 40px;
    font-weight: 700;
    position: absolute;
    left: 50%;
    bottom: 16px;
    /* Aligns center of text with center of avatars */
    transform: translateX(-50%);
    white-space: nowrap;
}

.round-text {
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.red-arrow {
    color: #ff2a7a;
    text-shadow: 0 0 10px rgba(255, 42, 122, 0.6);
}

.blue-arrow {
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

/* ─── MAIN PANEL ─────────────────────────────────── */
.pk-main {
    margin-top: 10px;
    padding: 24px 32px;
    background: linear-gradient(90deg, #A12B6B 0%, #4D3C8A 50%, #206FBA 100%);
    border-radius: 20px;
    border: 4px solid #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* ─── GIFT + TIMER ROW ───────────────────────────── */
.gift-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.gift-strip-side {
    width: 308px;
    height: 68px;
    display: flex;
    align-items: center;
}

.gift-strip-side.left {
    justify-content: flex-start;
}

.gift-strip-side.right {
    justify-content: flex-end;
}

.marquee-clip {
    width: 100%;
    height: 140%;
    overflow: hidden;
    position: relative;
    display: flex;
}

.marquee-track {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gift-icon {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Gift cycler (gift-marquee.js) ───────────────────────────────────────────
   gc-row/gc-card: page-based carousel (cycle & slide modes)
   ─────────────────────────────────────────────────────────────────────────── */
.gc-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

.gc-row.gc-row-right {
    justify-content: flex-end;
}

.gc-card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gc-anim-in {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* zoom-in → hold → zoom-out (same rhythm as multi-pk giftCycle) */
@keyframes gc-anim-cycle {
    0% {
        transform: scale(0.2);
        opacity: 0;
        animation-timing-function: ease-out;
    }

    15% {
        transform: scale(1.1);
        opacity: 1;
        animation-timing-function: ease-in-out;
    }

    25% {
        transform: scale(1);
        opacity: 1;
        animation-timing-function: linear;
    }

    75% {
        transform: scale(1);
        opacity: 1;
        animation-timing-function: ease-in-out;
    }

    85% {
        transform: scale(1.1);
        opacity: 1;
        animation-timing-function: ease-in;
    }

    100% {
        transform: scale(0.2);
        opacity: 0;
    }
}

.gc-anim-in {
    animation: gc-anim-in 0.4s ease-out both;
}

.gc-anim-cycle {
    animation: gc-anim-cycle 2.2s both;
}

/* slide mode viewport/track */
.gc-viewport {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.gc-track {
    display: flex;
    gap: 12px;
    align-items: center;
    height: 100%;
    will-change: transform;
}

.gc-slide-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ── Score-boost effects (score-boost.js) ────────────────────────────────────
   Multi-pk inspired: burst particles + bar sweep + shockwave + floater
   ─────────────────────────────────────────────────────────────────────────── */

/* Burst particles */
.score-burst-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    animation: score-burst-out 0.7s ease-out forwards;
}

@keyframes score-burst-out {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3);
    }
}

/* Bar sweep flash */
.score-bar-flash {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
    z-index: 4;
    pointer-events: none;
    animation: score-bar-sweep 0.55s ease-out forwards;
}

@keyframes score-bar-sweep {
    0% {
        opacity: 1;
        transform: scaleX(0);
        transform-origin: left;
        filter: brightness(2);
    }

    50% {
        opacity: 0.8;
        transform: scaleX(1);
        transform-origin: left;
    }

    100% {
        opacity: 0;
        transform: scaleX(1.4);
        transform-origin: left;
    }
}

/* Shockwave ring */
.score-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid currentColor;
    pointer-events: none;
    z-index: 10;
    animation: score-shockwave-expand 0.5s ease-out forwards;
}

@keyframes score-shockwave-expand {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.2);
        border-width: 6px;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
        border-width: 0;
    }
}

/* Score label pulse */
@keyframes score-label-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.28);
        color: #ffffaa;
        text-shadow: 0 0 12px #ffff00;
    }

    100% {
        transform: scale(1);
    }
}

.score-label-pulsing {
    animation: score-label-pulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Floating +X */
.score-floater {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    animation: mk-float 1s ease-out forwards;
}

.score-floater.blue {
    color: #f5d0fe;
    text-shadow: 0 0 12px #d946ef, 0 0 24px #7c3aed, 0 2px 4px rgba(0, 0, 0, 0.8);
}

.score-floater.pink {
    color: #a7f3d0;
    text-shadow: 0 0 12px #34d399, 0 0 24px #0d9488, 0 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes mk-float {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.3) rotate(-10deg);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(-15px) scale(1.4) rotate(5deg);
    }

    40% {
        transform: translateX(-50%) translateY(-35px) scale(1.1) rotate(-3deg);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px) scale(0.6) rotate(0deg);
    }
}

/* ─── TIMER ─────────────────────────────────────── */
.pk-timer {
    font-family: 'Montserrat';
    font-size: 100px;
    /* Reduced from 130px so it fits better */
    font-weight: 700;
    /* Thinner than before (was 900) */
    color: #fff;
    text-align: center;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 4px 8px 12px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    padding: 0 20px;
}

.pk-timer.timer-ready {
    font-size: 60px;
    color: #ffffff;
    text-shadow: 0 0 30px #ffffff, 0 4px 24px rgba(0, 0, 0, 0.7);
}

@keyframes timeup-scale {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.04);
    }
}

.pk-timer.timer-timeup {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 6px;
    /* TikTok pink → purple → cyan gradient text */
    background: linear-gradient(90deg, #FE2C55 0%, #c040ff 50%, #25F4EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: timeup-scale 0.7s ease-in-out infinite alternate;
}

.pk-timer.disconnected {
    opacity: 0.25;
    text-shadow: none;
}

/* ─── CLASH BURST particles (clash-burst.js) ─────── */
/* Container sits at the seam (width:0), sparks fly outward */
.cb-container {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 20;
}

@keyframes cb-spark-fly {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.cb-spark {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c, #fff);
    box-shadow: 0 0 5px var(--c, #fff), 0 0 10px var(--c, #fff);
    animation: cb-spark-fly 0.55s ease-out forwards;
}

/* ─── SCORE BAR ──────────────────────────────────── */




/* ─── SCORE CHANGE EFFECTS ─────────────────────── */
/* losing side */
.score-side.losing {
    opacity: 0.85;
    filter: brightness(0.8);
}

/* Boost flash overlay */
.score-boost-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    animation: boost-flash 0.6s ease-out forwards;
}

/* Defender visual Purple/Pink flash */
.score-boost-flash.blue {
    background: radial-gradient(ellipse at center, rgba(217, 70, 239, 0.6) 0%, rgba(124, 58, 237, 0.3) 40%, transparent 70%);
}

/* Attacker visual Teal/Green flash */
.score-boost-flash.pink {
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.6) 0%, rgba(13, 148, 136, 0.3) 40%, transparent 70%);
}

@keyframes boost-flash {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* Score number pop */
.score-pop-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: inherit;
    padding: inherit;
    pointer-events: none;
    z-index: 4;
    font-size: inherit;
    font-weight: 900;
    color: #fff;
    animation: pop-bounce 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.4);
}

@keyframes pop-bounce {
    0% {
        transform: scale(1.5);
        opacity: 0.8;
    }

    40% {
        transform: scale(0.9);
        opacity: 0.4;
    }

    70% {
        transform: scale(1.1);
        opacity: 0.2;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Floating +X */
.score-floater {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    animation: mk-float 1s ease-out forwards;
}

/* Defender Purple/Pink text */
.score-floater.blue {
    color: #f5d0fe;
    text-shadow: 0 0 12px #d946ef, 0 0 24px #7c3aed, 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Attacker Teal/Green text */
.score-floater.pink {
    color: #a7f3d0;
    text-shadow: 0 0 12px #34d399, 0 0 24px #0d9488, 0 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes mk-float {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.3) rotate(-10deg);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(-15px) scale(1.4) rotate(5deg);
    }

    40% {
        transform: translateX(-50%) translateY(-35px) scale(1.1) rotate(-3deg);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px) scale(0.6) rotate(0deg);
    }
}

/* Star burst */
.score-star {
    position: absolute;
    pointer-events: none;
    z-index: 18;
    font-size: 20px;
    animation: mk-star 0.8s ease-out var(--delay, 0s) forwards;
}

@keyframes mk-star {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg) translate(var(--tx, 0px), var(--ty, 0px));
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(360deg) translate(calc(var(--tx, 0px) * 2), calc(var(--ty, 0px) * 2));
    }
}

/* Boost flame trail */
.score-flame {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    pointer-events: none;
    z-index: 5;
    animation: mk-flame 0.5s ease-out forwards;
    background: radial-gradient(ellipse at center, rgba(255, 200, 0, 0.9) 0%, rgba(255, 100, 0, 0.6) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(4px);
}

.score-flame.blue {
    left: -10px;
}

.score-flame.pink {
    right: -10px;
}

@keyframes mk-flame {
    0% {
        opacity: 1;
        transform: translateY(-50%) scaleX(1.5) scaleY(1);
    }

    50% {
        opacity: 0.8;
        transform: translateY(-50%) scaleX(2) scaleY(1.3);
    }

    100% {
        opacity: 0;
        transform: translateY(-50%) scaleX(0.5) scaleY(0.5);
    }
}

/* Speed streak particles */
.score-streak {
    position: absolute;
    top: var(--y, 50%);
    width: var(--w, 20px);
    height: 2px;
    pointer-events: none;
    z-index: 15;
    border-radius: 2px;
    animation: mk-streak 0.4s linear var(--delay, 0s) forwards;
}

.score-streak.blue {
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.8), #fff);
    box-shadow: 0 0 4px rgba(217, 70, 239, 0.6);
}

.score-streak.pink {
    background: linear-gradient(270deg, transparent, rgba(52, 211, 153, 0.8), #fff);
    box-shadow: 0 0 4px rgba(52, 211, 153, 0.6);
}

@keyframes mk-streak {
    0% {
        opacity: 1;
        transform: scaleX(0.3);
    }

    50% {
        opacity: 1;
        transform: scaleX(1.5);
    }

    100% {
        opacity: 0;
        transform: scaleX(0.1) translateX(var(--dir, -30px));
    }
}


.score-profiles {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
}

.score-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-profile.right {
    flex-direction: row-reverse;
}

.score-profile-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-profile.left .score-profile-avatar {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5), 0 0 16px rgba(56, 189, 248, 0.3);
}

.score-profile.right .score-profile-avatar {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.5), 0 0 16px rgba(244, 63, 94, 0.3);
}

.score-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.score-profile-name {
    font-family: 'Noto Sans Thai', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ═══════════════════════════════════════════════════
   RESULT OVERLAY  —  TikTok PK style
   OBS-safe: zero backgrounds anywhere. Visual weight
   comes from large italic gradient text + avatar glow.
═══════════════════════════════════════════════════ */

#result-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

#result-overlay.show {
    pointer-events: all;
    opacity: 1;
}

/* ── Card: layout only, zero visual background ── */
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

/* ── Avatar ── */
.result-avatar {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Name ── */
.result-name {
    font-family: 'Noto Sans Thai', sans-serif;
    font-weight: 900;
    font-size: 40px;
    color: #fff;
    text-align: center;
}

/* ── Label: big italic gradient — the hero element ── */
.result-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 90px;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-svg {
    width: 56px;
    height: 56px;
    opacity: 0.9;
}

/* ═══ WINNER ════════════════════════════════════════
   White-to-pink gradient text, pink ring avatar glow
══════════════════════════════════════════════════ */
@keyframes winner-pop {
    0% {
        transform: scale(0.48) translateY(18px);
        opacity: 0;
    }

    62% {
        transform: scale(1.06) translateY(-4px);
        opacity: 1;
    }

    80% {
        transform: scale(0.98);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes winner-glow {

    0%,
    100% {
        box-shadow: 0 0 0 5px #FE2C55, 0 0 50px rgba(254, 44, 85, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px #FE2C55, 0 0 90px rgba(254, 44, 85, 1), 0 0 160px rgba(254, 44, 85, 0.4);
    }
}

.result-card.winner {
    animation: winner-pop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.result-card.winner .result-label {
    background: linear-gradient(120deg, #fff 0%, #ffd6df 40%, #FE2C55 80%, #c4003d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-card.winner .result-avatar {
    border: 5px solid #FE2C55;
    animation: winner-glow 1.8s ease-in-out 0.5s infinite;
}

.result-card.winner .result-name {
    color: #fff;
}

/* Confetti */
@keyframes confetti-fly {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-300px) rotate(600deg);
        opacity: 0;
    }
}

.confetti-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    animation: confetti-fly 1.3s ease-out forwards;
    z-index: 1;
}

/* Punch arms */
@keyframes punch-left {
    0% {
        transform: translateX(-300px) scaleX(-1);
        opacity: 0;
    }

    42% {
        transform: translateX(12px) scaleX(-1);
        opacity: 1;
    }

    58% {
        transform: translateX(-18px) scaleX(-1);
    }

    72% {
        transform: translateX(5px) scaleX(-1);
    }

    100% {
        transform: translateX(-300px) scaleX(-1);
        opacity: 0;
    }
}

@keyframes punch-right {
    0% {
        transform: translateX(300px);
        opacity: 0;
    }

    42% {
        transform: translateX(-12px);
        opacity: 1;
    }

    58% {
        transform: translateX(18px);
    }

    72% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(300px);
        opacity: 0;
    }
}

.punch {
    position: absolute;
    font-size: 72px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    line-height: 1;
}

.punch.left {
    left: -150px;
    animation: punch-left 1.1s ease-in-out 0.5s both;
}

.punch.right {
    right: -150px;
    animation: punch-right 1.1s ease-in-out 0.5s both;
}

/* ═══ LOSER ═════════════════════════════════════════
   Dark muted gradient text, gray desaturated avatar
══════════════════════════════════════════════════ */
@keyframes loser-drop {
    0% {
        transform: translateY(-14px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes screen-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    12% {
        transform: translateX(-9px) rotate(-0.5deg);
    }

    25% {
        transform: translateX(9px) rotate(0.5deg);
    }

    37% {
        transform: translateX(-7px);
    }

    50% {
        transform: translateX(7px);
    }

    62% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }

    87% {
        transform: translateX(-2px);
    }
}

.result-card.loser {
    animation: loser-drop 0.4s ease-out forwards;
}

.result-card.loser .result-label {
    background: linear-gradient(120deg, #4a4a4a 0%, #333 60%, #222 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-card.loser .result-avatar {
    border: 5px solid #2a2a2a;
    filter: grayscale(65%) brightness(0.6);
}

.result-card.loser .result-name {
    color: #555;
}

#result-overlay.loser-phase {
    animation: screen-shake 0.5s ease-in-out 0.2s both;
}

/* ═══ DRAW ══════════════════════════════════════════
   Pink→purple→cyan gradient text, dual avatar glow
══════════════════════════════════════════════════ */
@keyframes draw-pop {
    0% {
        transform: scale(0.52) translateY(24px);
        opacity: 0;
    }

    66% {
        transform: scale(1.05) translateY(-3px);
        opacity: 1;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes glow-pink {

    0%,
    100% {
        box-shadow: 0 0 0 5px #FE2C55, 0 0 35px rgba(254, 44, 85, 0.65);
    }

    50% {
        box-shadow: 0 0 0 9px #FE2C55, 0 0 70px rgba(254, 44, 85, 0.95);
    }
}

@keyframes glow-cyan {

    0%,
    100% {
        box-shadow: 0 0 0 5px #25F4EE, 0 0 35px rgba(37, 244, 238, 0.65);
    }

    50% {
        box-shadow: 0 0 0 9px #25F4EE, 0 0 70px rgba(37, 244, 238, 0.95);
    }
}

/* Draw card: pure layout, no box */
.draw-card {
    position: relative;
}

.draw-card::before,
.draw-card::after {
    display: none;
}

/* Layout children sit above the (disabled) ::before/::after layer. Exclude
   .confetti-dot: it is appended directly to the card and must stay
   position:absolute, otherwise it re-enters flow and pushes the centered
   label/avatar row upward on every burst. */
.draw-card>*:not(.confetti-dot) {
    position: relative;
    z-index: 1;
}

.draw-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 90px;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    /* In normal flow (not absolute) — appears above avatar row */
    position: static;
    background: linear-gradient(120deg, #FE2C55 0%, #d040ff 50%, #25F4EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* draw-avatar-left / draw-avatar-right set by result.js */
.draw-avatar {
    animation: draw-pop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.draw-avatar-left {
    border: 5px solid #25F4EE;
    animation: draw-pop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) forwards,
        glow-cyan 2s ease-in-out 0.6s infinite;
}

.draw-avatar-right {
    border: 5px solid #FE2C55;
    animation: draw-pop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s forwards,
        glow-pink 2s ease-in-out 0.6s infinite;
}

/* ═══ FADE IN / OUT ════════════════════════════════ */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.94) translateY(6px);
    }
}

.result-card.fade-in {
    animation: fade-in 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.result-card.fade-out {
    animation: fade-out 0.4s ease forwards;
}

/* ── pk-clash-video: seam video inside .clash-indicator (injected by clash-video.js) ── */
/* Mirrors .runner-video in race.css: absolute offset out of zero-width container */
.pk-clash-video {
    position: absolute;
    left: -55px;
    top: -55px;
    width: 110px;
    height: 110px;
    object-fit: contain;
    pointer-events: none;
    will-change: opacity;
    transform: translateZ(0);
}

/* ── pk-bg-overlay: background video for pk-card-content (injected by bg-overlay.js) ── */
.pk-bg-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
    display: none;
    border-radius: 40px 40px 0px 0px;
    will-change: opacity;
    transform: translateZ(0);
}

.draw-card.fade-in {
    animation: fade-in 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.draw-card.fade-out {
    animation: fade-out 0.4s ease forwards;
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
    .pk-timer {
        font-size: 64px;
        letter-spacing: 10px;
    }

    .idol-name {
        font-size: 18px;
        min-width: 90px;
        padding: 5px 14px;
    }

    .team-avatar {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    .score-label-left,
    .score-label-right {
        font-size: 26px;
        min-width: 44px;
    }

    .pk-score-bar {
        height: 52px;
        border-radius: 26px;
    }

    .pk-main {
        padding: 8px 10px 18px;
    }

    .gift-icon {
        width: 60px;
        height: 60px;
    }

    .result-avatar {
        width: 140px;
        height: 140px;
        font-size: 56px;
    }

    .result-name {
        font-size: 32px;
    }

    .score-profiles {
        margin-top: 24px;
    }

    .score-profile-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .score-profile-name {
        font-size: 16px;
    }
}
/* ── Multi-PK Victory Esports HUD Upgrades ── */

@keyframes game-confetti-fly {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
        filter: drop-shadow(0 0 2px currentColor);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4) rotate(45deg);
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0) rotate(360deg);
        opacity: 0;
    }
}

.mpk-winner-banner {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 42px;
    clip-path: polygon(15px 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0% 50%);
    border: 2px solid rgba(255, 255, 255, 0.45);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 100;
    animation: mpk-banner-in 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both, banner-shine-anim 3s linear infinite;
}

@keyframes banner-shine-anim {
    0% { background-position: 150% 0; }
    100% { background-position: -150% 0; }
}

.mpk-winner-banner--solo {
    --bg-start: #ec4899;
    --bg-mid: #f43f5e;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 35%, #fff 50%, var(--bg-mid) 65%, var(--bg-start) 100%);
    background-size: 300% 100%;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.mpk-winner-banner--co {
    --bg-start: #3b82f6;
    --bg-mid: #8b5cf6;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 35%, #fff 50%, var(--bg-mid) 65%, var(--bg-start) 100%);
    background-size: 300% 100%;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.mpk-winner-banner--draw {
    --bg-start: #475569;
    --bg-mid: #64748b;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 35%, #fff 50%, var(--bg-mid) 65%, var(--bg-start) 100%);
    background-size: 300% 100%;
    box-shadow: 0 8px 24px rgba(148, 163, 184, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes mpk-banner-in {
    from {
        opacity: 0;
        transform: translate(-50%, 40px) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* ── SCREEN SHAKE ── */
.screen-shake {
    animation: game-screen-shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes game-screen-shake {
    10%, 90% { transform: translate3d(-2px, -1px, 0) rotate(-0.5deg); }
    20%, 80% { transform: translate3d(4px, 2px, 0) rotate(1deg); }
    30%, 50%, 70% { transform: translate3d(-8px, -4px, 0) rotate(-1.5deg); }
    40%, 60% { transform: translate3d(8px, 4px, 0) rotate(1.5deg); }
}

/* ── WIDGET FLASH OVERLAY (NOT FULL SCREEN) ── */
.pk-flash-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 80%);
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    animation: flash-fade-out 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    border-radius: 40px;
}

@keyframes flash-fade-out {
    0% { opacity: 1; filter: brightness(2); }
    100% { opacity: 0; filter: brightness(1); }
}

/* ── EPIC BRIGHT PASTEL CYBER-HUD TIME'S UP SPLASH ── */
.game-timeup-splash {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 160px;
    transform: translateY(-50%) scaleY(0);
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.94) 15%, 
        rgba(255, 255, 255, 0.96) 50%, 
        rgba(255, 255, 255, 0.94) 85%, 
        rgba(255, 255, 255, 0) 100%
    );
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    backdrop-filter: blur(12px);
    animation: splash-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.game-timeup-splash.fade-out {
    animation: splash-slide-out 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splash-slide-in {
    0% { transform: translateY(-50%) scaleY(0); opacity: 0; }
    100% { transform: translateY(-50%) scaleY(1); opacity: 1; }
}

@keyframes splash-slide-out {
    0% { transform: translateY(-50%) scaleY(1); opacity: 1; }
    100% { transform: translateY(-50%) scaleY(0); opacity: 0; filter: blur(6px); }
}

.game-timeup-splash .splash-backdrop-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 117, 140, 0.35) 0%, transparent 70%);
    pointer-events: none;
    animation: backdrop-glow-pulse 2s infinite alternate;
}

.game-timeup-splash .splash-tech-lines {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(255, 117, 140, 0.04) 0px, rgba(255, 117, 140, 0.04) 1px, transparent 1px, transparent 30px);
    pointer-events: none;
    opacity: 0.8;
}

.game-timeup-splash .splash-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    position: relative;
    animation: content-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.game-timeup-splash .splash-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.game-timeup-splash .splash-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 70px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 12px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff758c 0%, #ff88ff 50%, #8e2de2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08)) drop-shadow(0 0 15px rgba(255, 117, 140, 0.3));
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.85);
    z-index: 2;
    margin: 0;
    transform: skewX(-6deg);
}

.game-timeup-splash .splash-subtitle {
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #8b5cf6;
    text-transform: uppercase;
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

/* Sci-fi targeting brackets */
.game-timeup-splash .hud-corner,
.mpk-winner-hud .hud-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: #ff758c;
    border-style: solid;
    pointer-events: none;
    z-index: 3;
}

.game-timeup-splash .hud-corner.top-left,
.mpk-winner-hud .hud-corner.top-left { top: 0; left: 0; border-width: 2.5px 0 0 2.5px; }

.game-timeup-splash .hud-corner.top-right,
.mpk-winner-hud .hud-corner.top-right { top: 0; right: 0; border-width: 2.5px 2.5px 0 0; }

.game-timeup-splash .hud-corner.bottom-left,
.mpk-winner-hud .hud-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 2.5px 2.5px; }

.game-timeup-splash .hud-corner.bottom-right,
.mpk-winner-hud .hud-corner.bottom-right { bottom: 0; right: 0; border-width: 0 2.5px 2.5px 0; }

.game-timeup-splash .cyber-laser-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #ff758c 30%, #8e2de2 50%, #ff758c 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(255, 117, 140, 0.5);
}

.game-timeup-splash .cyber-laser-line.top { top: 0; }
.game-timeup-splash .cyber-laser-line.bottom { bottom: 0; }

/* ── HIGH-END CINEMATIC EDGE-TO-EDGE RESULT RIBBON (MULTI-PK) ── */
.mpk-winner-hud {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 185px;
    transform: translateY(-50%) scaleY(0);
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.93) 15%, 
        rgba(255, 255, 255, 0.96) 50%, 
        rgba(255, 255, 255, 0.93) 85%, 
        rgba(255, 255, 255, 0) 100%
    );
    border-top: 2px solid rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 0;
    box-sizing: border-box;
    z-index: 9999;
    pointer-events: none;
    backdrop-filter: blur(12px);
    overflow: hidden;
    animation: hud-ribbon-slide-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mpk-winner-hud.fade-out {
    animation: hud-ribbon-slide-out 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hud-ribbon-slide-in {
    0% { transform: translateY(-50%) scaleY(0); opacity: 0; }
    100% { transform: translateY(-50%) scaleY(1); opacity: 1; }
}

@keyframes hud-ribbon-slide-out {
    0% { transform: translateY(-50%) scaleY(1); opacity: 1; }
    100% { transform: translateY(-50%) scaleY(0); opacity: 0; filter: blur(4px); }
}

/* Shimmer reflection sweeping edge to edge */
.mpk-winner-hud .hud-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 5;
    animation: hud-shimmer-sweep 4.5s infinite linear;
}

/* Digital Grid Pattern Background (No borders) */
.mpk-winner-hud .hud-grid-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(139, 92, 246, 0.08) 1.5px, transparent 1.5px);
    background-size: 15px 15px;
    pointer-events: none;
    z-index: 1;
}

/* Left/Right Sidebar telemetry logs synced to edges of viewport */
.mpk-winner-hud .hud-sidebar {
    position: absolute;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
    opacity: 0.6;
}
.mpk-winner-hud .hud-sidebar.left { left: 40px; text-align: left; }
.mpk-winner-hud .hud-sidebar.right { right: 40px; text-align: right; }

.mpk-winner-hud .hud-tech-text {
    font-family: monospace;
    font-size: 9px;
    color: #8b5cf6;
    letter-spacing: 1.5px;
}

/* Outer boundary highlights (just top and bottom laser lights, no box lines) */
.mpk-winner-hud .hud-laser-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2;
}
.mpk-winner-hud--solo .hud-laser-line {
    background: linear-gradient(90deg, transparent 0%, #ffb800 30%, #ff8800 50%, #ffb800 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.4);
}
.mpk-winner-hud--co .hud-laser-line {
    background: linear-gradient(90deg, transparent 0%, #818cf8 30%, #a78bfa 50%, #818cf8 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}
.mpk-winner-hud--draw .hud-laser-line {
    background: linear-gradient(90deg, transparent 0%, #cbd5e1 30%, #94a3b8 50%, #cbd5e1 70%, transparent 100%);
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.3);
}

.mpk-winner-hud .hud-laser-line.top { top: 0; }
.mpk-winner-hud .hud-laser-line.bottom { bottom: 0; }

/* Large Header title */
.hud-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
    width: 100%;
    z-index: 2;
}

.hud-header-wing {
    height: 1.5px;
    width: 80px;
    opacity: 0.7;
}
.mpk-winner-hud--solo .hud-header-wing { background: linear-gradient(90deg, transparent, #ffb800); }
.mpk-winner-hud--solo .hud-header-wing.right { background: linear-gradient(90deg, #ffb800, transparent); }
.mpk-winner-hud--co .hud-header-wing { background: linear-gradient(90deg, transparent, #a78bfa); }
.mpk-winner-hud--co .hud-header-wing.right { background: linear-gradient(90deg, #a78bfa, transparent); }
.mpk-winner-hud--draw .hud-header-wing { background: linear-gradient(90deg, transparent, #cbd5e1); }
.mpk-winner-hud--draw .hud-header-wing.right { background: linear-gradient(90deg, #cbd5e1, transparent); }

.hud-header-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
}
.mpk-winner-hud--solo .hud-header-text { color: #d97706; }
.mpk-winner-hud--co .hud-header-text { color: #6d28d9; }
.mpk-winner-hud--draw .hud-header-text { color: #475569; }

/* Body profiles column row */
.hud-body-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    width: 100%;
    z-index: 2;
}

.hud-winner-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    animation: hud-profile-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hud-avatar-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.hud-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.mpk-winner-hud--solo .hud-avatar { border-color: #ffb800; }
.mpk-winner-hud--co .hud-avatar { border-color: #a78bfa; }

.hud-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    box-sizing: border-box;
    background: rgba(139, 92, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}
.mpk-winner-hud--solo .hud-avatar-fallback { border-color: #ffb800; }
.mpk-winner-hud--co .hud-avatar-fallback { border-color: #a78bfa; }

/* Spotlight ray rotates behind avatar */
.hud-spotlight-ray {
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: conic-gradient(from 0deg, transparent, rgba(139, 92, 246, 0.12), transparent, rgba(255, 117, 140, 0.12), transparent);
    animation: spotlight-rotate 6s linear infinite;
}

@keyframes spotlight-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Double nested pulse rings */
.hud-pulse-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}
.mpk-winner-hud--solo .hud-pulse-ring { border: 2px solid rgba(255, 184, 0, 0.4); }
.mpk-winner-hud--co .hud-pulse-ring { border: 2px solid rgba(167, 139, 250, 0.4); }

.hud-pulse-ring.ring-1 { animation: avatar-ring-pulse 2.2s infinite ease-out; }
.hud-pulse-ring.ring-2 { animation: avatar-ring-pulse 2.2s infinite ease-out 1.1s; }

/* Crown and MVP placement */
.hud-crown-floater {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    animation: hud-crown-float 2s ease-in-out infinite alternate;
}

.hud-mvp-badge {
    position: absolute;
    top: -4px;
    left: -12px;
    background: linear-gradient(135deg, #ff758c 0%, #ff88ff 100%);
    border: 1.5px solid #fff;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 117, 140, 0.4);
    z-index: 3;
    animation: victory-badge-float 2.2s ease-in-out infinite alternate;
}

/* Winner details */
.hud-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* CRITICAL: Enlarge names and scores for maximum visual priority */
.hud-name {
    font-family: 'Noto Sans Thai', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #1e293b;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-score-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.hud-score-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: #94a3b8;
    letter-spacing: 1.5px;
}

.hud-score-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 20px;
}
.mpk-winner-hud--solo .hud-score-value { color: #d97706; }
.mpk-winner-hud--co .hud-score-value { color: #7c3aed; }
.mpk-winner-hud--draw .hud-score-value { color: #475569; }

/* ── MULTI-PK DEFEATED DIMMING ── */
.mpk-seg.is-defeated,
.mpkw-ring-slot.is-defeated {
    filter: grayscale(80%) opacity(0.45) !important;
    transform: scale(0.92);
    transition: all 0.5s ease;
}

/* Crown adjustments in multi HUD */
.mpk-winner-banner .crown-icon {
    display: inline-block;
    animation: victory-badge-float 2.2s ease-in-out infinite alternate;
    margin: 0 6px;
}
