/* =========================================================
   SETTINGS PAGE
   ========================================================= */

.settings-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


/* =========================================================
   SETTINGS SCREEN
   ========================================================= */

.settings-screen {
    width: min(560px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 40px 0;
    text-align: center;
}


    /* =========================================================
   TITLE
   ========================================================= */

    .settings-screen > h1 {
        margin: 0 0 34px;
        color: #fff;
        font-size: 38px;
        font-weight: 600;
        letter-spacing: 1px;
    }


/* =========================================================
   GENERAL SECTION
   ========================================================= */

.settings-section {
    width: 100%;
    padding: 22px;
    background: #292929;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

    .settings-section + .settings-section {
        margin-top: 18px;
    }

    .settings-section h2 {
        margin: 0;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 1px;
    }


/* =========================================================
   TURN OPTIONS
   ========================================================= */

.turn-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.turn-option {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    background: #333;
    color: white;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

    .turn-option:hover {
        border-color: #777;
        background: #383838;
        transform: translateY(-1px);
    }

    .turn-option:active {
        transform: translateY(1px);
    }

    .turn-option.selected {
        border-color: #ff2028;
        box-shadow: 0 0 0 3px rgba(255, 32, 40, 0.15), 0 0 12px rgba(255, 32, 40, 0.12);
        transform: translateY(-1px);
    }

/* White option */

.white-option {
    background: #e8edf9;
    border-color: #cfd6e8;
}

    .white-option:hover {
        background: #f0f3fb;
        border-color: #ff2028;
    }


/* Black option */

.black-option {
    background: #151515;
    border-color: #666;
}

    .black-option:hover {
        background: #1d1d1d;
        border-color: #ff2028;
    }


/* Random option */

.random-option {
    background: #333;
}

.question-mark {
    font-size: 34px;
    font-weight: 600;
    color: #d9ddeb;
}


/* =========================================================
   THINK TIME
   ========================================================= */

.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slider-value {
    min-width: 34px;
    color: #ff2028;
    font-size: 15px;
    font-weight: bold;
    text-align: right;
}


/* Slider */

.think-time-slider {
    width: 100%;
    margin: 20px 0 8px;
    accent-color: #ff2028;
    cursor: pointer;
}


/* Slider range labels */

.slider-range {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 12px;
}

/* =========================================================
   ALLOW UNDO
   ========================================================= */

.undo-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.undo-setting-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}


/* Custom checkbox */

.toggle-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .toggle-checkbox input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.checkbox-box {
    width: 20px;
    height: 20px;
    border: 1px solid #555;
    border-radius: 5px;
    background: #333;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.toggle-checkbox:hover .checkbox-box {
    background: #383838;
    border-color: #777;
}

.toggle-checkbox input:checked + .checkbox-box {
    background: #ff2028;
    border-color: #ff2028;
    box-shadow: 0 0 10px rgba(255, 32, 40, 0.18);
}

    .toggle-checkbox input:checked + .checkbox-box::after {
        content: "";
        position: absolute;
        width: 5px;
        height: 10px;
        left: 8px;
        top: 3px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

/* =========================================================
   ADVANCED OPTIONS
   ========================================================= */

.advanced-section {
    padding: 0;
    overflow: hidden;
}

.advanced-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 19px 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: left;
    transition: background 0.15s ease;
}

    .advanced-header:hover {
        background: #303030;
    }

.advanced-arrow {
    color: #aaa;
    font-size: 20px;
    line-height: 1;
}

.advanced-content {
    min-height: 0;
}


/* =========================================================
   ACTION BUTTONS
   ========================================================= */

.settings-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 26px;
}


/* Play */

.settings-play-button {
    width: 210px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #555;
    border-radius: 8px;
    background: #292929;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

    .settings-play-button:hover {
        background: #333;
        border-color: #ff2028;
        box-shadow: 0 0 14px rgba(255, 32, 40, 0.2), 0 5px 16px rgba(0, 0, 0, 0.3);
        transform: translateY(-2px);
    }

    .settings-play-button:active {
        transform: translateY(1px);
    }


/* Go back */

.settings-back-button {
    margin-top: 16px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s ease;
}

    .settings-back-button:hover {
        color: white;
    }


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .settings-page {
        min-height: 100dvh;
        overflow-y: auto;
    }

    .settings-screen {
        width: calc(100% - 24px);
        padding: 28px 0 30px;
    }

        .settings-screen > h1 {
            margin-bottom: 24px;
            font-size: 30px;
        }

    .settings-section {
        padding: 18px;
    }

    .turn-options {
        gap: 8px;
    }

    .turn-option {
        height: 72px;
    }

    .piece-white,
    .piece-black {
        width: 28px;
        height: 28px;
    }

    .question-mark {
        font-size: 28px;
    }

    .settings-play-button {
        width: 180px;
    }
}