/* =============================================
   MARMELAD LABS - Gaming Store Theme
   Playful, fun tech, marshmallow aesthetic
   ============================================= */

/* CSS Variables - Marmelad Labs Brandbook */
:root {
    /* Primary Palette */
    --soft-blue: #6c70eb;
    --soft-pink: #e84f8e;
    --vivid-cyan: #18edd3;
    --white: #ffffff;
    --dark-cyan: #34393a;
    --black: #000000;
    
    /* Marshmallow Palette (backgrounds, cards) */
    --marsh-orange: #fbe3bc;
    --marsh-green: #e3e7e0;
    --marsh-red: #f7cecd;
    --marsh-magenta: #e5d1e6;
    --marsh-blue: #d3d7ed;
    --marsh-yellow: #eaf1d0;
    
    /* Functional Colors */
    --bg-primary: #0f0f14;
    --bg-secondary: #1a1a24;
    --bg-card: #1e1e2a;
    --bg-card-hover: #252535;
    --text-primary: #ffffff;
    --text-secondary: #b8b8cc;
    --text-muted: #7a7a8c;
    --border-color: rgba(108, 112, 235, 0.15);
    --border-hover: rgba(108, 112, 235, 0.4);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-pink) 100%);
    --gradient-accent: linear-gradient(135deg, var(--vivid-cyan) 0%, var(--soft-blue) 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 30, 42, 0.9) 0%, rgba(26, 26, 36, 0.95) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    
    /* Shadows */
    --shadow-card: 0 8px 32px rgba(108, 112, 235, 0.08);
    --shadow-card-hover: 0 16px 48px rgba(108, 112, 235, 0.18);
    --shadow-button: 0 4px 16px rgba(108, 112, 235, 0.25);
    --shadow-glow: 0 0 40px rgba(24, 237, 211, 0.15);
    
    /* Border Radius - Marshmallow style */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 50px;
    
    /* Safe areas */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    
    /* Animation */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

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

/* Focus states - subtle, not distracting */
a:focus-visible,
button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 237, 211, 0.4);
}

input:focus-visible {
    outline: none;
    border-color: var(--vivid-cyan) !important;
    box-shadow: 0 0 20px rgba(24, 237, 211, 0.3);
}

/* Remove outline on click (only show on keyboard focus) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Body */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    /* Animated Marmelad background */
    background-image: 
        radial-gradient(ellipse at 10% 0%, rgba(108, 112, 235, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 10%, rgba(232, 79, 142, 0.12) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 100%, rgba(24, 237, 211, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 0% 60%, rgba(232, 79, 142, 0.08) 0%, transparent 30%),
        radial-gradient(ellipse at 100% 80%, rgba(108, 112, 235, 0.1) 0%, transparent 35%);
    background-attachment: fixed;
}

/* =============================================
   ANIMATED GRADIENT BORDER - Marmelad Magic ✨
   ============================================= */
@keyframes gradientRotate {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

@keyframes borderGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(108, 112, 235, 0.4));
    }
    50% { 
        filter: drop-shadow(0 0 16px rgba(232, 79, 142, 0.6));
    }
}

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* =============================================
   HEADER - Playful navigation
   ============================================= */
header {
    background: rgba(26, 26, 36, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    padding-top: calc(14px + var(--safe-area-inset-top));
    padding-left: calc(24px + var(--safe-area-inset-left));
    padding-right: calc(24px + var(--safe-area-inset-right));
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 12px;
}

.header-row {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.header-row-main {
    justify-content: space-between;
    position: relative;
}

.header-row-stats {
    justify-content: flex-start;
    gap: 12px;
}

.header-middle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.header-center > * {
    pointer-events: auto;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* Logo button */
.support-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-pink) 50%, var(--vivid-cyan) 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    font-weight: 700;
    font-size: 15px;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-button);
    font-family: 'Jumbalo', 'Nunito', sans-serif;
    letter-spacing: 0.5px;
}

.support-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 35px rgba(108, 112, 235, 0.5),
        0 0 50px rgba(232, 79, 142, 0.3);
}

.support-button .material-icons-round {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-text {
    background: linear-gradient(90deg, #fff 0%, var(--vivid-cyan) 50%, var(--soft-pink) 100%);
    background-size: 200% 100%;
    animation: logoShimmer 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 30px rgba(24, 237, 211, 0.3);
}

@keyframes logoShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Main store button */
.main-store-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--gradient-accent);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    font-weight: 600;
    font-size: 14px;
    border: none;
    box-shadow: var(--shadow-button);
}

.main-store-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(24, 237, 211, 0.35);
}

.main-store-button .material-icons-round {
    font-size: 20px;
}

/* Header buttons */
.header-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: linear-gradient(135deg, rgba(108, 112, 235, 0.1) 0%, rgba(232, 79, 142, 0.05) 100%);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    border: 1px solid rgba(108, 112, 235, 0.2);
    position: relative;
    overflow: hidden;
}

.header-button::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-full);
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        var(--soft-blue),
        var(--vivid-cyan),
        var(--soft-pink),
        var(--soft-blue)
    );
    opacity: 0;
    z-index: -1;
    animation: gradientRotate 2s linear infinite paused;
}

.header-button::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--radius-full) - 1px);
    background: var(--bg-secondary);
    z-index: -1;
}

.header-button:hover {
    background: transparent;
    color: var(--vivid-cyan);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(24, 237, 211, 0.2);
}

.header-button:hover::before {
    opacity: 1;
    animation-play-state: running;
}

.header-button .material-icons-round {
    font-size: 22px;
    transition: all var(--transition-normal);
}

.header-button:hover .material-icons-round {
    filter: drop-shadow(0 0 8px rgba(24, 237, 211, 0.6));
}

.invisible-href {
    text-decoration: none;
    color: inherit;
}

/* Search bar - Marmelad style */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(108, 112, 235, 0.08) 0%, rgba(232, 79, 142, 0.05) 100%);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    padding: 10px 18px;
    min-width: 200px;
    flex: 1;
    max-width: 400px;
    transition: all var(--transition-normal);
}

.search-bar::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(108, 112, 235, 0.3) 0%, rgba(232, 79, 142, 0.2) 100%);
    z-index: -1;
    transition: all var(--transition-normal);
}

.search-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: calc(var(--radius-full) - 2px);
    background: var(--bg-secondary);
    z-index: -1;
}

.search-bar:focus-within::before {
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        var(--soft-blue),
        var(--vivid-cyan),
        var(--soft-pink),
        var(--soft-blue)
    );
    animation: gradientRotate 2s linear infinite;
}

.search-bar:focus-within {
    box-shadow: 0 0 30px rgba(108, 112, 235, 0.3);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    flex: 1;
    padding-right: 10px;
    font-size: 15px;
    font-family: inherit;
    position: relative;
    z-index: 1;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .material-icons-round {
    color: var(--text-muted);
    font-size: 22px;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
}

.search-bar:focus-within .material-icons-round {
    color: var(--vivid-cyan);
    filter: drop-shadow(0 0 8px rgba(24, 237, 211, 0.5));
}

.search-bar .search-icon {
    cursor: pointer;
}

.search-bar .search-icon:hover {
    color: var(--vivid-cyan);
    transform: scale(1.1);
}

/* Language selector */
.language-selector {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--gradient-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    min-width: 70px;
}

.language-button:hover {
    background: rgba(108, 112, 235, 0.15);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.language-button .material-icons-round {
    font-size: 20px;
    color: var(--soft-blue);
    transition: transform var(--transition-normal);
}

.language-button:hover .material-icons-round {
    transform: rotate(15deg);
    color: var(--vivid-cyan);
}

.language-code {
    font-weight: 700;
    font-size: 13px;
    color: var(--white);
}

.language-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(26, 26, 36, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
    z-index: 1001;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.language-option:hover {
    background: rgba(108, 112, 235, 0.1);
    color: var(--white);
    padding-left: 22px;
}

.language-option:hover::before {
    transform: scaleY(1);
}

.language-option.active {
    background: rgba(108, 112, 235, 0.15);
    color: var(--soft-blue);
    font-weight: 600;
}

.language-option.active::before {
    transform: scaleY(1);
}

.language-option span:first-child {
    font-size: 22px;
}

/* Stats badges */
.games-count,
.games-size,
.active-downloads,
.online-users {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--gradient-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition-normal);
}

.games-count:hover,
.games-size:hover,
.active-downloads:hover,
.online-users:hover {
    border-color: var(--border-hover);
    background: rgba(108, 112, 235, 0.1);
}

.games-count .material-icons-round {
    font-size: 18px;
    color: var(--soft-blue);
}

.games-size .material-icons-round {
    font-size: 18px;
    color: var(--soft-pink);
}

.active-downloads {
    animation: pulse 2s ease-in-out infinite;
}

.active-downloads .material-icons-round {
    font-size: 18px;
    color: var(--vivid-cyan);
    animation: downloadPulse 1.5s ease-in-out infinite;
}

.online-users .material-icons-round {
    font-size: 18px;
    color: #4caf50;
}

.games-count span:last-child,
.games-size span:last-child,
.active-downloads span:last-child,
.online-users span:last-child {
    font-weight: 700;
    color: var(--white);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes downloadPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Material Icons */
.material-icons-round {
    font-family: 'Material Icons Round';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* =============================================
   FILTERS - Sorting controls
   ============================================= */
.filters {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}

.sorting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    flex: 1;
}

.sorting-group label {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.sorting-group label .material-icons-round {
    font-size: 22px;
    color: var(--soft-blue);
}

.sorting-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 40px 12px 16px;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    min-height: 46px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c70eb' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all var(--transition-normal);
}

.sorting-group select:hover,
.sorting-group select:focus {
    border-color: var(--soft-blue);
    box-shadow: 0 0 16px rgba(108, 112, 235, 0.2);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
main {
    flex: 1;
    padding: 32px 24px;
    padding-left: calc(24px + var(--safe-area-inset-left));
    padding-right: calc(24px + var(--safe-area-inset-right));
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

/* =============================================
   GAME CARDS - Marshmallow style with vertical covers
   ============================================= */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* Dynamic columns */
.card-container[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.card-container[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.card-container[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.card-container[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }
.card-container[data-columns="6"] { grid-template-columns: repeat(6, 1fr); }
.card-container[data-columns="7"] { grid-template-columns: repeat(7, 1fr); }
.card-container[data-columns="8"] { grid-template-columns: repeat(8, 1fr); }

.card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Animated gradient border setup */
    border: 2px solid transparent;
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Gradient border glow layer */
.card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: conic-gradient(
        from var(--gradient-angle, 0deg),
        var(--soft-blue),
        var(--vivid-cyan),
        var(--soft-pink),
        var(--soft-blue)
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
    animation: gradientRotate 3s linear infinite paused;
}

/* Inner background to cover the gradient */
.card::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: calc(var(--radius-lg) - 2px);
    background: var(--bg-card);
    z-index: -1;
    transition: background var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 50px rgba(108, 112, 235, 0.25),
        0 0 30px rgba(232, 79, 142, 0.15);
}

.card:hover::before {
    opacity: 1;
    animation-play-state: running;
}

.card:hover::after {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98) 0%, rgba(20, 20, 35, 0.98) 100%);
}

/* Focus state - same as hover */
.card:focus-visible {
    outline: none;
}

.card:focus-visible::before {
    opacity: 1;
    animation-play-state: running;
}

/* Vertical cover image (icon) */
.card img {
    width: 100%;
    aspect-ratio: 1 / 1.4;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-normal);
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: inherit;
}

.card-title {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.card-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
}

.card-info p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px;
}

.card-info strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.card-info span {
    color: var(--soft-blue);
    font-weight: 600;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    padding: 0 10px;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: var(--gradient-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    min-width: 48px;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
}

.pagination a:hover:not(.inactive):not(.active) {
    background: rgba(108, 112, 235, 0.15);
    border-color: var(--border-hover);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination a:active:not(.inactive) {
    transform: scale(0.95);
}

.pagination a.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
    box-shadow: var(--shadow-button);
}

.pagination a.inactive {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    background: transparent;
    border: none;
    min-width: 32px;
    padding: 12px 6px;
    color: var(--text-muted);
}

/* =============================================
   GAME DETAIL PAGE
   ============================================= */
.page {
    padding: 32px 24px;
}

.game-detail {
    max-width: 1200px;
    margin: 0 auto;
}

.game-hero h1 {
    font-family: 'Jumbalo', 'Nunito', sans-serif;
    font-size: 36px;
    margin-bottom: 24px;
    color: var(--white);
    background: linear-gradient(90deg, var(--white) 0%, var(--vivid-cyan) 50%, var(--soft-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.game-meta {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.game-meta p {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-meta strong {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-meta p:not(strong) {
    color: var(--text-primary);
    font-weight: 600;
}

.game-content-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.game-cover-section {
    min-width: 0;
}

/* Carousel for horizontal screenshots */
.carousel-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.carousel-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.carousel-item {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeIn 0.4s ease;
}

.carousel-item.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-primary);
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 10;
}

.carousel-button:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 20px;
}

.carousel-button.next {
    right: 20px;
}

.carousel-button .material-icons-round {
    font-size: 28px;
}

/* Game info section */
.game-info-section {
    min-width: 0;
}

.game-info {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    box-sizing: border-box;
}

.game-description {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 28px;
    padding: 0;
    overflow-x: hidden;
    word-wrap: break-word;
}

.game-description p {
    margin-bottom: 16px;
}

.game-tech-info {
    background: rgba(108, 112, 235, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.tech-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tech-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    line-height: 1.6;
}

.tech-key {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tech-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* Download buttons */
.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
}

.button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: linear-gradient(135deg, rgba(108, 112, 235, 0.15) 0%, rgba(232, 79, 142, 0.1) 100%);
    border: 1px solid rgba(108, 112, 235, 0.3);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    font-size: 15px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

/* Animated shine effect */
.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.button:hover::before {
    left: 100%;
}

.button:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(108, 112, 235, 0.25) 0%, rgba(232, 79, 142, 0.2) 100%);
    border-color: var(--soft-blue);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(108, 112, 235, 0.3),
        0 0 20px rgba(24, 237, 211, 0.1);
}

.button:active:not(:disabled) {
    transform: scale(0.98) translateY(0);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.button .material-icons-round {
    font-size: 24px;
    color: var(--vivid-cyan);
    transition: all var(--transition-normal);
    filter: drop-shadow(0 0 8px rgba(24, 237, 211, 0.4));
}

.button:hover .material-icons-round {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px rgba(24, 237, 211, 0.6));
}

/* Download button primary style - EXTRA JUICY */
.download-button,
.download-buttons > div:first-child .button {
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-pink) 50%, var(--vivid-cyan) 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 3s ease infinite !important;
    border: none !important;
    color: var(--white) !important;
    box-shadow: 
        0 6px 20px rgba(108, 112, 235, 0.4),
        0 0 30px rgba(232, 79, 142, 0.2);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.download-button:hover,
.download-buttons > div:first-child .button:hover {
    box-shadow: 
        0 12px 40px rgba(108, 112, 235, 0.5),
        0 0 50px rgba(232, 79, 142, 0.3),
        0 0 80px rgba(24, 237, 211, 0.2) !important;
    transform: translateY(-4px) scale(1.02) !important;
}

.download-button .material-icons-round,
.download-buttons > div:first-child .button .material-icons-round {
    color: var(--white) !important;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5)) !important;
}

/* Download icon animation */
.download-button:hover .material-icons-round,
.download-buttons .button:hover .material-icons-round {
    animation: downloadBounce 0.6s ease-in-out infinite;
}

@keyframes downloadBounce {
    0%, 100% { transform: translateY(0); }
    25%, 75% { transform: translateY(-4px); }
    50% { transform: translateY(-2px); }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: rgba(26, 26, 36, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 32px 24px;
    padding-bottom: calc(32px + var(--safe-area-inset-bottom));
    padding-left: calc(24px + var(--safe-area-inset-left));
    padding-right: calc(24px + var(--safe-area-inset-right));
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
}

.footer-content p {
    margin-bottom: 8px;
    font-size: 14px;
}

.footer-content a {
    color: var(--soft-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-content a:hover {
    color: var(--vivid-cyan);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Desktop & Large screens */
@media (min-width: 1200px) {
    header {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 24px;
    }
    
    .header-row {
        width: auto;
        max-width: none;
        margin: 0;
    }
    
    .header-row-main {
        flex: 1;
        justify-content: flex-start;
        gap: 20px;
    }
    
    .header-center {
        position: static;
        transform: none;
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .header-right {
        margin-left: auto;
    }
    
    .header-row-stats {
        margin-top: 0;
        flex: 0 1 auto;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    }
    
    main {
        padding: 24px 16px;
    }
    
    .game-content-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .header-row-main {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .header-middle {
        gap: 8px;
    }
    
    .header-center {
        position: static;
        transform: none;
    }
    
    .search-bar {
        flex: 1;
        min-width: 100px;
        max-width: none;
        padding: 8px 14px;
    }
    
    .search-bar input {
        font-size: 16px;
    }
    
    .header-stats {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .games-count,
    .games-size,
    .active-downloads,
    .online-users {
        font-size: 11px;
        padding: 6px 10px;
        gap: 4px;
        border-radius: var(--radius-full);
    }
    
    .games-count .material-icons-round,
    .games-size .material-icons-round,
    .active-downloads .material-icons-round,
    .online-users .material-icons-round {
        font-size: 14px;
    }
    
    .language-button {
        padding: 8px 10px;
        min-width: 56px;
    }
    
    .language-code {
        font-size: 11px;
    }
    
    .language-button .material-icons-round {
        font-size: 16px;
    }
    
    .header-button {
        padding: 8px;
    }
    
    .header-button .material-icons-round {
        font-size: 20px;
    }
    
    .support-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .support-button .material-icons-round {
        font-size: 18px;
    }
    
    .logo-text {
        display: none;
    }
    
    .main-store-button {
        display: none;
    }
    
    main {
        padding: 16px 12px;
    }
    
    .card-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .card {
        border-radius: var(--radius-md);
    }
    
    .card img {
        aspect-ratio: 1 / 1.3;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .card-info {
        font-size: 11px;
    }
    
    .filters {
        padding: 12px;
        gap: 10px;
    }
    
    .sorting-group {
        min-width: calc(50% - 5px);
    }
    
    .sorting-group select {
        padding: 10px 36px 10px 12px;
        font-size: 13px;
    }
    
    /* Game page */
    .page {
        padding: 16px 12px;
    }
    
    .game-hero h1 {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    .game-meta {
        padding: 16px;
        margin-bottom: 20px;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .game-meta p {
        font-size: 13px;
    }
    
    .game-meta strong {
        font-size: 11px;
    }
    
    .game-content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .carousel-container {
        border-radius: var(--radius-md);
    }
    
    .carousel-button {
        width: 44px;
        height: 44px;
    }
    
    .carousel-button .material-icons-round {
        font-size: 24px;
    }
    
    .carousel-button.prev {
        left: 12px;
    }
    
    .carousel-button.next {
        right: 12px;
    }
    
    .game-info {
        padding: 16px;
    }
    
    .game-tech-info {
        padding: 14px;
    }
    
    .tech-item {
        font-size: 13px;
    }
    
    .download-buttons {
        gap: 10px;
        margin-top: 20px;
    }
    
    .button {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 52px;
    }
    
    .button .material-icons-round {
        font-size: 22px;
    }
    
    .pagination {
        margin-top: 32px;
    }
    
    .pagination ul {
        gap: 6px;
    }
    
    .pagination a,
    .pagination span {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .footer {
        padding: 24px 16px;
    }
    
    .footer-content {
        font-size: 13px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    header {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .header-row-main {
        gap: 6px;
    }
    
    .search-bar {
        padding: 6px 12px;
    }
    
    .language-button {
        padding: 6px 8px;
        min-width: 48px;
    }
    
    .language-code {
        font-size: 10px;
    }
    
    .language-button .material-icons-round {
        font-size: 14px;
    }
    
    .header-button {
        padding: 6px;
    }
    
    .header-button .material-icons-round {
        font-size: 18px;
    }
    
    .games-count,
    .games-size,
    .active-downloads,
    .online-users {
        font-size: 10px;
        padding: 5px 8px;
        gap: 3px;
    }
    
    .games-count .material-icons-round,
    .games-size .material-icons-round,
    .active-downloads .material-icons-round,
    .online-users .material-icons-round {
        font-size: 12px;
    }
    
    .card-container {
        gap: 10px;
    }
    
    .card img {
        aspect-ratio: 1 / 1.2;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .card-info {
        font-size: 10px;
    }
    
    .game-hero h1 {
        font-size: 20px;
    }
    
    .game-meta {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    
    .game-info {
        padding: 14px;
    }
    
    .button {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .filters {
        flex-direction: column;
        padding: 10px;
    }
    
    .sorting-group {
        min-width: 100%;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        min-height: 40px;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        position: relative;
        padding: 8px 16px;
    }
    
    main {
        padding: 12px;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .card {
        -webkit-tap-highlight-color: transparent;
    }
    
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    
    .button,
    .header-button,
    .support-button,
    .language-button,
    .pagination a {
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .pagination a:active,
    .button:active {
        transform: scale(0.95);
    }
}
