
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 30px 15px;
    background: #171923;
    color: #ffffff;
    font-family: sans-serif;
}

.container {
    max-width: 1400px;
    margin: auto;
}

h1 {
    text-align: center;
    letter-spacing: 3px;
    font-size: 30px;
}

.status {
    margin: 30px 0 20px;
}

.status-box {
    background: #252a3a;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.status-box span {
    display: block;
    color: #aab1c5;
    font-size: 15px;
    margin-bottom: 8px;
}

.status-box strong {
    font-size: 36px;
}

.map-section {
    margin-top: 25px;
}

#mapContainer {
    width: 100%;
    height: 220px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 25px;
    background: #252a3a;
    border-radius: 10px;
    scroll-behavior: smooth;
}

#map {
    display: flex;
    gap: 8px;
    width: max-content;
    height: 100%;
    align-items: center;
}

.cell {
    flex-shrink: 0;
    width: 126px;
    height: 126px;
    background: #454b5d;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    transition: background 0.15s;
}

.cell.visited {
    background: #168b6a;
}

/* 5の倍数のマス */
.cell.multiple-of-five {
    background: #c0394b;
}

/* 5の倍数かつ通過済み */
.cell.multiple-of-five.visited {
    background: #8e2638;
}

/* 現在位置は赤より優先 */
.cell.current {
    background: #f0a832;
    color: #171923;
    font-weight: bold;
    transform: scale(1.08);
    box-shadow: 0 0 20px #f0a832;
}


.cell.current {
    background: #f0a832;
    color: #171923;
    font-weight: bold;
    transform: scale(1.08);
    box-shadow: 0 0 20px #f0a832;
}

.controls {
    margin-top: 30px;
    padding: 25px;
    background: #252a3a;
    border-radius: 10px;
}

label {
    display: block;
    margin-bottom: 12px;
    color: #cbd0df;
}

.input-group {
    display: flex;
    gap: 10px;
}

input {
    min-width: 0;
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 6px;
    background: #171923;
    color: white;
    font-size: 18px;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    background: #168b6a;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    filter: brightness(1.2);
}

#message {
    color: #aab1c5;
    font-size: 14px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .cell {
        width: 90px;
        height: 90px;
        font-size: 17px;
    }

    #mapContainer {
        height: 170px;
    }

    .input-group {
        flex-wrap: wrap;
    }

    button {
        flex: 1;
    }
}