/* BouncingBall88 CSS Design System */
/* All classes use prefix "s5b4-" to avoid conflicts */

/* CSS Variables - Color Palette */
:root {
    /* Primary Colors */
    --s5b4-primary: #D2691E;
    --s5b4-secondary: #FF8A80;
    --s5b4-accent: #FFB3FF;
    --s5b4-dark: #262626;
    --s5b4-light: #FFE4B5;

    /* Extended Color Palette */
    --s5b4-primary-dark: #A0522D;
    --s5b4-primary-light: #DEB887;
    --s5b4-secondary-dark: #E57373;
    --s5b4-secondary-light: #FFCDD2;
    --s5b4-accent-dark: #E91E63;
    --s5b4-accent-light: #F8BBD9;

    /* Neutral Colors */
    --s5b4-white: #FFFFFF;
    --s5b4-black: #000000;
    --s5b4-gray-100: #F5F5F5;
    --s5b4-gray-200: #EEEEEE;
    --s5b4-gray-300: #E0E0E0;
    --s5b4-gray-400: #BDBDBD;
    --s5b4-gray-500: #9E9E9E;
    --s5b4-gray-600: #757575;
    --s5b4-gray-700: #616161;
    --s5b4-gray-800: #424242;
    --s5b4-gray-900: #212121;

    /* Typography */
    --s5b4-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --s5b4-font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --s5b4-spacing-xs: 0.25rem;
    --s5b4-spacing-sm: 0.5rem;
    --s5b4-spacing-md: 1rem;
    --s5b4-spacing-lg: 1.5rem;
    --s5b4-spacing-xl: 2rem;
    --s5b4-spacing-2xl: 3rem;

    /* Border Radius */
    --s5b4-radius-sm: 0.25rem;
    --s5b4-radius-md: 0.5rem;
    --s5b4-radius-lg: 1rem;
    --s5b4-radius-xl: 1.5rem;

    /* Shadows */
    --s5b4-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --s5b4-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --s5b4-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --s5b4-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --s5b4-transition-fast: 0.15s ease;
    --s5b4-transition-normal: 0.3s ease;
    --s5b4-transition-slow: 0.5s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    scroll-behavior: smooth;
}

body {
    font-family: var(--s5b4-font-primary);
    font-size: 1.4rem;
    line-height: 1.5;
    color: var(--s5b4-light);
    background: linear-gradient(135deg, var(--s5b4-dark) 0%, var(--s5b4-gray-800) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container & Layout */
.s5b4-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 var(--s5b4-spacing-md);
}

.s5b4-wrapper {
    position: relative;
    min-height: 100vh;
    padding-bottom: 8rem; /* Space for bottom nav */
}

.s5b4-grid {
    display: grid;
    gap: var(--s5b4-spacing-md);
}

.s5b4-flex {
    display: flex;
    align-items: center;
}

.s5b4-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s5b4-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header */
.s5b4-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, var(--s5b4-primary) 0%, var(--s5b4-primary-dark) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--s5b4-transition-normal);
}

.s5b4-header-scrolled {
    background: linear-gradient(90deg, var(--s5b4-primary-dark) 0%, var(--s5b4-primary) 100%);
    box-shadow: var(--s5b4-shadow-lg);
}

.s5b4-header-content {
    padding: var(--s5b4-spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s5b4-logo {
    display: flex;
    align-items: center;
    gap: var(--s5b4-spacing-sm);
    text-decoration: none;
    color: var(--s5b4-white);
    font-weight: 700;
    font-size: 1.8rem;
}

.s5b4-logo-icon {
    width: 2.4rem;
    height: 2.4rem;
    background: var(--s5b4-accent);
    border-radius: var(--s5b4-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--s5b4-dark);
}

.s5b4-header-actions {
    display: flex;
    gap: var(--s5b4-spacing-sm);
}

.s5b4-btn {
    padding: var(--s5b4-spacing-sm) var(--s5b4-spacing-md);
    border: none;
    border-radius: var(--s5b4-radius-md);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--s5b4-transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 4.4rem; /* Touch target */
    min-width: 6rem;
}

.s5b4-btn-primary {
    background: var(--s5b4-secondary);
    color: var(--s5b4-dark);
}

.s5b4-btn-primary:hover {
    background: var(--s5b4-secondary-light);
    transform: translateY(-1px);
    box-shadow: var(--s5b4-shadow-md);
}

.s5b4-btn-secondary {
    background: var(--s5b4-accent);
    color: var(--s5b4-dark);
}

.s5b4-btn-secondary:hover {
    background: var(--s5b4-accent-light);
    transform: translateY(-1px);
    box-shadow: var(--s5b4-shadow-md);
}

.s5b4-menu-button {
    background: none;
    border: none;
    color: var(--s5b4-white);
    font-size: 2rem;
    cursor: pointer;
    padding: var(--s5b4-spacing-sm);
    border-radius: var(--s5b4-radius-sm);
    transition: all var(--s5b4-transition-fast);
    min-height: 4.4rem;
    min-width: 4.4rem;
}

.s5b4-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu */
.s5b4-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--s5b4-dark);
    z-index: 9999;
    transition: right var(--s5b4-transition-normal);
    overflow-y: auto;
    border-left: 1px solid var(--s5b4-primary);
}

.s5b4-menu-open {
    right: 0;
}

.s5b4-menu-header {
    padding: var(--s5b4-spacing-lg);
    background: linear-gradient(90deg, var(--s5b4-primary) 0%, var(--s5b4-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s5b4-menu-close {
    background: none;
    border: none;
    color: var(--s5b4-white);
    font-size: 2rem;
    cursor: pointer;
    padding: var(--s5b4-spacing-sm);
    border-radius: var(--s5b4-radius-sm);
    transition: all var(--s5b4-transition-fast);
}

.s5b4-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.s5b4-menu-nav {
    padding: var(--s5b4-spacing-md);
}

.s5b4-menu-item {
    display: block;
    padding: var(--s5b4-spacing-md);
    color: var(--s5b4-light);
    text-decoration: none;
    border-radius: var(--s5b4-radius-md);
    transition: all var(--s5b4-transition-fast);
    margin-bottom: var(--s5b4-spacing-xs);
}

.s5b4-menu-item:hover {
    background: var(--s5b4-primary);
    color: var(--s5b4-white);
    transform: translateX(4px);
}

.s5b4-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--s5b4-transition-normal);
}

.s5b4-overlay-active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.s5b4-main {
    margin-top: 6rem; /* Space for fixed header */
    padding: var(--s5b4-spacing-lg) 0;
}

.s5b4-section {
    margin-bottom: var(--s5b4-spacing-2xl);
}

.s5b4-section-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--s5b4-white);
    margin-bottom: var(--s5b4-spacing-lg);
    text-align: center;
    background: linear-gradient(90deg, var(--s5b4-secondary) 0%, var(--s5b4-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Carousel */
.s5b4-carousel {
    position: relative;
    margin-bottom: var(--s5b4-spacing-2xl);
    border-radius: var(--s5b4-radius-lg);
    overflow: hidden;
    box-shadow: var(--s5b4-shadow-xl);
}

.s5b4-carousel-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.s5b4-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--s5b4-transition-normal);
    cursor: pointer;
}

.s5b4-carousel-slide.app5b4-active {
    opacity: 1;
}

.s5b4-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.s5b4-carousel-dots {
    position: absolute;
    bottom: var(--s5b4-spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--s5b4-spacing-xs);
}

.s5b4-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--s5b4-transition-fast);
}

.s5b4-carousel-dot.app5b4-active {
    background: var(--s5b4-accent);
    transform: scale(1.2);
}

/* Game Grid */
.s5b4-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--s5b4-spacing-md);
    margin-bottom: var(--s5b4-spacing-xl);
}

.s5b4-game-item {
    text-align: center;
    cursor: pointer;
    transition: all var(--s5b4-transition-fast);
    text-decoration: none;
    color: var(--s5b4-light);
}

.s5b4-game-item:hover {
    transform: translateY(-4px);
}

.s5b4-game-icon {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--s5b4-radius-md);
    margin-bottom: var(--s5b4-spacing-xs);
    transition: all var(--s5b4-transition-fast);
    border: 2px solid transparent;
}

.s5b4-game-item:hover .s5b4-game-icon {
    border-color: var(--s5b4-secondary);
    box-shadow: var(--s5b4-shadow-md);
}

.s5b4-game-name {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cards */
.s5b4-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--s5b4-radius-lg);
    padding: var(--s5b4-spacing-lg);
    margin-bottom: var(--s5b4-spacing-lg);
    transition: all var(--s5b4-transition-normal);
}

.s5b4-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--s5b4-primary);
    transform: translateY(-2px);
    box-shadow: var(--s5b4-shadow-lg);
}

.s5b4-card-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--s5b4-white);
    margin-bottom: var(--s5b4-spacing-md);
}

.s5b4-card-text {
    color: var(--s5b4-gray-300);
    line-height: 1.6;
    margin-bottom: var(--s5b4-spacing-md);
}

/* Bottom Navigation */
.s5b4-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--s5b4-dark);
    border-top: 1px solid var(--s5b4-primary);
    z-index: 1000;
    padding: var(--s5b4-spacing-sm) 0;
    backdrop-filter: blur(10px);
}

.s5b4-bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 430px;
    margin: 0 auto;
}

.s5b4-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    padding: var(--s5b4-spacing-xs);
    cursor: pointer;
    transition: all var(--s5b4-transition-fast);
    text-decoration: none;
    color: var(--s5b4-gray-400);
    border-radius: var(--s5b4-radius-md);
}

.s5b4-bottom-nav-item:hover {
    color: var(--s5b4-secondary);
    transform: scale(1.05);
}

.s5b4-bottom-nav-item.app5b4-active {
    color: var(--s5b4-secondary);
    background: rgba(255, 138, 128, 0.1);
}

.s5b4-bottom-nav-icon {
    font-size: 2.4rem;
    margin-bottom: var(--s5b4-spacing-xs);
}

.s5b4-bottom-nav-text {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

/* Footer */
.s5b4-footer {
    background: var(--s5b4-dark);
    border-top: 1px solid var(--s5b4-primary);
    padding: var(--s5b4-spacing-2xl) 0 var(--s5b4-spacing-lg);
    margin-top: var(--s5b4-spacing-2xl);
}

.s5b4-footer-content {
    text-align: center;
}

.s5b4-partners {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s5b4-spacing-md);
    margin-bottom: var(--s5b4-spacing-lg);
}

.s5b4-partner-logo {
    height: 30px;
    width: auto;
    opacity: 0.7;
    transition: all var(--s5b4-transition-fast);
    filter: grayscale(100%);
}

.s5b4-partner-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.s5b4-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s5b4-spacing-md);
    margin-bottom: var(--s5b4-spacing-lg);
}

.s5b4-footer-link {
    color: var(--s5b4-gray-300);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all var(--s5b4-transition-fast);
}

.s5b4-footer-link:hover {
    color: var(--s5b4-secondary);
}

.s5b4-copyright {
    color: var(--s5b4-gray-500);
    font-size: 1.1rem;
    margin-top: var(--s5b4-spacing-lg);
}

/* Utility Classes */
.s5b4-text-center { text-align: center; }
.s5b4-text-left { text-align: left; }
.s5b4-text-right { text-align: right; }

.s5b4-mb-sm { margin-bottom: var(--s5b4-spacing-sm); }
.s5b4-mb-md { margin-bottom: var(--s5b4-spacing-md); }
.s5b4-mb-lg { margin-bottom: var(--s5b4-spacing-lg); }
.s5b4-mb-xl { margin-bottom: var(--s5b4-spacing-xl); }

.s5b4-mt-sm { margin-top: var(--s5b4-spacing-sm); }
.s5b4-mt-md { margin-top: var(--s5b4-spacing-md); }
.s5b4-mt-lg { margin-top: var(--s5b4-spacing-lg); }
.s5b4-mt-xl { margin-top: var(--s5b4-spacing-xl); }

.s5b4-p-sm { padding: var(--s5b4-spacing-sm); }
.s5b4-p-md { padding: var(--s5b4-spacing-md); }
.s5b4-p-lg { padding: var(--s5b4-spacing-lg); }

.s5b4-hidden { display: none; }
.s5b4-visible { display: block; }

/* Responsive Design */
@media (max-width: 768px) {
    .s5b4-container {
        padding: 0 var(--s5b4-spacing-sm);
    }

    .s5b4-main {
        padding-bottom: 8rem; /* Space for bottom nav */
    }

    .s5b4-section-title {
        font-size: 2rem;
    }

    .s5b4-carousel-container {
        height: 180px;
    }

    .s5b4-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: var(--s5b4-spacing-sm);
    }

    .s5b4-game-icon {
        height: 70px;
    }

    .s5b4-bottom-nav {
        display: block;
    }
}

@media (min-width: 769px) {
    .s5b4-bottom-nav {
        display: none;
    }

    .s5b4-wrapper {
        padding-bottom: 0;
    }
}

/* Animations */
@keyframes s5b4-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes s5b4-slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes s5b4-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.s5b4-fade-in {
    animation: s5b4-fadeIn var(--s5b4-transition-normal);
}

.s5b4-slide-up {
    animation: s5b4-slideInUp var(--s5b4-transition-normal);
}

.s5b4-pulse {
    animation: s5b4-pulse 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--s5b4-gray-800);
}

::-webkit-scrollbar-thumb {
    background: var(--s5b4-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--s5b4-primary-dark);
}