/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-body-primary: #141415;
    --bg-body-alt: #101010;
    --bg-elevated: #1D1E20;
    --bg-card: #18191B;
    --bg-subtle: #202124;
    --bg-pill: #222326;
    --border-subtle: #272A2F;
    --border-strong: #3A3D45;
    --divider-soft: rgba(255,255,255,0.04);
    
    --primary-blue: #0075FF;
    --primary-blue-hover: #1985FF;
    --primary-blue-active: #0060D1;
    
    --primary-pink: #FF4B9B;
    --primary-pink-mid: #FF6BB3;
    --primary-pink-light: #FF8FC7;
    
    --primary-green: #00B24B;
    --primary-green-mid: #58CD89;
    --primary-green-light: #A5E4BF;
    
    --accent-red: #FF4141;
    --accent-yellow: #FFC94A;
    --accent-purple: #9C5BFF;
    
    --text-primary: #FFFFFF;
    --text-secondary: #E2E4E8;
    --text-muted: #A6A7AA;
    --text-disabled: #7A7B80;
    
    /* Shadows */
    --shadow-elevation-1: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-elevation-2: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-elevation-hero: 0 12px 40px rgba(0,0,0,0.6);
    --focus-ring-blue: 0 0 0 2px rgba(0,117,255,0.65);
    --focus-ring-green: 0 0 0 2px rgba(0,178,75,0.65);
    
    /* Typography */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 0 24px;
}

html {
    scroll-behavior: smooth;
}

body.app-root {
    font-family: var(--font-base);
    background: var(--bg-body-primary);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Performance optimizations */
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "kern" 1;
    font-feature-settings: "kern" 1;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Header */
.site-header {
    background: #121212;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 0 rgba(0,0,0,0.7);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    padding: 12px 0;
    border-bottom: 1px solid var(--divider-soft);
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top__left {
    display: flex;
    align-items: center;
}

.header-logo svg {
    height: 40px;
    width: auto;
    display: block;
}

.header-top__right {
    display: flex;
    gap: 12px;
}

.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.btn-icon {
    display: none;
}

.btn-text {
    display: inline;
}

.header-bottom {
    padding: 0;
}

.main-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
    padding: 12px 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: block;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-link:focus {
    outline: var(--focus-ring-blue);
    outline-offset: 2px;
}

/* Table of Contents */
.toc-wrapper {
    background: var(--bg-body-primary);
    border-top: 1px solid var(--divider-soft);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 999;
    display: block;
    min-height: 48px;
}

.toc-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

.table-of-contents {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.table-of-contents::-webkit-scrollbar {
    display: none;
}

.toc-list {
    display: flex;
    list-style: none;
    gap: 16px;
    padding: 12px 0;
    white-space: nowrap;
    margin: 0;
}

.toc-list:empty::before {
    content: '';
    display: none;
}

.toc-item {
    display: inline-block;
}

.toc-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    display: block;
}

.toc-link:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
}

.toc-link.active {
    color: var(--primary-blue);
    background: rgba(0,117,255,0.1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    position: relative;
}

.btn--icon {
    padding: 8px;
    min-width: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn--icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Buttons */
.btn {
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 60px;
    text-align: center;
    /* Performance optimization */
    will-change: transform;
}

.btn--primary.btn--green {
    background: linear-gradient(135deg, #FF4B9B 0%, #FF6BB3 100%);
    color: var(--text-primary);
    box-shadow: var(--shadow-elevation-1);
}

.btn--primary.btn--green:hover {
    background: linear-gradient(135deg, #FF5BA5 0%, #FF7BB8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,75,155,0.4);
}

.btn--primary.btn--green:active {
    background: linear-gradient(135deg, #E63D8A 0%, #FF5BA5 100%);
    box-shadow: 0 3px 10px rgba(0,0,0,0.55);
}

.btn--primary.btn--green:focus {
    outline: 0 0 0 2px rgba(255,75,155,0.65);
    outline-offset: 2px;
}

.btn--secondary.btn--dark {
    background: var(--bg-pill);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn--secondary.btn--dark:hover {
    background: #2B2E34;
}

.btn--secondary.btn--dark:active {
    background: #222429;
}

.btn--secondary.btn--dark:focus {
    outline: var(--focus-ring-blue);
    outline-offset: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
    background: var(--bg-body-primary);
    border-bottom: 1px solid var(--divider-soft);
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs-list li {
    display: flex;
    align-items: center;
}

.breadcrumbs-list li:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: var(--text-disabled);
}

.breadcrumbs-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs-list a:hover {
    color: var(--primary-pink);
}

.breadcrumbs-list li[aria-current="page"] {
    color: var(--text-primary);
}

/* Hero Section */
.hero-section {
    padding: 48px 0;
    background: var(--bg-body-primary);
}

.hero-section h1 {
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 24px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-lead {
    font-size: 16px;
    line-height: 24px;
    color: var(--text-secondary);
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

.reading-time__label {
    color: var(--text-muted);
}

.reading-time__value {
    color: var(--text-secondary);
    font-weight: 600;
}

.hero-image {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-image figure {
    margin: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: contain;
}

.hero-cta {
    align-self: center;
}

.fact-checked {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

.fact-checked span {
    color: var(--primary-pink);
}

/* Games Section */
.games-section {
    padding: 48px 0;
    background: var(--bg-body-primary);
}

.section-title {
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    align-items: start;
}

.game-card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-elevation-1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Performance optimization */
    contain: layout style paint;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.55);
    border-color: var(--primary-pink);
}

.game-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    position: relative;
}

.game-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 24px 24px 0 0;
    /* Performance optimization */
    will-change: transform;
    transform: translateZ(0);
}

.game-card__title-wrapper {
    background: linear-gradient(135deg, rgba(255,75,155,0.95) 0%, rgba(255,107,179,0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 14px 16px;
    border-radius: 0 0 24px 24px;
    border-top: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    flex-shrink: 0;
    width: 100%;
}

.game-card__title {
    font-size: 16px;
    line-height: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.game-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    /* Performance optimization */
    will-change: transform, opacity;
}

.game-card:hover .game-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
    pointer-events: auto;
}

/* Content Sections */
.content-section {
    padding: 48px 0;
    background: var(--bg-body-primary);
}

.content-section h2 {
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.content-section h3 {
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.section-image {
    margin: 0 0 24px 0;
    text-align: center;
}

.section-image img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: contain;
}

.content {
    color: var(--text-secondary);
    line-height: 24px;
}

.content p {
    margin-bottom: 16px;
}

.content ul,
.content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.content li {
    margin-bottom: 8px;
}

/* Tables */
.content table,
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.content table thead,
.content-table thead {
    background: var(--bg-subtle);
}

.content table th,
.content-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.content table td,
.content-table td {
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--divider-soft);
}

.content table tbody tr:last-child td,
.content-table tbody tr:last-child td {
    border-bottom: none;
}

.content table tbody tr:hover,
.content-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.content table tbody tr:nth-child(even),
.content-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.01);
}

/* Author Section */
.author-section {
    padding: 48px 0;
    background: var(--bg-body-primary);
    border-top: 1px solid var(--divider-soft);
}

.author-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-elevation-1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.author-content:hover {
    box-shadow: var(--shadow-elevation-2);
    border-color: var(--border-strong);
}

.author-content,
.author-block {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-elevation-1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.author-content:hover,
.author-block:hover {
    box-shadow: var(--shadow-elevation-2);
    border-color: var(--border-strong);
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--border-subtle);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-pink-mid) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.author-bio {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 22px;
    font-size: 15px;
}

.author-date,
.author-updated {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-date::before,
.author-updated::before {
    content: '🕒';
    font-size: 12px;
    opacity: 0.7;
}

/* FAQ Section */
.faq-section {
    padding: 48px 0;
    background: var(--bg-body-primary);
}

.faq-content {
    margin-bottom: 32px;
    color: var(--text-secondary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    color: var(--primary-blue);
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px 20px 20px;
    color: var(--text-secondary);
    line-height: 24px;
}

.faq-answer p {
    margin: 0;
}

/* Footer */
.site-footer {
    background: var(--bg-body-alt);
    border-top: 1px solid var(--border-subtle);
    padding: 48px 0 24px;
    margin-top: 48px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-logo svg {
    height: 40px;
    width: auto;
    display: block;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-payments {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.payment-icon {
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.footer-gambleaware svg {
    height: 40px;
    width: auto;
    display: block;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-gambleaware a:hover svg {
    opacity: 1;
}

.footer-gambleaware a {
    display: inline-block;
    text-decoration: none;
}

.footer-copyright {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--divider-soft);
    color: var(--text-muted);
    font-size: 12px;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary-blue);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-elevation-2);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-2px);
}

.back-to-top:focus {
    outline: var(--focus-ring-blue);
    outline-offset: 2px;
}

/* Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    :root {
        --container-padding: 0 12px;
    }
    
    .header-top {
        padding: 12px 0;
        position: relative;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .header-top__right {
        display: none;
    }
    
    .header-mobile-actions {
        display: flex;
    }
    
    .header-bottom {
        display: none;
        padding: 16px 0;
        border-top: 1px solid var(--divider-soft);
    }
    
    .header-bottom.show {
        display: block;
    }
    
    .toc-wrapper {
        display: block;
        border-top: 1px solid var(--divider-soft);
        background: var(--bg-body-primary);
        position: relative;
        z-index: 998;
    }
    
    .header-bottom.show ~ .toc-wrapper {
        display: block;
    }
    
    .toc-wrapper .toc-list {
        min-height: 40px;
    }
    
    .toc-wrapper .table-of-contents {
        max-height: 60px;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .toc-list {
        padding: 8px 0;
        gap: 12px;
    }
    
    .toc-link {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .btn-text {
        display: none;
    }
    
    .btn-icon {
        display: block;
    }
    
    .hero-section h1 {
        font-size: 24px;
        line-height: 32px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .game-grid {
        grid-template-columns: repeat(10, 200px);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
    }
    
    .game-grid::-webkit-scrollbar {
        display: none;
    }
    
    .game-card {
        scroll-snap-align: start;
        min-width: 200px;
        aspect-ratio: 1;
    }
    
    .game-card__image {
        height: 200px;
    }
    
    .content-section h2 {
        font-size: 20px;
        line-height: 26px;
    }
    
    /* Table Cards for Mobile */
    .table-cards {
        display: grid;
        gap: 16px;
        margin: 24px 0;
    }
    
    .table-card {
        background: var(--bg-card);
        border-radius: 12px;
        padding: 16px;
        border: 1px solid var(--border-subtle);
    }
    
    .table-card strong {
        display: block;
        color: var(--text-primary);
        font-size: 13px;
        margin-bottom: 4px;
        font-weight: 600;
    }
    
    .table-card span {
        display: block;
        color: var(--text-secondary);
        font-size: 14px;
    }
    
    /* Hide tables on mobile when converted to cards */
    .content table[data-converted="true"],
    .content-table[data-converted="true"] {
        display: none !important;
    }
    
    /* Show table cards only on mobile */
    .table-cards {
        display: grid;
    }
    
    /* Keep original table styles for desktop fallback */
    .content table:not([data-converted="true"]),
    .content-table:not([data-converted="true"]) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .content table:not([data-converted="true"]) thead,
    .content-table:not([data-converted="true"]) thead {
        display: table-header-group;
    }
    
    .content table:not([data-converted="true"]) tbody,
    .content-table:not([data-converted="true"]) tbody {
        display: table-row-group;
    }
    
    .content table:not([data-converted="true"]) tr,
    .content-table:not([data-converted="true"]) tr {
        display: table-row;
    }
    
    .content table:not([data-converted="true"]) th,
    .content table:not([data-converted="true"]) td,
    .content-table:not([data-converted="true"]) th,
    .content-table:not([data-converted="true"]) td {
        display: table-cell;
        padding: 10px 12px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .author-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .back-to-top,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

