:root {
        /* Muted violet for large surfaces: header band, game modes,
           step numbers, contact card. Desaturated so it doesn't
           overpower the page. */
        --violet-muted: #8266B2;
        /* Vivid violet for small accents: links, headings, borders. */
        --violet: #7C3AED;
        --slate: #2E4057;

        --brand-gradient: linear-gradient(135deg, var(--violet-muted) 0%, var(--slate) 100%);
    }

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

    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        line-height: 1.6;
        color: var(--slate);
        overflow-x: hidden;
        background: #f8f9fa;
    }

    /* Navigation */
    nav {
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    nav .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-logo {
        font-size: 1.5rem;
        font-weight: bold;
        background: linear-gradient(135deg, var(--violet) 0%, var(--slate) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-decoration: none;
        cursor: pointer;
    }

    .nav-links {
        display: flex;
        gap: 30px;
        list-style: none;
    }

    .nav-links a {
        color: var(--slate);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
        cursor: pointer;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--violet);
    }

    .nav-toggle {
        display: none;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--slate);
    }

    /* Header */
    header {
        background: var(--brand-gradient);
        color: white;
        padding: 28px 20px;
        text-align: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    /* The logo artwork carries its own rounded-square shape and padding,
       so the container stays transparent and the shadow follows the mark. */
    .app-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-icon img {
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.3));
    }

    header h1 {
        font-size: 2.1rem;
        margin-bottom: 6px;
    }

    header p {
        font-size: 1.1rem;
        opacity: 0.95;
    }

    /* Google Play badge in the header band. Google's badge artwork is used
       as supplied — no recolouring, cropping or added effects — so this only
       sets its size. Height 48px keeps it above Google's 40px minimum, and
       the width matches the asset's 811:240 ratio so it never distorts. */
    .store-badges {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
        margin-top: 18px;
    }

    .store-badge {
        display: inline-block;
        line-height: 0;
    }

    /* Both badge files are edge-to-edge artwork with no internal padding, so a
       shared height makes the two black shapes match. Width follows each file's
       own aspect ratio: Google 811x240, Apple 119.66x40. */
    .store-badge img {
        height: 48px;
        width: auto;
    }

    /* Container */
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 28px 20px;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .nav-links {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            flex-direction: column;
            padding: 20px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .nav-links.active {
            display: flex;
        }

        .nav-links li {
            width: 100%;
            text-align: center;
        }

        .nav-links a {
            display: block;
            padding: 15px;
            border-top: 1px solid #e2e8f0;
        }

        .nav-toggle {
            display: block;
        }

        header h1 {
            font-size: 2rem;
        }

        header p {
            font-size: 1rem;
        }
    }

    /* Inline icons: monochrome line art that inherits the colour of
       whatever it sits on, so violet on light cards and white on the
       brand bands. Sizes are set per usage below. */
    .feature-icon svg,
    .mode-card h3 svg,
    .link-card .icon svg,
    .contact-btn svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.75;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex-shrink: 0;
    }

    /* ==================== HOME STYLES ==================== */
    #home-content {
        background: #f8f9fa;
    }

    /* Features Section */
    .features {
        padding: 56px 20px;
        background: #f8f9fa;
    }

    .section-title {
        text-align: center;
        font-size: 2rem;
        margin-bottom: 32px;
        color: var(--slate);
    }

    .features-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }

    .feature-card {
        background: white;
        padding: 26px;
        border-radius: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .feature-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

    .feature-icon {
        color: var(--violet);
        margin-bottom: 10px;
        line-height: 0;
    }

    .feature-icon svg {
        width: 34px;
        height: 34px;
    }

    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
        color: var(--slate);
    }

    .feature-card p {
        color: #718096;
        line-height: 1.8;
    }

    /* How It Works Section */
    .how-it-works {
        padding: 56px 20px;
        background: white;
    }

    .steps {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 24px;
        margin-top: 32px;
    }

    .step {
        text-align: center;
        position: relative;
    }

    .step-number {
        width: 60px;
        height: 60px;
        background: var(--brand-gradient);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: bold;
        margin: 0 auto 12px;
        box-shadow: 0 4px 15px rgba(4, 139, 168, 0.4);
    }

    .step h3 {
        font-size: 1.3rem;
        margin-bottom: 6px;
        color: var(--slate);
    }

    .step p {
        color: #718096;
    }

    /* Game Modes Section */
    .game-modes {
        padding: 56px 20px;
        background: var(--brand-gradient);
        color: white;
    }

    .game-modes .section-title {
        color: white;
    }

    .modes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 22px;
        margin-top: 32px;
    }

    .mode-card {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        padding: 26px;
        border-radius: 20px;
        border: 2px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }

    .mode-card:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-5px);
    }

    .mode-card h3 svg {
        width: 22px;
        height: 22px;
    }

    .mode-card h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mode-card p {
        opacity: 0.95;
        line-height: 1.8;
    }

    /* Stats Section */
    .stats {
        padding: 44px 20px;
        background: var(--slate);
        color: white;
        text-align: center;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 24px;
        max-width: 1000px;
        margin: 0 auto;
    }

    .stat {
        padding: 10px;
    }

    .stat-number {
        font-size: 2.4rem;
        font-weight: bold;
        background: linear-gradient(135deg, var(--violet) 0%, #ffffff 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .stat-label {
        font-size: 1.1rem;
        opacity: 0.8;
        margin-top: 10px;
    }

    /* Footer */
    footer {
        background: #1a202c;
        color: white;
        padding: 24px 20px;
        text-align: center;
    }

    footer .container {
        text-align: center;
    }

    footer p {
        opacity: 0.8;
    }

    footer a {
        color: inherit !important;
        text-decoration: none;
    }

    footer a:hover {
        text-decoration: underline;
    }

    /* ==================== SUPPORT STYLES ==================== */
    #support-content {
        background: #f8f9fa;
    }

    /* Contact Card */
    .contact-card {
        background: var(--brand-gradient);
        color: white;
        padding: 28px;
        border-radius: 20px;
        text-align: center;
        margin-bottom: 24px;
        box-shadow: 0 10px 40px rgba(4, 139, 168, 0.3);
    }

    .contact-card h2 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .contact-card p {
        font-size: 1.1rem;
        margin-bottom: 20px;
        opacity: 0.95;
    }

    .contact-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: white;
        color: var(--violet);
        padding: 13px 32px;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        cursor: pointer;
    }

    .contact-btn svg {
        width: 20px;
        height: 20px;
    }

    .contact-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    }

    /* FAQ Section */
    .faq-section {
        background: white;
        padding: 28px;
        border-radius: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        margin-bottom: 24px;
    }

    .faq-section h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
        color: var(--slate);
        text-align: center;
    }

    .faq-item {
        margin-bottom: 18px;
        padding-bottom: 18px;
        border-bottom: 1px solid #e2e8f0;
    }

    .faq-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .faq-question {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--slate);
        margin-bottom: 6px;
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .faq-question::before {
        content: "Q:";
        color: var(--violet);
        font-weight: bold;
        flex-shrink: 0;
    }

    .faq-answer {
        color: #4a5568;
        line-height: 1.8;
        padding-left: 32px;
    }

    .faq-answer strong {
        color: var(--slate);
    }

    .faq-answer ul {
        margin-top: 10px;
        padding-left: 20px;
    }

    .faq-figure {
        margin: 18px 0 4px;
        max-width: 320px;
    }

    .faq-figure img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    }

    .faq-figure figcaption {
        margin-top: 8px;
        font-size: 0.85rem;
        line-height: 1.5;
        color: #718096;
    }

    /* Quick Links */
    .quick-links {
        background: white;
        padding: 28px;
        border-radius: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        margin-bottom: 24px;
    }

    .quick-links h2 {
        font-size: 1.5rem;
        margin-bottom: 18px;
        color: var(--slate);
        text-align: center;
    }

    .links-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .link-card {
        background: #f7fafc;
        padding: 18px;
        border-radius: 15px;
        text-align: center;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        cursor: pointer;
    }

    /* Cards that are real links should not look different from the rest. */
    a.link-card {
        display: block;
        color: inherit;
        text-decoration: none;
    }

    .link-card:hover {
        background: #edf2f7;
        border-color: var(--violet);
        transform: translateY(-2px);
    }

    .link-card .icon {
        color: var(--violet);
        margin-bottom: 6px;
        line-height: 0;
    }

    .link-card .icon svg {
        width: 30px;
        height: 30px;
    }

    .link-card h3 {
        font-size: 1.1rem;
        color: var(--slate);
        margin-bottom: 5px;
    }

    .link-card p {
        font-size: 0.9rem;
        color: #718096;
    }

    /* ==================== TERMS STYLES ==================== */
    #terms-content {
        background: white;
    }

    #terms-content > .container:first-child {
        max-width: 800px;
        background-color: white;
        min-height: 100vh;
    }

    #terms-content h2 {
        color: var(--violet);
        margin-top: 22px;
        margin-bottom: 10px;
        font-size: 1.5em;
    }

    #terms-content p {
        margin-bottom: 12px;
        text-align: justify;
    }

    #terms-content ul {
        margin-left: 30px;
        margin-bottom: 15px;
    }

    #terms-content li {
        margin-bottom: 6px;
    }

    #terms-content a {
        color: var(--violet);
        text-decoration: none;
    }

    #terms-content a:hover {
        text-decoration: underline;
    }

    /* ==================== PRIVACY STYLES ==================== */
    #privacy-content {
        background: white;
    }

    #privacy-content > .container:first-child {
        max-width: 800px;
        background-color: white;
        min-height: 100vh;
    }

    .last-updated {
        color: #666;
        font-size: 0.9em;
        font-style: italic;
        text-align: center;
        margin-bottom: 20px;
    }

    #privacy-content h2 {
        color: var(--violet);
        margin-top: 22px;
        margin-bottom: 10px;
        font-size: 1.5em;
    }

    #privacy-content h3 {
        color: var(--slate);
        margin-top: 16px;
        margin-bottom: 10px;
        font-size: 1.2em;
    }

    #privacy-content p {
        margin-bottom: 12px;
        text-align: justify;
    }

    #privacy-content ul {
        margin-left: 30px;
        margin-bottom: 15px;
    }

    #privacy-content li {
        margin-bottom: 6px;
    }

    .highlight {
        background-color: #e0f4f7;
        padding: 15px;
        border-left: 4px solid var(--violet);
        margin: 16px 0;
    }

    .contact {
        background-color: #f9f9f9;
        padding: 20px;
        border-radius: 5px;
        margin-top: 22px;
    }

    details {
        margin-top: 15px;
    }

    summary {
        cursor: pointer;
        font-style: italic;
        color: var(--violet);
        user-select: none;
        margin-bottom: 10px;
    }

    summary:hover {
        color: var(--slate);
    }

    details[open] summary {
        margin-bottom: 15px;
    }

    /* Rules page. Scoped to #rules-content so the italic disclosure styling used by
       the privacy page's <details> is left alone. */
    #rules-content .container {
        max-width: 800px;
    }

    #rules-content .rules-intro {
        color: #4a5568;
        line-height: 1.7;
        margin-bottom: 28px;
    }

    #rules-content details {
        background: white;
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        margin: 0 0 14px;
        overflow: hidden;
    }

    #rules-content summary {
        font-family: inherit;
        font-style: normal;
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--slate);
        padding: 18px 22px;
        margin: 0;
        list-style: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    #rules-content summary::-webkit-details-marker {
        display: none;
    }

    /* Chevron drawn in CSS so the page stays free of extra assets. */
    #rules-content summary::after {
        content: "";
        width: 9px;
        height: 9px;
        flex: none;
        border-right: 2px solid var(--violet);
        border-bottom: 2px solid var(--violet);
        transform: rotate(45deg) translate(-2px, -2px);
        transition: transform 0.2s ease;
    }

    #rules-content details[open] summary::after {
        transform: rotate(-135deg) translate(-2px, -2px);
    }

    #rules-content summary:hover {
        color: var(--violet);
    }

    #rules-content summary:focus-visible {
        outline: 3px solid var(--violet);
        outline-offset: -3px;
    }

    #rules-content .rules-body {
        padding: 0 22px 20px;
        color: #4a5568;
        line-height: 1.8;
    }

    #rules-content .rules-body p {
        margin-bottom: 14px;
    }

    #rules-content .rules-body ul {
        margin: 0 0 14px;
        padding-left: 20px;
    }

    #rules-content .rules-body li {
        margin-bottom: 6px;
    }

    #rules-content .rules-body strong {
        color: var(--slate);
    }

    #rules-content a {
        color: var(--violet);
        text-decoration: none;
    }

    #rules-content a:hover {
        text-decoration: underline;
    }

    /* Wide content must scroll inside its own box rather than the page. */
    #rules-content .table-scroll {
        overflow-x: auto;
        margin-bottom: 16px;
    }

    #rules-content .rules-table {
        border-collapse: collapse;
        width: 100%;
        min-width: 320px;
    }

    #rules-content .rules-table th,
    #rules-content .rules-table td {
        text-align: left;
        padding: 9px 14px;
        border-bottom: 1px solid #e7e4f0;
        white-space: nowrap;
    }

    #rules-content .rules-table th {
        color: var(--slate);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    #rules-content .rules-table td:last-child {
        font-weight: 700;
        color: var(--slate);
    }

    #rules-content .rules-figure {
        margin: 4px 0 14px;
        max-width: 320px;
    }

    #rules-content .rules-figure img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    }

    #rules-content .rules-figure figcaption {
        margin-top: 8px;
        font-size: 0.85rem;
        line-height: 1.5;
        color: #718096;
    }

    #rules-content .rules-footer-note {
        text-align: center;
        color: #4a5568;
        margin-top: 26px;
    }

    #privacy-content a {
        color: var(--violet);
        text-decoration: none;
    }

    #privacy-content a:hover {
        text-decoration: underline;
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
        .section-title {
            font-size: 1.75rem;
        }

        .faq-section,
        .quick-links,
        .contact-card {
            padding: 20px;
        }

        #privacy-content .container {
            padding: 15px;
        }
    }
