:root {
    --bg-color: #121213;
    --text-color: #ffffff;
    --tile-bg: transparent;
    --tile-border: #3a3a3c;
    --correct-bg: #538d4e;
    --present-bg: #b59f3b;
    --absent-bg: #3a3a3c;
    --key-bg: #818384;
    --header-height: 50px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid #3a3a3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    margin-left: 8px;
}

#game-board {
    flex-grow: 1;
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-gap: 5px;
    padding: 10px;
    margin-top: 20px;
    width: 350px;
    height: 420px;
}

.row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 5px;
}

.tile {
    width: 100%;
    height: 100%;
    border: 2px solid var(--tile-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.1s linear, background-color 0.5s ease;
}

.tile.filled {
    border-color: #565758;
    animation: pop 0.1s linear;
}

.tile.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-bg);
}

.tile.present {
    background-color: var(--present-bg);
    border-color: var(--present-bg);
}

.tile.absent {
    background-color: var(--absent-bg);
    border-color: var(--absent-bg);
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

#keyboard {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
}

.key-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    touch-action: manipulation;
}

.key {
    background-color: var(--key-bg);
    color: white;
    border: none;
    border-radius: 4px;
    margin: 0 3px;
    padding: 20px 12px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    flex: 1;
    max-width: 43px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.key.wide {
    max-width: 65px;
    font-size: 12px;
}

/* FAQ Section Styling */
#faq-section {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin: 40px 0;
    line-height: 1.6;
}

hr {
    border: none;
    border-top: 1px solid #3a3a3c;
    margin-bottom: 20px;
}

#faq-section h2 {
    margin-bottom: 20px;
    text-align: center;
}

.faq-container details {
    margin-bottom: 12px;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 10px;
}

.faq-container summary {
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

.faq-container p {
    margin-top: 10px;
    color: #b1b1b1;
}

.color-explanation .tile {
    display: inline-flex;
    width: 30px;
    height: 30px;
    font-size: 16px;
    margin-right: 8px;
    border-radius: 4px;
}

#how-to-play-extra {
    margin-top: 30px;
}

#how-to-play-extra h3 {
    margin-bottom: 10px;
}

#how-to-play-extra ul {
    list-style: disc;
    padding-left: 20px;
    color: #b1b1b1;
}

footer {
    padding: 20px;
    font-size: 12px;
    color: #565758;
    text-align: center;
}

/* Modal and Styles */
.hidden {
    display: none !important;
}

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal-content {
    background-color: var(--bg-color);
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 40px;
    position: relative;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 23px 0 rgba(0, 0, 0, 0.2);
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 24px;
}

/* Message Toast */
.message-toast {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    color: #000;
    padding: 15px 20px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Statistics Styles */
.stats-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
}

.stat-number {
    font-size: 30px;
    font-weight: bold;
}

.stat-label {
    font-size: 12px;
    text-align: center;
}

h2,
h3 {
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.dist-chart {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid #3a3a3c;
    margin-bottom: 20px;
}

.dist-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}

.dist-num {
    width: 20px;
    font-size: 14px;
}

.dist-bar {
    background-color: #3a3a3c;
    color: #fff;
    padding: 2px 8px;
    font-size: 14px;
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

.dist-bar.highlight {
    background-color: var(--correct-bg);
}

.action-btn {
    background-color: var(--correct-bg);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    #game-board {
        width: 300px;
        height: 360px;
    }

    .tile {
        font-size: 24px;
    }
}