:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --text: #2b2b2b;
    --text-light: #6c757d;
    --bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    background: var(--white);
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    padding-left: 5%;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text);
    cursor: pointer;
}

.nav {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 80%;
    max-width: 300px;
    background: var(--white);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: right 0.3s ease;
    z-index: 99;
}

.nav.active {
    right: 0;
}

.filter-button {
    display: block;
    padding: 8px 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-button.active {
    color: var(--primary);
    font-weight: 600;
}

/* Hero Section */
.hero {
    padding: 25px 0;
    text-align: center;
}

.hero-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--text-light);
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px 0 0 25px;
    font-size: 1rem;
}

.search-button {
    padding: 0 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
}

/* Games List */
.games-section {
    padding: 20px 0 40px;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-list {
    display: grid;
    gap: 15px;
}

.game-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
    margin-bottom: 15px;
}

.game-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.game-badge.new {
    background: #28a745;
}

.game-badge.popular {
    background: #dc3545;
}

.game-badge.top100 {
    background: #007bff;
}

.card-content {
    display: flex;
    padding: 15px;
    gap: 12px;
}

.game-image-container {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.game-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    flex: 1;
    min-width: 0;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    min-height: 1.8em;
}

.game-title {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding-right: 10px;
}

.game-rating {
    color: #ffc107;
    font-size: 0.85rem;
    white-space: nowrap;
}

.game-genre {
    display: block;
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.description-container {
    position: relative;
    margin-top: 5px;
}

.game-description {
    font-size: 0.8rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em;

    /* Современный способ с line-clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -moz-box;
    -moz-box-orient: vertical;
    -moz-line-clamp: 2;
    display: box;
    box-orient: vertical;
    line-clamp: 2;
}

.info-tooltip {
    position: absolute;
    right: 0;
    bottom: 0;
    color: var(--primary);
    cursor: help;
    font-size: 0.9rem;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 10;
    pointer-events: none;
}

.info-tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

.download-btn {
    align-self: center;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-btn:hover {
    background: var(--primary-dark);
}

.download-btn i {
    font-size: 0.8rem;
}

/* Footer */
.footer {
    background: var(--white);
    padding: 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    color: var(--text-light);
    font-size: 1.2rem;
}

/* Responsive */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .nav {
        position: static;
        width: auto;
        background: transparent;
        box-shadow: none;
        display: flex;
        gap: 20px;
        padding: 0;
    }

    .filter-button {
        border: none;
        padding: 5px 0;
    }

    .card-content {
        padding: 20px;
    }

    .game-image-container {
        width: 80px;
        height: 80px;
    }
}

/* Hidden state for filtering */
.game-card.hidden {
    display: none !important;
}

/* Добавьте в styles.css */
.game-card.search-hidden {
    display: none !important;
}

#noResults {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 1rem;
}

/* Carousel Styles */
.carousel-section {
    padding: 20px 0;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    margin: 0 -15px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    padding: 0 15px;
    transition: transform 0.5s ease;
    will-change: transform;
}

.carousel-item {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-item:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.carousel-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.carousel-title {
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (min-width: 768px) {
    .carousel-item {
        flex: 0 0 100px;
    }

    .carousel-icon {
        width: 80px;
        height: 80px;
    }
}