
:root {
    --cell-size: 85px;
    --gap-size: 1px;
    --padding: 10px;
    --min-width: 900px;
    --max-width: 1200px;
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --text-color: #2c3e50;
}

@font-face {
    font-family: NotoColorEmojiLimited;
    unicode-range: U+1F1E6-1F1FF;
    src: url(https://raw.githack.com/googlefonts/noto-emoji/main/fonts/NotoColorEmoji.ttf);
}

body {
    font-family: 'NotoColorEmojiLimited', Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    /*font-family: 'NotoColorEmojiLimited', -apple-system, BlinkMacSystemFont,*/
    /*             'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji',*/
    /*             'Segoe UI Emoji', 'Segoe UI Symbol';*/
    margin: 0;
    padding: 0;
    display: flex;
    /*justify-content: center;*/
    align-items: flex-start;
    min-height: 100vh;
    background-color: #ecf0f1;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    /*max-width: var(--max-width);*/
    /*min-width: var(--min-width);*/
    /*width: 100%;*/
    margin: var(--padding);
    padding: var(--padding);
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-direction: column;
}

.text-block {
    text-align: left;
    margin: 10px 0;
    padding-left: 10px;
    width: 100%;
}

.footer {
    text-align: center;
    margin: 10px 0;
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
}

.map-grid-wrapper {
    /*width: 100%;*/
    /*max-width: calc(var(--cell-size) * 9 + var(--gap-size) * 8);*/
    /*display: flex;*/
    /*justify-content: center;*/
    /*align-items: center;*/
    padding: var(--padding);
    background-color: #f0f0f0;
    overflow: auto;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    gap: var(--gap-size);
    background-color: #777;
}

.map-cell {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: var(--cell-size);
    height: var(--cell-size);
    font-size: 13px;
    padding: 0;
    cursor: pointer;
    line-height: 1.0;
    background-color: #bcc2c2;

}

.notch {
    position: absolute;
    width: 50%;
    height: 50%;
}

.top-notch {
    clip-path: polygon(50% 30%, 0% 0%, 100% 0%);
    top: 0;
    left: 25%;
}

.bottom-notch {
    clip-path: polygon(50% 70%, 0% 100%, 100% 100%);
    bottom: 0;
    left: 25%;
}

.left-notch {
    clip-path: polygon(30% 50%, 0% 0%, 0% 100%);
    top: 25%;
    left: 0;
}

.right-notch {
    clip-path: polygon(70% 50%, 100% 0%, 100% 100%);
    top: 25%;
    right: 0;
}

.wm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    z-index: 10000;
}

.wm::before {
    content: 'Watermark ';
    width: 100%;
    height: 100%;
    font-size: 30px;
    color: rgba(0, 0, 0, 0.01);
    z-index: 10001;
}


@keyframes fadeInOut {
    0% {
        opacity: 0.1;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

.map-cell.updated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    animation: fadeInOut 2s ease-out;
}

.map-cell.unknown .notch::before,
.map-cell.unknown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 20%;
}

@keyframes blinkGradient {
    0% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.2;
    }
}

.map-cell.danger::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, darkred 100%);
    animation: blinkGradient 1.5s infinite;
}

.map-cell.safe-zone {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.2) 5px, rgba(255, 255, 255, 0.2) 10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-cell.safe-zone-neutral {
    background-color: transparent !important;
}

.cell-state {
    font-size: calc(0.4 * var(--cell-size));
    line-height: 1; 
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.6;
}

.top-left-text,
.top-right-text,
.bottom-left-text,
.bottom-right-text,
.center-right-text {
    position: absolute;
}

.top-left-text {
    top: 3%;
    left: 7%;
    background-color: rgb(255, 255, 255, 0.5);
	border: 1px solid white;
	padding: 2px;
	margin: 0px;
}

.top-right-text {
    top: 5%;
    right: 5%;
    text-align: right;
    opacity: 70%;
}

.bottom-left-text {
    bottom: 5%;
    left: 10%;
}

.bottom-left-text {
    bottom: 5%;
    left: 5%;
    background-color: rgba(255, 255, 255, .2);
    border-radius: 7px;
    padding: 1px 3px;
    margin: -2px;
}

.safe-zone-neutral .bottom-left-text {
    background-color: rgba(0, 0, 0, .1);
}

.bottom-right-text {
    bottom: 5%;
    right: 5%;
    opacity: 70%;
}

.special-zone .bottom-right-text {
    font-size: calc(0.4 * var(--cell-size));
    line-height: 1;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.3;
}

.center-right-text {
    right: 5%;
    font-size: 2em;
}

.time-text {
    margin: 0;
    font-size: 70%;
    font-weight: bold;
    padding-left: 3px;
}
.bottom-right-text .time-text {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid white;
    background: #ddd;
    color: black;
    margin: 0;
}

.outdated {
    /* background-color: gray; */
}
.outdated .cell-state {
    background-color: black;
    /* display: none; */
    opacity: 0.4;
}
.outdated .top-left-text {
    opacity: 0.4;
}
.outdated .top-right-text .time-text {
    color: #660000;
}

.tooltip {
    display: none;
    position: absolute;
    overflow: hidden;
    background-color: #dfe6e9;
    color: var(--text-color);
    padding: 5px;
    border-radius: 4px;
    z-index: 1000;
    font-size: 0.9em;
    white-space: nowrap;
    /* transform: translateX(-0%) translateY(30px); */
    left: 30px;
    top: 70px;
}

.map-cell:hover .tooltip {
    display: block;
}

button {
    display: block;
    width: 100%;
    padding: 10px 4px;
    background-color: #3498db;
    border: 1px solid #afd7f2;
    border-radius: 3px;
    color: white;
}
button:hover {
    background-color: #0f84d2;
    cursor: pointer;
}
button.sending {
    background-color: gray;
}
button.sent {
    background-color: green;
    animation: blinkGradient 1.5s infinite;
}
button.error {
    background-color: #660000;
}


p.label-red {
    font-size: 0.9em;
    margin: 0 0 3px 0;
    padding: 1px 3px;
    background-color: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
    color: red;
    font-weight: bold;
    border: 2px solid red;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* Subtle text shadow */
}

p.label-purple {
    font-size: 0.9em;
    margin: 0 0 3px 0;
    padding: 1px 3px;
    background-color: rgba(128, 0, 128, 0.1); /* Light purple background */
    border-radius: 10px;
    color: purple;
    font-weight: bold;
    border: 2px solid purple; /* Border of the same color */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* Subtle text shadow */
}

p.label-blue {
    font-size: 0.9em;
    margin: 0 0 3px 0;
    padding: 1px 3px;
    background-color: rgba(0, 0, 255, 0.1); /* Light blue background */
    border-radius: 10px;
    color: blue;
    font-weight: bold;
    border: 2px solid blue; /* Border of the same color */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* Subtle text shadow */
}

p.label-white {
    font-size: 0.9em;
    margin: 0 0 3px 0;
    padding: 1px 3px;
    background-color: rgba(255, 255, 255, 0.7); /* White background */
    border-radius: 10px;
    color: white;
    font-weight: bold;
    border: 2px solid white; /* Border of the same color */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* Subtle text shadow */
}

#error-block {
    background-color: #660000;
    color: white;
    margin-left: 1em;
    padding-left: 2em;
    font-size: large;
    font-weight: bold;
    width: 100%;
}
