:root {
    --burst-scale: 1.8;
    --burst-opacity: 0.85;
    --whale-opacity: 0.82;
    --burst-rotate-s: 12s;
}
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.container {
    width: 1200px;
    height: 400px;
    border-style: solid;
    border-color: hsl(0, 10%, 50%) hsl(0, 20%, 50%) hsl(0, 10%, 50%)
        hsl(0, 20%, 50%);
    border-width: 15px;
    display: flex;
    background: linear-gradient(
        to bottom,
        #696992 0%,
        #afb0b7 20%,
        #e9e9e9 35%,
        #8f9e90 69%,
        #e7e7e7 100%
    );
    box-shadow: inset 0 0 50px #000000;
    position: relative;
    overflow: hidden;
    float: left;
    background-clip: content-box;
}
.container:before {
    content: '';
    position: absolute;
    width: calc(100% - 40px);
    top: calc(50% - 20px);
    left: 0;
    border-style: solid;
    border-width: 20px 20px;
    border-color: transparent hsla(0, 70%, 50%, 0.75) transparent
        hsla(0, 70%, 50%, 0.75);
    height: 2px;
    background-color: rgba(250, 250, 250, 0.5);
    overflow: hidden;
    z-index: 1;
    background-clip: content-box;
}
.container:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0) 80%,
        rgba(0, 0, 0, 0.8) 100%
    );
}
/* When winning, hide/dim all direct children except .winner */
.container.has-win > :not(.winner) {
    opacity: 0; /* full blackout; or try .1 for dim */
    filter: none; /* keep sharp; remove if you prefer blur */
    transition: opacity 0.2s ease;
}

.col {
    width: 100%;
}

.row {
    border-style: solid;
    border-color: #eee;
    border-width: 2px;
}
.row:after {
    content: '';
    display: block;
    padding-top: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
.beluga:after {
    background-image: url('../images/beluga1.webp');
}
.blue:after {
    background-image: url('../images/blue1.webp');
}
.bowhead:after {
    background-image: url('../images/bowhead1.webp');
}
.gray:after {
    background-image: url('../images/gray1.webp');
}
.humpback:after {
    background-image: url('../images/humpback1.webp');
}
.minke:after {
    background-image: url('../images/minke1.webp');
}
.orca:after {
    background-image: url('../images/orca1.webp');
}
.pilot:after {
    background-image: url('../images/pilot1.webp');
}
.sperm:after {
    background-image: url('../images/sperm1.webp');
}
/*-------------=== winner style ===-------------*/
.winner {
    position: absolute;
    inset: 0; /* fill the slot container */
    z-index: 3;
    pointer-events: none;
    transform: scale(0); /* hidden until active */
    transition: transform 0.12s linear;
}
.winner.active {
    transform: scale(1);
}

/* Pseudo-elements are container-scoped (no viewport sizing) */
.winner::before,
.winner::after {
    content: '';
    position: absolute;
    inset: 0;
    display: block;
}

/* BACKGROUND BURST */
.winner::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--burst-scale, 1.8) * 100%);
    height: calc(var(--burst-scale, 1.8) * 100%);
    transform: translate(-50%, -50%);
    transform-origin: 50% 50%;
    background: no-repeat center / contain
        url(//bannerflow.blob.core.windows.net/resources/winner2-d4e9ae90-43f8-4575-99b9-fc675462bc35.svg?v=636058905940602803);
    opacity: var(--burst-opacity, 0.45);
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25));
    will-change: transform;
}

.winner.active::before {
    animation: rotateBurst var(--burst-rotate-s, 12s) linear infinite;
}

/* FOREGROUND WHALE */
.winner::after {
    content: '';
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: var(--whale-opacity);
    transform: scale(0.6);
    animation: whalePop 0.9s ease-out forwards,
        whaleBreath 2.8s ease-in-out 0.9s infinite alternate;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

/* Map winner class -> whale image */
.winner.beluga::after {
    background-image: url('../images/beluga1.webp');
}
.winner.blue::after {
    background-image: url('../images/blue1.webp');
}
.winner.bowhead::after {
    background-image: url('../images/bowhead1.webp');
}
.winner.gray::after {
    background-image: url('../images/gray1.webp');
}
.winner.humpback::after {
    background-image: url('../images/humpback1.webp');
}
.winner.minke::after {
    background-image: url('../images/minke1.webp');
}
.winner.orca::after {
    background-image: url('../images/orca1.webp');
}
.winner.pilot::after {
    background-image: url('../images/pilot1.webp');
}
.winner.sperm::after {
    background-image: url('../images/sperm1.webp');
}

/* Pop-in flare */
@keyframes whalePop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    45% {
        transform: scale(1.06);
        opacity: 0.85;
    }
    70% {
        transform: scale(0.96);
        opacity: 0.75;
    }
    100% {
        transform: scale(1);
        opacity: 0.65;
    }
}

/* Gentle breathing pulse */
@keyframes whaleBreath {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.04);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .winner::after {
        animation: none;
        transform: none;
    }
    .winner.active::before {
        animation: none;
    }
}

@keyframes rotateBurst {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
/*-----------------------------------------------*/
.handle {
    position: relative;
    float: left;
    vertical-align: top;
    height: 60px;
    margin-top: 70px;
    width: 15px;
    border-radius: 0 5px 5px 0/20px;
    border: 1px solid rgba(189, 160, 112, 0.5);
    background: linear-gradient(
        to bottom,
        #cd9819 0%,
        #f5f5f5 20%,
        #e2ba78 67%,
        #b6783d 90%,
        #cd9819 100%
    );
}
.handle,
.handle:before,
.handle:after {
    transition: all 0.2s linear;
    cursor: pointer;
}
.handle:before,
.handle:after {
    content: '';
    display: block;
    position: absolute;
}
.handle:before {
    border-style: solid;
    border-width: 1px;
    border-color: rgba(163, 126, 67, 0.1);
    background: linear-gradient(
        to right,
        #f5d6b1 0%,
        #cc9310 20%,
        #f1e767 60%,
        #f5f5f5 90%,
        #f1e767 100%
    );
    width: 8px;
    height: 80px;
    bottom: 30px;
    right: -10px;
    border-bottom-right-radius: 10px 8px;
}
.handle:after {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    top: -64px;
    right: -17px;
    border: 1px solid rgba(204, 147, 16, 0.3);
    background: radial-gradient(
        ellipse at 75% 25%,
        #ffffff 0%,
        #f1e767 25%,
        #cc9310 60%,
        #feb645 91%
    );
}
.handle.active {
    background-position: 0 47px;
}
.handle.active:before {
    height: 0px;
    border-bottom-right-radius: 2px;
    transform: translateY(5px);
}
.handle.active:after {
    transform: translateY(85px);
}
