* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #1a1a3a;
}

.navbar {
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: #1a1a3a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    height: 60px;
    position: relative;
    font-weight: 600;
}

.nav-brand {
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-brand i {
    font-size: 32px;
    margin-right: 10px;
    color: #00c7ff;
}

.brand-text {
    font-size: 24px;
    font-weight: bold;
    color: #00c7ff;
}

.highlight {
    color: #ffdd00;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-right: auto;
    height: 100%;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    padding: 0 15px;
    height: 60px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #ffdd00;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: height 0.3s ease;
    z-index: -1;
}

.nav-links a:hover::before {
    height: 100%;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 15px;
}

.search-input {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px;
    width: 200px;
    outline: none;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Montserrat', sans-serif;
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.search-button i {
    font-size: 16px;
}

.search-button:hover {
    transform: scale(1.1);
}

.games-container {
    max-width: 1440px; /* Accommodates 8 cards of 175px + gaps */
    margin: 2rem auto;
    padding: 0 1rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(8, 175px);
    gap: 0.8rem;
    justify-content: center;
}

.game-card {
    position: relative;
    width: 175px;
    height: 175px;
    background: #2a2a4a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.game-card:hover {
    border-color: #ffdd00;
    box-shadow: 0 0 15px rgba(255, 221, 0, 0.5);
}

.game-card a {
    text-decoration: none;
    color: #333;
    display: block;
    height: 100%;
    position: relative;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.1);
}

.game-card h3 {
    position: absolute;
    width: 100%;
    padding: 0.4rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    font-size: 0.8rem;
    font-weight: 600;
    bottom: -100%;
    left: 0;
    margin: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.game-card:hover h3 {
    bottom: 0;
    background-color: #ffdd00;
}

.random-game-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.random-game-btn {
    background: linear-gradient(45deg, #ff4e50, #f9d423);
    border: none;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.random-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.random-game-btn i {
    font-size: 1.4rem;
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #ffdd00;
    color: #1a1a3a;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    background-color: #ffe433;
}

.scroll-top-btn.visible {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.games-menu {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.games-menu h2 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    justify-content: center;
}

.category-card {
    display: flex;
    align-items: center;
    background: #2a2a4a;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: #00c7ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 199, 255, 0.3);
}

.category-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
    transition: transform 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card span {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

/* Media Queries for Category Grid */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-card {
        padding: 0.5rem;
    }
    .category-card img {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    .category-card span {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1440px) {
    .games-container {
        max-width: 1260px;
    }
    .games-grid {
        grid-template-columns: repeat(7, 175px);
    }
}

@media (max-width: 1260px) {
    .games-container {
        max-width: 1080px;
    }
    .games-grid {
        grid-template-columns: repeat(6, 175px);
    }
}

@media (max-width: 1080px) {
    .games-container {
        max-width: 900px;
    }
    .games-grid {
        grid-template-columns: repeat(5, 175px);
    }
}

@media (max-width: 900px) {
    .games-container {
        max-width: 720px;
    }
    .games-grid {
        grid-template-columns: repeat(4, 175px);
    }
}

@media (max-width: 720px) {
    .games-container {
        max-width: 540px;
    }
    .games-grid {
        grid-template-columns: repeat(3, 175px);
    }
}

@media (max-width: 540px) {
    .games-container {
        max-width: 360px;
    }
    .games-grid {
        grid-template-columns: repeat(2, 175px);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 20px;
    }
    
    .nav-links {
        order: 2;
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        height: 40px;
    }
    
    .search-container {
        margin-left: auto;
    }
}

@media (max-width: 1600px) {
    .games-container {
        max-width: 1400px;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Game Page Styles */
.game-page-container {
    display: flex;
    padding: 20px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-sidebar {
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-card {
    width: 120px;
    height: 120px;
    margin: 0;
}

.sidebar-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-card h3 {
    font-size: 12px;
    padding: 5px;
}

.game-content {
    flex-grow: 1;
}

.game-title {
    margin: 20px 0;
    font-size: 24px;
    color: #333;
}

#game-frame {
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Text Section Styles */
.text-section {
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 2rem 0;
}

.text-content {
    color: #fff;
    line-height: 1.6;
}

.text-content h2 {
    color: #fff;
    margin: 1.5rem 0 1rem;
    font-size: 1.5rem;
}

.text-content p {
    margin-bottom: 1rem;
}

.game-link {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.3s;
}

.game-link:hover {
    color: #ff00ff;
}

.contact-link {
    color: #00ffff;
    text-decoration: none;
}

.contact-link:hover {
    color: #ff00ff;
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.show-more-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-top: 1rem;
    background: none;
    border: none;
    color: #00ffff;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.show-more-btn:hover {
    color: #ff00ff;
}

.show-more-btn i {
    margin-left: 0.5rem;
}

/* Footer Styles */
.site-footer {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    text-align: center;
    margin-top: 2rem;
}

.footer-links {
    color: #fff;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #00ffff;
}

.copyright {
    margin-left: 0.5rem;
    color: #888;
}

.random-game-button {
    display: flex;
    justify-content: center;
    width: calc(8 * 130.75px + 7 * 15px);
    margin: 20px auto;
    margin-left: 20px;
}

.random-game-button button {
    border: none;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border-radius: 25px;
    cursor: pointer;
    padding: 12px 30px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.random-game-button button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.random-game-button i {
    font-size: 20px;
}