* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    /* Prevent long text from overflowing */
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-bg: #0f0f23;
    --card-bg: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --border-color: rgba(255, 255, 255, 0.1);
}

html {
    width: 100%;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    background: #0a0a15;
    /* Ensure background matches */
}

/* Prevent Media Overflow */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Header */
.header {
    width: 100%;
    /* Fallback */
    width: -webkit-fill-available;
    background: rgba(10, 10, 21, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    /* Forces stretch */
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: block;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    flex-wrap: wrap;
    /* Allow wrapping to prevent overflow */
}

.logo {
    font-size: 26px;
    font-weight: 900;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
    white-space: nowrap;
    /* Keep logo on one line */
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.logo-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-icon {
    font-size: 18px;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px;
}

.header-search-input {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 14px;
    width: 250px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    width: 300px;
}

.header-search-input::placeholder {
    color: var(--text-secondary);
}

.header-search-btn {
    background: var(--primary-gradient);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
}

.hamburger {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.15) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 64px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(102, 126, 234, 0.5);
}

.game-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    /* Strict 4:3 Ratio (800x600 equivalent) */
    height: auto;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

/* Game Overlay & Play Button - Hidden Global Override */
.game-overlay,
.play-button,
.play-icon {
    display: none !important;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.game-info {
    padding: 20px;
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.game-category {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--category-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: var(--category-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.category-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.category-description {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* --- Game Play Page Styles --- */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* --- Game Play Page Styles --- */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.game-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 30px;
    margin-bottom: 60px;
    align-items: start;
    width: 100%;
}

.game-main {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    width: 100%;
    min-width: 0;
    /* Center text/content if game is smaller */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-frame-wrapper {
    position: relative;
    background: #000;
    width: 100%;
    /* STRICT 800x600 Constraint as requested */
    max-width: 800px;
    height: 600px;
    margin: 0 auto;
    /* Center the player */
}

.game-frame {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    /* Container for absolute children */
    background: #000;
    overflow: hidden;
    display: block;
}

.game-frame iframe,
.game-frame object,
.game-frame embed,
.game-frame canvas,
.game-frame>div {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.game-details {
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    align-self: flex-start;
    /* Reset flex alignment for details */
    text-align: left;
}

.game-header {
    margin-bottom: 25px;
}

.game-title-main {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 900;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    word-wrap: break-word;
    line-height: 1.2;
}

.game-meta-bar {
    display: flex;
    gap: 15px 20px;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.rating-display,
.stars,
.action-buttons,
.share-buttons,
.game-sidebar {
    display: flex;
}

.rating-display,
.stars {
    align-items: center;
    gap: 8px;
}

.stars {
    gap: 4px;
}

.action-buttons {
    gap: 12px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.game-sidebar {
    flex-direction: column;
    gap: 25px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* Buttons & Elements */
.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 10;
}

.fullscreen-btn:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: scale(1.05);
}

.star {
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star.filled {
    color: #ffd700;
}

.star.empty {
    color: #444;
}

.star:hover {
    transform: scale(1.2);
}

.action-btn {
    flex: 1;
    min-width: 180px;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-favorite {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-favorite.active {
    background: var(--secondary-gradient);
    border-color: transparent;
    color: white;
}

.btn-favorite:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.3);
}

.share-btn {
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-facebook {
    background: #1877f2;
}

.share-twitter {
    background: #1da1f2;
}

.share-whatsapp {
    background: #25d366;
}

.share-copy {
    background: var(--primary-gradient);
}

/* Sidebar Items */
.sidebar-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    overflow: hidden;
}

.sidebar-games-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Increased gap */
}

.sidebar-game-item {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    width: 100%;
    overflow: hidden;
}

.sidebar-game-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-game-thumb {
    width: 120px;
    /* Larged thumbnail 4:3 */
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.sidebar-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-game-item:hover .sidebar-game-thumb img {
    transform: scale(1.1);
}

.sidebar-game-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-game-title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    /* Larger Text */
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-game-title:hover {
    color: #667eea;
}

.sidebar-game-cat {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    position: relative;
    margin-top: 80px;
    padding: 100px 0 30px;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.footer-wave svg path {
    fill: #0a0a15;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-about {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-icon {
    font-size: 36px;
}

.footer-logo h3 {
    font-size: 24px;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.footer-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright,
.footer-tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.logo-icon,
.social-link:hover {
    animation-play-state: running;
}

/* --- Game Loader (Click to Play) Styles --- */
.game-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    transition: background 0.3s ease;
}

.game-loader:hover .loader-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.btn-play-game {
    position: relative;
    z-index: 6;
    background: var(--primary-gradient);
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    color: white;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-btn 2s infinite;
}

@keyframes pulse-btn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.btn-play-game:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.8);
    animation: none;
}

.play-icon-large {
    font-size: 24px;
}


/* --- Hardened Mobile & Layout Fixes (Final) --- */
@media (max-width: 1024px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
        max-width: 100%;
    }

    .game-wrapper {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .game-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .game-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
        overflow: visible;
    }

    .header-search {
        order: 3;
        width: 100%;
        margin: 0;
    }

    .header-search-input {
        width: 100% !important;
        max-width: 100%;
    }

    .site-logo {
        max-height: 40px;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 5px;
        transition: right 0.4s;
        z-index: 1000;
    }

    .nav.active {
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .logo {
        max-width: 100%;
        white-space: normal;
        word-break: break-all;
    }

    .share-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .footer-about,
    .footer-section {
        width: 100%;
        max-width: 100%;
    }

    .game-frame {
        height: 56.25vw;
        /* Maintain ratio on mobile, but respecting new 600px desktop rule above */
        min-height: 300px;
        max-height: 600px;
    }

    .sidebar-game-thumb {
        width: 90px;
        height: auto;
        aspect-ratio: 4/3;
    }
}