/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors from design system */
    --bg-body-top: #1D3C3A;
    --bg-body-mid: #1B3836;
    --bg-body-bottom: #2B5955;
    --bg-header: #203E3A;
    --bg-nav-strip: #27534F;
    --surface-card: #1A3735;
    --surface-card-elevated: #27504D;
    --surface-section: #234946;
    --surface-input: #1F413D;
    --border-card: #1F413D;
    --border-section-divider: #536B69;
    --border-input: #536B69;
    --border-focus: #F0DE53;
    --text-primary: #E0EDEC;
    --text-secondary: #98A8A7;
    --text-muted: #738B89;
    --text-inverse: #232B2E;
    --text-accent: #F0DE53;
    --accent-yellow: #F0DE53;
    --accent-yellow-soft: #FBD06B;
    --accent-yellow-strong: #F4E46A;
    --accent-red: #E20504;
    
    /* Typography */
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-h1: 28px;
    --font-size-h2: 18px;
    --font-size-h3: 16px;
    --font-size-body: 14px;
    --font-size-caption: 12px;
    --font-size-label: 11px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    /* Shadows */
    --shadow-card-soft: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-card-strong: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-button: 0 3px 8px rgba(0,0,0,0.40);
    
    /* Container */
    --container-max-width: 1200px;
    --container-padding: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, var(--bg-body-top) 0%, var(--bg-body-mid) 40%, var(--bg-body-bottom) 100%);
    min-height: 100vh;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header */
header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-section-divider);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    height: 64px;
    overflow: visible;
}

.header-top__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    overflow: visible;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 0;
    overflow: visible;
    flex-shrink: 0;
    margin-top: 1px;
}

.logo img {
    height: 60px;
    width: auto;
    background: transparent;
    border: 1px solid var(--accent-yellow);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: 
        0 0 5px rgba(240, 222, 83, 0.3),
        0 0 10px rgba(240, 222, 83, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 4px rgba(240, 222, 83, 0.4));
    transition: all 0.3s ease;
    object-fit: contain;
}

.logo:hover img {
    box-shadow: 
        0 0 8px rgba(240, 222, 83, 0.4),
        0 0 15px rgba(240, 222, 83, 0.25),
        0 6px 12px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 0 6px rgba(240, 222, 83, 0.5));
    transform: scale(1.02);
}

.header-top__actions {
    display: flex;
    gap: 12px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.header-nav {
    background: var(--bg-nav-strip);
    padding: 12px 0;
}

.header-nav__actions {
    display: none;
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.nav-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-body);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: background 0.3s;
}

.nav-list a:hover {
    background: rgba(255,255,255,0.1);
}

/* ToC */
.toc-wrapper {
    background: var(--bg-nav-strip);
    border-top: 1px solid var(--border-section-divider);
    padding: 8px 0;
    position: sticky;
    top: 64px;
    z-index: 999;
}

.toc {
    overflow: hidden;
}

.toc-list {
    display: flex;
    list-style: none;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
}

.toc-list::-webkit-scrollbar {
    display: none;
}

.toc-list li {
    flex-shrink: 0;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-caption);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all 0.3s;
    display: block;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--text-accent);
    background: rgba(240,222,83,0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-yellow-strong) 0%, var(--accent-yellow) 50%, var(--accent-yellow-soft) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: #FCE957;
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: #DCCC4C;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
    transform: translateY(0);
}

.btn-primary:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Main */
main {
    padding: 24px 0 80px;
}

/* Hero */
.hero {
    padding: 40px 0;
}

.hero h1 {
    font-size: var(--font-size-h1);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

h1 {
    font-size: var(--font-size-h1);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.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;
}

.lead {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    line-height: 1.7;
}

.reading-time {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: var(--font-size-caption);
}

.reading-time__label {
    font-weight: 500;
}

.hero-image {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.hero-image figure {
    width: 100%;
    max-width: 600px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    object-fit: contain;
}

.btn-hero-cta {
    width: 100%;
    max-width: 300px;
}

.fact-checked {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-caption);
    margin-top: 16px;
}

.fact-checked span::before {
    content: "✓ ";
    color: var(--accent-yellow);
}

/* Games Section */
.games-section {
    padding: 40px 0;
}

.games-section h2 {
    font-size: var(--font-size-h2);
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.game-card {
    position: relative;
    background: var(--surface-card-elevated);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-card-soft);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-strong);
}

.game-card:hover .game-card__play {
    opacity: 1;
    transform: translateY(0);
}

.game-card img {
    width: 100%;
    height: auto;
    min-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.game-card h3 {
    font-size: var(--font-size-body);
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.game-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(10px);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 10;
}

.game-card:hover .game-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
    pointer-events: auto;
}

/* Content Sections */
.content-section {
    padding: 40px 0;
}

.content-section h2 {
    font-size: var(--font-size-h2);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.content-section h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
    text-align: center;
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.section-image {
    margin: 24px 0;
    text-align: center;
}

.section-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    object-fit: contain;
}

.content {
    color: var(--text-secondary);
    line-height: 1.7;
}

.content p {
    margin-bottom: 16px;
}

.content ul,
.content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.content li {
    margin-bottom: 8px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--surface-section);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: var(--surface-card-elevated);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-section-divider);
}

td {
    padding: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-section-divider);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-section-divider);
}

.breadcrumbs ol {
    display: flex;
    list-style: none;
    gap: 8px;
    color: var(--text-muted);
    font-size: var(--font-size-caption);
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--text-accent);
}

.breadcrumbs li[aria-current="page"] {
    color: var(--text-primary);
}

/* Step-by-step sections */
.steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.step-card {
    background: var(--surface-section);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.3s;
    box-shadow: var(--shadow-card-soft);
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-strong);
}

.step-index {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--accent-yellow-strong) 0%, var(--accent-yellow) 50%, var(--accent-yellow-soft) 100%);
    color: var(--text-inverse);
    font-weight: 700;
    font-size: var(--font-size-h3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-body {
    flex: 1;
}

.step-title {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-body p {
    color: var(--text-secondary);
    margin: 0;
    font-size: var(--font-size-body);
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: 1fr;
    }
    
    .step-card {
        padding: 16px;
    }
}

/* Author Section */
.author-section {
    padding: 40px 0;
    border-top: 1px solid var(--border-section-divider);
    border-bottom: 1px solid var(--border-section-divider);
}

.author-block {
    display: flex;
    gap: 24px;
    align-items: start;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-align: center;
}

.author-info p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.author-updated {
    color: var(--text-muted);
    font-size: var(--font-size-caption);
}

/* FAQ Section */
.faq-section {
    padding: 40px 0;
}

.faq-list {
    margin-top: 24px;
}

details {
    background: var(--surface-section);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 16px;
}

summary {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 0;
    list-style: none;
    position: relative;
    padding-left: 24px;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "+";
    position: absolute;
    left: 0;
    font-size: 20px;
    color: var(--text-accent);
    font-weight: bold;
}

details[open] summary::before {
    content: "−";
}

details p {
    margin-top: 12px;
    color: var(--text-secondary);
    padding-left: 24px;
}

/* Footer */
footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-section-divider);
    padding: 40px 0 24px;
    margin-top: 60px;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    margin-top: 4px;
}

.footer-logo img {
    height: 60px;
    width: auto;
    background: transparent;
    border: 1px solid var(--accent-yellow);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: 
        0 0 5px rgba(240, 222, 83, 0.3),
        0 0 10px rgba(240, 222, 83, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 4px rgba(240, 222, 83, 0.4));
    transition: all 0.3s ease;
}

.footer-logo:hover img {
    box-shadow: 
        0 0 8px rgba(240, 222, 83, 0.4),
        0 0 15px rgba(240, 222, 83, 0.25),
        0 6px 12px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 0 6px rgba(240, 222, 83, 0.5));
    transform: scale(1.02);
}

.footer-nav ul {
    list-style: none;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 6px 0;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--text-accent);
}

.footer-payments h4 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.payment-icon {
    padding: 6px 12px;
    background: var(--surface-card);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-caption);
    color: var(--text-secondary);
}

.footer-gambleaware {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 0;
}

.gambleaware-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(240, 222, 83, 0.3);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.gambleaware-link:hover {
    background: rgba(240, 222, 83, 0.1);
    border-color: rgba(240, 222, 83, 0.6);
    color: var(--text-accent);
    transform: translateY(-1px);
}

.gambleaware-text {
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0.3px;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-section-divider);
    color: var(--text-muted);
    font-size: var(--font-size-caption);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--accent-yellow);
    color: var(--text-inverse);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-card-strong);
    z-index: 1000;
    transition: all 0.3s;
}

.back-to-top:hover {
    background: var(--accent-yellow-soft);
    transform: translateY(-2px);
}

.back-to-top:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .header-top {
        height: 56px;
    }
    
    .header-top__content {
        position: relative;
        gap: 8px;
    }
    
    .header-top__actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .header-top__actions .btn {
        padding: 8px 12px;
        font-size: var(--font-size-caption);
        white-space: nowrap;
        min-width: auto;
    }
    
    .menu-toggle {
        display: flex;
        z-index: 1002;
        flex-shrink: 0;
    }
    
    .logo {
        margin-top: 4px;
    }
    
    .logo img {
        height: 50px;
    }
    
    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-header);
        border-top: 1px solid var(--border-section-divider);
        padding: 16px;
        display: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1001;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    
    .header-nav.active {
        display: block;
    }
    
    .header-nav .container {
        padding: 0;
    }
    
    .header-nav .nav-list {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        margin-bottom: 16px;
    }
    
    .header-nav .nav-list li {
        width: 100%;
    }
    
    .header-nav .nav-list a {
        display: block;
        padding: 12px;
        text-align: center;
        border-radius: var(--radius-md);
    }
    
    .header-nav__actions {
        display: none;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding-top: 16px;
        border-top: 1px solid var(--border-section-divider);
        margin-top: 16px;
    }
    
    .header-nav.active .header-nav__actions {
        display: flex;
    }
    
    .header-nav__actions .btn {
        width: 100%;
    }
    
    .toc-wrapper {
        top: 56px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        order: -1;
    }
    
    .games-section {
        padding: 24px 0;
    }
    
    .games-grid {
        display: flex;
        overflow-x: auto;
        gap: 16px;
        padding: 8px 0 24px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .games-grid::-webkit-scrollbar {
        display: none;
    }
    
    .game-card {
        min-width: 180px;
        max-width: 180px;
        flex-shrink: 0;
        scroll-snap-align: start;
        padding: 12px;
    }
    
    .game-card img {
        min-height: 160px;
    }
    
    .game-card h3 {
        font-size: var(--font-size-caption);
        margin-top: 8px;
    }
    
    .author-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-payments {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-payments h4 {
        text-align: center;
    }
    
    .payment-icons {
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 12px;
    }
    
    main {
        padding: 16px 0 72px;
    }
    
    .hero {
        padding: 24px 0;
    }
    
    .content-section {
        padding: 24px 0;
    }
}

/* Table responsive on mobile */
@media (max-width: 768px) {
    table {
        display: block;
        width: 100%;
        margin: 16px 0;
        background: transparent;
        border-radius: 0;
        overflow: visible;
    }
    
    thead {
        display: none;
    }
    
    tbody {
        display: block;
        width: 100%;
    }
    
    tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 12px;
        background: var(--surface-section);
        border: 1px solid var(--border-card);
        border-radius: var(--radius-md);
        padding: 12px;
        box-shadow: var(--shadow-card-soft);
    }
    
    tbody tr:last-child {
        margin-bottom: 0;
    }
    
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-card);
        text-align: left;
        gap: 12px;
    }
    
    tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-primary);
        flex-shrink: 0;
        min-width: 40%;
        text-align: left;
    }
    
    tbody td::after {
        content: "";
        flex: 1;
    }
    
    /* Fallback if data-label is not set */
    tbody td:not([data-label])::before {
        content: "";
    }
    
    tbody td:not([data-label]) {
        display: block;
        text-align: center;
    }
}

/* 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;
}

