/* Main Game Container */
.hero-section {
    padding-bottom: 50px !important;
}

#main-container {
    margin-top: 20px;
}

.game-container {
    text-align: center;
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Game Title */
.game-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Grid Layout */
#grid {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(6, 60px);
    gap: 5px;
    justify-content: center;
}

.tile {
    width: 60px;
    height: 60px;
    border: 2px solid #3a3a3c;
    background-color: #121213;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 24px;
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
    animation: tileFlip 0.6s ease-in-out;
}

@keyframes tileFlip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

.tile.correct {
    background-color: #538d4e;
    border-color: #538d4e;
    animation: correctTile 0.6s ease-in-out;
}

.tile.present {
    background-color: #b59f3b;
    border-color: #b59f3b;
    animation: presentTile 0.6s ease-in-out;
}

.tile.absent {
    background-color: #3a3a3c;
    border-color: #3a3a3c;
    animation: absentTile 0.6s ease-in-out;
}

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

    50% {
        transform: scale(1.1);
    }

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

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

    50% {
        transform: scale(1.05);
    }

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

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

    50% {
        transform: scale(0.95);
    }

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

/* Keyboard Container */
.keyboard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

#keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.keyboard-row.middle {
    margin-left: 15px;
}


.key {
    width: 43px;
    height: 58px;
    border: none;
    background-color: #555;
    color: white;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


.key:hover {
    background-color: #6a6a6c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.key:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.key.wide {
    width: 65px;
}

.key.enter {
    width: 80px;
    font-size: 12px;
}

.key.backspace {
    width: 80px;
    font-size: 16px;
}

.key.correct {
    background-color: #538d4e;
}

.key.present {
    background-color: #b59f3b;
}

.key.absent {
    background-color: #3a3a3c;
}

/* Statistics Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #121213;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
}

.modal-title {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #818384;
    text-transform: uppercase;
}

.guess-distribution {
    margin-bottom: 30px;
}

.guess-distribution h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

.guess-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.guess-number {
    width: 20px;
    font-size: 0.9rem;
    color: white;
    text-align: right;
}

.guess-bar-container {
    flex: 1;
    height: 20px;
    background-color: #3a3a3c;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.guess-bar {
    height: 100%;
    background-color: #538d4e;
    border-radius: 2px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.guess-count {
    width: 30px;
    font-size: 0.9rem;
    color: white;
    text-align: left;
}

.play-again-btn {
    width: 100%;
    background-color: #538d4e;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-again-btn:hover {
    background-color: #4a7c45;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(83, 141, 78, 0.3);
}

.play-again-btn:active {
    transform: translateY(0);
}

/* info section  */

.footer-info-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #d6ecfa, #f1f9ff);
    color: #2c3e50;
    padding: 20px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    max-width: 650px;
    margin: 20px auto;
    box-sizing: border-box;
    box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.footer-info-box .icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #a9cce3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1b4f72;
    font-size: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer-info-box .text {
    flex: 1;
    line-height: 1.6;
}

.footer-info-box .text h3 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #154360;
    margin-top: 0 !important;
}

.footer-info-box .text ul {
    margin: 0;
    padding-left: 18px;
}

.footer-info-box .text li {
    margin-bottom: 8px;
}


/* Responsive Design */
/* 1299px and above */
@media (min-width: 1300px) {
    .game-container {
        max-width: 700px;
        padding: 30px;
    }

    .game-title {
        font-size: 3rem;
    }

    #grid {
        grid-template-columns: repeat(5, 70px);
        grid-template-rows: repeat(6, 70px);
        gap: 8px;
    }

    .tile {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .key {
        width: 50px;
        height: 65px;
        font-size: 16px;
    }

    .key.enter,
    .key.backspace {
        width: 90px;
    }

}

/* 992px to 1299px */
@media (max-width: 1299px) and (min-width: 993px) {
    .game-container {
        max-width: 600px;
        padding: 25px;
    }

    .game-title {
        font-size: 2.5rem;
    }

    #grid {
        grid-template-columns: repeat(5, 65px);
        grid-template-rows: repeat(6, 65px);
        gap: 6px;
    }

    .tile {
        width: 65px;
        height: 65px;
        font-size: 26px;
    }

    .key {
        width: 45px;
        height: 60px;
        font-size: 15px;
    }

    .key.enter,
    .key.backspace {
        width: 85px;
    }

    .footer-info-box {
        max-width: 90%;
        font-size: 15px;
        padding: 18px;
    }
}

/* 768px to 992px */
@media (max-width: 992px) and (min-width: 769px) {
    .game-container {
        max-width: 550px;
        padding: 20px;
    }

    .game-title {
        font-size: 2.2rem;
    }

    #grid {
        grid-template-columns: repeat(5, 60px);
        grid-template-rows: repeat(6, 60px);
        gap: 5px;
    }

    .tile {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .key {
        width: 42px;
        height: 58px;
        font-size: 14px;
    }

    .key.enter,
    .key.backspace {
        width: 80px;
    }

    .keyboard-row.middle {
        margin-left: 12px;
    }

    .footer-info-box {
        flex-direction: row;
        gap: 14px;
        padding: 16px 18px;
    }

    .footer-info-box .text h3 {
        font-size: 17px;
        margin-top: 0 !important;
    }
}

/* 600px to 768px */
@media (max-width: 768px) and (min-width: 601px) {
    .game-container {
        max-width: 500px;
        padding: 15px;
    }

    .game-title {
        font-size: 2rem;
    }

    #grid {
        grid-template-columns: repeat(5, 55px);
        grid-template-rows: repeat(6, 55px);
        gap: 4px;
    }

    .tile {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .key {
        width: 38px;
        height: 52px;
        font-size: 13px;
    }

    .key.enter,
    .key.backspace {
        width: 70px;
    }

    .keyboard-row.middle {
        margin-left: 10px;
    }


    .modal-content {
        padding: 25px;
        max-width: 350px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .footer-info-box {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 16px;
    }

    .footer-info-box .icon {
        margin-bottom: 10px;
    }

    .footer-info-box .text h3 {
        font-size: 16px;
        margin-top: 0 !important;
    }
}

/* 480px to 600px */
@media (max-width: 600px) and (min-width: 481px) {
    .game-container {
        max-width: 450px;
        padding: 12px;
    }

    .game-title {
        font-size: 1.8rem;
    }

    #grid {
        grid-template-columns: repeat(5, 50px);
        grid-template-rows: repeat(6, 50px);
        gap: 3px;
    }

    .tile {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .key {
        width: 35px;
        height: 48px;
        font-size: 12px;
    }

    .key.enter,
    .key.backspace {
        width: 70px;
    }

    .keyboard-row.middle {
        margin-left: 8px;
    }


    .modal-content {
        padding: 20px;
        max-width: 320px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .footer-info-box {
        padding: 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .footer-info-box .icon {
        width: 40px;
        height: 40px;
    }

}

/* 350px to 480px */
@media (max-width: 480px) and (min-width: 400px) {
    .hero-section {
        padding: 20px 0 !important;
    }

    .game-container {
        max-width: 380px;
        padding: 10px;
    }

    .game-title {
        font-size: 1.6rem;
    }

    #grid {
        grid-template-columns: repeat(5, 48px);
        grid-template-rows: repeat(6, 48px);
        gap: 4px;
        margin-bottom: 0px !important;
    }

    .tile {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .key {
        width: 29px;
        height: 39px;
        font-size: 11px;
    }

    .key.enter,
    .key.backspace {
        width: 57px;
    }

    .keyboard-row.middle {
        margin-left: 6px;
    }

    .modal-content {
        padding: 15px;
        max-width: 300px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .stats-grid {
        gap: 6px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .guess-distribution h3 {
        font-size: 1rem;
    }

    .footer-info-box {
        padding: 12px;
        font-size: 13.5px;
    }

    .footer-info-box .text h3 {
        font-size: 15px;
        margin-top: 0 !important;
    }

    .footer-info-box .text li {
        margin-bottom: 6px;
    }
}

@media (max-width: 399px) and (min-width: 351px) {
    .hero-section {
        padding: 20px 0 !important;
        margin: 0 !important;
    }

    .game-container {
        max-width: 340px;
        padding: 8px;
    }

    .game-title {
        font-size: 1.4rem;
    }

    #grid {
        grid-template-columns: repeat(5, 44px);
        grid-template-rows: repeat(6, 44px);
        gap: 2px;
    }

    .tile {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .keyboard-container {
        margin: 15px auto 10px;
    }

    .key {
        width: 25px;
        height: 35px;
        font-size: 10px;

    }

    .key.enter,
    .key.backspace {
        width: 50px;
    }
}

/* 320px to 350px */
@media (max-width: 350px) {
    .hero-section {
        padding: 20px 0 !important;
        margin: 0 !important;
    }

    .game-container {
        max-width: 340px;
        padding: 8px;
    }

    .game-title {
        font-size: 1.4rem;
    }

    #grid {
        grid-template-columns: repeat(5, 44px);
        grid-template-rows: repeat(6, 44px);
        gap: 2px;
    }

    .tile {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .keyboard-container {
        margin: 15px auto 10px;
    }

    .key {
        width: 25px;
        height: 35px;
        font-size: 10px;

    }

    .key.enter,
    .key.backspace {
        width: 50px;
    }

    .modal-content {
        padding: 12px;
        max-width: 280px;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .stats-grid {
        gap: 4px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.5rem;
    }

    .guess-distribution h3 {
        font-size: 0.9rem;
    }

    .guess-number {
        width: 15px;
        font-size: 0.8rem;
    }

    .guess-count {
        width: 25px;
        font-size: 0.8rem;
    }

    .footer-info-box {
        font-size: 13px;
        padding: 10px;
    }

    .footer-info-box .icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 320px) {
    .hero-section {
        padding: 20px 0 !important;
        margin: 0 !important;
    }

    .game-container {
        max-width: 340px;
        padding: 8px;
    }

    .game-title {
        font-size: 1.4rem;
    }

    #grid {
        grid-template-columns: repeat(5, 44px);
        grid-template-rows: repeat(6, 44px);
        gap: 2px;
    }

    .tile {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .keyboard-container {
        margin: 15px auto 10px;
    }

    .key {
        width: 25px;
        height: 35px;
        font-size: 10px;

    }

    .key.enter,
    .key.backspace {
        width: 50px;
    }

    .modal-content {
        padding: 12px;
        max-width: 280px;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .stats-grid {
        gap: 4px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.5rem;
    }

    .guess-distribution h3 {
        font-size: 0.9rem;
    }

    .guess-number {
        width: 15px;
        font-size: 0.8rem;
    }

    .guess-count {
        width: 25px;
        font-size: 0.8rem;
    }

    .footer-info-box {
        font-size: 12.5px;
        padding: 8px;
    }

    .footer-info-box .text h3 {
        font-size: 14px;
        margin-top: 0 !important;
    }
}