/* 68jl CSS Design System - Mobile-first responsive design */

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

html {
    font-size: 62.5%; /* 10px base for rem calculations */
    --vh: 1vh;
}

:root {
    /* Color palette based on requirements */
    --g309-primary: #FA8072; /* Salmon primary */
    --g309-secondary: #A0522D; /* Saddle Brown */
    --g309-dark: #2E4057; /* Dark blue-gray */
    --g309-gray: #999999; /* Gray */
    --g309-accent: #FFCC33; /* Gold */
    --g309-teal: #20B2AA; /* Light Sea Green */
    
    /* Semantic colors */
    --g309-bg-primary: var(--g309-dark);
    --g309-bg-secondary: var(--g309-secondary);
    --g309-text-primary: #ffffff;
    --g309-text-secondary: var(--g309-gray);
    --g309-text-accent: var(--g309-accent);
    --g309-border: rgba(255, 255, 255, 0.1);
    
    /* Spacing system */
    --g309-spacing-xs: 0.5rem;
    --g309-spacing-sm: 1rem;
    --g309-spacing-md: 1.5rem;
    --g309-spacing-lg: 2rem;
    --g309-spacing-xl: 3rem;
    
    /* Typography */
    --g309-font-size-xs: 1.2rem;
    --g309-font-size-sm: 1.4rem;
    --g309-font-size-md: 1.6rem;
    --g309-font-size-lg: 1.8rem;
    --g309-font-size-xl: 2.4rem;
    --g309-font-size-xxl: 3.2rem;
    
    /* Shadows and effects */
    --g309-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --g309-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --g309-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --g309-border-radius: 8px;
    --g309-border-radius-sm: 4px;
    --g309-border-radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--g309-font-size-md);
    line-height: 1.5;
    color: var(--g309-text-primary);
    background: linear-gradient(135deg, var(--g309-bg-primary) 0%, var(--g309-bg-secondary) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading states */
.g309-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Container and layout */
.g309-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 var(--g309-spacing-sm);
    position: relative;
}

.g309-wrapper {
    width: 100%;
    min-height: calc(100vh - 64px);
    padding-bottom: 64px; /* Space for bottom nav */
}

.g309-section {
    padding: var(--g309-spacing-lg) 0;
}

.g309-grid {
    display: grid;
    gap: var(--g309-spacing-md);
}

.g309-flex {
    display: flex;
    align-items: center;
    gap: var(--g309-spacing-sm);
}

.g309-flex-col {
    display: flex;
    flex-direction: column;
    gap: var(--g309-spacing-sm);
}

/* Header and navigation */
.g309-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(46, 64, 87, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--g309-border);
    z-index: 1000;
    height: 60px;
}

.g309-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--g309-spacing-sm);
    height: 100%;
}

.g309-logo {
    display: flex;
    align-items: center;
    gap: var(--g309-spacing-xs);
    text-decoration: none;
    color: var(--g309-text-primary);
}

.g309-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--g309-border-radius-sm);
}

.g309-logo-text {
    font-size: var(--g309-font-size-lg);
    font-weight: 700;
    color: var(--g309-accent);
}

.g309-header-actions {
    display: flex;
    align-items: center;
    gap: var(--g309-spacing-xs);
}

.g309-hamburger {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.g309-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--g309-text-primary);
    margin: 4px 0;
    transition: all 0.3s ease;
}

.g309-hamburger-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.g309-hamburger-active span:nth-child(2) {
    opacity: 0;
}

.g309-hamburger-active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile navigation */
.g309-mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--g309-bg-primary);
    z-index: 999;
    transition: right 0.3s ease;
    border-left: 1px solid var(--g309-border);
}

.g309-nav-open {
    right: 0;
}

.g309-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.g309-overlay-active {
    opacity: 1;
    visibility: visible;
}

.g309-nav-menu {
    padding: 80px 0 0 0;
    list-style: none;
}

.g309-nav-item {
    border-bottom: 1px solid var(--g309-border);
}

.g309-nav-link {
    display: block;
    padding: var(--g309-spacing-md);
    color: var(--g309-text-primary);
    text-decoration: none;
    font-size: var(--g309-font-size-md);
    transition: all 0.3s ease;
}

.g309-nav-link:hover,
.g309-nav-link:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--g309-accent);
}

/* Buttons */
.g309-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--g309-spacing-sm) var(--g309-spacing-md);
    font-size: var(--g309-font-size-sm);
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--g309-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly minimum */
    text-align: center;
}

.g309-btn-primary {
    background: linear-gradient(135deg, var(--g309-primary) 0%, var(--g309-accent) 100%);
    color: var(--g309-text-primary);
    box-shadow: var(--g309-shadow-sm);
}

.g309-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--g309-shadow-md);
}

.g309-btn-secondary {
    background: transparent;
    color: var(--g309-text-primary);
    border: 2px solid var(--g309-primary);
}

.g309-btn-secondary:hover {
    background: var(--g309-primary);
    color: var(--g309-text-primary);
}

.g309-btn-pressed {
    transform: scale(0.98);
    opacity: 0.8;
}

.g309-btn-small {
    padding: var(--g309-spacing-xs) var(--g309-spacing-sm);
    font-size: var(--g309-font-size-xs);
    min-height: 36px;
}

/* Carousel */
.g309-carousel {
    position: relative;
    margin: 60px 0 var(--g309-spacing-lg) 0;
    border-radius: var(--g309-border-radius-lg);
    overflow: hidden;
    box-shadow: var(--g309-shadow-lg);
}

.g309-slide {
    position: relative;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.g309-slide img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.g309-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: var(--g309-spacing-md);
}

.g309-slide-content h3 {
    font-size: var(--g309-font-size-lg);
    margin-bottom: var(--g309-spacing-xs);
}

.g309-slide-content p {
    font-size: var(--g309-font-size-sm);
    opacity: 0.9;
}

/* Game grid */
.g309-game-section {
    margin: var(--g309-spacing-xl) 0;
}

.g309-section-title {
    font-size: var(--g309-font-size-xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--g309-spacing-lg);
    color: var(--g309-accent);
}

.g309-game-category {
    margin-bottom: var(--g309-spacing-xl);
}

.g309-category-title {
    font-size: var(--g309-font-size-lg);
    font-weight: 600;
    margin-bottom: var(--g309-spacing-md);
    padding: var(--g309-spacing-sm) var(--g309-spacing-md);
    background: linear-gradient(135deg, var(--g309-primary) 0%, var(--g309-teal) 100%);
    border-radius: var(--g309-border-radius);
    text-align: center;
}

.g309-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--g309-spacing-sm);
    margin-bottom: var(--g309-spacing-lg);
}

.g309-game-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--g309-border-radius);
    padding: var(--g309-spacing-xs);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--g309-border);
}

.g309-game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--g309-shadow-md);
    background: rgba(255, 255, 255, 0.15);
}

.g309-game-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--g309-border-radius-sm);
    margin: 0 auto var(--g309-spacing-xs);
    object-fit: cover;
}

.g309-game-name {
    font-size: var(--g309-font-size-xs);
    font-weight: 500;
    color: var(--g309-text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Content sections */
.g309-content-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--g309-border-radius-lg);
    padding: var(--g309-spacing-lg);
    margin: var(--g309-spacing-lg) 0;
    border: 1px solid var(--g309-border);
}

.g309-content-title {
    font-size: var(--g309-font-size-xl);
    font-weight: 700;
    margin-bottom: var(--g309-spacing-md);
    color: var(--g309-accent);
}

.g309-content-text {
    line-height: 1.6;
    margin-bottom: var(--g309-spacing-md);
    color: var(--g309-text-primary);
}

.g309-content-text:last-child {
    margin-bottom: 0;
}

.g309-promo-link {
    color: var(--g309-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.g309-promo-link:hover {
    color: var(--g309-accent);
    text-decoration: underline;
}

/* Footer */
.g309-footer {
    background: var(--g309-bg-primary);
    border-top: 1px solid var(--g309-border);
    padding: var(--g309-spacing-xl) 0;
    margin-top: var(--g309-spacing-xl);
}

.g309-footer-content {
    text-align: center;
}

.g309-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--g309-spacing-md);
    margin-bottom: var(--g309-spacing-lg);
}

.g309-footer-link {
    color: var(--g309-text-secondary);
    text-decoration: none;
    font-size: var(--g309-font-size-sm);
    transition: color 0.3s ease;
}

.g309-footer-link:hover {
    color: var(--g309-accent);
}

.g309-partners {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--g309-spacing-sm);
    margin: var(--g309-spacing-lg) 0;
    opacity: 0.7;
}

.g309-partner-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--g309-border-radius-sm);
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.g309-partner-logo:hover {
    filter: grayscale(0%);
}

.g309-copyright {
    font-size: var(--g309-font-size-xs);
    color: var(--g309-text-secondary);
    margin-top: var(--g309-spacing-md);
}

/* Bottom navigation */
.g309-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(46, 64, 87, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--g309-border);
    z-index: 1000;
    height: 64px;
}

.g309-bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
}

.g309-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--g309-text-secondary);
    transition: all 0.3s ease;
    min-width: 44px;
    padding: var(--g309-spacing-xs) 0;
}

.g309-nav-item:hover,
.g309-nav-active {
    color: var(--g309-accent);
    transform: translateY(-1px);
}

.g309-nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.g309-nav-text {
    font-size: var(--g309-font-size-xs);
    font-weight: 500;
    line-height: 1;
}

/* Lazy loading */
.g309-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.g309-lazy.loaded {
    opacity: 1;
}

/* Responsive design */
@media (min-width: 375px) {
    .g309-container {
        padding: 0 var(--g309-spacing-md);
    }
    
    .g309-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

@media (min-width: 430px) {
    .g309-container {
        max-width: 100%;
        padding: 0 var(--g309-spacing-lg);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --g309-border: rgba(255, 255, 255, 0.3);
    }
    
    .g309-game-card {
        border: 2px solid var(--g309-border);
    }
}

/* Focus styles for keyboard navigation */
.g309-btn:focus,
.g309-nav-link:focus,
.g309-nav-item:focus {
    outline: 2px solid var(--g309-accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .g309-header,
    .g309-bottom-nav,
    .g309-mobile-nav {
        display: none;
    }
    
    .g309-wrapper {
        padding-bottom: 0;
    }
}