@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=Zen+Kaku+Gothic+New:wght@300;400;500;700;900&display=swap");

*, *::before, *::after {
   box-sizing: border-box;
}

body {
    font-family: "Outfit", sans-serif !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f1e0f7;
    color: #333;
}

h1 {
    color: #2c3e50;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

#board {
    display: grid;
    grid-template-columns: repeat(8, 55px);
    grid-template-rows: repeat(8, 55px);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #bea8e1, #a689b6);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#main-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#game-container .board-wrapper {
    position: relative;
    width: 440px;
    height: 440px;
    overflow: hidden;
    border-radius: 20px;
}

.cell {
    width: 55px;
    height: 55px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cell.valid-move {
    background-color: rgba(212, 145, 248, 0.878);
}

.cell.valid-move:hover {
    background-color: rgba(222, 144, 238, 0.7);
}

.piece {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.piece.black {
    background: linear-gradient(145deg, #333333, #000000);
    border: 1px solid #111;
}

.piece.white {
    background: linear-gradient(145deg, #f0f0f0, #cccccc);
    border: 1px solid #eee;
}

#game-info {
    background-color: #f3f3f3;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

#game-info p {
    margin: 8px 0;
    font-size: 1.15em;
    color: #555;
}

.settings-panel {
    border-radius: 20px;
    background: linear-gradient(135deg, #bea8e1, #a689b6);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: absolute;
    width: 100%;
    height: 100%;
    justify-content: center;
    gap: 20px;
    top: 0;
    left: 0;

    transform: translateY(100%);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.4s;
}

.settings-panel.open {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.setting-label {
    font-size: 1.1em;
    font-weight: 400;
    color: #000;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #7b21b0;
}

input:focus + .slider {
    box-shadow: 0 0 1px #7b21b0;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.message {
    margin-top: 15px;
    padding: 10px;
    background-color: #ebd4ed;
    color: #155724;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.temp-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.temp-message.show {
    opacity: 1;
}

#reset-button,
#review-button,
#settings-button {
    font-family: "Outfit", sans-serif !important;
    margin-top: 10px;
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    background: linear-gradient(145deg, #b36ded, #7b21b0);
    color: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#review-button {
    background: linear-gradient(145deg, #6dedab, #18a362);
    margin-left: 10px;
}

#settings-button {
    background: linear-gradient(145deg, #6dbced, #1f18a3);
    margin-left: 10px;
}

#reset-button:hover,
#review-button:hover,
#settings-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
#reset-button:hover {
    background: linear-gradient(145deg, #6821b0, #b56ded);
}
#review-button:hover {
    background: linear-gradient(145deg, #18a362, #6dedab);
}
#settings-button:hover {
    background: linear-gradient(145deg, #215ab0, #6d9eed);
}

.dev-text {
    text-align: center;
    margin-top: 50px;
}

.hidden {
    display: none !important;
}

#debug-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 36px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 50px;
    width: auto;
    max-width: 1000px;
}

.debug-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.debug-controls button {
    padding: 8px 15px;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.debug-controls button:hover {
    background: #e0e0e0;
}

.debug-board-container {
    margin-top: 20px;
    text-align: center;
}

.debug-boards {
    display: flex;
    gap: 40px;
}

.small-board {
    display: grid;
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(8, 40px);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #bea8e1, #a689b6);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.small-board .cell {
    width: 40px;
    height: 40px;
}

.small-board .piece {
    width: 34px;
    height: 34px;
}

.cell.just-placed {
    background-color: rgba(255, 255, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.6) inset;
}

.board-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}

#debug-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.debug-line {
    stroke: #ff3333;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.8;
}
.debug-arrow-head {
    fill: #ff3333;
}

@media (max-width: 600px) {
    body {
        margin-top: 0px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    #game-container {
        padding: 15px;
        border-radius: 35px;
        gap: 20px;
        margin-top: 10px;
    }

    #game-container .board-wrapper {
        position: relative;
        width: 320px;
        height: 320px;
    }

    #board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }

    .cell {
        width: 40px;
        height: 40px;
    }

    .piece {
        width: 35px;
        height: 35px;
    }

    #game-info {
        padding: 15px;
        max-width: 320px;
    }

    #game-info p {
        font-size: 1em;
    }

    .message {
        font-size: 0.9em;
        padding: 8px;
        width: 90%;
        margin: auto;
    }

    #reset-button,
    #review-button,
    #settings-button {
        padding: 10px 20px;
        font-size: 1em;
    }

    .debug-controls {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas:
            "prev counter next"
            "start close end";
        gap: 15px 10px;
        width: 100%;
        justify-items: center;
    }

    .debug-controls button {
        width: 90%;
        padding: 8px 0;
    }

    .debug-boards {
        flex-direction: column;
        gap: 0px;
    }

    #debug-start {
        grid-area: start;
    }
    #debug-prev {
        grid-area: prev;
    }
    #debug-counter {
        grid-area: counter;
        white-space: nowrap;
    }
    #debug-next {
        grid-area: next;
    }
    #debug-end {
        grid-area: end;
    }
    #debug-close {
        grid-area: close;
    }
}
