body {
    font-family: arial, helvetica, sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
}

ul {
    margin: 0 0 0 5px;
    padding: 0;
    list-style-position: inside;
}

p {
    margin: 0 0 20px;
}


button.active,

.action-button {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;

    border: 2px solid #777;
    border-radius: 6px;

    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-button:hover {
    background: #e0e0e0;
    border-color: #555;
    transform: translateY(1px);
}

.action-button.active {
    background: #ccc;
    border-color: #555;
    color: #000;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.action-button:disabled {
    background: #ccc;
    border-color: #999;
    color: #666;
    cursor: not-allowed;
}

.button-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.legend,
.stats-panel,
.button-wrapper {
    width: 100%;
}



.wrapper {
    display: block;
    margin: 0 auto;
    width: 1300px;
    position: relative;
}

.map {
    border-collapse: collapse;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.map-tile {
    border: 2px solid #aaa;
    width: 64px;
    height: 64px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.map-tile:hover {
    outline: 3px solid cornflowerblue;
    border-color: deepskyblue;
}

.map-tile[data-status="closed"] {
    background: #000;
}

.map-tile[data-status="begin"] {
    background: darkslateblue;
}

.map-tile[data-status="end"] {
    background: darkorange;
}

.map-tile[data-status="set-closed"] {
    background: indianred;
}

.map-tile[data-status="set-opened"] {
    background: aquamarine;
}

.map-tile[data-status="path"] {
    background: forestgreen;
}

.map-tile[data-lv]:after {
    font-size: 30px;
    position: absolute;
    top: 0;
    left: 0;
    line-height: 50px;
    text-align: center;
    display: block;
    width: 47px;
    letter-spacing: -2px;
    color: #999;
}

.map-tile[data-lv="2"]:after {
    content: '\2022\2022';
}

.map-tile[data-lv="3"]:after {
    content: '\2022\2022\2022';
}

.map-tile[data-lv="4"]:after {
    content: '\2022\2022\2022\2022';
}

.map-tile[data-status="current"] {
    background: darkgreen !important;
}


.map-tile[data-status="neighbor-check"] {
    background: dodgerblue !important;
}



.stat {
    position: absolute;
}
.stat.f,
.stats-preview .f {
    top: 4px;
    left: 4px;
    position: absolute;
}

.stat.g,
.stats-preview .g {
    font-size: 0.7rem;
    bottom: 4px;
    left: 4px;
    position: absolute;
}

.stat.h,
.stats-preview .h {
    font-size: 0.7rem;
    bottom: 4px;
    right: 5px;
    position: absolute;
}

.stats-preview {
    width: 100px;
    height: 100px;
    background: #9FD6D2;
    border: 5px solid #aaa;
    display: block;
    font-size: 30px;
    position: relative;
}

.break {
    margin-bottom: 20px;
    display: block;
}

.break.alt {
    margin-bottom: 10px;
}

.legend-wrapper {
    float: right;
    width: 280px;
}

.legend {
    padding: 0;
    background: #ddd;
    display: inline-block;
    list-style: none;
    border: 1px solid #aaa;
    margin-left: 0;
}

.legend li {
    border-left: 30px solid #fff;
    padding: 5px 20px 5px 10px;
    width: 100%;
    box-sizing: border-box;
}

.legend .closed {
    border-color: #000;
}

.legend .begin {
    border-color: darkslateblue;
}

.legend .end {
    border-color: darkorange;
}

.legend .set-opened {
    border-color: aquamarine;
}

.legend .set-closed {
    border-color: indianred;
}

.legend .path {
    border-color: forestgreen;
}


.stats-panel {
    margin-top: 15px;
    background: #eee;
    border: 1px solid #aaa;
    padding: 10px;
    box-sizing: border-box;
}

.stats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats li {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 8px;
}

.stats li span {
    display: inline-block;
    min-width: 50px;
    text-align: right;
}


.stats li span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 1px solid #555;
}


#stat-path::before {
    background: forestgreen;
}


#stat-closed::before {
    background: indianred;
}


#stat-open::before {
    background: aquamarine;
}


.top-nav {
    width: 100%;
    background: #222;
    padding: 10px 0;
    text-align: center;
    margin-bottom: 20px;
}

.top-nav a {
    color: #eee;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    font-family: sans-serif;
}

.top-nav a:hover {
    color: #4CAF50;
}


