/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Premium Colors */
    --bg-color: #0f172a;
    --bg-gradient-start: #1e293b;
    --bg-gradient-end: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-glass: rgba(255, 255, 255, 0.05);
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-tertiary: #a855f7;
    --accent-hover: #0ea5e9;
    --accent-soft: rgba(56, 189, 248, 0.1);
    --border-soft: rgba(255, 255, 255, 0.1);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 16px 48px rgba(56, 189, 248, 0.3);
    --shadow-premium: 0 20px 60px rgba(0, 0, 0, 0.5);
    --radius-large: 24px;
    --radius-medium: 16px;
    --radius-small: 12px;

    /* Premium Gradients */
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #a855f7 100%);
    --gradient-card: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    --gradient-shine: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient-start);
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(129, 140, 248, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(56, 189, 248, 0.2) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    z-index: -1;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Touch-friendly improvements */
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

/* Improve text readability on mobile */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent text selection on interactive elements */
.game-card,
.filter-btn,
.play-btn,
.nav-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in content areas */
.game-card-description,
.hero-subtitle,
.content-section p {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header:hover::after {
    opacity: 1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-main);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    font-weight: 700;
    letter-spacing: -0.5px;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 3rem 0 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    letter-spacing: -1px;
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Search Box */
.search-container {
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.8rem;
    font-size: 1rem;
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-large);
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.3), 0 0 0 4px var(--accent-soft);
    transform: translateY(-2px);
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.7rem 1.8rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-large);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    opacity: 0.2;
    z-index: 0;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

/* ========================================
   Main Content
   ======================================== */
.main {
    flex: 1;
    padding: 2rem 0 4rem;
}

/* ========================================
   Most Played Section
   ======================================== */
.most-played-section {
    padding: 3rem 0 2rem;
    background: rgba(56, 189, 248, 0.03);
    border-radius: var(--radius-large);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.most-played-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.1), transparent 50%),
        radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.1), transparent 50%);
    pointer-events: none;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.most-played-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.most-played-card {
    position: relative;
}

.most-played-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.play-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* ========================================
   Games Grid
   ======================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Game Card */
.game-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-soft);
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-shine);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-premium);
    border-color: var(--accent);
    background: rgba(30, 41, 59, 0.9);
}

.game-thumbnail {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    background: var(--gradient-card);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-soft);
}

.game-thumbnail::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.game-thumbnail::after {
    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;
}

.game-card:hover .game-thumbnail::after {
    left: 100%;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.game-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.game-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.5;
}

.game-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.game-category {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(56, 189, 248, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--accent);
    border-radius: var(--radius-small);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
}

.game-card:hover .game-category {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.play-btn {
    padding: 0.7rem 1.8rem;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-btn:hover::before {
    width: 300px;
    height: 300px;
}

.play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.5);
    animation: gradientShift 2s ease infinite;
}

.play-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========================================
   Game Page Styles
   ======================================== */
.game-page {
    background: var(--bg-color);
}

.game-container {
    flex: 1;
    padding: 2rem 0;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.game-badges {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid;
}

.badge-category {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.badge-difficulty {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.game-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Game Frame */
.game-frame-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
}

.game-frame-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-icon {
    font-size: 1.3rem;
    line-height: 1;
}

/* Fullscreen mode styles */
.game-frame-wrapper:fullscreen {
    background: #000;
}

.game-frame-wrapper:fullscreen .game-frame-container {
    padding-top: 0;
    height: 100%;
}

.game-frame-wrapper:fullscreen .game-iframe {
    width: 100%;
    height: 100%;
}

/* Webkit fullscreen support */
.game-frame-wrapper:-webkit-full-screen {
    background: #000;
}

.game-frame-wrapper:-webkit-full-screen .game-frame-container {
    padding-top: 0;
    height: 100%;
}

.game-frame-wrapper:-webkit-full-screen .game-iframe {
    width: 100%;
    height: 100%;
}

/* Mozilla fullscreen support */
.game-frame-wrapper:-moz-full-screen {
    background: #000;
}

.game-frame-wrapper:-moz-full-screen .game-frame-container {
    padding-top: 0;
    height: 100%;
}

.game-frame-wrapper:-moz-full-screen .game-iframe {
    width: 100%;
    height: 100%;
}

/* MS fullscreen support */
.game-frame-wrapper:-ms-fullscreen {
    background: #000;
}

.game-frame-wrapper:-ms-fullscreen .game-frame-container {
    padding-top: 0;
    height: 100%;
}

.game-frame-wrapper:-ms-fullscreen .game-iframe {
    width: 100%;
    height: 100%;
}

/* Game Error */
.game-error {
    text-align: center;
    padding: 4rem 2rem;
}

.game-error h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.game-error p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-medium);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem 0 1.5rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    margin-top: auto;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.5;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    position: relative;
    padding-left: 1rem;
}

.footer-links a::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.footer-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(8px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-soft);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    position: relative;
}

.footer-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: var(--gradient-primary);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .games-grid,
    .most-played-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Desktop (1024px - 1399px) - Default styles apply */

/* Tablet Landscape (769px - 1023px) */
@media (max-width: 1023px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .games-grid,
    .most-played-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.8rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .game-card-title {
        font-size: 1.2rem;
    }

    .search-input {
        padding: 1rem 1.5rem;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.8rem;
    }

    .nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Hero */
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* Search & Filters */
    .search-container {
        max-width: 100%;
        margin-bottom: 1.2rem;
    }

    .category-filters {
        gap: 0.6rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    /* Games Grid */
    .games-grid,
    .most-played-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    /* Game Cards */
    .game-card {
        border-radius: 16px;
    }

    .game-thumbnail {
        height: 150px;
        font-size: 3.5rem;
    }

    .game-info {
        padding: 1.2rem;
    }

    .game-card-title {
        font-size: 1.1rem;
    }

    .game-card-description {
        font-size: 0.85rem;
    }

    .game-category {
        font-size: 0.75rem;
        padding: 0.4rem 0.9rem;
    }

    .play-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }

    /* Most Played Section */
    .most-played-section {
        padding: 2rem 0 1.5rem;
        margin: 1.5rem 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .most-played-badge {
        padding: 0.3rem 0.7rem;
        font-size: 0.7rem;
    }

    /* Game Page */
    .game-title {
        font-size: 2rem;
    }

    .game-badges {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Footer */
    .footer {
        padding: 2.5rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 0 1rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-links a {
        padding-left: 0;
    }

    .footer-links a::before {
        display: none;
    }

    .footer-links a:hover {
        transform: translateX(0);
    }

    .footer-bottom {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Mobile Landscape & Small Tablet (481px - 767px) */
@media (max-width: 640px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .games-grid,
    .most-played-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.2rem;
    }

    .game-thumbnail {
        height: 130px;
        font-size: 3rem;
    }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }

    /* Header */
    .header {
        position: relative;
    }

    .header-content {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding: 0.8rem 0;
    }

    .logo {
        font-size: 1.1rem;
        justify-content: center;
    }

    .logo-icon {
        font-size: 1.6rem;
    }

    .logo-text {
        font-size: 0.95rem;
    }

    .nav {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    /* Hero */
    .hero {
        padding: 1.8rem 0 1.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        padding: 0 0.5rem;
        line-height: 1.5;
    }

    /* Search & Filters */
    .search-container {
        margin-bottom: 1rem;
    }

    .search-input {
        padding: 0.9rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .category-filters {
        gap: 0.5rem;
        padding: 0 0.2rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    /* Games Grid */
    .games-grid,
    .most-played-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    /* Game Cards */
    .game-card {
        max-width: 100%;
        border-radius: 14px;
    }

    .game-thumbnail {
        height: 140px;
        font-size: 3.5rem;
    }

    .game-info {
        padding: 1rem;
    }

    .game-card-title {
        font-size: 1.05rem;
    }

    .game-card-description {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .game-card-footer {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
    }

    .game-category {
        text-align: center;
    }

    .play-btn {
        width: 100%;
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    /* Most Played Section */
    .most-played-section {
        padding: 1.5rem 0 1rem;
        margin: 1rem 0;
        border-radius: 16px;
    }

    .section-title {
        font-size: 1.4rem;
        padding-bottom: 0.8rem;
    }

    .section-title::after {
        width: 80px;
        height: 3px;
    }

    .most-played-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        top: 8px;
        right: 8px;
    }

    .play-count {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    /* Game Page */
    .game-container {
        padding: 1.5rem 0;
    }

    .game-header {
        margin-bottom: 1.5rem;
    }

    .game-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .game-badges {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .game-description {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    /* Fullscreen Button */
    .fullscreen-btn {
        top: 10px;
        right: 10px;
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        gap: 2rem;
        padding: 0 0.8rem;
        margin-bottom: 1.5rem;
    }

    .footer-section h3 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    .footer-section p {
        font-size: 0.82rem;
        line-height: 1.5;
    }

    .footer-links li {
        margin-bottom: 0.4rem;
    }

    .footer-links a {
        font-size: 0.82rem;
    }

    .footer-bottom {
        padding-top: 1.5rem;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .footer-bottom::before {
        width: 150px;
    }

    .footer-bottom p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* No Results */
    .no-results {
        padding: 3rem 1rem;
        font-size: 1rem;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }

    .filter-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.75rem;
    }

    .game-thumbnail {
        height: 120px;
        font-size: 3rem;
    }

    .game-card-title {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.2rem;
    }
}

/* Landscape Orientation Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .search-container {
        margin-bottom: 0.8rem;
    }

    .most-played-section {
        padding: 1.5rem 0 1rem;
    }

    .footer {
        padding: 1.5rem 0 1rem;
    }
}

/* Print Styles */
@media print {

    .header,
    .footer,
    .category-filters,
    .search-container,
    .particles {
        display: none;
    }

    .game-card {
        page-break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}