@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Barlow:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --lime: #ffca80;
    --muted: #a1aaa4;
    --line: #ffffff21
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #14131c;
    color: #eef3ed;
    font-family: Barlow, Arial, sans-serif;
    font-size: 16px;
    overflow: hidden
}

button,
input,
select {
    font: inherit
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .45;
    cursor: not-allowed
}

button,
input,
select {
    outline-offset: 4px
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--lime)
}

button {
    transition: background .18s, transform .18s
}

button:hover:not(:disabled) {
    filter: brightness(1.15)
}

button:active:not(:disabled) {
    transform: translateY(1px)
}

.hidden {
    display: none !important
}

#viewport {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 65% 48%, #26372b, #111815 65%)
}

#arena {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none
}

#labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden
}

.playerlabel {
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 2px 5px #000;
    transform: translate(-50%, -100%);
    text-align: center
}

.playerlabel .you {
    color: #b6fa62
}

.playerlabel i {
    display: block;
    font-style: normal;
    color: #b6fa62;
    font-size: 14px
}

header {
    position: relative;
    height: 100px;
    padding: 26px 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(#111614cc, #11161411)
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 19px
}

.brand small {
    display: block;
    font-size: 10px;
    letter-spacing: 3.9px;
    color: #a3aea4;
    margin-top: 4px
}

.brandmark {
    font-family: Impact, sans-serif;
    font-size: 44px;
    letter-spacing: -9px;
    color: var(--lime);
    padding-right: 9px;
    transform: skew(-8deg)
}

.brandmark span {
    color: #e9f0df
}

.topright {
    display: flex;
    align-items: center;
    gap: 22px
}

.tag {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--muted)
}

.iconbtn {
    background: #111a1580;
    border: 1px solid var(--line);
    padding: 10px 14px;
    color: #d8e0d8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px
}

.panel {
    position: absolute;
    z-index: 2;
    top: 130px;
    left: 42px;
    width: 320px;
    padding: 0 1rem 20px 1rem;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.8px;
    color: var(--lime);
    display: flex;
    align-items: center;
    gap: 9px
}

.spark {
    height: 6px;
    width: 6px;
    background: var(--lime);
    box-shadow: 0 0 15px #b6fa6280
}

h1,
h2 {
    font-family: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
    line-height: .91;
    letter-spacing: -.7px;
    font-weight: 800;
    margin: 22px 0
}

h1 {
    font-size: 68px
}

h1 em {
    font-style: normal;
    color: var(--lime)
}

h2 {
    font-size: 48px;
    line-height: .96
}

.intro {
    font-size: 18px;
    line-height: 1.4;
    color: #b6bfb7
}

.divider {
    width: 38px;
    height: 2px;
    background: #4d5d4b;
    margin: 23px 0
}

label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: #bac3b9;
    margin: 16px 0 8px
}

input,
select {
    background: #141d18e8;
    color: #f0f5e8;
    border: 1px solid #425044;
    border-radius: 3px;
    padding: 12px 14px;
    width: 100%;
    height: 44px
}

input:focus,
select:focus {
    outline: 1px solid var(--lime);
    border-color: var(--lime)
}

.primary {
    position: relative;
    background: var(--lime);
    border: 0;
    color: #172211;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1.2px;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    margin-top: 14px;
    border-radius: 3px
}

.primary span,
.secondary span {
    float: right;
    font-size: 22px
}

.primary small {
    display: block;
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 600;
    opacity: .7;
    margin-top: 5px
}

.secondary {
    padding: 12px 16px;
    border: 1px solid #62705c;
    background: #263222bb;
    width: 100%;
    color: #eff7e9;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    border-radius: 3px
}

.or {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #a2afa4;
    margin: 17px 0
}

.or span {
    height: 1px;
    background: var(--line);
    flex: 1
}

#joinForm {
    display: flex;
    margin-top: 10px;
    gap: 5px
}

#code {
    width: 45%;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px
}

#join {
    flex: 1;
    background: #1d281ed9;
    color: #d7e4d1;
    border: 1px solid #425044;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px
}

.hint {
    font-size: 12px;
    color: #9ca99e;
    line-height: 1.55
}

#connection {
    color: #ffca87;
    font-size: 13px;
    line-height: 1.4;
    margin: 8px 0
}

#arenaCaption {
    position: absolute;
    bottom: 110px;
    left: 46%;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 15px 20px;
    border-left: 2px solid #b6fa6280;
    background: linear-gradient(90deg, #131c1590, transparent);
    pointer-events: none
}

#arenaCaption>span:last-child {
    font-size: 13px;
    line-height: 1.5;
    color: #abb8aa
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 58px;
    border-top: 1px solid var(--line);
    padding: 0 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #7f8e82;
    background: #0e1513a0;
    z-index: 2
}

footer i {
    font-style: normal;
    color: #a6c987;
    margin: 0 10px
}

footer button {
    border: 0;
    background: none;
    color: #c0cbbc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px
}

.roomcode {
    width: 100%;
    padding: 14px;
    text-align: left;
    color: var(--lime);
    border: 1px dashed #7b9b55;
    background: #20311b88
}

.roomcode span {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 7px
}

.roomcode small {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    letter-spacing: 1px
}

#roster {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    max-height: 250px;
    overflow: auto
}

.rosterentry {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    background: #16231ce6;
    padding: 9px 7px;
    overflow: hidden
}

.rosterentry b {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.swatch {
    width: 7px;
    height: 7px;
    flex: none
}

.rosterentry small {
    font-size: 9px;
    opacity: .65
}

.textbtn {
    border: 0;
    background: none;
    color: #a5b89f;
    font-size: 12px;
    margin-top: 18px;
    padding: 0
}

.matchtop {
    position: absolute;
    top: 120px;
    left: 42px;
    right: 42px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px
}

.roundbox {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.roundbox small {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--lime)
}

.roundbox strong {
    font-family: 'Barlow Condensed', Impact, sans-serif;
    font-size: 32px
}

.objective {
    text-align: center;
    padding: 10px 25px;
    background: #121a13a8;
    border-top: 2px solid var(--lime)
}

.objective span {
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 18px
}

.objective small {
    display: block;
    color: #b1c2a8;
    font-size: 12px;
    margin-top: 6px
}

#scores {
    position: absolute;
    top: 217px;
    right: 42px;
    width: 164px;
    background: #0d1710b8;
    padding: 12px
}

.score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 7px 0
}

.score b {
    margin-left: auto;
    color: var(--lime)
}

.score.dead {
    opacity: .4
}

.score.dead span {
    text-decoration: line-through
}

#centerMessage {
    position: absolute;
    left: 50%;
    top: 43%;
    transform: translate(-50%, -50%);
    font-family: 'Barlow Condensed', Impact, sans-serif;
    font-size: 72px;
    text-shadow: 0 3px 30px #000;
    text-align: center;
    pointer-events: none;
    width: 80%
}

#centerMessage small {
    display: block;
    font: 600 14px Barlow, sans-serif;
    letter-spacing: 2px;
    margin-top: 15px
}

.actions {
    position: absolute;
    bottom: 87px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    border: 1px solid #8bac5360;
    background: #142013e0;
    border-radius: 5px;
    overflow: hidden
}

.actions>div,
.actions>button {
    min-width: 155px;
    text-align: center;
    padding: 13px 22px;
    border: 0;
    border-right: 1px solid #7f9c5b33;
    background: transparent;
    color: inherit
}

.actions>button:last-child {
    border: 0
}

.actions small {
    display: block;
    font-size: 10px;
    letter-spacing: 1.4px;
    color: #98ae8e;
    margin-top: 7px
}

kbd {
    font-family: Barlow, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px
}

.actions .ready {
    color: var(--lime)
}

#restart {
    position: absolute;
    bottom: 185px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px
}

#toast {
    position: absolute;
    left: 50%;
    bottom: 170px;
    transform: translateX(-50%);
    background: #142016eb;
    border: 1px solid #63754c;
    padding: 12px 20px;
    z-index: 10;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    max-width: 90%;
    text-align: center
}

#toast.show {
    opacity: 1
}

dialog {
    max-width: 520px;
    width: calc(100% - 32px);
    max-height: 88vh;
    overflow: auto;
    background: #17201a;
    border: 1px solid #516344;
    color: #e9eee7;
    padding: 36px;
    border-radius: 8px
}

dialog::backdrop {
    background: #050c09b0;
    backdrop-filter: blur(9px)
}

dialog h2 {
    color: var(--lime)
}

dialog ol {
    padding-left: 21px
}

dialog li {
    padding: 7px 0 7px 7px
}

dialog li::marker {
    color: var(--lime);
    font-weight: 700
}

dialog p {
    font-size: 14px;
    color: #b7c3b4;
    line-height: 1.5;
    margin: 7px 0
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #aabda3;
    border: 0;
    background: none;
    font-size: 28px
}

.sr {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    width: 1px;
    height: 1px;
    overflow: hidden
}

body.playing header {
    height: 82px
}

body.playing .tag {
    display: none
}

@media(min-height:950px) {
    .panel {
        top: 17vh
    }

    h1 {
        font-size: 80px
    }

    .intro {
        font-size: 20px
    }

    .divider {
        margin: 30px 0
    }
}

@media(max-height:820px) and (min-width:761px) {
    header {
        height: 78px
    }

    .panel {
        top: 100px
    }

    h1 {
        font-size: 52px;
        margin: 16px 0
    }

    .intro {
        font-size: 15px;
        margin: 10px 0
    }

    .divider {
        margin: 13px 0
    }

    .primary {
        padding: 12px 16px
    }

    .or {
        margin: 12px 0
    }

    .hint {
        margin: 8px 0
    }

    footer {
        height: 44px
    }

    #arenaCaption {
        bottom: 72px
    }
}

@media(max-width:760px) {
    body {
        overflow: auto;
        min-height: 100dvh
    }

    header {
        height: 78px;
        padding: 18px 20px
    }

    .brand {
        font-size: 15px;
        gap: 10px
    }

    .brandmark {
        font-size: 35px
    }

    .brand small {
        font-size: 8px;
        letter-spacing: 3px
    }

    .topright {
        gap: 7px
    }

    .tag {
        display: none
    }

    .iconbtn {
        padding: 9px 10px;
        font-size: 10px
    }

    .panel {
        position: relative;
        top: auto;
        left: auto;
        margin: calc(37vh - 78px) 20px 85px;
        width: calc(100% - 40px);
        padding: 22px;
        background: #121b17ed;
        border: 1px solid #35442f;
        max-width: 440px
    }

    h1 {
        font-size: 44px;
        line-height: .94;
        margin: 14px 0
    }

    h1 br:nth-child(2) {
        display: none
    }

    .intro {
        position: absolute;
        right: 22px;
        top: 58px;
        font-size: 12px
    }

    .divider {
        margin: 17px 0
    }

    #arenaCaption {
        display: none
    }

    footer {
        padding: 0 20px;
        height: 48px;
        font-size: 8px
    }

    footer>span:last-child {
        display: none
    }

    footer button {
        font-size: 9px
    }

    .matchtop {
        left: 17px;
        right: 17px;
        top: 98px;
        gap: 10px
    }

    .roundbox strong {
        font-size: 23px
    }

    .objective {
        padding: 9px;
        max-width: 48%
    }

    .objective span {
        font-size: 12px
    }

    .objective small {
        font-size: 10px;
        line-height: 1.4
    }

    .matchtop .iconbtn {
        padding: 9px 5px;
        font-size: 9px
    }

    #scores {
        top: 190px;
        right: 12px;
        width: 112px;
        padding: 8px
    }

    .score {
        font-size: 10px;
        padding: 5px 0;
        gap: 5px
    }

    .actions {
        bottom: 72px;
        width: calc(100% - 24px);
        max-width: 490px
    }

    .actions>div,
    .actions>button {
        min-width: 0;
        flex: 1;
        padding: 13px 5px
    }

    .actions>div {
        display: none
    }

    .actions small {
        font-size: 9px
    }

    kbd {
        font-size: 11px
    }

    #centerMessage {
        font-size: 52px
    }

    #toast {
        bottom: 150px;
        width: 85%
    }

    body.playing {
        overflow: hidden
    }

    dialog {
        padding: 28px
    }

    dialog h2 {
        font-size: 43px
    }
}

/* Ability targeting and dual-stick controls */
.actions .controlnote {
    width: 225px;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1.6;
    color: #a4b59c;
    letter-spacing: 1px
}

.actions .ability {
    position: relative;
    min-width: 110px;
    padding: 10px 20px;
    touch-action: none;
    user-select: none
}

.skillIcon {
    display: block;
    width: 38px;
    height: 38px;
    margin: 0 auto 5px;
    color: #b6fa62
}

.skillIcon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round
}

.flashAbility .skillIcon {
    color: #ffd56f
}

.flashAbility svg {
    fill: #ffd56f33
}

.ability kbd {
    position: absolute;
    left: 8px;
    top: 6px;
    font-size: 11px;
    color: #b7c3ae
}

.ability.armed {
    background: #64863255 !important;
    box-shadow: inset 0 0 0 2px #b6fa62
}

.flashAbility.armed {
    box-shadow: inset 0 0 0 2px #ffd56f;
    background: #a7792950 !important
}

#aimHint {
    position: absolute;
    bottom: 192px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    max-width: 85%;
    padding: 8px 12px;
    color: #e8f2df;
    background: #122013bb;
    pointer-events: none
}

#aimHint:empty {
    display: none
}

#moveStick {
    display: none;
    position: absolute;
    width: 138px;
    height: 138px;
    border-radius: 50%;
    border: 2px solid #b6fa6255;
    background: #192b21aa;
    touch-action: none;
    user-select: none;
    bottom: 80px;
    left: 25px;
    box-shadow: inset 0 0 25px #121911
}

#moveKnob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    border: 2px solid #c2efa885;
    border-radius: 50%;
    background: #83a56a55;
    transform: translate(-50%, -50%);
    pointer-events: none
}

#moveStick small {
    position: absolute;
    bottom: -24px;
    width: 100%;
    text-align: center;
    letter-spacing: 2px;
    font-size: 10px;
    color: #a7ba99;
    pointer-events: none
}

.touch-controls #moveStick {
    display: block
}

.touch-controls .actions {
    left: auto;
    right: 22px;
    bottom: 95px;
    transform: none;
    background: none;
    border: 0;
    gap: 12px;
    overflow: visible;
    width: auto
}

.touch-controls .actions .controlnote {
    display: none
}

.touch-controls .actions .ability {
    flex: none;
    width: 83px;
    height: 83px;
    min-width: 0;
    padding: 10px;
    border-radius: 50%;
    border: 2px solid #b6fa6288;
    background: #182719ec;
    box-shadow: 0 4px 20px #0007
}

.touch-controls .actions .flashAbility {
    border-color: #ffd56f88;
    background: #302919eb;
    margin-top: -50px
}

.touch-controls .ability kbd {
    display: none
}

.touch-controls .ability small {
    font-size: 9px;
    letter-spacing: .4px;
    margin-top: 0
}

.touch-controls #aimHint {
    bottom: 235px
}

.touch-controls .ability:disabled {
    opacity: .38
}

@media(max-width:760px) {
    .actions .controlnote {
        display: none
    }

    #moveStick {
        left: 14px;
        width: 118px;
        height: 118px;
        bottom: 90px
    }

    .touch-controls .actions {
        right: 13px;
        gap: 9px;
        bottom: 101px
    }

    .touch-controls .actions .ability {
        width: 72px;
        height: 72px;
        padding: 7px
    }

    .touch-controls .skillIcon {
        width: 32px;
        height: 32px
    }

    .touch-controls #aimHint {
        bottom: 225px;
        font-size: 10px;
        width: 85%
    }
}

@media(max-height:520px) {
    .touch-controls #moveStick {
        bottom: 62px;
        width: 100px;
        height: 100px
    }

    .touch-controls .actions {
        bottom: 65px
    }

    .touch-controls #aimHint {
        bottom: 162px
    }

    .touch-controls .matchtop {
        top: 82px
    }

    .touch-controls #scores {
        top: 151px
    }

    .touch-controls #centerMessage {
        font-size: 38px
    }
}

/* Character selection and multilingual layouts */
#language {
    width: 125px;
    height: 36px;
    font-size: 12px;
    padding: 6px 8px;
    letter-spacing: 0
}

.topright {
    gap: 12px
}

#characterDialog {
    max-width: 1060px;
    width: calc(100% - 28px);
    padding: 30px;
    background: radial-gradient(ellipse at top, #2c392b, #121b16 70%)
}

#characterDialog h2 {
    font-size: 38px;
    line-height: 1.1;
    margin: 16px 0 24px
}

.characterCards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.characterCard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #0e1814;
    border: 1px solid #506048;
    border-radius: 8px;
    padding: 0 18px 20px;
    color: #edf3e7;
    text-align: left;
    overflow: hidden
}

.characterCard:hover {
    border-color: #c2df83
}

.characterCard.selected {
    border-color: #b6fa62;
    box-shadow: 0 0 0 2px #b6fa62;
    background: #22331c
}

.characterCard canvas {
    width: 100%;
    height: 190px;
    object-fit: contain;
    pointer-events: none;
    background: radial-gradient(ellipse, #52613b44, transparent 70%)
}

.characterName {
    font-size: 25px;
    font-weight: 800;
    color: #d8edb6;
    margin: 8px 0
}

.characterSkill {
    font-size: 13px;
    color: #d7baf5;
    margin: 6px 0 12px
}

.characterSkill b {
    border: 1px solid #ad89cc;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px
}

.characterDescription {
    font-size: 13px;
    line-height: 1.55;
    color: #afbea9
}

.characterFooter {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 22px
}

.characterFooter button {
    width: auto;
    margin: 0;
    min-width: 120px
}

.specialAbility .skillIcon {
    color: #d7b1ff;
    font-size: 36px;
    line-height: 38px
}

.specialAbility.armed {
    box-shadow: inset 0 0 0 2px #d7b1ff;
    background: #704c9955 !important
}

.actions .ability {
    min-width: 115px;
    max-width: 160px;
    padding: 10px 15px
}

.actions small {
    letter-spacing: .5px;
    line-height: 1.3
}

.actions .controlnote {
    width: 190px
}

.touch-controls .actions {
    gap: 8px
}

.touch-controls .actions .ability {
    min-width: 0
}

.touch-controls .actions #specialAction {
    position: absolute;
    bottom: 99px;
    right: 0;
    width: 75px;
    height: 75px;
    border-color: #bd8bec
}

.touch-controls .actions #specialAction small {
    font-size: 9px
}

.touch-controls .actions #specialAction .skillIcon {
    font-size: 30px;
    height: 30px;
    line-height: 30px
}

:lang(hi) h1,
:lang(hi) h2,
:lang(zh) h2,
:lang(ru) h2 {
    font-family: Arial, sans-serif;
    line-height: 1.2;
    letter-spacing: 0
}

:lang(hi) button,
:lang(hi) label,
:lang(hi) small,
:lang(zh) button,
:lang(ru) button {
    letter-spacing: 0
}

@media(max-width:760px) {
    #language {
        width: 93px;
        font-size: 11px
    }

    .topright {
        gap: 5px
    }

    .brand {
        font-size: 12px;
        gap: 7px
    }

    .brandmark {
        font-size: 28px
    }

    header {
        padding: 14px
    }

    .brand small {
        font-size: 7px
    }

    #sound {
        font-size: 9px;
        padding: 8px 5px
    }

    .characterCards {
        grid-template-columns: 1fr
    }

    .characterCard {
        display: grid;
        grid-template-columns: 108px 1fr;
        padding: 12px;
        column-gap: 12px
    }

    .characterCard canvas {
        grid-column: 1;
        grid-row: 1 / 4;
        height: 150px;
        align-self: center
    }

    .characterName {
        font-size: 22px
    }

    .characterDescription {
        font-size: 12px
    }

    .characterSkill {
        font-size: 12px;
        margin: 3px 0 8px
    }

    #characterDialog {
        padding: 18px
    }

    #characterDialog h2 {
        font-size: 25px
    }

    .characterFooter {
        position: sticky;
        bottom: -18px;
        background: #142018;
        padding: 15px 0;
        margin: 8px 0 -10px
    }

    .characterFooter button {
        min-width: 0;
        font-size: 12px
    }

    .actions .ability {
        min-width: 0
    }

    .actions .controlnote {
        display: none
    }
}

@media(max-height:550px) and (min-width:600px) {
    .characterCards {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .characterCard {
        display: flex;
        padding: 8px
    }

    .characterCard canvas {
        height: 105px
    }

    .characterName {
        font-size: 19px
    }

    .characterDescription {
        font-size: 11px
    }

    #characterDialog h2 {
        font-size: 23px;
        margin: 6px 0
    }

    .characterFooter {
        margin-top: 8px
    }
}

.touch-controls .actions #specialAction {
    left: 0;
    right: auto;
    bottom: 100px
}

@media(max-width:380px) {
    .brandmark {
        display: none
    }

    .brand {
        font-size: 10px
    }

    .brand small {
        letter-spacing: 1.2px
    }

    #language {
        width: 82px
    }

    .characterCard {
        grid-template-columns: 82px 1fr
    }

    .characterCard canvas {
        height: 130px
    }

    .characterName {
        font-size: 19px
    }
}

header {
    justify-content: flex-end
}

.panel h1 {
    font-size: clamp(42px, 5vw, 68px);
    line-height: .95;
    letter-spacing: -1px;
    text-transform: none
}

.panel h1 .amp {
    color: #bd9aff;
    font-size: .8em
}

.panel h1 em {
    color: var(--lime)
}

footer {
    justify-content: center
}

#arenaCaption:empty {
    display: none
}

.intro {
    color: #f2e9df
}

/* Mobile: keep the ability hit areas stable and the match table compact. */
body {
    -webkit-touch-callout: none
}

button {
    touch-action: manipulation
}

.ability,
.ability * {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none
}

.ability>* {
    pointer-events: none
}

#scores {
    width: 260px;
    padding: 10px;
    background: #111820df;
    pointer-events: auto
}

#scores table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

#scores th {
    text-align: left;
    color: #c3a1ed;
    padding: 5px
}

#scores td {
    padding: 5px;
    border-top: 1px solid #ffffff12
}

#scores td:first-child {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

#scores td:nth-child(2) {
    color: #f69ea7;
    white-space: nowrap
}

#scores .mine {
    background: #ffca8018
}

#scores .respawning {
    opacity: .55
}

#matchCode {
    display: block;
    color: #ffca80;
    font-size: 17px;
    letter-spacing: 2px;
    padding: 5px 0
}

@media(max-width:760px) {
    #scores {
        top: 180px;
        right: 8px;
        width: 185px;
        padding: 5px
    }

    #scores table {
        font-size: 10px
    }

    #scores td,
    #scores th {
        padding: 3px
    }

    #scores td:first-child {
        max-width: 86px
    }

    .roundbox strong {
        font-size: 15px
    }

    .objective {
        max-width: 45%
    }

    .touch-controls .actions #specialAction {
        z-index: 5;
        bottom: 92px
    }

    .touch-controls .actions {
        z-index: 10
    }

    #moveStick {
        z-index: 10
    }
}

@media(max-height:520px) {
    #scores {
        top: 155px;
        max-height: calc(100dvh - 175px);
        overflow: auto;
        width: 180px
    }

    .matchtop {
        top: 74px
    }
}

.healthbar {
    display: block !important;
    width: 48px;
    height: 6px;
    margin: 4px auto 0;
    background: #241e27;
    border: 1px solid #ffffff88;
    border-radius: 2px;
    overflow: hidden
}

.healthbar b {
    display: block;
    height: 100%;
    transition: width .12s
}

.playerlabel {
    color: #ff6666
}

.clownlabel {
    position: absolute;
    transform: translate(-50%, -100%);
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 2px 4px #000, 0 0 8px #000;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none
}

.hearts {
    display: block;
    font-style: normal;
    letter-spacing: 2px;
    font-size: 17px;
    text-shadow: 0 1px 3px #000
}

.hearts.recharged {
    filter: drop-shadow(0 0 7px #a9eaff)
}

.characterCards {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

#characterDialog {
    max-height: 90vh;
    overflow-y: auto
}

.characterCard canvas {
    max-height: 145px
}

.characterCard {
    min-height: 0
}

footer {
    display: flex;
    gap: 20px
}

footer a {
    color: inherit;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800
}

@media(max-width:700px) {
    .characterCards {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .characterDescription {
        font-size: 11px
    }

    .characterCard canvas {
        max-height: 100px
    }
}

.portalNav {
    display: flex;
    gap: 8px;
    pointer-events: auto
}

.portalRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #ffffff20
}

.portalRow small {
    flex: 1
}

.portalRow button {
    width: auto;
    padding: 8px
}

#portalDialog {
    width: min(650px, 94vw);
    max-height: 85vh;
    overflow: auto
}

#portalDialog textarea {
    width: 100%;
    min-height: 90px;
    background: #131b18;
    color: #e9efdb;
    padding: 12px
}

#portalDialog a {
    display: inline-block;
    margin-top: 20px;
    color: #bbd98c
}

.replayBar {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: min(800px, 94vw);
    padding: 14px;
    background: #17221ef5;
    border: 1px solid #839e60;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center
}

.replayBar[hidden] {
    display: none
}

.replayBar input {
    flex: 1;
    min-width: 60px;
    padding: 0
}

.replayBar select {
    width: 85px
}

.replaying .actions,
.replaying #moveStick,
.replaying #changeCharacter {
    display: none !important
}

@media(max-width:700px) {
    .portalNav {
        gap: 3px
    }

    .portalNav button {
        font-size: 9px;
        padding: 7px
    }

    .replayBar {
        gap: 6px;
        font-size: 10px
    }

    .replayBar button {
        padding: 5px
    }
}

@media(max-width:760px) {
    header {
        flex-wrap: wrap;
        gap: 5px;
        align-content: center
    }

    .topright {
        flex: 1
    }

    .portalNav {
        justify-content: flex-end
    }

    .characterCard {
        display: flex;
        flex-direction: column;
        align-items: stretch
    }

    .characterCard canvas {
        width: 100%;
        height: 100px
    }

    .characterName {
        font-size: 20px
    }

    .characterFooter {
        grid-column: 1/-1
    }
}

#menu {
    max-height: calc(100vh - 165px);
    overflow-y: auto
}

#rankedPlay {
    margin-bottom: 8px
}

/* Compact looping character picker: arrows, keyboard and mobile swipe. */
#characterDialog {
    max-width: 510px;
    padding: 20px;
    max-height: 92dvh
}

#characterDialog h2 {
    font-size: 26px;
    margin: 10px 0 12px
}

.characterCards {
    display: block;
    touch-action: pan-y
}

.characterCard[hidden] {
    display: none !important
}

.characterCard {
    display: flex;
    width: 100%;
    padding: 8px 18px 14px;
    min-height: 260px
}

.characterCard canvas {
    height: 130px;
    max-height: 130px
}

.characterName {
    font-size: 23px;
    margin: 4px 0
}

.characterCarouselNav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 8px
}

.characterCarouselNav button {
    width: 54px;
    min-height: 44px;
    padding: 0;
    font-size: 30px
}

.characterCarouselNav span {
    font-size: 13px;
    color: #c1d5af
}

#characterDialog .characterFooter {
    position: static;
    margin: 12px 0 0;
    padding: 0
}

#characterDialog .characterFooter button {
    min-width: 0;
    flex: 1
}

@media(max-height:650px) {
    .characterCard {
        min-height: 0
    }

    .characterCard canvas {
        height: 80px;
        max-height: 80px
    }

    #characterDialog {
        padding: 14px
    }

    .characterSkill {
        margin: 4px 0
    }

    .characterDescription {
        font-size: 12px
    }
}

/* Between rounds the results stay visible; changing a champion is optional. */
.match-results #scores {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(560px, 90vw);
    max-height: 55vh;
    overflow: auto;
    background: #14201af5;
    border: 1px solid #9aac74;
    padding: 20px;
    z-index: 20
}

.match-results #scores table {
    width: 100%;
    font-size: 18px
}

.match-results #scores td {
    padding: 9px 12px
}

.match-results #centerMessage {
    top: 17%;
    font-size: 28px
}

.match-results .actions {
    display: none
}

.match-results #changeCharacter {
    display: block;
    position: fixed;
    left: 50%;
    bottom: 9%;
    transform: translateX(-50%);
    background: #273a21;
    z-index: 21
}

@media(max-width:600px) {
    .match-results #scores {
        padding: 10px
    }

    .match-results #scores table {
        font-size: 14px
    }

    .match-results #scores td {
        padding: 6px
    }

    .match-results #centerMessage {
        font-size: 20px
    }
}

.match-results .objective {
    visibility: hidden
}

.match-results #scores {
    pointer-events: auto
}
/* Bottom-to-top recharge driven by the actual simulation cooldown. */
.actions .ability{isolation:isolate;overflow:hidden}
.actions .ability::before{content:"";position:absolute;inset:0;background:#35495d;transform:scaleY(var(--cooldown-fill,1));transform-origin:bottom;pointer-events:none;opacity:0;z-index:-1;transition:transform .08s linear}
.actions .ability.cooling{opacity:1!important;background:#111720!important;color:#fff!important}
.actions .ability.cooling::before{opacity:1}
.actions .ability.cooling small,.actions .ability.cooling kbd{color:#fff!important;opacity:1;text-shadow:0 1px 3px #000;font-weight:800}
.actions .ability.cooling .skillIcon{opacity:.75}
#userSettings{margin:20px 0;border:1px solid #ffffff35;padding:14px}#userSettings legend{font-weight:800;font-size:13px}.settingToggle{display:flex;gap:12px;align-items:center;letter-spacing:0;font-size:14px;line-height:1.4}.settingToggle input{width:20px;height:20px;flex:0 0 20px;accent-color:#ffd071}#helpDialog{max-height:90dvh;overflow:auto}

/* Separate settings and readable hotkey editor. */
#settingsDialog{width:min(540px,94vw);max-height:88dvh;overflow:auto}#settingsDialog fieldset{margin:20px 0;padding:16px;border:1px solid #455247;border-radius:12px}#settingsDialog legend{color:#c6f590;font-weight:700}.hotkeyRow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0!important}.hotkeyRow input{width:120px;text-align:center;cursor:pointer;margin:0}#hotkeySettings{max-height:300px;overflow:auto}.armorShield{display:inline-block;position:relative;width:15px;height:18px;margin-left:5px;background:#394347;clip-path:polygon(8% 0,92% 0,92% 58%,75% 83%,50% 100%,25% 83%,8% 58%);vertical-align:middle;filter:drop-shadow(0 0 2px #111)}.armorShield:after{content:'';position:absolute;inset:0;background:currentColor;transform:scaleY(var(--armor-fill,1));transform-origin:bottom}.armorShield[hidden]{display:none}
.touch-controls #moveStick{scale:var(--touch-scale,1);transform-origin:bottom left}.touch-controls .actions{scale:var(--touch-scale,1);transform-origin:bottom right}.touch-controls.left-handed #moveStick{left:auto;right:28px;transform-origin:bottom right}.touch-controls.left-handed .actions{right:auto;left:18px;transform-origin:bottom left}
