
/* =========================================
   THE CLIMB — COMPLETE SITE DESIGN
   ========================================= */

/* GLOBAL RESET */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #f5f2e9;
    font-family: Arial, Helvetica, sans-serif;

    background:
         linear-gradient(
        rgba(5, 7, 14, 0.25),
        rgba(5, 7, 14, 0.45)
    ),
        url("/static/images/style/takeover.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


/* =========================================
   MAIN CONTAINER AND TITLE
   ========================================= */

.container {
    width: 92%;
    max-width: 1200px;
    margin: 65px auto 40px;
    padding: 25px;
    text-align: center;
}

.container > h1 {
    margin: 0;
    color: #e8c879;
    font-size: clamp(42px, 6vw, 68px);
    font-weight: 900;
    letter-spacing: 8px;
    text-shadow:
        0 0 15px rgba(218, 174, 85, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.8);
}

.subtitle {
    margin-top: 8px;
    color: #c1b18d;
    font-size: 13px;
    letter-spacing: 4px;
    font-weight: bold;
}


/* =========================================
   NAVIGATION
   ========================================= */

.navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 35px 0 45px;
}

.navigation button {
    padding: 14px 28px;

    color: #e9dfc5;
    background: rgba(15, 18, 27, 0.9);

    border: 1px solid rgba(211, 176, 103, 0.45);
    border-radius: 6px;

    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.navigation button:hover {
    color: #17130b;
    background: #d7b66b;
    border-color: #e8c879;
    transform: translateY(-3px);
    box-shadow: 0 5px 18px rgba(215, 182, 107, 0.25);
}

.navigation button:focus-visible {
    outline: 2px solid #e8c879;
    outline-offset: 4px;
}


/* =========================================
   PLAYER CARDS
   ========================================= */

.players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;

    width: 100%;
    margin: 40px auto 0;
}

.player {
    min-width: 0;
    padding: 32px 25px;

    text-align: center;

background:
    linear-gradient(
        rgba(5, 8, 15, 0.30),
        rgba(5, 8, 15, 0.45)
    ),
    url("/static/images/style/player_background.jpeg");

background-size: cover;
background-position: center;
background-repeat: no-repeat;

    border: 1px solid rgba(218, 184, 111, 0.45);
    border-radius: 12px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.45),
        inset 0 0 25px rgba(218, 184, 111, 0.04);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.player:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 200, 121, 0.85);

    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.55),
        0 0 18px rgba(218, 184, 111, 0.1);
}

.player h2 {
    margin: 0 0 25px;

    color: #e8c879;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.player p {
    color: #eee9dc;
    font-size: 17px;
    font-weight: bold;
    margin: 12px 0;
}


/* =========================================
   PLAYER PROFILE IMAGES
   ========================================= */

.player img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    object-fit: contain;
}

#player1-profile-image,
#player2-profile-image {
    width: 425px;
    height: 425px;
    object-fit: cover;
    border: 3px solid #c9a65d;
    border-radius: 5%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}


/* =========================================
   RANK EMBLEMS
   ========================================= */

#player1-rank-image,
#player2-rank-image {
    width: 425px;
    height: 425px;

    object-fit: contain;

    margin: 20px auto;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.65));
}


/* =========================================
   RANK AND LP TEXT
   ========================================= */

#player1-rank,
#player2-rank {
    color: #e8c879;
    font-size: 23px;
    letter-spacing: 1px;
}

#player1-lp,
#player2-lp {
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
}

#player1-kda,
#player1-kda-ratio,
#player2-kda,
#player2-kda-ratio {
    color: #c8c4ba;
    font-size: 15px;
}


/* =========================================
   LP COMPARISON
   ========================================= */

.comparison {
    width: 100%;
    max-width: 850px;

    margin: 38px auto;
    padding: 28px 25px;

background:
    linear-gradient(
        rgba(5, 8, 15, 0.30),
        rgba(5, 8, 15, 0.45)
    ),
    url("/static/images/style/stat_background.jpeg");

background-size: cover;
background-position: center;
background-repeat: no-repeat;

    border: 1px solid rgba(218, 184, 111, 0.5);
    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.comparison h2 {
    margin: 0 0 15px;

    color: #c9a65d;
    font-size: 17px;
    letter-spacing: 4px;
}

#lp-difference {
    margin: 12px 0;

    color: #e8c879;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900;
}

#leader {
    margin: 10px 0 0;

    color: #eae3d2;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}


/* =========================================
   STATISTICS BOXES
   ========================================= */

.player-statistics {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;

    gap: 28px;
    margin: 40px auto;
}

.stat-card {
    flex: 1 1 280px;
    max-width: 370px;
    min-width: 0;

    padding: 26px 22px;

    text-align: center;

    background:
    linear-gradient(
        rgba(5, 8, 15, 0.30),
        rgba(5, 8, 15, 0.45)
    ),
    url("/static/images/style/stat_background.jpeg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border: 1px solid rgba(218, 184, 111, 0.4);
    border-radius: 10px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 200, 121, 0.8);
}

.stat-card h3 {
    margin: 0 0 25px;

    color: #e8c879;
    font-size: 16px;
    letter-spacing: 2px;
    line-height: 1.5;
}

.stat-players {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 15px;
}

.stat-players > div {
    flex: 1;
    min-width: 0;
}

.stat-players span {
    display: block;
    margin-bottom: 12px;

    color: #c9a65d;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
}

.stat-players p {
    margin: 10px 0;

    color: #f5f2e9;
    font-size: 17px;
    font-weight: bold;
}


/* =========================================
   PLAYER BIO
   ========================================= */

#bio-page {
    margin-top: 35px;
}

#bio-page .players {
    align-items: stretch;
    gap: 48px;
}

#bio-page .player h2 {
    min-height: 55px;
    font-size: 21px;
    line-height: 1.4;
}

#bio-page .player ul {
    margin: 20px 0;
    padding-left: 22px;

    text-align: left;
}

#bio-page .player li {
    margin-bottom: 20px;

    color: #e5e0d5;
    font-size: 14px;
    line-height: 1.8;
}

#bio-page .player li strong {
    color: #e8c879;
    font-size: 15px;
}

#bio-page .player img {
    width: 450px;
    height: 450px;
    max-width: 100%;

    object-fit: cover;

    margin: 25px auto 5px;

    border: 2px solid rgba(218, 184, 111, 0.65);
    border-radius: 8px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.55);
}


/* =========================================
   SEASON COUNTDOWN
   ========================================= */

.season-countdown {
    width: fit-content;
    max-width: 92%;

    margin: 20px auto 35px;
    padding: 18px 30px;

    text-align: center;

    background: rgba(5, 8, 15, 0.88);

    border: 1px solid rgba(218, 184, 111, 0.55);
    border-radius: 8px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.countdown-label {
    margin-bottom: 8px;

    color: #c9a65d;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 3px;
}

#season-countdown {
    color: #e8c879;

    font-family: monospace;
    font-size: clamp(19px, 3vw, 27px);
    font-weight: bold;
    letter-spacing: 2px;
}


/* =========================================
   OPTIONAL DIGITAL CLOCK STYLING
   ========================================= */

.digital-clock {
    width: fit-content;
    margin: 25px auto;
    padding: 18px 25px;

    text-align: center;

    background: rgba(5, 8, 15, 0.85);
    border: 1px solid rgba(218, 184, 111, 0.4);
    border-radius: 10px;

    backdrop-filter: blur(10px);
}

#clock {
    color: #e8c879;
    font-family: monospace;
    font-size: 38px;
    font-weight: bold;
    letter-spacing: 4px;
}

#date {
    margin-top: 6px;

    color: #bcb5a5;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* =========================================
   RESPONSIVE DESIGN — TABLETS
   ========================================= */

@media (max-width: 850px) {

    .container {
        width: 95%;
        margin-top: 40px;
        padding: 15px;
    }

    .players,
    #bio-page .players {
        gap: 25px;
    }

    .player {
        padding: 25px 18px;
    }

    #player1-profile-image,
    #player2-profile-image {
        width: 160px;
        height: 160px;
    }

    #player1-rank-image,
    #player2-rank-image {
        width: 130px;
        height: 130px;
    }

    #bio-page .player img {
        width: 240px;
        height: 240px;
    }
    #player1-rank-image,
#player2-rank-image {
    margin-bottom: 0;
}

#player1-rank,
#player2-rank {
    margin-top: 4px;
}
}


/* =========================================
   RESPONSIVE DESIGN — MOBILE
   ========================================= */

@media (max-width: 650px) {

    .container {
        width: 100%;
        margin: 25px auto;
        padding: 12px;
    }

    .container > h1 {
        font-size: 38px;
        letter-spacing: 5px;
    }

    .subtitle {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .navigation {
        gap: 8px;
        margin: 25px 0 30px;
    }

    .navigation button {
        padding: 11px 14px;
        font-size: 11px;
    }

    .players,
    #bio-page .players {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 25px;
    }

    .player {
        padding: 25px 18px;
    }

    #player1-profile-image,
    #player2-profile-image {
        width: 180px;
        height: 180px;
    }

    #player1-rank-image,
    #player2-rank-image {
        width: 140px;
        height: 140px;
    }

    .comparison {
        padding: 22px 15px;
        margin: 25px auto;
    }

    .player-statistics {
        gap: 18px;
        margin: 25px auto;
    }

    .stat-card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    #bio-page .player h2 {
        min-height: auto;
    }

    #bio-page .player img {
        width: 260px;
        height: 260px;
    }

    #bio-page .player li {
        font-size: 13px;
    }

    .season-countdown {
        padding: 15px 20px;
    }
}
/* Align biography images at the bottom of their cards */

#bio-page .player {
    display: flex;
    flex-direction: column;
}

#bio-page .player img {
    margin: auto auto 0;
}

/* Image below statistics */

.stats-bottom-image {
    width: 100%;
    margin: 45px auto 30px;
    text-align: center;
}

.stats-bottom-image img {
    display: block;
    width: 85%;
    max-width: 600px;
    height: auto;
    margin: 0 auto;

    border-radius: 8px;
    border: 1px solid rgba(218, 184, 111, 0.45);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
/* Used to toggle pages and rank emblems (CSP-safe, no inline styles) */
[hidden] {
    display: none !important;
}

/* =========================================
   STREAK ANIMATIONS (League of Legends style)
   win: empowered aura · loss: grey screen · stuck: crowd control
   script.js sets --level and .lvl-N on .avatar-wrap and the caption
   ========================================= */

.avatar-wrap {
    --level: 0;
    position: relative;
    isolation: isolate;
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 14px;
}

.player .avatar-wrap > img {
    position: relative;
    z-index: 0;
    margin: 0;
    transition: filter 0.6s ease, box-shadow 0.6s ease, border-color 0.6s ease;
}

/* Keep the player name above rune circles and the crown */
.player h2 {
    position: relative;
    z-index: 4;
}

.mood-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.mood-back {
    z-index: -1;
}

.mood-clip {
    overflow: hidden;
    border-radius: 5%;
}

.mood-free {
    z-index: 2;
}

/* ---------- Colors ---------- */

.mood-win,
.caption-win {
    --aura: #0ac8b9;          /* hextech blue */
    --aura-light: #a8fff4;
}

.mood-win.lvl-3,
.mood-win.lvl-4,
.caption-win.lvl-3,
.caption-win.lvl-4 {
    --aura: #f0b232;          /* gold */
    --aura-light: #fff1c1;
}

.mood-win.lvl-5,
.caption-win.lvl-5 {
    --aura: #b65cff;          /* legendary */
    --aura-light: #ffd86b;
}

/* ---------- League-style banner caption ---------- */

.player .form-caption {
    --banner: #c8aa6e;
    --banner-glow: rgba(200, 170, 110, 0.6);

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;

    margin: 6px auto 8px;
    padding: 7px 30px 8px;

    background:
        linear-gradient(90deg, transparent, var(--banner-glow), transparent) top / 100% 1px no-repeat,
        linear-gradient(90deg, transparent, var(--banner-glow), transparent) bottom / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(1, 10, 19, 0.94), rgba(9, 20, 40, 0.94));

    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
}

.caption-title {
    color: var(--banner);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 0 12px var(--banner-glow);
}

.caption-sub {
    color: #a09b8c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.player .form-caption.caption-win {
    --banner: var(--aura-light);
    --banner-glow: var(--aura);
}

.player .form-caption.caption-loss {
    --banner: #e84057;
    --banner-glow: rgba(232, 64, 87, 0.65);
}

.player .form-caption.caption-stuck {
    --banner: #cdb0ff;
    --banner-glow: rgba(150, 90, 255, 0.75);
}

/* LEGENDARY gets a moving gold/purple shine */
.caption-win.lvl-5 .caption-title {
    background: linear-gradient(90deg, #ffd86b, #ffffff, #b65cff, #ffd86b) 0 0 / 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: legendary-shine 2.5s linear infinite;
}

@keyframes legendary-shine {
    to { background-position: 200% 0; }
}

/* ---------- Recent results ---------- */

.recent-form {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 10px;
}

.result-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.result-dot.win {
    background: #0ac8b9;
    box-shadow: 0 0 6px rgba(10, 200, 185, 0.6);
}

.result-dot.loss {
    background: #e84057;
    box-shadow: 0 0 6px rgba(232, 64, 87, 0.6);
}

/* Latest game */
.result-dot:last-child {
    outline: 2px solid #c8aa6e;
    outline-offset: 2px;
}

/* =========================================
   WIN: empowered hextech aura
   ========================================= */

:is(#player1-avatar, #player2-avatar).mood-win > img {
    border-color: var(--aura-light);
    box-shadow:
        0 0 calc(8px + var(--level) * 7px) calc(var(--level) * 1.5px) var(--aura),
        0 5px 20px rgba(0, 0, 0, 0.5);
    animation: aura-pulse 1.8s ease-in-out infinite;
}

@keyframes aura-pulse {
    50% { filter: brightness(1.08) saturate(1.15); }
}

/* Soft glow behind the photo */
.aura-halo {
    position: absolute;
    inset: -6%;
    border-radius: 12%;
    background: radial-gradient(closest-side, var(--aura), transparent);
    opacity: calc(0.25 + var(--level) * 0.08);
    filter: blur(14px);
    animation: halo-breathe 2.4s ease-in-out infinite;
}

@keyframes halo-breathe {
    50% { opacity: calc(0.15 + var(--level) * 0.06); }
}

/* Rotating rune circle: tick marks + a thin outer line, shown as a ring by the mask */
.rune-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 112%;
    aspect-ratio: 1;
    border: 2px solid var(--aura);
    border-radius: 50%;

    background: repeating-conic-gradient(var(--aura-light) 0deg 1.5deg, transparent 1.5deg 7.5deg);
    -webkit-mask: radial-gradient(closest-side, transparent 86%, #000 87% 92%, transparent 93% 96%, #000 97%);
    mask: radial-gradient(closest-side, transparent 86%, #000 87% 92%, transparent 93% 96%, #000 97%);

    filter: drop-shadow(0 0 6px var(--aura));
    opacity: 0.9;

    translate: -50% -50%;
    animation: ring-spin 16s linear infinite;
}

/* Inner, faster ring with longer rune marks, turning the other way */
.rune-ring.ring-2 {
    width: 105%;
    background: repeating-conic-gradient(var(--aura) 0deg 5deg, transparent 5deg 20deg);
    animation-duration: 9s;
    animation-direction: reverse;
}

/* Outer ring at Legendary */
.rune-ring.ring-3 {
    width: 119%;
    background: repeating-conic-gradient(var(--aura-light) 0deg 0.8deg, transparent 0.8deg 3deg);
    animation-duration: 24s;
}

@keyframes ring-spin {
    to { rotate: 360deg; }
}

/* Hextech sparks (small diamonds) rising over the photo */
.spark {
    position: absolute;
    bottom: 0;
    left: var(--x);
    width: calc(6px * var(--size));
    aspect-ratio: 1;

    background: var(--aura-light);
    box-shadow: 0 0 6px 2px var(--aura);
    opacity: 0;

    rotate: 45deg;
    animation: spark-rise var(--dur) ease-out var(--delay) infinite;
}

@keyframes spark-rise {
    0%   { bottom: 0;    translate: 0 0;            opacity: 0; }
    15%  {                                          opacity: 1; }
    100% { bottom: 105%; translate: var(--drift) 0; opacity: 0; }
}

/* Lightning around the frame (Godlike / Legendary) */
.bolts {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 0 4px var(--aura)) drop-shadow(0 0 10px var(--aura));
}

.bolt {
    fill: none;
    stroke: var(--aura-light);
    stroke-width: 2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    animation: bolt-flicker 0.9s steps(1) infinite;
}

@keyframes bolt-flicker {
    0%   { opacity: 1; }
    20%  { opacity: 0.2; }
    30%  { opacity: 0.95; }
    55%  { opacity: 0; }
    100% { opacity: 0; }
}

/* =========================================
   LOSS: grey screen
   ========================================= */

:is(#player1-avatar, #player2-avatar).mood-loss > img {
    border-color: #5b5a56;
    filter:
        grayscale(calc(0.7 + var(--level) * 0.06))
        brightness(calc(0.9 - var(--level) * 0.05))
        contrast(1.1);
    box-shadow:
        0 0 calc(var(--level) * 6px) rgba(232, 64, 87, 0.45),
        0 5px 20px rgba(0, 0, 0, 0.6);
}

/* Dark red vignette beating like a heartbeat */
.mood-loss .mood-clip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(90, 0, 15, calc(0.3 + var(--level) * 0.08)) 100%
    );
    animation: heartbeat 1.6s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { opacity: 0.7; }
    15%      { opacity: 1; }
    30%      { opacity: 0.8; }
    45%      { opacity: 1; }
}

.ash {
    position: absolute;
    top: -5%;
    left: var(--x);
    width: calc(5px * var(--size));
    aspect-ratio: 1;
    border-radius: 1px;
    background: #b9b4aa;
    opacity: 0;
    animation: ash-fall var(--dur) linear var(--delay) infinite;
}

@keyframes ash-fall {
    0%   { top: -5%;  translate: 0 0;           rotate: 0deg;   opacity: 0; }
    10%  {                                                      opacity: 0.8; }
    100% { top: 105%; translate: var(--sway) 0; rotate: 300deg; opacity: 0.2; }
}

/* Cracked screen (Feeding and worse) */
.cracks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: crack-in 0.3s ease-out both;
}

.crack,
.crack-shadow {
    fill: none;
    vector-effect: non-scaling-stroke;
}

.crack {
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 1.5;
}

.crack-shadow {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 3.5;
}

@keyframes crack-in {
    from { opacity: 0; scale: 0.9; }
    to   { opacity: 1; scale: 1; }
}

/* Respawn timer */
.respawn {
    position: absolute;
    left: 50%;
    bottom: 6%;
    width: 26%;
    aspect-ratio: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;

    background: radial-gradient(circle, rgba(1, 10, 19, 0.9) 60%, rgba(1, 10, 19, 0.7));
    border: 2px solid #785a28;
    border-radius: 50%;
    box-shadow:
        0 0 0 4px rgba(1, 10, 19, 0.55),
        0 0 18px rgba(0, 0, 0, 0.8);

    translate: -50% 0;
}

.respawn-label {
    color: #a09b8c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.respawn-count {
    color: #f0e6d2;
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 10px rgba(232, 64, 87, 0.8);
}

/* =========================================
   STUCK: crowd control
   ========================================= */

:is(#player1-avatar, #player2-avatar).mood-stuck > img {
    border-color: #8f6fe8;
    filter: saturate(0.55) brightness(0.85);
    box-shadow:
        0 0 calc(var(--level) * 8px) rgba(150, 90, 255, 0.6),
        0 5px 20px rgba(0, 0, 0, 0.5);
    animation: struggle 2.4s ease-in-out infinite;
}

/* Trying to move, but CC'd */
@keyframes struggle {
    0%, 60%, 100% { translate: 0 0;     rotate: 0deg; }
    64%           { translate: -1% 0;   rotate: -0.6deg; }
    68%           { translate: 1% 0;    rotate: 0.6deg; }
    72%           { translate: -0.8% 0; rotate: -0.4deg; }
    76%           { translate: 0.8% 0;  rotate: 0.4deg; }
    80%           { translate: 0 0;     rotate: 0deg; }
}

/* Purple tint over the whole photo */
.mood-stuck .mood-clip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(90, 40, 200, 0.5), rgba(90, 40, 200, 0.08) 65%);
}

/* CC mist rising from the bottom, higher each level */
.cc-mist {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -5%;
    height: calc(25% + var(--level) * 12%);

    background:
        radial-gradient(ellipse at 30% 100%, rgba(140, 80, 255, 0.75), transparent 60%),
        radial-gradient(ellipse at 75% 100%, rgba(90, 40, 220, 0.7), transparent 55%),
        linear-gradient(to top, rgba(60, 20, 140, 0.8), transparent);
    filter: blur(6px);

    animation: mist-drift 5s ease-in-out infinite alternate;
}

@keyframes mist-drift {
    from { translate: -4% 0; }
    to   { translate: 4% 0; }
}

/* Crowd-control ring on the ground */
.cc-ring {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 90%;
    aspect-ratio: 3 / 1;

    border: 3px solid rgba(205, 176, 255, 0.9);
    border-radius: 50%;
    box-shadow:
        0 0 14px rgba(160, 100, 255, 0.9),
        inset 0 0 14px rgba(160, 100, 255, 0.7);

    translate: -50% 50%;
    animation: cc-pulse 1.4s ease-in-out infinite;
}

@keyframes cc-pulse {
    50% { scale: 1.06; opacity: 0.6; }
}

/* Energy chains crossing the photo (Rooted / Hardstuck) */
.chain {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150%;
    height: calc(5% + var(--level) * 1%);

    background:
        linear-gradient(transparent 42%, #b79cff 42% 58%, transparent 58%) 4.5% 0 / 9% 100% repeat-x,
        radial-gradient(ellipse 50% 42% at 50% 50%, transparent 50%, #e2d4ff 55%, #7b4dff 72%, transparent 78%) 0 0 / 9% 100% repeat-x;
    filter: drop-shadow(0 0 5px rgba(150, 90, 255, 0.95));

    translate: -50% -50%;
    animation: chain-tighten 2.4s ease-in-out infinite;
}

.chain-a {
    rotate: 30deg;
}

.chain-b {
    rotate: -30deg;
    animation-delay: -1.2s;
}

@keyframes chain-tighten {
    0%, 100% { scale: 1 1; }
    50%      { scale: 0.98 1.15; }
}

/* Padlock rune (Hardstuck) */
.cc-lock {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16%;
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(160, 100, 255, 1));
    translate: -50% -50%;
    animation: lock-pulse 1.6s ease-in-out infinite;
}

.lock-shackle {
    fill: none;
    stroke: #e2d4ff;
    stroke-width: 4;
    stroke-linecap: round;
}

.lock-body {
    fill: #2a1660;
    stroke: #e2d4ff;
    stroke-width: 2.5;
}

.lock-hole {
    fill: #e2d4ff;
}

@keyframes lock-pulse {
    50% { scale: 1.1; }
}

/* ---------- Small screens ---------- */

@media (max-width: 850px) {
    .caption-title {
        font-size: 15px;
        letter-spacing: 3px;
    }

    .respawn-label {
        display: none;
    }

    .respawn-count {
        font-size: 18px;
    }
}

/* Respect users who turn off animations: keep the static look only */
@media (prefers-reduced-motion: reduce) {
    .avatar-wrap *,
    .player .avatar-wrap > img,
    .caption-title {
        animation: none !important;
    }
}

/* =========================================
   PHANTOM CROWN (current leader)
   ========================================= */

.crown {
    position: absolute;
    z-index: 3;
    top: -13%;
    left: -11%;
    width: 32%;
    pointer-events: none;

    transform: rotate(-20deg);
    animation: crown-float 3.6s ease-in-out infinite;
}

.crown svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.crown-main {
    position: relative;
    opacity: 0.88;
    filter:
        drop-shadow(0 0 6px rgba(255, 220, 130, 0.9))
        drop-shadow(0 0 18px rgba(255, 200, 90, 0.55));
    animation: crown-phantom 2.8s ease-in-out infinite;
}

.crown-body,
.crown-band {
    stroke: #fff3c0;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.crown-gem {
    fill: #eaf6ff;
    stroke: #bfe3ff;
    stroke-width: 1;
}

/* Expanding, fading copy behind the crown: the "phantom" aura */
.crown .crown-echo {
    position: absolute;
    inset: 0;
    opacity: 0;
    filter: blur(2px);
    transform-origin: 50% 70%;
    animation: crown-echo 2.8s ease-out infinite;
}

/* Ghostly mist under the crown */
.crown::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -12%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 230, 160, 0.45), transparent 70%);
    filter: blur(4px);
    animation: crown-phantom 2.8s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% { transform: rotate(-20deg) translateY(0); }
    50%      { transform: rotate(-15deg) translateY(-8%); }
}

@keyframes crown-phantom {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 0.45; }
}

@keyframes crown-echo {
    0%   { transform: scale(1);                    opacity: 0.55; }
    100% { transform: scale(1.4) translateY(-12%); opacity: 0; }
}

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

    .crown .crown-echo {
        display: none;
    }
}
