/* --- Global Styles --- */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #0f172a;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background 0.5s;
    color: #fff;
}

::-webkit-scrollbar {
    display: none;
}

p {
    font-weight: bold;
    font-size: 20px;
    color: white;
}

/* --- Board --- */
#board {
    width: 350px;
    margin: 20px auto;
    border-radius: 12px;
}

/* --- Move List --- */
#moveListContainer {
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: #ffffffcc;
    border-radius: 12px;
    padding: 10px;
    font-size: 16px;
    scroll-behavior: smooth;
    margin-top: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#moveListContainer h3 {
    margin: 0 0 10px;
    text-align: center;
    color: #333;
    font-weight: bold;
    text-shadow: none;
}

#movesList ul {
    margin: 0;
    padding: 0;
}

#movesList li {
    padding: 10px;
    text-align: center;
    border-top: 1px solid #ccc;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    border-radius: 6px;
    margin-bottom: 4px;
    text-align: left;
    list-style: none;
}

#moveList li:hover {
    background: linear-gradient(90deg, #d5dfff, #a0c4ff);
    transform: scale(1.03);
}

/* --- Buttons and select --- */
select {
    padding: 10px 10px;
    border-radius: 12px;
    border: none;
    background: red;
    font-size: 14px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-right: 10px;
}

button {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: red;
    font-size: 16px;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: 0.3s;
}

button:hover {
    background: darkred;
    transform: translateY(-2px);
}

/* --- Scroll Menu --- */
div.scrollmenu {
    background-color: #ffffffcc;
    overflow: auto;
    white-space: nowrap;
    border-radius: 0px 0px 12px 12px;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

div.scrollmenu a {
    display: inline-block;
    color: black;
    text-align: center;
    padding: 14px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    margin: 0 4px;
    transition: 0.3s;
}

div.scrollmenu a:hover {
    background-color: #ffd26a;
    color: white;
}

/* --- Tables --- */
table {
    width: 95%;
    margin: 20px auto;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: white;
    color: black;
}

th,
td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
}

th {
    background: #ffd26a;
    color: white;
}

tr:nth-child(odd) {
    background: #ffffffdd;
}

tr:nth-child(even) {
    background: #f1f1f1dd;
}

tr:hover {
    background: #ffe4a1;
    transform: scale(1.01);
    transition: 0.3s;
}

/* --- Evaluation Bar --- */
#evaluationBarContainer {
    width: 90%;
    max-width: 350px;
    height: 40px;
    margin: 20px auto;
    background: #ffffffcc;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 12px;
}

#evaluationBar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#evaluationScore {
    font-weight: bold;
    color: black;
    text-align: center;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding-top: 60px;
}

.modal-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #333;
    width: 85%;
    position: relative;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.close {
    color: #333;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    text-decoration: none;
}

.close:hover,
.close:focus {
    color: #ff4e50;
    text-decoration: none;
    cursor: pointer;
}

.modal-content img {
    display: block;
    margin: 0 auto;
    border: 2px solid #333;
    max-width: 100%;
    border-radius: 8px;
}

.modal-content button {
    display: block;
    margin: 20px auto;
    border-radius: 12px;
    border: 2px solid #333;
    font-weight: bold;
    color: black;
    text-decoration: none;
    padding: 10px 20px;
    background: #ffd26a;
    cursor: pointer;
    transition: 0.3s;
}

.modal-content button:hover {
    background: #ffc040;
}

/* --- Footer --- */
footer {
    background-color: #ffffffcc;
    overflow: auto;
    white-space: nowrap;
    border-radius: 12px 12px 0px 0px;
    text-align: center;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

footer p {
    font-size: 15px;
    color: black;
}

.line-text {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #a0c4ff;
    font-style: italic;
    font-size: 20px;
    text-shadow: none;
    margin: 25px;
}

.line-text::before,
.line-text::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid #a0c4ff;
    width: 20px;
}

.line-text::before {
    margin-right: 10px !important;
}

.line-text::after {
    margin-left: 10px !important;
}

#playRandom span {
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background-image: linear-gradient(to top left, black, white);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

#status {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
    transition: 0.3s;
}

.popUp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: blue;
    padding: 20px;
    border: none;
    color: white;
    border-radius: 10px;
    width: 60%;
    text-align: center;
    animation: popIn 0.5s ease forwards;
}

@keyframes popIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Group */
.group {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 15px;
    gap: 10px;
}

/* Opening */
#openingExplorer {
    border-radius: 20px;
    background-color: #8c939e;
    padding: 10px;
    text-align: center;
    position: relative;
    border: 2px solid white;
}

#searchInput {
    padding: 10px;
    width: 100%;
    font-weight: bold;
    color: black;
    box-sizing: border-box;
    border-radius: 20px;
    border: none;
}

/* Header */
.header {
    text-align: center;
}

/* Fen selector */
.fen-selector {
    text-align: center;
}

/* Mistakes */
.mistakes {
    text-align: center;
    background-color: wheat;
    color: black;
    border-radius: 20px;
    padding: 20px;
    border: 2px solid white;
}

.mistakes_black {
    color: black;
}

.mistakes_white {
    color: gray;
}