* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-image: url('../pics/bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    overflow-x: hidden;
}

div, button {
    cursor: pointer;
}

/* Custom Visible Gold Scrollbars for Modals & Tables */
#modal-content::-webkit-scrollbar,
#leaderboard-modal-content::-webkit-scrollbar,
.leaderboard-table-wrapper::-webkit-scrollbar {
    width: 8px !important;
    display: block !important;
}

#modal-content::-webkit-scrollbar-track,
#leaderboard-modal-content::-webkit-scrollbar-track,
.leaderboard-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
}

#modal-content::-webkit-scrollbar-thumb,
#leaderboard-modal-content::-webkit-scrollbar-thumb,
.leaderboard-table-wrapper::-webkit-scrollbar-thumb {
    background-color: goldenrod !important;
    border-radius: 4px !important;
}

#modal-content::-webkit-scrollbar-thumb:hover,
#leaderboard-modal-content::-webkit-scrollbar-thumb:hover,
.leaderboard-table-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: #fdd835 !important;
}

/* Splash Welcome Overlay */
.welcome {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.welcome img {
    width: auto;
    height: 5rem;
    border-radius: 10px;
}

/* Outer Screen Wrapper */
.main-board {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 10px;
}

/* Instruction Banner */
.instruct {
    width: 100%;
    max-width: 800px;
    background-color: rgba(0, 0, 0, 0.85);
    color: gold;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95rem;
    border: 1.5px solid goldenrod;
    margin: 0 auto 15px auto;
}

.alert {
    color: gold;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
    min-height: 24px;
}

/* Game Buttons */
.buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

button {
    padding: 10px 18px;
    border: 2px solid goldenrod;
    border-radius: 8px;
    background-color: brown;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9rem;
    transition: filter 0.15s ease;
}

button:hover {
    filter: brightness(1.15);
}

.rule-button {
    padding: 10px 18px;
    border: 2px solid goldenrod;
    border-radius: 8px;
    background-color: yellow;
    color: black;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Rules Modal Popup */
#modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#modal-content {
    background: #1e3d23;
    border: 3px solid goldenrod;
    color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
    position: relative;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    box-sizing: border-box;
    overflow-y: auto;
}

#modal-content h2 {
    color: gold;
    margin-bottom: 15px;
    font-size: 22px;
    text-align: center;
}

#modal-content h4 {
    color: gold;
    margin-top: 12px;
    margin-bottom: 4px;
}

#modal-content p {
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
}

#close-modal {
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background-color: #d32f2f;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Leaderboard Modal Popup Container */
#leaderboard-modal-content {
    background: #1e3d23;
    border: 3px solid goldenrod;
    color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
    position: relative;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    box-sizing: border-box;
    overflow-y: auto;
}

.leaderboard-table-wrapper {
    max-height: 60vh;
    overflow-y: auto;
    width: 100%;
}