* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    height: 100%;
    font-family: sans-serif;
    touch-action: none;
}

body {
    background-image: url('tile.webp');
    background-repeat: repeat;
}

canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
    clip-path: circle(42.725% at center);
}

@keyframes pulse {
    from {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.map {
    position: fixed;
}

.mapBorder {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

body .map.zooming {
    transition: none;
}

.menu-btn {
    position: fixed;
    top: 8px;
    left: 8px;
    padding: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 20;
}

.menu-btn:hover .bar {
    background: #ccc;
}

.menu-btn .bar {
    background: #fff;
    width: 30px;
    height: 3px;
    margin-bottom: 4px;
    border-radius: 10px 0;
    box-shadow: 0px 0px 3px 1.5px #000;
    transition: background 0.1s ease-in-out;
}

.menu-btn .bar:last-child {
    margin-bottom: 0;
}

.menu {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 16px 10px 12px;
    position: fixed;
    top: 46px;
    left: -180px;
    font-size: 14px;
    transition: left 0.3s ease-in-out;
    z-index: 20;
}

.menu.menuOpen {
    left: 0px;
}

.menu label {
    cursor: pointer;
    user-select: none;
}

.menu .inputRow {
    display: flex;
    align-items: center;
    height: 26px;
}

.inputRow input {
    margin-right: 8px;
}

.mapText {
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    text-shadow: 0 0 6px #000, 0 0 6px #000, 0 0 3px #000;
    user-select: none;
    pointer-events: none;
}

#messages {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px;
    position: fixed;
    left: 0px;
    bottom: 0px;
    z-index: 10;
    font-size: 12px;
    transition: left 0.3s ease-in-out;
    max-height: 350px;
    display: block;
    overflow-y: scroll;
}

#messages .datetime {
    color: gray;
    text-align: right;
}

#messages .date {
    display: none;
}

#messages .name {
    color: darkorange;
}

#messages .name::after {
    color: white;
    content: ":";
}

#messages .type2 .text {
    color: gold;
    text-transform: uppercase;
}

#messages .server .name {
    color: deepskyblue;
}

#messages td > p {
    display: contents;
}

.coords {
    position: fixed;
    right: 8px;
    bottom: 6px;
    z-index: 10;
    font-size: 10px;
}

.mapIcon {
    position: absolute;
    width: 32px;
    height: 32px;
    background-image: url('mapIcons.png');
    background-size: 192px;
    transform: translate(-50%, -50%);
}

.mapIcon .center {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
}

.mapIcon .text {
    bottom: -11px;
}

.mapIcon.player {
    background-position: 0 0;
    filter: hue-rotate(240deg);
}

.mapIcon.fire {
    background-position: -32px 0;
}

.mapIcon.dot {
    background-position: -64px 0;
}

.mapIcon.mine {
    background-position: -96px 0;
}

.mapIcon.house {
    background-position: -128px 0;
}

.mapIcon.cave {
    background-position: 0 -32px;
}

.mapIcon.boss {
    background-position: -32px -32px;
    pointer-events: auto;
    cursor: help;
    z-index: 3;
}

.mapIcon.boss .text {
    position: absolute;
    left: 50%;
    top: -30px;
    bottom: unset;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.78);
    text-shadow:
        0 0 3px #000,
        0 0 6px #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mapIcon.boss:hover .text {
    opacity: 1;
    visibility: visible;
}

.mapIcon.start {
    background-position: -64px -32px;
}

.mapIcon.ping {
    background-position: -96px -32px;
    animation: pulse 1.2s ease-in-out infinite;
}

.mapIcon.dead {
    background-position: -128px -32px;
}

.mapIcon.pvp {
    filter: hue-rotate(0deg) !important;
}

/* Evento / raid activo */

.mapIcon.event {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid rgba(255, 0, 0, 0.2);
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.2) !important;
    pointer-events: auto;
    cursor: help;
    z-index: 1;
}

.mapIcon.event.paused {
}

.mapIcon.event.active {
    border-color: rgba(255, 0, 0, 1);
    background: rgba(255, 0, 0, 0.10) !important;
}

.mapIcon.event .text {
    position: absolute;
    left: 50%;
    top: -28px;
    bottom: unset;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    text-shadow:
        0 0 3px #000,
        0 0 6px #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mapIcon.event:hover .text {
    opacity: 1;
    visibility: visible;
}

/* Portales */

.mapIcon.portal {
    position: absolute;
    width: 26px;
    height: 26px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: help;
    z-index: 4;
    background-image: none;
}

.mapIcon.portal::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('mapIcons.png');
    background-size: 192px;
    background-position: -3px -35px;
    background-repeat: no-repeat;
    pointer-events: none;
}

.mapIcon.portal.disconnected::before {
    opacity: 0.65;
    filter:
        grayscale(0.75)
        drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.mapIcon.portal.spidered::before {
    filter:
        saturate(1.35)
        drop-shadow(0 0 3px rgba(255, 255, 255, 0.55));
}

.mapIcon.portal.match::before {
    filter:
        saturate(1.6)
        drop-shadow(0 0 3px rgba(53, 208, 79, 1))
        drop-shadow(0 0 8px rgba(53, 208, 79, 0.95))
        drop-shadow(0 0 13px rgba(53, 208, 79, 0.65));
}

.mapIcon.portal.focused::before {
    filter:
        saturate(1.4)
        drop-shadow(0 0 3px rgba(255, 255, 255, 1))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 13px rgba(255, 255, 255, 0.6));
}

.mapIcon.portal.focused.match::before {
    filter:
        saturate(1.8)
        drop-shadow(0 0 3px rgba(255, 255, 255, 1))
        drop-shadow(0 0 7px rgba(53, 208, 79, 1))
        drop-shadow(0 0 13px rgba(53, 208, 79, 0.9));
}

.mapIcon.portal.disconnected.focused.match::before {
    filter:
        saturate(1.8)
        drop-shadow(0 0 3px rgba(255, 255, 255, 1))
        drop-shadow(0 0 7px rgb(255, 0, 0))
        drop-shadow(0 0 13px rgba(208, 53, 53, 0.9)) !important
}

.mapIcon.portal .text {
    position: absolute;
    left: 50%;
    top: -30px;
    bottom: unset;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.78);
    text-shadow:
        0 0 3px #000,
        0 0 6px #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mapIcon.portal:hover .text {
    opacity: 1;
    visibility: visible;
}

/* Cluster de portales */

.mapIcon.portalCluster {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 5;
    background-image: none;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.78);
    border: 2px solid rgba(80, 190, 255, 0.9);
    box-shadow:
        0 0 4px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(80, 190, 255, 0.7);
}

.mapIcon.portalCluster:hover,
.mapIcon.portalCluster.focused,
.mapIcon.portalCluster.open {
    z-index: 40 !important;
}

.mapIcon.portalCluster.open,
.mapIcon.portalCluster.focused {
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 0 4px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(255, 255, 255, 0.8),
        0 0 14px rgba(80, 190, 255, 0.8);
}

.mapIcon.portalCluster.match {
    border-color: rgba(53, 208, 79, 1);
    box-shadow:
        0 0 4px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(53, 208, 79, 0.95),
        0 0 14px rgba(53, 208, 79, 0.75);
}

.mapIcon.portalCluster .text {
    position: absolute;
    left: 50%;
    top: 50%;
    bottom: unset;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow:
        0 0 3px #000,
        0 0 6px #000;
    pointer-events: none;
}

.portalClusterTooltip {
    position: absolute;
    left: 50%;
    top: -8px;
    bottom: unset;
    transform: translate(-50%, -100%);
    min-width: 180px;
    max-width: 280px;
    padding: 7px 9px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    text-shadow:
        0 0 3px #000,
        0 0 6px #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 41;
}

.mapIcon.portalCluster:hover .portalClusterTooltip {
    opacity: 1;
    visibility: visible;
}

.portalClusterTooltipTitle {
    color: #80cfff;
    font-weight: bold;
    margin-bottom: 4px;
}

.portalClusterTooltipRow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu .menuMapIcon {
    position: static;
    transform: scale(0.7);
}

.hpBar {
    border: 1px solid #f55;
    height: 9px;
    width: 100%;
    position: relative;
}

.hp {
    width: 100%;
    height: 100%;
    background: #f55;
    transition: width 0.5s linear;
}

.hpText {
    position: absolute;
    font-size: 10px;
    line-height: 8px;
    top: 0;
    left: 50%;
    transform: translate(-50%, 0);
    white-space: nowrap;
}

.playerListContainer {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 0;
    position: fixed;
    top: 0px;
    right: 0px;
    font-size: 12px;
    transition: right 0.3s ease-in-out;
    z-index: 20;
    min-width: 100px;
    text-align: center;
}

.playerListTitle {
    font-size: 16px;
    margin-bottom: 6px;
}

.playerListEntry {
    padding: 3px 16px;
    cursor: pointer;
}

.playerListEntry.selected {
    background: rgba(135, 134, 202, 0.75);
}

.playerListTut {
    font-size: 12px;
    margin-top: 16px;
}

.topMessage {
    position: fixed;
    top: 6px;
    left: 50%;
    transform: translate(-50%, 0);
    color: #fff;
    text-shadow: 0 0 6px #000, 0 0 6px #000, 0 0 3px #000;
    font-size: 24px;
    text-align: center;
}

.gameTime {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 4px #000;
    pointer-events: none;
    user-select: none;
}
