/* Critical CSS - Inline candidates */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Performance optimized selectors */
.container, .header, .featured-games, .search-section {
    contain: layout style;
}

.game-card-modern, .featured-card {
    will-change: transform;
    contain: layout;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #fff;
    line-height: 1.5; /* Reduced from 1.6 for compactness */
    overflow-x: hidden;
    padding-top: 60px; /* Reduced from 70px */
    text-rendering: optimizeSpeed; /* Performance optimization */
}

.container {
    min-height: 100vh;
    position: relative;
}

/* Simplified Featured Games Section */
.featured-games {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 0.8rem; /* Further reduced padding */
    position: relative;
}

.featured-container {
    max-width: 1200px;
    margin: 0 auto;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Reduced min-width */
    gap: 1rem; /* Reduced from 1.5rem */
    margin-top: 1rem; /* Reduced from 1.5rem */
}

.featured-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; /* Consistent border-radius */
    padding: 1rem; /* Reduced from 1.5rem */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Optimized transitions */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-card:hover {
    transform: translateY(-10px);
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.featured-icon {
    font-size: 2.2rem; /* Slightly reduced */
    margin-bottom: 0.6rem; /* Reduced from 0.8rem */
    display: block;
}

.featured-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.featured-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}


/* Simple Search Section */
.search-section {
    background: #0a0a0f;
    padding: 0.6rem; /* Further reduced padding */
    position: relative;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px; /* Further reduced for compactness */
    padding: 0.3rem 1rem; /* Further reduced padding */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem; /* Further reduced margin */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); /* Reduced shadow */
}

.search-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    color: #667eea;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem; /* Reduced from 1.1rem */
    outline: none;
    padding: 0.8rem 0; /* Reduced from 1rem */
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-clear {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.search-clear.visible {
    display: block;
}

.search-filters {
    display: flex;
    gap: 0.8rem; /* Reduced from 1rem */
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1rem; /* Reduced padding */
    border-radius: 20px; /* Slightly reduced */
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease; /* Optimized */
    outline: none;
}

.filter-select:hover, .filter-select:focus {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.filter-select option {
    background: #1a1a2e;
    color: white;
}

.sort-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem; /* Reduced padding */
    border-radius: 20px; /* Consistent with filter-select */
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease; /* Optimized */
    outline: none;
}

.sort-button:hover, .sort-button.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-results {
    min-height: 80px; /* Reduced from 100px */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px; /* Reduced from 20px */
    padding: 1rem; /* Reduced from 1.5rem */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.search-results.visible {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.search-suggestions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; /* Consistent border-radius */
    padding: 1rem; /* Reduced from 1.5rem */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.8rem; /* Reduced from 1rem */
}

.suggestion-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.suggestion-tags {
    display: flex;
    gap: 0.6rem; /* Reduced from 0.8rem */
    flex-wrap: wrap;
}

.suggestion-tag {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.4rem 0.8rem; /* Reduced padding */
    border-radius: 16px; /* Slightly reduced */
    font-size: 0.85rem; /* Slightly smaller */
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease; /* Optimized */
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.suggestion-tag:hover {
    background: rgba(102, 126, 234, 0.4);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(10px);
}

.search-result-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.search-result-info h4 {
    margin: 0 0 0.5rem 0;
    color: white;
}

.search-result-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* User Collections Section */
.user-collections {
    background: #0a0a0f;
    padding: 0.8rem; /* Further reduced padding */
    position: relative;
}

.collections-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem; /* Further reduced gap */
}

.collection-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; /* Further reduced for consistency */
    padding: 1rem; /* Further reduced padding */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem; /* Reduced margin */
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); /* Slightly reduced */
    gap: 0.8rem; /* Reduced from 1rem */
}

.collection-game-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px; /* Consistent border-radius */
    padding: 0.8rem; /* Reduced from 1rem */
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease; /* Optimized */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-game-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.collection-game-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.collection-game-name {
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

.empty-collection {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 2rem;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem; /* Reduced padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(45deg, #667eea, #764ba2, #ff6b6b, #feca57);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.logo-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin-top: -5px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-list a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-list a:hover {
    color: #667eea;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.nav-list a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.nav-list a:hover::after {
    width: 100%;
}

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

/* Hero Section */
.hero {
    min-height: 20vh; /* Further reduced for compact layout */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    text-align: center;
    padding: 0.8rem 0.6rem; /* Further reduced padding */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.2rem; /* Further reduced for compact layout */
    font-weight: 900;
    margin-bottom: 0.4rem; /* Further reduced margin */
    line-height: 1.0; /* Tighter line-height */
    font-family: 'Orbitron', monospace;
}

.gradient-text {
    background: linear-gradient(45deg, #667eea, #764ba2, #ff6b6b, #feca57);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.hero-description {
    font-size: 0.9rem; /* Further reduced for compactness */
    margin-bottom: 0.8rem; /* Further reduced margin */
    opacity: 0.8;
    line-height: 1.3; /* Tighter line-height */
}

.cta-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    padding: 1rem 2rem; /* Reduced from 1.2rem 2.5rem */
    border-radius: 50px;
    font-size: 1rem; /* Reduced from 1.1rem */
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem; /* Reduced from 1rem */
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.cta-arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
    transform: translateX(5px);
}


/* Categories Section */
.categories-section {
    padding: 1rem 0.8rem; /* Further reduced padding */
    background: #0a0a0f;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 1rem; /* Further reduced margin */
}

.section-title {
    font-size: 2.2rem; /* Reduced from 2.5rem */
    font-weight: 700;
    margin-bottom: 0.6rem; /* Reduced from 0.8rem */
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.2rem;
    opacity: 0.7;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem; /* Reduced from 0.8rem */
    margin-bottom: 1.5rem; /* Reduced from 2rem */
    flex-wrap: wrap;
}

.category-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1.2rem; /* Reduced padding */
    border-radius: 20px; /* Slightly reduced */
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease; /* Optimized */
    backdrop-filter: blur(10px);
}

.category-tab:hover, .category-tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.games-container {
    max-width: 1400px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 2rem;
}

.games-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Reduced min-width */
    gap: 1rem; /* Reduced from 1.5rem */
    padding: 0 0.8rem; /* Reduced padding */
}

/* Modern Game Cards */
.game-card-modern {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; /* Consistent border-radius */
    padding: 1.2rem; /* Reduced from 1.5rem */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Optimized transitions */
    overflow: hidden;
}

.game-card-modern:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #ff6b6b, #feca57);
    border-radius: 16px; /* Matched with card border-radius */
    opacity: 0;
    transition: opacity 0.2s ease; /* Faster transition */
    z-index: -1;
}

.game-card-modern:hover .card-glow {
    opacity: 0.7;
    animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-icon {
    font-size: 2.2rem; /* Reduced from 2.5rem */
    margin-bottom: 0.6rem; /* Reduced from 0.8rem */
    display: block;
}

.card-title {
    font-size: 1.2rem; /* Reduced from 1.3rem */
    font-weight: 600;
    margin-bottom: 0.5rem; /* Reduced from 0.6rem */
    color: #fff;
}

.card-desc {
    font-size: 0.9rem; /* Reduced from 0.95rem */
    opacity: 0.8;
    margin-bottom: 1.2rem; /* Reduced from 1.5rem */
    line-height: 1.4; /* Reduced line-height */
}

/* Card stats removed for consistency - all cards now have standardized structure */

.card-actions {
    display: flex;
    gap: 0.6rem; /* Reduced from 0.8rem */
    margin-top: 0.8rem; /* Reduced from 1rem */
    align-items: center;
}

/* Favorite Button Styles */
.favorite-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    backdrop-filter: blur(5px);
}

.favorite-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    transform: scale(1.1);
    color: #ff6b6b;
}

.favorite-btn.favorited {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.favorite-btn.favorited:hover {
    background: rgba(255, 107, 107, 0.4);
    transform: scale(1.05);
}

.play-btn {
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem; /* Increased padding for better visual balance */
    border-radius: 12px; /* Consistent with card border-radius */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Standardized Card Actions - All cards now have consistent structure */


/* Removed difficulty and players indicators for consistency */

/* Category Filtering */
.category-section {
    display: none;
}

.category-section.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legacy Game Previews (from old design) */
.game-preview-2048 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 20px;
}

.tile {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; }
.tile-16 { background: #f59563; }

.game-preview-pacman {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pacman-maze {
    position: relative;
    width: 100px;
    height: 80px;
}

.pacman-player {
    position: absolute;
    top: 30px;
    left: 10px;
    width: 20px;
    height: 20px;
    background: #ffeb3b;
    border-radius: 50%;
    animation: pacmanMove 2s linear infinite;
}

.pacman-ghost {
    position: absolute;
    top: 25px;
    right: 20px;
    width: 18px;
    height: 25px;
    border-radius: 9px 9px 0 0;
    background: #f44336;
    animation: ghostFloat 2s ease-in-out infinite;
}

@keyframes pacmanMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(40px); }
}

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

.game-preview-tetris {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tetris-board {
    position: relative;
    width: 80px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.tetris-block {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 2px;
    animation: tetrisFall 3s ease-in-out infinite;
}

.tetris-i {
    background: #00f5ff;
    top: 10px;
    left: 10px;
}

.tetris-o {
    background: #ffeb3b;
    top: 30px;
    right: 10px;
}

@keyframes tetrisFall {
    0% { transform: translateY(-20px); opacity: 0; }
    50% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* Features Section */
.features {
    padding: 2rem 1.5rem; /* Reduced from 3rem 2rem */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.features-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.features-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(102, 126, 234, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

.feature-item p {
    opacity: 0.8;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #050505;
    color: white;
    padding: 3rem 2rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #feca57;
}

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

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.2rem 0;
    display: inline-block;
}

.footer-section a:hover {
    color: #667eea;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile-first responsive design improvements */

/* Enhanced mobile viewport handling */
@supports (height: 100dvh) {
    .container {
        min-height: 100dvh;
    }
    .hero {
        min-height: 50dvh;
    }
}

/* Better iOS Safari handling */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.8rem;
    }
    
    .games-carousel {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.2rem;
    }

    .collections-container {
        grid-template-columns: 1fr;
        gap: 1rem; /* Further reduced for mobile */
    }
    
    .search-filters {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .filter-select, .sort-button {
        width: 180px;
    }

    .search-section {
        padding: 1rem 0.5rem;
    }

    .user-collections {
        padding: 0.6rem; /* Further reduced for mobile */
    }
    
    .carousel-slide {
        padding: 2rem;
    }
    
    .slide-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .trending-grid {
        grid-template-columns: 1fr;
    }
    
    .comments-grid {
        grid-template-columns: 1fr;
    }
    
    .search-suggestions {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 50px; /* Reduced from 60px for mobile */
    }

    .hero {
        padding: 0.6rem 0.4rem; /* Further reduced for mobile compactness */
        min-height: 18vh; /* Further reduced for mobile */
    }

    .hero-title {
        font-size: 1.6rem; /* Further reduced for mobile compactness */
    }
    
    .header-content {
        padding: 0.6rem 0.5rem; /* Reduced padding */
        flex-direction: column;
        gap: 0.6rem; /* Reduced from 0.8rem */
    }

    .nav-list {
        gap: 0.6rem; /* Reduced from 0.8rem */
    }
    
    .category-tabs {
        gap: 0.4rem; /* Reduced from 0.5rem */
    }

    .category-tab {
        padding: 0.5rem 0.8rem; /* Reduced padding */
        font-size: 0.85rem; /* Reduced from 0.9rem */
    }
    
    .games-carousel {
        grid-template-columns: 1fr;
        gap: 1rem; /* Reduced from 1.2rem */
    }

    .section-title {
        font-size: 1.8rem; /* Reduced from 2rem */
    }

    .features-title {
        font-size: 1.6rem; /* Reduced from 1.8rem */
    }

    .categories-section {
        padding: 1rem 0.5rem; /* Reduced from 1.2rem 0.5rem */
    }

    .featured-games {
        padding: 0.6rem 0.5rem; /* Reduced from 0.8rem 0.5rem */
    }
    
    .search-wrapper {
        padding: 0.4rem 0.8rem; /* Reduced padding */
        margin-bottom: 0.8rem; /* Reduced from 1rem */
    }

    .search-input {
        font-size: 0.95rem; /* Reduced from 1rem */
    }
    
    .search-filters {
        gap: 0.4rem; /* Reduced from 0.5rem */
    }

    .filter-select, .sort-button {
        width: 100%;
        max-width: 200px; /* Reduced from 250px */
    }
    
    .carousel-title {
        font-size: 1.8rem;
    }
    
    .carousel-controls {
        gap: 0.3rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .slide-info h3 {
        font-size: 1.5rem;
    }
    
    .trending-card {
        padding: 1.5rem;
    }
    
    .comment-card {
        padding: 1.5rem;
    }
    
    .comments-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .view-more-comments, .write-comment {
        width: 100%;
        max-width: 300px;
    }
    
    .collections-container {
        padding: 0 0.5rem;
    }

    .collection-section {
        padding: 0.8rem; /* Reduced padding for mobile */
    }
    
    .collection-games {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 55px; /* Slightly reduced */
    }

    .hero {
        padding: 0.5rem 0.4rem; /* Further reduced for smallest screens */
        min-height: 16vh; /* Further reduced for compact mobile layout */
    }

    .hero-title {
        font-size: 1.4rem; /* Further reduced for smallest screens */
    }

    .logo-text {
        font-size: 1.6rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.8rem; /* Reduced from 1rem 2rem */
        font-size: 0.95rem; /* Slightly reduced from 1rem */
    }
    
    .banner-item {
        min-width: 120px;
        padding: 0.8rem 1.5rem;
    }
    
    .game-card-modern {
        padding: 1rem;
    }

    .featured-card {
        padding: 0.8rem;
    }

    .categories-section {
        padding: 0.8rem 0.5rem; /* Reduced from 1rem 0.5rem */
    }

    .features {
        padding: 1.2rem 0.5rem; /* Reduced from 1.5rem 0.5rem */
    }

    .featured-grid {
        gap: 0.8rem;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .games-carousel {
        gap: 0.8rem;
    }

    .collections-container {
        grid-template-columns: 1fr;
        gap: 0.8rem; /* Further reduced for mobile */
    }
    
    .carousel-slide {
        padding: 1.5rem;
    }
    
    .slide-info h3 {
        font-size: 1.3rem;
    }
    
    .slide-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .quick-play-btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
    }
    
    .card-icon {
        font-size: 2rem; /* Further reduced for mobile */
    }

    /* Additional mobile optimizations */
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .collection-games {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.6rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Smallest mobile optimizations */
    .hero {
        min-height: 15vh; /* Further reduced for most compact layout */
        padding: 0.4rem 0.3rem; /* Further reduced */
    }

    .hero-title {
        font-size: 1.3rem; /* Optimized for smallest screens */
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .cta-button {
        padding: 0.7rem 1.3rem; /* Further reduced */
        font-size: 0.9rem; /* Slightly smaller */
    }

    .game-card-modern {
        padding: 1rem;
    }

    .featured-card {
        padding: 0.8rem;
    }
}

/* Performance Optimizations */
/* Simplified animations for better performance */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Improved contrast ratios for accessibility */
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.65); /* Improved from 0.6 */
}

.card-desc {
    opacity: 0.85; /* Improved from 0.8 */
}

/* Critical CSS candidates for inlining */
.above-fold {
    contain: layout style paint;
}

/* Optimized font loading */
@font-face {
    font-family: 'Noto Sans KR';
    font-display: swap;
}

@font-face {
    font-family: 'Orbitron';
    font-display: swap;
}

/* Remove unused styles for production */
/* Legacy game preview animations can be removed if not used */