:root {
    --primary: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --accent: #f43f5e;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --container-max-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    /* Slightly reduced for better mobile space */
}

/* Typography Enhancements */
h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

p {
    color: var(--text-muted);
}

/* Navigation */
header {
    height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-light);
}

/* Hero Section */
.hero {
    padding: 180px 0 100px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(109, 40, 217, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(109, 40, 217, 0.6);
}

.btn-secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Card Visuals */
.hero-visual {
    position: relative;
    height: 400px;
}

.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.card {
    position: absolute;
    width: 280px;
    height: 380px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition);
}

.card-1 {
    z-index: 3;
    transform: rotate(-5deg);
    background: linear-gradient(145deg, #2e1065 0%, #1e1b4b 100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-2 {
    z-index: 2;
    transform: translate(20px, 10px) rotate(5deg);
    opacity: 0.6;
}

.card-3 {
    z-index: 1;
    transform: translate(40px, 20px) rotate(15deg);
    opacity: 0.3;
}

#preview-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

/* Sections */
.section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.bg-alt {
    background: #0a0f1e;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    text-align: center;
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.rule-card {
    background: var(--glass-bg);
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    position: relative;
    transition: var(--transition);
}

.rule-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.step-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-light);
    opacity: 0.5;
    position: absolute;
    top: 1rem;
    right: 2rem;
}

.rule-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-item {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid transparent;
    transition: var(--transition);
}

.category-item:hover {
    border-color: var(--secondary);
    background: rgba(236, 72, 153, 0.05);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.category-item h3 {
    margin-bottom: 0.5rem;
}

/* SEO Content Section */
.seo-content {
    border-top: 1px solid var(--glass-border);
}

.seo-content article {
    max-width: 800px;
    margin: 0 auto;
}

.seo-content h2,
.seo-content h3 {
    margin-bottom: 1.5rem;
}

.seo-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Footer */
footer {
    padding: 5rem 0 2rem;
    background: #050810;
    border-top: 1px solid var(--glass-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    margin-bottom: 1.5rem;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

/* Variations */
.variations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.variation-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.variation-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-light);
}

/* Question Lists */
.lists-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.list-column h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.list-column ul {
    list-style: none;
}

.list-column li {
    background: var(--glass-bg);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary);
    color: var(--text-white);
}

/* Check List */
.check-list {
    list-style: none;
    margin-top: 2rem;
}

.check-list li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.2rem;
}

/* FAQ */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.faq-item {
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.faq-item h4 {
    margin-bottom: 0.75rem;
    color: var(--text-white);
    font-size: 1.1rem;
}

/* Modal and Game UI */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    overflow-y: auto;
    /* Enable vertical scrolling for small screens */
    padding: 2rem 0;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 800px;
    padding: 3rem;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 1);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.game-step h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-step p {
    margin-bottom: 2.5rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.selection-item input {
    display: none;
}

.selection-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.selection-item input:checked+.selection-box {
    background: rgba(109, 40, 217, 0.2);
    border-color: var(--primary-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.2);
}

.selection-box .icon {
    font-size: 1.8rem;
}

.selection-box .label {
    font-weight: 600;
    color: var(--text-white);
    font-size: 0.9rem;
    text-align: center;
}

/* Levels custom style */
.selection-grid.levels {
    grid-template-columns: repeat(3, 1fr);
}

/* Game Interface */
.game-header {
    margin-bottom: 3rem;
}

#question-counter {
    display: block;
    margin-bottom: 1rem;
    color: var(--primary-light);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--glass-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.question-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

#game-question {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    max-width: 600px;
    line-height: 1.3;
}

.game-step.hidden {
    display: none;
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.finish-visual {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

/* Responsive fixes */
@media (max-width: 600px) {
    .container {
        padding: 0 1rem;
        /* More space on very small screens */
    }

    .section {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .modal-content {
        padding: 1.5rem;
        border-radius: 24px;
        margin: auto;
        /* Correctly center within the scrollable overlay */
    }

    .game-step h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .game-step p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .selection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .selection-grid.levels {
        grid-template-columns: repeat(3, 1fr);
    }

    .selection-box {
        padding: 0.75rem;
        gap: 0.35rem;
    }

    .selection-box .icon {
        font-size: 1.2rem;
    }

    .selection-box .label {
        font-size: 0.75rem;
    }

    .nav-links {
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    /* Navbar mobile adjustment */
    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero-content {
        margin: 20px auto;
    }

    .cta-group {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .rules-grid,
    .variations-grid,
    .lists-wrapper,
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}