@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #080709;
    --panel: #100d10;
    --line: #34232b;
    --red: #f04466;
    --gold: #f4c971;
    --muted: #867a7f;
    --white: #f7f3f4
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 50% 43%, #211018 0, #100b10 37%, #080709 78%);
    color: var(--white);
    font-family: Manrope, Arial, sans-serif;
    min-height: 100vh
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .14;
    background-image: linear-gradient(#ffffff09 1px, transparent 1px), linear-gradient(90deg, #ffffff09 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(transparent, #000 20%, #000 75%, transparent)
}

.game-shell {
    position: relative;
    width: min(100% - 56px, 1240px);
    margin: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.topbar {
    height: 86px;
    border-bottom: 1px solid #ffffff13;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto
}

.brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    display: flex;
    align-items: center;
    gap: 11px
}

.brand b {
    color: var(--red)
}

.brand-mark {
    color: var(--gold);
    font-size: 22px
}

.stats {
    display: flex;
    gap: clamp(22px, 5vw, 70px)
}

.stats>div {
    display: flex;
    flex-direction: column;
    gap: 3px
}

.label,
.progress-head,
.feed-heading,
.arena-caption,
footer,
.winner-kicker {
    font: 10px 'DM Mono', monospace;
    letter-spacing: .12em;
    color: var(--muted)
}

.stats strong {
    font: 600 17px 'DM Mono', monospace
}

.stats small {
    font-size: 11px;
    color: #766b70
}

.stage {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px;
    align-items: center;
    gap: 32px;
    min-height: 430px;
    padding: 22px 0 12px
}

.arena-wrap {
    position: relative;
    width: min(100%, min(65vh, 670px));
    aspect-ratio: 1;
    margin: auto;
    display: grid;
    place-items: center
}

.arena-halo {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, #3b1725 0%, #1a1017 52%, transparent 72%);
    filter: blur(18px);
    opacity: .76
}

canvas {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1
}

.arena-caption {
    position: absolute;
    left: 50%;
    bottom: 2%;
    transform: translateX(-50%);
    z-index: 2;
    white-space: nowrap;
    font-size: 9px
}

.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--red);
    border-radius: 50%;
    margin-right: 7px;
    box-shadow: 0 0 10px #f04466
}

.eliminations {
    align-self: center;
    border: 1px solid #ffffff14;
    background: linear-gradient(145deg, #151015c9, #0e0b0ec9);
    padding: 15px 14px;
    min-height: 174px;
    max-height: 240px;
    overflow: hidden;
    box-shadow: 0 14px 40px #0005
}

.feed-heading {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #ffffff12;
    color: #c5b9be
}

.feed-heading span:last-child {
    color: var(--red)
}

#feed {
    margin: 0;
    padding: 7px 0 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden
}

#feed li {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 10px;
    color: #b3a9ae;
    animation: feed-in .3s ease-out
}

#feed img {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px
}

.feed-rank {
    font: 9px 'DM Mono', monospace;
    color: #695e64;
    width: 21px
}

.under-arena {
    padding: 4px 0 18px
}

.progress-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px
}

.progress-head strong {
    font-weight: 500;
    color: #dbd3d6
}

.progress-track {
    height: 3px;
    background: #32242a;
    overflow: hidden
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #a91d3c, var(--red), var(--gold));
    box-shadow: 0 0 10px #f0446670;
    transition: width .25s ease
}

.flag-strip {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16px, 1fr));
    gap: 5px;
    max-height: 53px;
    overflow: hidden;
    mask-image: linear-gradient(90deg, #000 95%, transparent)
}

.flag-chip {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 2px;
    opacity: .93;
    transition: opacity .3s, filter .3s, transform .3s
}

.flag-chip.dead {
    opacity: .18;
    filter: grayscale(1)
}

footer {
    height: 39px;
    border-top: 1px solid #ffffff13;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px
}

footer i {
    font-style: normal;
    color: var(--gold);
    margin-left: 5px
}

.winner {
    position: absolute;
    z-index: 4;
    inset: 15%;
    border: 1px solid #ed4b6d77;
    background: radial-gradient(ellipse, #27141eec, #0d0a0def 74%);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 55px #f0446622;
    text-align: center;
    animation: winner-in .65s cubic-bezier(.2, .8, .2, 1)
}

.winner.hidden {
    display: none
}

.winner-kicker {
    color: var(--gold);
    margin-bottom: 3px
}

.winner-title {
    font: 800 clamp(35px, 6vw, 64px)/1 'Barlow Condensed', sans-serif;
    letter-spacing: .1em;
    margin-bottom: 13px
}

.winner img {
    width: clamp(86px, 16vw, 150px);
    aspect-ratio: 4/3;
    object-fit: cover;
    border: 1px solid #ffffff48;
    box-shadow: 0 0 35px #f0446655
}

.winner-name {
    font: 700 20px Manrope, sans-serif;
    margin: 12px 0 18px
}

.winner button {
    border: 1px solid #e44a68;
    background: linear-gradient(120deg, #9d1733, #da3555);
    color: white;
    padding: 12px 19px;
    font: 700 10px 'DM Mono', monospace;
    letter-spacing: .1em;
    cursor: pointer;
    box-shadow: 0 0 20px #db38504a;
    transition: transform .2s, box-shadow .2s
}

.winner button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 28px #db385080
}

.winner button span {
    margin-left: 18px;
    color: var(--gold)
}

@keyframes feed-in {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes winner-in {
    from {
        opacity: 0;
        transform: scale(.92)
    }

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

@media(max-width:700px) {
    .game-shell {
        width: min(100% - 28px, 520px)
    }

    .topbar {
        height: 68px
    }

    .brand {
        font-size: 10px;
        letter-spacing: .1em;
        gap: 6px
    }

    .brand-mark {
        font-size: 18px
    }

    .stats {
        gap: 13px
    }

    .label {
        font-size: 8px
    }

    .stats strong {
        font-size: 13px
    }

    .stats small {
        font-size: 9px
    }

    .stage {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
        padding: 9px 0 8px;
        align-items: stretch
    }

    .arena-wrap {
        width: min(100%, 50vh, 490px);
        margin: auto
    }

    .arena-caption {
        bottom: 3%;
        font-size: 8px
    }

    .eliminations {
        min-height: 72px;
        max-height: 76px;
        width: 100%;
        padding: 8px 10px
    }

    .feed-heading {
        padding-bottom: 5px;
        font-size: 9px
    }

    #feed {
        flex-direction: row;
        gap: 10px;
        padding-top: 6px
    }

    #feed li {
        font-size: 9px;
        gap: 5px
    }

    #feed li:nth-child(n+5) {
        display: none
    }

    #feed img {
        width: 18px;
        height: 12px
    }

    .feed-rank {
        width: auto
    }

    .under-arena {
        padding-top: 2px
    }

    .progress-head {
        font-size: 9px
    }

    .flag-strip {
        grid-template-columns: repeat(auto-fill, minmax(13px, 1fr));
        gap: 3px;
        max-height: 40px;
        margin-top: 9px
    }

    .winner {
        inset: 16% 10%
    }

    footer {
        height: 31px;
        font-size: 8px
    }
}

@media(max-width:380px) {
    .stats {
        gap: 9px
    }

    .stats strong {
        font-size: 12px
    }

    .brand {
        font-size: 9px
    }

    .arena-wrap {
        width: min(100%, 48vh)
    }
}

/* Use the full frame height when the game is shown in a 9:16 portrait viewport. */
@media (max-aspect-ratio: 9/16) {
    .game-shell {
        width: min(100% - 28px, 720px);
        min-height: 100svh
    }

    .topbar {
        height: clamp(64px, 8vh, 88px)
    }

    .stage {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: clamp(10px, 2.6vh, 28px);
        padding: clamp(8px, 2vh, 20px) 0
    }

    .arena-wrap {
        width: min(100%, 42vh, 760px);
        margin: auto
    }

    .eliminations {
        width: min(100%, 520px);
        align-self: center;
        min-height: clamp(76px, 11vh, 170px);
        max-height: clamp(76px, 11vh, 170px)
    }

    .under-arena {
        padding: 4px 0 clamp(10px, 2vh, 20px)
    }

    .flag-strip {
        max-height: clamp(36px, 5.5vh, 64px)
    }
}

/* Keep the complete game inside one centered 9:16 mobile-style frame. */
body {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    display: grid;
    place-items: center
}

.game-shell {
    width: min(100vw, 56.25svh);
    height: min(100svh, 177.7778vw);
    min-height: 0;
    aspect-ratio: 9/16;
    overflow: hidden;
    padding: 0 clamp(12px, 2.6vw, 24px);
    border: 1px solid #a51c3b;
    background: linear-gradient(180deg, #12090e 0%, #0a080b 52%, #10090d 100%);
    box-shadow: 0 0 36px #e42d5422, inset 0 0 24px #e42d540b
}

.topbar {
    height: clamp(66px, 10vh, 94px);
    flex: 0 0 auto
}

.stage {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(78px, 17svh, 170px) minmax(0, 1fr);
    grid-template-areas: "feed" "arena";
    align-items: center;
    gap: clamp(4px, 1vh, 10px);
    padding: clamp(4px, 1vh, 12px) 0
}

.arena-wrap {
    grid-area: arena;
    width: min(100%, 44svh, 78vw, 940px);
    aspect-ratio: 1;
    margin: auto
}

.eliminations {
    grid-area: feed;
    align-self: center;
    width: min(100%, 520px);
    min-height: 0;
    max-height: 100%;
    margin: auto
}

.under-arena {
    flex: 0 0 auto;
    padding: 4px 0 clamp(8px, 1.6vh, 16px)
}

.flag-strip {
    max-height: clamp(34px, 6svh, 80px)
}

footer {
    flex: 0 0 auto;
    height: clamp(28px, 4.6vh, 40px)
}