:root {
    --primary: #0056b3;
    --accent: #ff6b00;
    --accent-hover: #e65e00;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --text: #334155;
    --border: #e2e8f0;
    --success: #10b981;
    --radius: 8px;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: var(--text);
    margin: 0;
    line-height: 1.7;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* HEADER */
header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 42px;
    width: auto;
}

.fallback-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--dark);
}

.desktop-nav {
    display: none;
    gap: 25px;
}

@media(min-width: 900px) {
    .desktop-nav {
        display: flex;
    }

    .desktop-nav a {
        font-weight: 600;
        color: var(--text);
        font-size: 0.95rem;
    }

    .desktop-nav a:hover,
    .desktop-nav a.active {
        color: var(--primary);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-link {
    font-weight: 600;
    color: var(--text);
    display: none;
}

@media(min-width: 600px) {
    .login-link {
        display: block;
    }
}

.cta-button {
    background: var(--accent);
    color: white;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: inline-block;
    text-align: center;
}

.cta-button:hover {
    background: var(--accent-hover);
}

/* GAME STAGE HERO */
.game-stage {
    background: linear-gradient(180deg, var(--dark) 0%, #1e293b 100%);
    color: white;
    padding: 40px 0 60px;
}

.game-meta-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-meta-header h1 {
    margin: 0;
    font-size: 2.4rem;
    letter-spacing: -1px;
}

.subtitle {
    color: #94a3b8;
    margin-top: 5px;
    font-size: 1.1rem;
}

.mode-toggles {
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    padding: 4px;
    border-radius: 50px;
    margin-top: 20px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
}

.mode-btn.active {
    background: white;
    color: var(--dark);
}

/* VIEWPORT & TICKER */
.game-viewport {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.live-ticker {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8rem;
    padding: 8px;
    display: flex;
    gap: 20px;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid #333;
}

.ticker-item {
    display: inline-block;
    color: #fbbf24;
    font-weight: 600;
}

.game-iframe-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.play-icon-shape {
    width: 80px;
    height: 80px;
    background: var(--accent);
    border-radius: 50%;
    color: white;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    margin-bottom: 20px;
    box-shadow: 0 0 25px rgba(255, 107, 0, 0.4);
    transition: transform 0.2s;
}

.play-link:hover .play-icon-shape {
    transform: scale(1.1);
}

.game-controls-ui {
    background: #1e293b;
    padding: 15px;
    border-top: 1px solid #334155;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 15px;
    align-items: center;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}

.stepper {
    display: flex;
    background: #0f172a;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.stepper button {
    width: 30px;
    background: #334155;
    border: none;
    color: white;
    cursor: pointer;
}

.stepper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    text-align: center;
    font-weight: bold;
}

.difficulty-selector {
    display: flex;
    gap: 4px;
    justify-content: center;
    background: #0f172a;
    padding: 4px;
    border-radius: 4px;
}

.diff-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
}

.diff-btn.active {
    background: #334155;
    color: white;
    font-weight: bold;
}

.diff-btn.active.easy {
    background: var(--success);
}

.action-btn {
    display: block;
    background: var(--success);
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    color: #94a3b8;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

/* MAIN CONTENT LAYOUT */
.main-content-layout {
    display: flex;
    gap: 50px;
    padding-top: 60px;
    padding-bottom: 60px;
    align-items: flex-start;
}

.toc-sidebar {
    width: var(--sidebar-width);
    position: sticky;
    top: 100px;
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: none;
}

@media(min-width: 1024px) {
    .toc-sidebar {
        display: block;
    }
}

.toc-sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar li {
    margin-bottom: 12px;
}

.toc-sidebar a {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.toc-sidebar a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.promo-box {
    background: var(--dark);
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 30px;
    text-align: center;
}

.promo-box h4 {
    margin: 0;
    color: var(--accent);
}

.small-btn {
    display: inline-block;
    background: white;
    color: var(--dark);
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 10px;
    font-size: 0.85rem;
}

.long-read {
    flex: 1;
    max-width: 100%;
}

.long-read section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.long-read h2 {
    font-size: 2rem;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.long-read h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-top: 30px;
    margin-bottom: 15px;
}

.long-read p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.detailed-list li {
    margin-bottom: 15px;
}

/* VISUALS & TABLES */
.article-visual {
    margin: 40px 0;
    background: #f1f5f9;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px dashed #cbd5e1;
    text-align: center;
}

.visual-placeholder {
    background: #e2e8f0;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
    border-radius: 4px;
}

.article-visual figcaption {
    margin-top: 15px;
    font-style: italic;
    color: #64748b;
    font-size: 0.9rem;
}

/* OPTIMIZED TABLES FOR MOBILE */
.table-container {
    width: 100%;
    overflow-x: auto;
    /* Scroll enabled */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    margin: 30px 0;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
    /* Forces scroll on small screens */
}

.data-table th {
    background: var(--dark);
    color: white;
    padding: 15px;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: #f8fafc;
}

/* APP & PAYMENT */
.app-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.tech-spec {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tech-spec h4 {
    color: var(--primary);
    margin-top: 0;
}

.download-cta-area {
    text-align: center;
    margin-top: 40px;
    background: #eff6ff;
    padding: 40px;
    border-radius: var(--radius);
}

.small-note {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 10px;
}

.payment-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
}

.payment-list li {
    background: white;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.payment-list strong {
    display: block;
    color: var(--dark);
    margin-bottom: 5px;
    font-size: 1rem;
}

.alert-box {
    background: #fff7ed;
    border-left: 5px solid var(--accent);
    padding: 20px;
    margin: 30px 0;
    border-radius: 4px;
}

/* FAQ */
.accordion details {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.accordion summary {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.accordion summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    color: var(--primary);
    font-weight: bold;
}

.accordion details[open] summary {
    border-bottom: 1px solid #f1f5f9;
}

.accordion details[open] summary::after {
    content: '-';
}

.acc-text {
    padding: 20px;
    color: #475569;
}

/* FINAL CTA */
.final-cta-section {
    text-align: center;
    padding: 60px;
    background: var(--dark);
    color: white;
    border-radius: var(--radius);
    margin-top: 60px;
}

.final-cta-section h3 {
    font-size: 2rem;
    margin-top: 0;
}

.cta-button.large {
    padding: 15px 40px;
    font-size: 1.1rem;
    margin-top: 20px;
}

/* FOOTER */
.main-footer {
    background: var(--darker);
    color: #94a3b8;
    padding: 60px 0 30px;
    border-top: 5px solid var(--accent);
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 30px;
}

.footer-brand h3 {
    color: white;
    margin-top: 0;
}

.footer-cols {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.f-col h4 {
    color: white;
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.f-col a {
    display: block;
    margin-bottom: 10px;
    color: #64748b;
    font-size: 0.9rem;
}

.f-col a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 20px;
}

.payment-icons-footer {
    display: flex;
    gap: 10px;
}

.payment-icons-footer span {
    background: #1e293b;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-content-layout {
        flex-direction: column;
    }

    .toc-sidebar {
        display: none;
    }

    .game-controls-ui {
        grid-template-columns: 1fr;
    }

    .footer-cols {
        flex-direction: column;
        gap: 30px;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        text-align: center;
        justify-content: center;
    }

    .app-details-grid {
        grid-template-columns: 1fr;
    }

    .header-content .desktop-nav {
        display: none;
    }

    /* Standard Mobile Menu */
    .game-meta-header h1 {
        font-size: 1.8rem;
    }
}

/* Add to existing CSS */

/* Optimized Content Images */
.content-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    /* Hidden by default due to onerror in HTML, will show if src exists */
}

/* Specific styling for the payments visual to be cleaner */
.payments-visual .visual-placeholder {
    background: white;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

/* Container for the whole figure */
.app-showcase-container {
    margin: 40px 0;
    text-align: center;
    background: #f1f5f9;
    /* Light background to frame screenshots */
    padding: 20px 0;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* The Scrollable Track */
.app-scroller {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    /* Enables horizontal scroll */
    padding: 10px 20px;
    /* Breathing room for shadows */
    scroll-snap-type: x mandatory;
    /* Makes scrolling snap to images */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */

    /* Centers images if there are few, scrolls if there are many */
    justify-content: flex-start;
}

/* Desktop Adjustment: Center items if screen is wide enough */
@media (min-width: 768px) {
    .app-scroller {
        justify-content: center;
    }
}

/* The Images Styling */
.app-screen {
    flex: 0 0 auto;
    /* Don't shrink images */
    height: 450px;
    /* Fixed height for uniformity */
    width: auto;
    /* Width adjusts automatically */
    border-radius: 16px;
    /* Rounded phone-like corners */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    /* Nice shadow */
    scroll-snap-align: center;
    /* Image snaps to center when scrolling */
    border: 4px solid #1e293b;
    /* Dark border to simulate phone frame */
    background: #000;
}

/* Custom Scrollbar Styling (Optional - makes it look cleaner) */
.app-scroller::-webkit-scrollbar {
    height: 8px;
}

.app-scroller::-webkit-scrollbar-track {
    background: transparent;
}

.app-scroller::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

/* Caption Styling */
.app-showcase-container figcaption {
    margin-top: 15px;
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

/* Fallback box if images are missing */
.app-fallback {
    display: none;
    /* Hidden by default */
    height: 450px;
    width: 250px;
    background: #e2e8f0;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 2px dashed #94a3b8;
    color: #64748b;
}

/* Logic to show fallback if sibling images fail (requires JS or simplified CSS approach) 
   Note: The inline HTML onerror handles hiding broken images. 
   The fallback div above is just a placeholder if you want to manually show it. */