* {
    --user-drag: none;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

}

:root {
    /* Vibrant Color Scheme */
    --primary-bg: #2d3047;
    --game-bg: #fffd98;
    --grid-bg: #ff9b71;
    --tile-bg: #e84855;
    --text-light: #ffffff;
    --text-dark: #1b1b1e;

    /* Tile colors - vibrant gradient */
    --tile-2: #ff9b71;
    --tile-4: #e84855;
    --tile-8: #1e96fc;
    --tile-16: #46237a;
    --tile-32: #3a7ca5;
    --tile-64: #256eff;
    --tile-128: #ff66d8;
    --tile-256: #ff4a1c;
    --tile-512: #15e6cd;
    --tile-1024: #f9c80e;
    --tile-2048: #f86624;

    /* Button colors */
    --btn-primary: #256eff;
    --btn-secondary: #ff66d8;
    --btn-success: #15e6cd;
    --btn-danger: #e84855;

    /* Score colors */
    --score-bg: #46237a;
    --score-text: #ffffff;
    --drop-down-primary-color: #77634C;
    --drop-down-secondary-color: #B49D88;
    --drop-down-info-color: #E5DBCC;
    --drop-down-light-color: #FCF8EF;
    --theme-color-dark: #7a6858;
    --body-bg: #f2f2f2;
    --nav-bg: linear-gradient(89.86deg, #ffffff 8.6%, 99.86%);
    --nav-bg-play: #f9f2e8;
    --nav-btn: #0a0a0a;
    --nav-link-txt: #0a0707;
    --nav-link-hover-txt: #0a0707;
    --lang-menu-txt: #0a0a0a;
    --lag-list-bg: #ffffff;
    --lag-list-txt: #0a0a0a;
    --lang-option-hover-bg: #f0f0f0;
    --game-section-bg: #f9f2e8;
    --game-section-txt: #0a0808;
    --new-game-btn-bg: #8e7357;
    --new-game-btn-txt: #ffffff;
    --start-new-game-btn: #897561;
    --undo-bg: #d8d4c9;
    --undo-txt: #0a0a0a;
    --undo-btn-bg: #a39387;
    --undo-btn-icon: #ffffff;
    --footer-bg: #2b2b2b;
    --footer-menu-txt: #ffffff;
    --footer-menu-border: #ffffff;
    --footer-menu-hover-txt: #0a0a0a;
    --footer-menu-hover-bg: #ffffff;
    --footer-bg-2: #161616;
    --footer-txt: #ffffff;
    --top-button-bg: #876e56;
    --top-button-txt: #ffffff;
    --top-button-hover-bg: #876e56;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
    /* Height of navbar */
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--body-bg);
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: var(--game-section-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    width: 100%;
    height: 75px;
    background-color: var(--drop-down-light-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}



.logo {
    float: left;
    margin-left: 10px;
}

.menu-btn {
    width: 60px;
    height: 50px;
    background-color: var(--drop-down-info-color);
    float: left;
    margin-left: 10px;
    border-radius: 20px;
    text-align: center;
    color: var(--drop-down-primary-color);
    font-size: 1.524rem;
    cursor: pointer;

}

.pad {
    padding-top: 12px;
}

.logopic {
    float: left;
}

.logopic img {
    height: 40px;
}

.align {
    height: 50px;
    float: right;
    margin-left: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.align h3 {
    display: inline-block;
    color: var(--drop-down-primary-color);
    font-weight: bolder;
}

.language-selector {
    margin-left: auto;
}



/* Dropdown styles */
.menu-dropdown {
    display: block;
    position: absolute;
    top: 75px;
    left: 20px;
    background-color: var(--drop-down-info-color);
    border-radius: 20px;
    width: 300px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition:
        max-height 0.3s ease-out,
        opacity 0.2s ease-out,
        transform 0.2s ease-out;
    transition-delay: 0s, 0.15s, 0s;
}

.menu-dropdown a {
    width: 95%;
    margin: auto;
    border-radius: 10px;
    display: block;
    padding: 10px 15px;
    color: var(--drop-down-primary-color);
    text-decoration: none;
}

.menu-dropdown h1 {
    font-size: 1.234rem;
}

.menu-dropdown p {
    font-size: 0.876rem;
}

.menu-dropdown a:hover {
    background-color: var(--drop-down-primary-color);
    color: white;
}

.menu-dropdown.show {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.3s ease-in,
        opacity 0.2s ease-in,
        transform 0.2s ease-in;
    transition-delay: 0s;
}

.aalign {
    height: 50px;
    float: right;
    margin-left: 5px;
    padding-top: 10px;
    display: flex;
    justify-content: center;
    /* Horizontal center */
    align-items: center;
    /* Vertical center */
}

.aalign h3 {
    display: inline-block;
    color: #8e6e47;
    font-weight: bolder;
}

h2,
h3 {
    color: #876e56 !important;
}

.language-selector {
    position: relative;
    margin-left: 20px;
}

#current-language {
    background: transparent;
    border: none;
    color: #8e6e47;
    font-weight: 500;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--lag-list-bg);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    min-width: 150px;
    z-index: 1000;
}

.language-dropdown.show {
    display: block;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--lag-list-txt);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.language-dropdown a:hover {
    background: var(--lang-option-hover-bg);
}

.flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
}

/* Mobile Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--nav-btn);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    background: var(--game-section-bg);
    padding: 15px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.show {
    display: block;
}

.mobile-menu .nav-menu {
    flex-direction: column;
}

.mobile-menu .nav-menu li {
    margin: 10px 0;
}



.game {
    padding: 30px 0;
    background-color: var(--grid-bg);
}

.play-container {
    max-width: 500px;
    margin: 0 auto;
}

.restart-button {
    background: var(--btn-secondary);
    color: var(--text-light);
    border: none;
    width: 150px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.restart-button:hover {
    background: var(--tile-128);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}


.heading {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.scores-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.score-container {
    background: var(--score-bg);
    color: var(--score-text);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Position at left corner */
    margin-right: auto;
}

.best-container {
    background: var(--score-bg);
    color: var(--score-text);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Position at right corner */
    margin-left: auto;
}

.score-container::before,
.best-container::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.8;
}

.game-container {
    background: var(--grid-bg);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.grid-container {
    background: var(--grid-bg);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.grid-row {
    display: flex;
    margin-bottom: 10px;
}

.grid-row:last-child {
    margin-bottom: 0;
}

.grid-cell {
    width: 25%;
    height: 0;
    padding-bottom: 25%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
}

.grid-cell:last-child {
    margin-right: 0;
}

/* Tile styles with vibrant colors */
.tile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    border-radius: 6px;
    transition: all 0.1s;
    color: var(--text-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.tile-2 {
    background: var(--tile-2);
    color: var(--text-dark);
}

.tile-4 {
    background: var(--tile-4);
}

.tile-8 {
    background: var(--tile-8);
}

.tile-16 {
    background: var(--tile-16);
}

.tile-32 {
    background: var(--tile-32);
}

.tile-64 {
    background: var(--tile-64);
}

.tile-128 {
    background: var(--tile-128);
    font-size: 20px;
}

.tile-256 {
    background: var(--tile-256);
    font-size: 20px;
}

.tile-512 {
    background: var(--tile-512);
    color: var(--text-dark);
    font-size: 20px;
}

.tile-1024 {
    background: var(--tile-1024);
    color: var(--text-dark);
    font-size: 18px;
}

.tile-2048 {
    background: var(--tile-2048);
    font-size: 18px;
}

.tile-super {
    background: var(--primary-bg);
    color: var(--text-light);
    font-size: 16px;
}

.power-ups {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}


.game-message {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 48, 71, 0.9);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
}

.game-message p {
    font-size: 60px;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--text-light);
}

.game-message .lower {
    display: flex;
    gap: 15px;
}

.game-message .keep-playing-button,
.game-message .retry-button {
    background: var(--btn-success);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-message .keep-playing-button:hover {
    background: var(--tile-512);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.game-message .retry-button {
    background: var(--btn-danger);
}

.game-message .retry-button:hover {
    background: var(--tile-256);
    transform: translateY(-2px);
}

/* Alert Styles */
#alertOverlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 48, 71, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

#customAlert {
    background: var(--game-bg);
    color: var(--text-dark);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#customAlert.show {
    opacity: 1;
    transform: translateY(0);
}

#customAlert p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.alert-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-buttons button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 48px;
}

.start-btn {
    background-color: var(--btn-primary);
    color: white;
}

.start-btn:hover {
    background-color: var(--tile-64);
    transform: translateY(-2px);
}

.cancel-btn {
    background-color: transparent;
    border: 2px solid var(--btn-primary);
    color: var(--btn-primary);
}

.cancel-btn:hover {
    background-color: rgba(37, 110, 255, 0.1);
}

/* Animation for tile appearance */
@keyframes tileAppear {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tile.new-tile {
    animation: tileAppear 0.2s ease-out;
}

/* Animation for tile merge */
@keyframes tileMerge {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.tile.merged {
    animation: tileMerge 0.2s ease-out;
    z-index: 20;
}






/* Content Sections */
.text-section {
    padding: 40px 0;
    background-color: var(--game-section-bg);
}


/* FAQ Accordion Custom Styles */
.accordion .card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.accordion .card-header {
    background-color: var(--game-section-bg);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #876e56;
}

.accordion .btn-link {
    color: #333;
    font-size: 1.1rem;
    text-align: left;
    width: 100%;
    transition: color 0.3s;
}

.accordion .btn-link:hover {
    color: #7a6858;
    text-decoration: none;
}

.accordion .card-body {
    background-color: #fff;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

.accordion .collapse.show .btn-link {
    color: #007bff;
    font-weight: 600;
}

/* Footer Styles */
footer {
    background: var(--footer-bg);
    color: var(--footer-txt);
}

.footer-top {
    padding: 40px 0;
}

.footer-bottom {
    background: var(--footer-bg-2);
    padding: 20px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.social {
    color: var(--footer-txt);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social:hover {
    color: var(--footer-menu-hover-txt);
    background: var(--footer-menu-hover-bg);
    transform: translateY(-3px);
}

.footer-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu a {
    color: var(--footer-menu-txt);
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: var(--footer-menu-hover-txt);
}

.footer-menu a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--footer-menu-border);
    transition: width 0.3s ease;
}

.footer-menu a:hover::after {
    width: 100%;
}

/* Scroll to Top Button */
#goTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--top-button-bg);
    color: var(--top-button-txt);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#goTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#goTopBtn:hover {
    background: var(--top-button-hover-bg);
}

/* Responsive Styles */
@media (max-width: 991px) {}

@media (max-width: 767px) {
    .hamburger {
        display: block;
    }

    .scores-container {
        gap: 10px;
    }

    .score-container,
    .best-container {
        min-width: 80px;
        padding: 8px 12px;
    }

    .grid-cell {
        padding-bottom: 22%;
    }

    .game-message p {
        font-size: 40px;
    }

    .tile {
        font-size: 18px;
    }

    .tile-128,
    .tile-256,
    .tile-512 {
        font-size: 16px;
    }

    .tile-1024,
    .tile-2048 {
        font-size: 14px;
    }

    .tile-super {
        font-size: 12px;
    }

    .footer-menu {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}