:root {
    --rr-ink: #071014;
    --rr-panel: rgba(8, 17, 21, 0.88);
    --rr-panel-2: rgba(15, 28, 34, 0.9);
    --rr-lime: #b7ff2a;
    --rr-green: #6fc510;
    --rr-orange: #ff7a18;
    --rr-cream: #f5f8ef;
    --rr-muted: #a9b4b9;
    --rr-line: rgba(183, 255, 42, 0.72);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    display: grid;
    overflow: hidden;
    touch-action: none;
    background: #101923;
    color: var(--rr-cream);
    font-family: "Trebuchet MS", Arial, sans-serif;
}

canvas {
    background-color: #134461;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    position: fixed;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

#splash {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr) minmax(280px, 360px);
    grid-template-rows: auto 1fr auto;
    gap: 20px 28px;
    padding: 46px 54px 28px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(10, 15, 18, 0.1) 40%, rgba(8, 12, 14, 0.56)),
        linear-gradient(90deg, rgba(5, 9, 10, 0.28), rgba(5, 9, 10, 0.02) 38%, rgba(5, 9, 10, 0.28)),
        url("images/robin-rumble-arena-bg.png");
    background-position: center;
    background-size: cover;
}

#splash::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 12%, rgba(183, 255, 42, 0.1), transparent 28%),
        linear-gradient(0deg, rgba(5, 8, 9, 0.24), rgba(5, 8, 9, 0) 34%);
}

#splash::after {
    display: none;
}

.rr-panel {
    position: relative;
    border: 1px solid var(--rr-line);
    background: linear-gradient(180deg, rgba(25, 38, 42, 0.92), rgba(5, 11, 14, 0.92));
    color: var(--rr-cream);
    clip-path: polygon(16px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 16px) 100%, 12px 100%, 0 calc(100% - 12px), 0 16px);
    box-shadow: 0 0 0 1px rgba(3, 8, 10, 0.75), 0 0 24px rgba(109, 211, 19, 0.2);
}

.rr-panel::before {
    content: "";
    position: absolute;
    inset: 4px;
    pointer-events: none;
    border: 1px solid rgba(183, 255, 42, 0.34);
    clip-path: polygon(12px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 12px) 100%, 10px 100%, 0 calc(100% - 10px), 0 12px);
}

.rr-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    color: var(--rr-lime);
}

.rr-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rr-online {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
}

.rr-online strong,
.rr-wallet strong {
    display: block;
    font-size: 1rem;
    font-weight: 900;
}

.rr-online small,
.rr-wallet small {
    display: block;
    margin-top: 8px;
    color: var(--rr-muted);
    font-size: 0.95rem;
    line-height: 1.35;
}

.rr-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--rr-lime);
    box-shadow: 0 0 14px var(--rr-lime);
}

.rr-wallet {
    grid-column: 3;
    grid-row: 1;
    min-height: 104px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 18px 20px 24px;
    text-align: left;
}

.rr-wallet .rr-chevron {
    margin-left: auto;
    color: var(--rr-lime);
    font-size: 2rem;
    line-height: 1;
}

.rr-side-menu {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    display: grid;
    gap: 12px;
    margin-bottom: 72px;
}

.rr-menu-action {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--rr-cream);
    background: var(--rr-panel);
    font-weight: 900;
    font-size: 1rem;
}

.rr-menu-action .rr-icon {
    border-right: 1px solid rgba(183, 255, 42, 0.38);
    padding-right: 14px;
}

.rr-hero {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 8px 0 44px;
}

.rr-logo {
    width: min(620px, 100%);
    max-height: 43vh;
    object-fit: contain;
    filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 20px rgba(183, 255, 42, 0.46));
}

.rr-name-label {
    width: min(420px, 100%);
    margin-top: 6px;
    color: var(--rr-lime);
    font-size: 0.85rem;
    font-weight: 900;
    text-align: left;
}

#player-name {
    display: block;
    -webkit-appearance: none;
    appearance: none;
    width: min(420px, 100%);
    height: 60px;
    margin: 8px 0 16px;
    padding: 0 20px;
    border: 1px solid rgba(183, 255, 42, 0.92);
    border-radius: 0;
    outline: none;
    background: linear-gradient(180deg, rgba(241, 247, 228, 0.98), rgba(187, 209, 163, 0.94));
    color: #162027;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 60px;
    clip-path: polygon(14px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 14px) 100%, 12px 100%, 0 calc(100% - 12px), 0 14px);
    box-shadow: inset 0 0 18px rgba(183, 255, 42, 0.18), 0 0 20px rgba(0, 0, 0, 0.32);
}

#player-name::placeholder {
    color: rgba(22, 32, 39, 0.62);
}

.button {
    border: 0;
    text-align: center;
    user-select: none;
}

#loading-game {
    width: min(460px, 100%);
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--rr-cream);
    background:
        linear-gradient(180deg, rgba(131, 206, 0, 0.92), rgba(43, 91, 3, 0.92)),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    border: 1px solid rgba(183, 255, 42, 0.9);
    clip-path: polygon(24px 0, calc(100% - 24px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 24px) 100%, 24px 100%, 0 calc(100% - 22px), 0 22px);
    box-shadow: 0 0 0 4px rgba(9, 13, 8, 0.76), 0 0 38px rgba(183, 255, 42, 0.48);
    cursor: wait;
}

.rr-primary-title {
    display: block;
    font-size: 3.1rem;
    font-weight: 1000;
    line-height: 1;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

.rr-primary-subtitle {
    display: block;
    margin-top: 12px;
    color: #e8ffaf;
    font-size: 0.95rem;
    font-weight: 900;
}

.loading #loading-game {
    animation: rrPulse 1.4s ease-in-out infinite alternate;
}

.ready #loading-game {
    cursor: pointer;
    animation: none;
}

.ready #loading-game:hover,
.rr-secondary-action:hover,
.rr-menu-action:hover,
.rr-wallet:hover {
    filter: brightness(1.16);
}

@keyframes rrPulse {
    from {
        opacity: 0.72;
        transform: translateY(1px);
    }
    to {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.rr-secondary-actions {
    width: min(620px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.rr-secondary-action {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(6, 11, 14, 0.9);
    color: var(--rr-cream);
    font-weight: 900;
    font-size: 1rem;
    text-align: center;
}

#wallet-connect {
    grid-column: 1 / -1;
}

.rr-secondary-action .rr-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.rr-secondary-action .rr-icon svg {
    width: 28px;
    height: 28px;
}

.rr-x {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.rr-info-card {
    z-index: 1;
    grid-column: 3;
    grid-row: 2;
    align-self: end;
    min-height: 270px;
    padding: 28px 28px 18px;
}

.rr-info-card strong {
    display: block;
    color: var(--rr-lime);
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 1000;
}

.rr-info-card p {
    margin: 18px 0 32px;
    color: #d2d8dc;
    font-size: 1rem;
    line-height: 1.55;
}

.rr-divider {
    width: 100%;
    height: 1px;
    display: block;
    margin: 18px 0 4px;
    background: linear-gradient(90deg, transparent, rgba(183, 255, 42, 0.74), transparent);
}

.rr-info-card footer {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    color: var(--rr-lime);
    font-size: 0.95rem;
    font-weight: 900;
}

.rr-info-card footer span:last-child {
    color: var(--rr-muted);
}

.rr-bottom-strip {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 62px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 0;
    padding: 0 24px;
    border: 1px solid var(--rr-line);
    background: rgba(6, 12, 14, 0.86);
    color: var(--rr-lime);
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.38);
}

.rr-bottom-strip span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
    font-size: 1rem;
    white-space: nowrap;
}

.rr-bottom-strip span + span {
    border-left: 1px solid rgba(183, 255, 42, 0.42);
}

.rr-bottom-strip b {
    color: var(--rr-cream);
    font-size: 1.35rem;
}

.playing #splash,
.paused #splash {
    display: none;
}

#fullscreen,
#menu-button,
.rr-mobile-button {
    position: fixed;
    z-index: 4;
    display: none;
}

#fullscreen {
    top: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    display: block;
    padding: 8px;
    border: 1px solid rgba(183, 255, 42, 0.82);
    background: rgba(6, 12, 14, 0.72);
    clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
}

#fullscreen img,
#menu-button img,
.rr-mobile-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(83%) sepia(94%) saturate(624%) hue-rotate(21deg) brightness(105%) contrast(102%);
}

#menu-button {
    top: 18px;
    left: 18px;
    width: 48px;
    height: 48px;
    padding: 10px;
    border: 1px solid rgba(183, 255, 42, 0.82);
    background: rgba(6, 12, 14, 0.8);
}

#shoot-button {
    top: 48%;
    left: 76%;
    width: 78px;
    height: 78px;
}

#rope-button {
    top: 36%;
    left: 61%;
    width: 68px;
    height: 68px;
}

#jump-button {
    right: 28%;
    bottom: 9%;
    width: 62px;
    height: 62px;
}

.rr-mobile-button {
    padding: 14px;
    border: 1px solid rgba(183, 255, 42, 0.74);
    border-radius: 50%;
    background: rgba(6, 12, 14, 0.72);
    box-shadow: 0 0 22px rgba(183, 255, 42, 0.24);
}

#crosshair {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(183, 255, 42, 0.86);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(183, 255, 42, 0.5);
}

#crosshair::before,
#crosshair::after,
#crosshair span::before,
#crosshair span::after {
    content: "";
    position: absolute;
    background: rgba(245, 248, 239, 0.92);
}

#crosshair::before {
    top: 50%;
    left: -16px;
    width: 13px;
    height: 2px;
}

#crosshair::after {
    top: 50%;
    right: -16px;
    width: 13px;
    height: 2px;
}

#crosshair span::before {
    top: -16px;
    left: 50%;
    width: 2px;
    height: 13px;
}

#crosshair span::after {
    bottom: -16px;
    left: 50%;
    width: 2px;
    height: 13px;
}

.playing #crosshair {
    display: block;
}

#menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5;
    place-items: center;
    background: rgba(5, 8, 10, 0.46);
}

.paused #menu {
    display: grid;
}

.rr-pause-action {
    width: 260px;
    min-height: 72px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rr-line);
    background: var(--rr-panel);
    color: var(--rr-lime);
    font-size: 1.4rem;
    font-weight: 1000;
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}

#chat {
    display: none;
}

.playing #chat {
    position: fixed;
    left: 18px;
    bottom: 82px;
    z-index: 4;
    width: 280px;
    min-height: 48px;
    display: block;
}

#chat-button {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid rgba(183, 255, 42, 0.72);
    background: rgba(6, 12, 14, 0.8);
    filter: invert(83%) sepia(94%) saturate(624%) hue-rotate(21deg) brightness(105%) contrast(102%);
}

#chat #chat-text-box {
    display: none;
}

#chat.chatting #chat-text-box {
    position: absolute;
    left: 50px;
    bottom: 0;
    display: block;
    width: 220px;
    height: 42px;
    border: 1px solid var(--rr-line);
    background: rgba(6, 12, 14, 0.88);
    color: var(--rr-cream);
    padding: 0 12px;
    outline: none;
}

#chat p.message {
    display: inline-block;
    width: 100%;
    margin: 0 0 6px;
    padding: 8px 10px;
    color: var(--rr-cream);
    background: rgba(6, 12, 14, 0.68);
    border-left: 2px solid var(--rr-lime);
    font-size: 0.9rem;
}

#kill-feed {
    position: fixed;
    right: 20px;
    top: 112px;
    z-index: 4;
    max-width: 360px;
    color: var(--rr-cream);
    text-align: right;
    font-weight: 800;
}

#health-bar {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 4;
    width: min(430px, 52vw);
    height: 44px;
    transform: translateX(-50%);
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(183, 255, 42, 0.82);
    background: rgba(6, 12, 14, 0.84);
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}

#health-bar span {
    color: var(--rr-lime);
    font-size: 0.9rem;
    font-weight: 1000;
}

.rr-hp-track {
    flex: 1;
    height: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

#health-bar #hp {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--rr-orange), var(--rr-lime));
    box-shadow: 0 0 12px rgba(183, 255, 42, 0.62);
    transition: width 0.16s ease-out;
}

.playing #health-bar {
    display: flex;
}

#game-info {
    display: none;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 4;
    gap: 10px;
    color: var(--rr-cream);
    font-size: 1rem;
    font-weight: 900;
}

.playing #game-info {
    display: flex;
}

#kill-count,
#bow-king {
    min-width: 110px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(183, 255, 42, 0.72);
    background: rgba(6, 12, 14, 0.84);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

#kill-count span {
    color: var(--rr-lime);
    font-size: 0.8rem;
}

#kill-count b {
    color: var(--rr-cream);
    font-size: 1.15rem;
}

#fps {
    position: fixed;
    right: 20px;
    bottom: 76px;
    z-index: 4;
    color: var(--rr-lime);
    width: 90px;
    text-align: right;
    font-size: 0.8rem;
}

.rotated #shoot-button {
    top: 85%;
    left: 50%;
}

.rotated canvas {
    transform: rotate(90deg);
    transform-origin: bottom left;
    width: 100vh;
    height: 100vw;
    margin-top: -100vw;
}

#controls,
#server-list,
#kickstarter,
#loading-indicator,
.footer,
ul,
#server-list .server {
    font-family: monospace;
}

#disconnect-message {
    position: fixed;
    left: 50%;
    top: 24px;
    z-index: 6;
    transform: translateX(-50%);
    color: var(--rr-lime);
    background: var(--rr-panel);
    border: 1px solid var(--rr-line);
    padding: 12px 18px;
    font-size: 1rem;
}

@media (max-width: 1120px) {
    #splash {
        grid-template-columns: 220px 1fr;
        grid-template-rows: auto 1fr auto;
        padding: 34px 30px 24px;
    }

    .rr-wallet {
        grid-column: 2;
    }

    .rr-hero {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-bottom: 24px;
    }

    .rr-side-menu,
    .rr-info-card {
        display: none;
    }
}

@media (max-width: 760px) {
    #splash {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        gap: 12px;
        padding: 18px;
    }

    .rr-online,
    .rr-wallet {
        grid-column: 1;
        min-height: 78px;
        padding: 14px 16px;
    }

    .rr-wallet {
        grid-row: 2;
    }

    .rr-hero {
        grid-column: 1;
        grid-row: 3;
        justify-content: start;
        padding-top: 8px;
    }

    .rr-logo {
        max-height: 33vh;
    }

    .rr-primary-title {
        font-size: 2.25rem;
    }

    #loading-game {
        min-height: 96px;
    }

    .rr-secondary-actions {
        grid-template-columns: 1fr;
    }

    .rr-bottom-strip {
        grid-column: 1;
        grid-row: 4;
        grid-template-columns: 1fr 1fr;
        min-height: 94px;
        padding: 8px 12px;
    }

    .rr-bottom-strip span {
        font-size: 0.85rem;
        justify-content: flex-start;
        border: 0;
    }

    #health-bar {
        width: calc(100vw - 32px);
    }

    #game-info {
        right: 12px;
        top: 12px;
    }

    .playing #chat {
        width: calc(100vw - 32px);
        left: 16px;
    }
}
