/* ==========================================================================
   PlayLogicGames - Main Stylesheet
   Mobile-First, Dark Theme, Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Variables)
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --color-bg: #0d0d14;
    --color-bg-alt: #151520;
    --color-surface: #1a1a28;
    --color-surface-hover: #252538;
    --color-border: #2a2a3c;

    --color-text: #e8e8f0;
    --color-text-muted: #9898a8;
    --color-text-heading: #ffffff;

    --color-primary: #6c5ce7;
    --color-primary-hover: #7d6ff0;
    --color-secondary: #00cec9;
    --color-accent: #fd79a8;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Layout */
    --container-max: 1200px;
    --header-height: 64px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-heading);
    font-weight: 600;
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-2xl) 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-heading);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.logo:hover {
    color: var(--color-text-heading);
}

.logo-icon {
    color: var(--color-primary);
    font-size: var(--font-size-2xl);
}

.logo .highlight {
    color: var(--color-secondary);
}

/* Navigation Toggle (Mobile) */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: var(--transition-base);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: var(--transition-base);
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.nav-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Main Navigation */
.main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    display: none;
    padding: var(--space-md) 0;
}

.main-nav.is-open {
    display: block;
}

.nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.nav-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    padding: var(--space-3xl) 0;
    text-align: center;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-border);
}

.hero h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--color-text-heading) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-secondary:hover {
    background-color: var(--color-secondary);
    color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   Section Titles
   -------------------------------------------------------------------------- */
.section-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: calc(var(--space-md) * -1);
    margin-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Game Cards Grid
   -------------------------------------------------------------------------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.game-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.game-card a {
    display: block;
    color: inherit;
}

.game-card a:hover {
    color: inherit;
}

.game-card-image {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-hover);
}

.game-card-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.game-card-content {
    padding: var(--space-md);
}

.game-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.game-card-category {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.game-card-retro .game-card-image {
    position: relative;
}

.game-card-retro .game-card-image::after {
    content: 'RETRO';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background-color: var(--color-accent);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Category Cards
   -------------------------------------------------------------------------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-xl);
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: var(--transition-base);
    color: var(--color-text);
}

.category-card:hover {
    border-color: var(--color-primary);
    background-color: var(--color-surface-hover);
    color: var(--color-text);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.category-card h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
}

.category-card p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   About Section
   -------------------------------------------------------------------------- */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    margin-bottom: var(--space-md);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-md);
    color: var(--color-text-heading);
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-section a {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.footer-section a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.disclaimer {
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Game Page Layout
   -------------------------------------------------------------------------- */
.game-page {
    padding: var(--space-md) 0;
}

.game-page header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.game-page h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-sm);
}

.game-page .meta {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.game-container {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-placeholder {
    text-align: center;
    color: var(--color-text-muted);
}

.game-placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.game-content {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.game-content h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

.game-content h2:not(:first-child) {
    margin-top: var(--space-xl);
}

.game-content p {
    margin-bottom: var(--space-md);
}

.game-content ul, .game-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.game-content li {
    margin-bottom: var(--space-sm);
    list-style: disc;
}

.game-content ol li {
    list-style: decimal;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
    padding: var(--space-md) 0;
    font-size: var(--font-size-sm);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--color-text-muted);
}

.breadcrumb-item a {
    color: var(--color-text-muted);
}

.breadcrumb-item:last-child {
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet (768px+) */
@media (min-width: 768px) {
    :root {
        --font-size-3xl: 2.5rem;
        --font-size-4xl: 3rem;
    }

    .nav-toggle {
        display: none;
    }

    .main-nav {
        position: static;
        display: block;
        background: transparent;
        border: none;
        padding: 0;
    }

    .nav-list {
        flex-direction: row;
        gap: var(--space-lg);
    }

    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .game-card h3 {
        font-size: var(--font-size-lg);
    }

    .game-page h1 {
        font-size: var(--font-size-3xl);
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: var(--font-size-4xl);
    }

    .game-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-lg);
    }

    .category-grid {
        gap: var(--space-lg);
    }

    .game-container {
        aspect-ratio: 16 / 10;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --------------------------------------------------------------------------
   Footer banner (Ontario slots, /slots/)
   -------------------------------------------------------------------------- */
.footer-banner {
    display: block;
    max-width: 1136px;
    margin: 0 auto var(--space-2xl);
}

.footer-banner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

@media (max-width: 767px) {
    .footer-banner {
        max-width: 360px;
    }
}
