/*@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;800&family=Oxanium:wght@700&display=swap');*/

:root {
    --card-width: 80px;
    --card-height: 112px;
    --card-radius: 10px;
    --col-gap: 15px;
    --vert-overlap: 30px;
    --brightness: 1;

    /* --- Theme Variables: Neon Mode (Default) --- */
    --bg-gradient: radial-gradient(circle at 50% 30%, #3B4361, #12141D);
    --card-surface: #1a1a1a;
    --card-back-bg: #121212;
    --card-back-border: 1px solid rgba(255, 255, 255, 0.15);
    --card-back-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
    --card-back-icon: '⚡';
    --card-back-icon-color: rgba(0, 229, 255, 0.1);
    --text-color-red: #ff0099;
    --text-color-black: #00f0ff;
    --text-shadow-red: 0 0 8px rgba(255, 0, 153, 0.6);
    --text-shadow-black: 0 0 8px rgba(0, 240, 255, 0.6);
    --border-color-red: rgba(255, 0, 153, 0.8);
    --border-color-black: rgba(0, 240, 255, 0.8);
    --box-shadow-red: 0 0 4px rgba(255, 0, 153, 0.1), 0 0 12px 1px rgba(255, 0, 153, 0.25);
    --box-shadow-black: 0 0 4px rgba(0, 240, 255, 0.1), 0 0 12px 1px rgba(0, 240, 255, 0.25);
}

body.classic {
    /* --- Theme Variables: Classic Mode --- */
    --bg-gradient: radial-gradient(circle farthest-corner at center, #236B44, #0D3823); /* CORRECTED GRADIENT */
    --card-surface: #F8F8F8;
    --card-back-bg: linear-gradient(to bottom right, #3B82F6, #1D4ED8);
    --card-back-border: 2px solid #FFFFFF;
    --card-back-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --card-back-icon: ''; /* No icon in classic mode */
    --text-color-red: #D90429; /* Classic Red */
    --text-color-black: #000000; /* Classic Black */
    --text-shadow-red: none;
    --text-shadow-black: none;
    --border-color-red: transparent;
    --border-color-black: transparent;
    --box-shadow-red: 0 1px 15px rgba(0, 0, 0, 0.7); /* Subtle shadow for all classic cards */
    --box-shadow-black: 0 1px 15px rgba(0, 0, 0, 0.7);
}

/* Mobile Responsive Vars */
@media (max-width: 768px) {
    :root {
        --card-width: 12.5vw;
        --card-height: 17.5vw;
        --card-radius: 6px; /* Adjusted for mobile */
        --col-gap: 0.5vw;
        --vert-overlap: 3.5vh;
    }
}

body {
    margin: 0;
    font-family: 'Poppins', 'Oxanium', sans-serif;
    background: var(--bg-gradient);
    color: white;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    transition: background 0.3s;
}

body.classic, body.classic .btn, body.classic .logo, body.classic .controls {
    color: #FFFFFF;
}

body.classic .logo span {
    color: #FFD700; /* Gold color for classic accent */
}

/* --- Header & Timer (No major changes) --- */
header {
    position: relative;
    width: 100%;
    padding: 10px 15px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
    height: 60px;
}

/* --- HAMBURGER BUTTON --- */
#nav-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#nav-toggle:hover {
    border-color: #00f3ff; /* Neon Cyan */
    color: #00f3ff;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

/* --- DROPDOWN NAVIGATION MENU --- */
#main-nav {
    position: absolute;
    top: 60px; /* Adjust based on your header height */
    left: 15px;
    background-color: rgba(15, 20, 25, 0.95); /* Dark semi-transparent */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden state class */
#main-nav.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

#main-nav ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

#main-nav li {
    margin: 0;
}

#main-nav a {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 15px;
    font-family: sans-serif;
    transition: all 0.2s ease;
}

/* Neon Hover Effects */
#main-nav a:hover {
    background-color: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    padding-left: 25px; /* Slight indent animation on hover */
}

#main-nav hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Make the app download link stand out */
#main-nav a.highlight {
    color: #ff00ff; /* Neon Pink */
    font-weight: bold;
}

#main-nav a.highlight:hover {
    background-color: rgba(255, 0, 255, 0.15);
    color: #fff;
    text-shadow: 0 0 8px #ff00ff;
}

/* --- FOOTER CONTAINER --- */
footer {
    background-color: #0b0c10; /* Very dark background */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px 20px 20px;
    font-family: sans-serif;
    color: #888;
    margin-top: auto; /* Pushes footer to bottom if page is short */
}

/* Grid layout for columns */
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    max-width: 900px;
    margin: 0 auto;
    gap: 30px;
    text-align: center;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Stack the links vertically */
.footer-col a {
    display: block; /* This fixes the side-by-side issue */
    color: #9ca3af;
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: #00f3ff; /* Neon cyan hover */
}

/* Style the language dropdown */
.footer-lang-select {
    background-color: #1f2937;
    color: #fff;
    border: 1px solid #374151;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.footer-lang-select:focus {
    border-color: #00f3ff;
}

/* Bottom copyright bar */
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.footer-bottom .dl-link {
    color: #ff00ff; /* Neon pink for download link */
    text-decoration: none;
    margin-left: 5px;
}

.footer-bottom .dl-link:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    .footer-grid {
        flex-direction: column;
        align-items: center;
    }

    .footer-col {
        margin-bottom: 20px;
    }
}

.logo {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.logo span {
    color: var(--text-color-black);
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, #333, #555);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn.primary {
    background: linear-gradient(90deg, #ff00cc, #3333ff);
    border: none;
}

body.classic .btn.primary {
    background: linear-gradient(135deg, #1E90FF, #1C75BC);
}

.mode-toggle {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    display: flex;
    padding: 2px;
}

.mode-opt {
    padding: 4px 10px;
    font-size: 0.7rem;
    border-radius: 12px;
    cursor: pointer;
    color: #aaa;
}

.mode-opt.active {
    background: #333;
    color: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

#timer-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    display: none;
}

#timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    box-shadow: 0 0 10px #ff00ff;
    transition: width 0.1s linear;
}


/* --- Game Board (No changes needed) --- */
#game-container {
    height: calc(100vh - 60px);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    touch-action: none;
}

.top-row {
    display: flex;
    justify-content: space-between;
    height: var(--card-height);
}

.left-group, .right-group {
    display: flex;
    gap: var(--col-gap);
}

.tableau-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    column-gap: var(--col-gap);
}

.freecell-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    column-gap: var(--col-gap);
}

.tableau-col {
    height: 100%;
    position: relative;
}

.slot {
    position: relative;
    width: var(--card-width);
    height: var(--card-height);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--card-radius);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

body.classic .slot {
    background: rgba(0, 0, 0, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.foundation::before {
    content: attr(data-suit);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.1;
    color: white;
}

body.classic .foundation::before {
    opacity: 0.2;
}


/* --- Cards --- */
.card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-radius);
    background: var(--card-surface);
    border: 1.5px solid transparent;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-sizing: border-box;
    cursor: pointer;
    filter: brightness(var(--brightness));
    transition: filter 0.2s, top 0.1s, transform 0.2s, box-shadow 0.2s, background 0.3s;
    font-family: 'Oxanium', sans-serif;
}

.card:hover {
    transform: translateY(-5px) scale(1.03);
    z-index: 10;
}

/* CARD FACE STYLING - NOW SEMANTIC */
.card.suit-red {
    color: var(--text-color-red);
    text-shadow: var(--text-shadow-red);
    border-color: var(--border-color-red);
    box-shadow: var(--box-shadow-red);
}

.card.suit-black {
    color: var(--text-color-black);
    text-shadow: var(--text-shadow-black);
    border-color: var(--border-color-black);
    box-shadow: var(--box-shadow-black);
}

.card-corner {
    font-weight: 700;
    line-height: 1;
    font-size: 1.5rem;
}

.card-corner.bottom {
    transform: rotate(180deg);
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    opacity: 0.95;
}

.card.selected {
    outline: 3px solid #00aeff;
    outline-offset: -2px;
    box-shadow: 0 0 15px rgba(0, 174, 255, 0.7);
}

/* Style for the error message popup */
.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #d32f2f; /* Red color */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Can't click on it */
}

/* Style for the autocomplete button */
#autocomplete-btn {
    /* Your button styles here - e.g., padding, background, etc. */
    padding: 8px 16px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .card-corner {
        font-size: 1.25rem;
    }

    .card-center {
        font-size: 1.25rem;
    }

    .card {
        padding: 1px;
    }
}

/* CARD BACK STYLING - USES THEME VARIABLES */
.card-back {
    background: var(--card-back-bg);
    border: var(--card-back-border);
    box-shadow: var(--card-back-shadow);
    align-items: center;
    justify-content: center;
}

.card-back * {
    display: none;
}

.card-back::after {
    content: var(--card-back-icon);
    font-size: calc(var(--card-width) * 0.4);
    color: var(--card-back-icon-color);
    opacity: 0.8;
}


/* --- Rest of the file... --- */
/* All the other styles like .seo-section, .overlay, etc. remain unchanged. */
.seo-section {
    background: #111;
    color: #aaa;
    padding: 40px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
    border-top: 1px solid #333;
}

.seo-container {
    max-width: 800px;
    margin: 0 auto;
}

.seo-container h2 {
    color: white;
    margin-top: 30px;
}

.seo-container p {
    margin-bottom: 15px;
}

.ad-slot {
    background: #000;
    border: 1px dashed #444;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    font-size: 0.8rem;
}

.ad-leaderboard {
    width: 100%;
    height: 90px;
}

.ad-rectangle {
    width: 300px;
    height: 250px;
    margin: 30px auto;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.overlay h2 {
    font-size: 3rem;
    margin-bottom: 10px;
}

#auto-btn {
    display: none;
    background: #00ff99;
    color: #000;
    border: none;
    box-shadow: 0 0 15px #00ff99;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.7;
    }
}

.content-section {
    background: #111;
    color: #ccc;
    padding: 50px 20px;
    font-size: 1rem;
    line-height: 1.7;
    border-top: 1px solid #333;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
}

.content-container h1 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-family: 'Oxanium', sans-serif;
    text-shadow: 0 0 10px var(--text-color-black);
}

.content-container h2 {
    color: white;
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.content-container h3 {
    color: var(--text-color-black);
    margin-top: 25px;
}

.content-container ul {
    padding-left: 20px;
}

.content-container li {
    margin-bottom: 10px;
}

.footer-nav {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed #333;
}

.lang-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-dropdown {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-family: 'Poppins', 'Oxanium', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #1a1a1a url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300f0ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 15px top 50%;
    background-size: 12px auto;
    padding: 10px 40px 10px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-dropdown:hover, .lang-dropdown:focus {
    border-color: var(--text-color-black);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.lang-dropdown option {
    background: #121212;
    color: #fff;
    padding: 10px;
}

.store-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.store-btn {
    height: 50px;
    transition: transform 0.2s;
}

.rules-list a {
    color: #00f3ff;
}
