/* Basic Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8; /* Off-white */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.8em;
    font-weight: 700;
}

h2 {
    font-size: 2em;
    font-weight: 600;
}

h3 {
    font-size: 1.5em;
    font-weight: 500;
}

p {
    margin-bottom: 1em;
}

a {
    color: #3498db; /* Default blue for general links */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header */
.header {
    background-color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo img {
    height: 40px;
}

.header .nav ul {
    list-style: none;
    display: flex;
}

.header .nav ul li {
    margin-left: 30px;
}

.header .nav ul li a {
    color: #555;
    font-weight: 500;
    font-size: 1.1em;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.header .nav ul li a:hover {
    color: #2e8b57; /* Dark green for nav hover */
    text-decoration: none;
}

.header .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #555;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #2e8b57; /* Dark green */
    color: #fff;
}

.btn-primary:hover {
    background-color: #226b41; /* Darker green */
    color: #fff;
    text-decoration: none;
}

.btn-primary-large {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    background-color: #2e8b57; /* Dark green */
    color: #fff;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary-large:hover {
    background-color: #226b41; /* Darker green */
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #e0e0e0; /* Light grey */
    color: #34495e;
    border: 1px solid #a0a0a0; /* Slightly darker grey */
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #bdc3c7;
    color: #34495e;
    text-decoration: none;
}

/* Main Content Sections */
.main-content {
    padding: 40px 0;
}

.section-description {
    max-width: 800px;
    margin: 0 auto 30px auto;
    font-size: 1.1em;
    color: #555;
    text-align: center;
}

/* Hero Sections */
.hero-left-image {
    background-color: #e8f5e9; /* Light greenish off-white */
    padding: 80px 0;
}

.hero-left-image .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.hero-left-image .hero-content {
    flex: 1;
    padding-right: 50px;
}

.hero-left-image .hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
}

.hero-left-image .hero-content p {
    font-size: 1.3em;
    color: #555;
    margin-bottom: 30px;
}

.hero-left-image .hero-image {
    flex: 1;
    text-align: right;
}

.hero-left-image .hero-image img {
    max-height: 450px;
    width: auto;
    display: inline-block;
}

/* Section Devices */
.section-devices {
    background-color: #ffffff;
    padding: 50px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.device-card {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.device-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.device-card img {
    max-width: 100px;
    height: auto;
    margin: 0 auto 20px auto;
}

.device-card h3 {
    color: #2e8b57; /* Dark green for card titles */
    margin-bottom: 10px;
    font-size: 1.4em;
}

.device-card p {
    color: #666;
    font-size: 1em;
}

/* Section Download Guide (Left sidebar + Right content) */
.section-download-guide {
    background-color: #ffffff;
    padding: 50px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.download-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.sidebar-nav {
    flex: 0 0 250px;
    padding: 30px;
    background-color: #f3fdf6; /* Lighter green background */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.sidebar-nav h3 {
    color: #2e8b57; /* Dark green */
    margin-bottom: 25px;
    font-size: 1.4em;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav ul li {
    margin-bottom: 15px;
}

.sidebar-nav ul li a {
    color: #555;
    font-size: 1.1em;
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li a.active {
    background-color: #2e8b57; /* Dark green */
    color: #fff;
    text-decoration: none;
}

.guide-content {
    flex: 1;
    padding: 0 20px;
}

.guide-content h2 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 20px;
}

.guide-content p {
    color: #555;
    line-height: 1.8;
}

.guide-content ol {
    margin-left: 25px;
    margin-bottom: 1em;
    color: #555;
}

.guide-content ol li {
    margin-bottom: 10px;
}

.content-image-small {
    max-width: 80%;
    margin: 20px 0 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Section Platform Highlights (Three blocks) */
.section-platform-highlights {
    background-color: #f3fdf6; /* Light greenish off-white */
    padding: 60px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.highlight-item {
    padding: 30px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.highlight-item img {
    max-width: 120px;
    height: auto;
    margin: 0 auto 20px auto;
}

.highlight-item h3 {
    color: #2e8b57; /* Dark green */
    font-size: 1.5em;
    margin-bottom: 15px;
}

.highlight-item p {
    color: #666;
    font-size: 1em;
}

/* Section Large Screenshot */
.section-large-screenshot {
    background-color: #ffffff;
    padding: 60px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.large-screenshot-image {
    max-width: 90%;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.image-caption {
    font-size: 1.1em;
    color: #777;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Section Compatibility Table */
.section-compatibility-table {
    background-color: #fdfdfd;
    padding: 60px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.section-compatibility-table p {
    max-width: 900px;
    margin: 0 auto 30px auto;
    font-size: 1.1em;
    color: #555;
}

.section-compatibility-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.section-compatibility-table th,
.section-compatibility-table td {
    border: 1px solid #e0e0e0;
    padding: 15px;
    text-align: left;
    font-size: 1em;
}

.section-compatibility-table th {
    background-color: #2e8b57; /* Dark green header */
    color: #ffffff;
    font-weight: 600;
}

.section-compatibility-table tr:nth-child(even) {
    background-color: #f5f5f5;
}

.section-compatibility-table tr:hover {
    background-color: #eaf8f5; /* Light greenish hover */
}

/* Section Pre-Download Checklist */
.section-pre-download-checklist {
    background-color: #ffffff;
    padding: 50px 0;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.checklist {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.checklist li {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%232e8b57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>') no-repeat left center;
    background-size: 20px;
    padding-left: 30px;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #555;
}

/* Section CTA Bottom */
.section-cta-bottom {
    background-color: #2e8b57; /* Dark green */
    color: #fff;
    text-align: center;
    padding: 60px 0;
    border-radius: 0;
    box-shadow: none;
}

.section-cta-bottom h2 {
    color: #fff;
    margin-bottom: 25px;
    font-size: 2.5em;
}

.cta-small-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    margin-top: 15px;
}

/* Footer Dark (Simple) */
.footer-dark {
    background-color: #2c3e50; /* Existing dark color */
    color: #ecf0f1;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
}

.footer-dark p {
    margin-bottom: 0;
}

.footer-dark a {
    color: #ecf0f1;
    margin: 0 5px;
    text-decoration: underline;
}

.footer-dark a:hover {
    color: #2e8b57; /* Dark green hover */
}

/* Responsive Design (keeping existing media queries and adjusting colors if needed) */
@media (max-width: 1440px) {
    .container {
        max-width: 1000px;
    }
    h1 { font-size: 2.5em; }
    h2 { font-size: 1.8em; }
    .hero-left-image .hero-content h1 {
        font-size: 3em;
    }
    .section-cta-bottom h2 {
        font-size: 2.2em;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.6em; }
    .header .nav {
        display: none;
    }
    .header .menu-toggle {
        display: block;
    }
    .header .logo img {
        height: 35px;
    }
    .hero-left-image .container {
        flex-direction: column;
        text-align: center;
    }
    .hero-left-image .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }
    .hero-left-image .hero-image {
        text-align: center;
    }
    .download-layout {
        flex-direction: column;
    }
    .sidebar-nav {
        flex: auto;
        width: 100%;
        margin-bottom: 30px;
    }
    .guide-content {
        padding: 0;
    }
    .device-grid, .highlight-grid {
        grid-template-columns: 1fr;
    }
    .device-card, .highlight-item {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    .section-cta-bottom h2 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.4em; }
    h3 { font-size: 1.2em; }
    .header .logo img {
        height: 30px;
    }
    .btn-primary, .btn-secondary, .btn-primary-large {
        padding: 10px 20px;
        font-size: 1em;
    }
    .hero-left-image .hero-content h1 {
        font-size: 2.5em;
    }
    .hero-left-image .hero-content p {
        font-size: 1.1em;
    }
    .section-cta-bottom h2 {
        font-size: 1.8em;
    }
    .cta-small-text {
        font-size: 0.95em;
    }
    .content-image-small {
        max-width: 100%;
    }
    .large-screenshot-image {
        max-width: 100%;
    }
}

@media (max-width: 390px) {
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.3em; }
    .hero-left-image .hero-content h1 {
        font-size: 2em;
    }
    .section-cta-bottom h2 {
        font-size: 1.6em;
    }
}
/* AAPoker visual safety patch: CTA sizing, image containment, icon consistency */
html {
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.header .logo img,
.topbar img,
.quality-top img,
.mobile-head img,
img[src*="aapoker-logo-primary"],
img[src*="aapoker-logo-icon"] {
    width: auto;
    height: 38px;
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
    flex: 0 0 auto;
}

.hero,
.quality-hero,
.section,
.section.media,
.section.compact,
.app,
.pc,
.reinstall,
.note-left,
.entry,
.phone-hero,
.login-hero,
[class*="grid"] {
    min-width: 0;
}

.visual-panel,
.quality-card,
.mini-card,
.card,
article,
figure {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.visual-panel img,
.quality-card img,
.content-image,
.phone-strip img,
.final-image img,
.hero img,
.quality-hero img,
.section img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
}

.cta-row,
.quality-cta,
.download-buttons,
.hero-buttons,
.hero-actions,
.final-cta,
.seo-final-cta,
.quality-hero-cta,
.mid-cta {
    align-items: center;
    align-content: center;
    min-height: 0;
}

.btn-primary,
.btn-secondary,
.btn-primary-large,
.btn-primary-hero,
.btn-primary-final-cta,
.btn-tertiary,
.quality-btn,
.module-cta,
.topbar a,
.mobile-head a,
.cta-row a,
.quality-cta a,
.download-buttons a,
.hero-buttons a,
.hero-actions a,
.final-cta a,
.seo-final-cta a,
.quality-hero-cta a,
.mid-cta a,
button[class*="btn"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    align-self: center;
    flex: 0 0 auto;
    white-space: normal;
}

@media (max-width: 900px) {
    .cta-row,
    .quality-cta,
    .download-buttons,
    .hero-buttons,
    .hero-actions,
    .seo-final-cta,
    .quality-hero-cta,
    .mid-cta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-primary-large,
    .btn-primary-hero,
    .btn-primary-final-cta,
    .btn-tertiary,
    .quality-btn,
    .module-cta,
    .topbar a,
    .mobile-head a,
    .cta-row a,
    .quality-cta a,
    .download-buttons a,
    .hero-buttons a,
    .hero-actions a,
    .final-cta a,
    .seo-final-cta a,
    .quality-hero-cta a,
    .mid-cta a {
        width: auto;
        max-width: 100%;
        min-height: 0;
        height: auto;
        flex: 0 1 auto;
    }

    .hero,
    .quality-hero,
    .section,
    .section.media,
    .section.compact,
    .app,
    .pc,
    .reinstall,
    .note-left,
    .entry,
    .phone-hero,
    .login-hero {
        max-width: 100%;
        overflow-x: hidden;
    }

    h1, h2, h3, p, li, a {
        overflow-wrap: anywhere;
    }
}
/* AAPoker visual safety patch v2: prevent CTA vertical text and icon oversize */
.btn-primary,
.btn-secondary,
.btn-primary-large,
.btn-primary-hero,
.btn-primary-final-cta,
.btn-tertiary,
.quality-btn,
.module-cta,
.topbar a,
.mobile-head a,
.cta-row a,
.quality-cta a,
.download-buttons a,
.hero-buttons a,
.hero-actions a,
.final-cta a,
.seo-final-cta a,
.quality-hero-cta a,
.mid-cta a,
a[href="/go/aapoker"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: calc(100vw - 48px) !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
    align-self: center !important;
    flex: 0 1 auto !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-align: center !important;
}

.header .logo img,
.topbar img,
.quality-top img,
.mobile-head img,
img[src*="aapoker-logo-primary"],
img[src*="aapoker-logo-icon"] {
    width: auto !important;
    height: auto !important;
    max-height: 42px !important;
    max-width: 180px !important;
    object-fit: contain !important;
}

@media (max-width: 480px) {
    .btn-primary,
    .btn-secondary,
    .btn-primary-large,
    .btn-primary-hero,
    .btn-primary-final-cta,
    .btn-tertiary,
    .quality-btn,
    .module-cta,
    .topbar a,
    .mobile-head a,
    .cta-row a,
    .quality-cta a,
    .download-buttons a,
    .hero-buttons a,
    .hero-actions a,
    .final-cta a,
    .seo-final-cta a,
    .quality-hero-cta a,
    .mid-cta a,
    a[href="/go/aapoker"] {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        font-size: 15px !important;
    }
}
/* AAPoker visual safety patch v3: mobile tables and route-card CTA blocks */
table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

th,
td {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-download-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

.route-card,
a.route-card,
.entry-card,
a.entry-card {
    height: auto !important;
    min-height: 0 !important;
    align-items: center !important;
    align-self: center !important;
    line-height: 1.25 !important;
}

.route-card strong,
.route-card small,
.entry-card strong,
.entry-card small {
    line-height: 1.25 !important;
}

@media (max-width: 480px) {
    table {
        font-size: 13px;
    }

    th,
    td {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .route-card,
    a.route-card,
    .entry-card,
    a.entry-card {
        padding: 10px 12px !important;
        gap: 10px !important;
    }
}
/* AAPoker visual safety patch v4: compact route cards and narrow table CTAs */
.route-card,
a.route-card {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 4px 14px !important;
    padding: 14px 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.route-card span {
    width: 42px !important;
    height: 42px !important;
    grid-row: span 2 !important;
    flex: 0 0 auto !important;
}

.route-card strong,
.route-card small {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.table-download-link {
    max-width: 100% !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: keep-all !important;
}

.info-col-item {
    max-width: 100% !important;
    padding: 22px !important;
}

@media (max-width: 480px) {
    .route-card,
    a.route-card {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        padding: 10px 12px !important;
    }

    .route-card strong {
        font-size: 18px !important;
    }

    .route-card small {
        font-size: 13px !important;
    }

    .info-col-item {
        padding: 18px !important;
    }
}