.desc {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.35;
    transition: 0.15s ease;
}

/* Обрезка до 2 строк */
.desc-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    /* 2 строки */
    overflow: hidden;
}

/* Навёл — показываем полностью */
.desc-clamp:hover {
    /* снять ограничение */
    display: block;
    /* важно: выходим из -webkit-box */
    overflow: visible;
    color: rgba(255, 255, 255, 0.9);
}



:root {
    --primary-dark: #0a0e17;
    --secondary-dark: #121826;
    --sega-blue: #0066cc;
    --sega-red: #cc0000;
    --neon-green: #00ff9d;
    --neon-purple: #9d00ff;
    --neon-yellow: #c7ba00;
    --accent-glow: 0 0 15px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
}

img,
video,
iframe,
canvas {
    max-width: 100%;
    height: auto;
}

body {
    font-family: "Exo 2", sans-serif;
    background-color: var(--primary-dark);
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 102, 204, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(204, 0, 0, 0.05) 0%, transparent 20%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

:lang(en) {
    font-family: "Orbitron", sans-serif;
}

/* Fullscreen Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top, rgba(0, 102, 204, 0.4), rgba(0, 0, 0, 0.9));
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.auth-overlay-content {
    max-width: 420px;
    width: 100%;
    background: rgba(10, 14, 23, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 204, 0.6);
    box-shadow: 0 0 30px rgba(0, 102, 204, 0.7);
    padding: 2rem 2.5rem;
    text-align: center;
}

.auth-overlay-content h2 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    color: var(--neon-green);
}

.auth-overlay-content p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

#authCodeInput {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 102, 204, 0.5);
    background: rgba(18, 24, 38, 0.9);
    color: #fff;
    margin-bottom: 1rem;
    outline: none;
    font-size: 1rem;
}

#authCodeInput:focus {
    border-color: var(--sega-blue);
    box-shadow: 0 0 12px rgba(0, 102, 204, 0.6);
}

.auth-error {
    margin-top: 0.8rem;
    color: var(--sega-red);
    font-size: 0.9rem;
}

main {
    flex: 1 0 auto;
}

/* Typography */
h1,
h2,
h3,
h4,
.logo,
.btn-primary {
    font-weight: 700;
    letter-spacing: 1px;
}

/* Components */
.btn-primary {
    background: linear-gradient(90deg, var(--sega-blue), var(--neon-purple));
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.6);
}

.btn-primary-en {
    background: linear-gradient(90deg, var(--neon-green), var(--neon-yellow));
}

.btn-sega {
    background: linear-gradient(90deg, var(--sega-red), var(--neon-purple)) !important;
}

/* Custom select for game versions */
.custom-select-wrapper {
    position: relative;
    max-width: 343px;
    width: 100%;
    user-select: none;
    flex: 1;
    /* Allow wrapper to be flexible */
    min-width: 0;
    /* Allow shrinking below content size */
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    background: #232946;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
    border: 1.5px solid var(--sega-blue, #0066cc);
    cursor: pointer;
    transition: box-shadow 0.2s, border 0.2s;
}

.custom-select.open {
    border-color: var(--sega-blue);
}

.custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    color: #fff;
    font-size: 1rem;
    border-radius: 6px;
    background: transparent;
}

.custom-select__trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    flex: 1;
    min-width: 0;
}

.custom-select .arrow {
    width: 0;
    height: 0;
    margin-left: 1rem;
    flex-shrink: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--sega-blue, #0066cc);
    transition: transform 0.3s;
}

.custom-select.open .arrow {
    transform: rotate(-180deg);
}

.custom-options {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #232946;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
    border: 1.5px solid var(--sega-blue, #0066cc);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    max-height: 220px;
    overflow-y: auto;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
}

.custom-select.open .custom-options {
    opacity: 1;
    pointer-events: auto;
    border-radius: 6px;
}

.custom-option {
    padding: 0.7rem 1rem;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    min-height: 46px;
}

.custom-option.selected {
    background: var(--sega-blue, #0066cc);
}

.custom-option:hover {
    background: #007bf7;
}

/* Game version select styles */
.game-list {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    /* Allow wrapping to prevent overflow */
}

.game-version-select {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #232946;
    color: #fff;
    border: 1px solid #444;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
    cursor: pointer;
}

.game-version-select:focus {
    border: 1.5px solid var(--sega-blue, #0066cc);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(0, 102, 204, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    background: linear-gradient(90deg, var(--sega-blue), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: var(--accent-glow) rgba(0, 102, 204, 0.5);
}

.logo span {
    color: var(--sega-red);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--neon-green);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--sega-blue), var(--neon-green));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sega-blue), var(--neon-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(157, 0, 255, 0.5);
}

.user-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(157, 0, 255, 0.8);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Search Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(26, 34, 54, 0.8);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: white;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--sega-blue);
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
    width: 250px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 1rem;
    color: var(--sega-blue);
    pointer-events: none;
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-search-btn:hover {
    color: var(--neon-green);
}

.mobile-menu-btn {
    display: none;
}

/* Desktop Search Dropdown Results */
.search-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--secondary-dark);
    border: 1px solid rgba(0, 102, 204, 0.5);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: none;
}

.search-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 102, 204, 0.2);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(0, 102, 204, 0.2);
}

.search-result-title {
    color: white;
    font-weight: 500;
}

.search-result-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Hero Section */
.hero {
    max-height: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 100px;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--sega-blue), var(--neon-green), var(--sega-red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(0, 102, 204, 0.7);
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    0% {
        text-shadow: 0 0 30px rgba(0, 102, 204, 0.7);
    }

    100% {
        text-shadow: 0 0 40px rgba(0, 255, 157, 0.7);
    }
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pixel decoration */
.pixel-decoration {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--neon-green);
    z-index: -1;
    opacity: 0.7;
    overflow: hidden;
    overflow-x: hidden !important;
}

.pixel-decoration-blue {
    background-color: var(--sega-blue);
}

.pixel-decoration-red {
    background-color: var(--sega-red);
}

/* Main Content */
.section-title {
    text-align: center;
    margin: 2rem 0 2rem;
    font-size: 2.5rem;
    color: white;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid rgba(0, 102, 204, 0.5);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--sega-blue);
    border-color: var(--sega-blue);
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.7);
}

/* Alphabet Filter */
.alphabet-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto 1rem;
    flex-wrap: wrap;
    border-radius: 8px;
}

.alphabet-btn {
    background-color: rgba(26, 34, 54, 0.8);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem;
    min-width: 35px;
    height: 35px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alphabet-btn:hover {
    background-color: rgba(0, 102, 204, 0.4);
    border-color: var(--sega-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.alphabet-btn.active {
    background: linear-gradient(135deg, var(--sega-blue), #0088ff);
    border-color: var(--neon-green);
    color: white;
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.7), 0 0 5px rgba(0, 255, 157, 0.3);
    transform: scale(1.05);
}

.alphabet-btn[data-letter="all"] {
    min-width: auto;
    padding: 0.4rem 1rem;
}


/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background-color: var(--secondary-dark);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 102, 204, 0.2);
    position: relative;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--neon-green);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 157, 0.2);
}

.game-card-img {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.9), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.game-card-overlay .btn-primary {
    display: none;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.game-card-info {
    padding: 1.5rem;
}

.game-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: white;
}

.game-card-meta {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.game-card-genres {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.genre-tag {
    background-color: rgba(0, 102, 204, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 102, 204, 0.5);
}

/* Game Page */
.game-page,
.catalog-page,
.my-games-page {
    display: none;
    padding: 6rem 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-page-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.game-media {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    max-height: 460px;
}

.game-media img {
    width: 100%;
    height: auto;
    display: block;
}

.game-media-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(45deg, var(--secondary-dark), #1a2236);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

/* 2 слоя для плавного переключения фото */
.game-media-placeholder .bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity .35s ease;
    z-index: 1;
}

.game-media-placeholder .bg-layer.is-visible {
    opacity: 1;
}

/* заголовок поверх фото */
.game-media-placeholder h2 {
    color: var(--neon-green);
    font-size: 2.5rem;

    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    /* по желанию */
}

.mod-author-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
    border-radius: 0 0 14px 14px;
}

.mod-author-bar span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.mod-author-link {
    color: var(--neon-green);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.mod-author-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--neon-green);
}

.author-globe {
    color: var(--sega-blue);
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.author-globe:hover {
    transform: scale(1.2);
    color: #fff;
}

.game-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-play {
    flex: 1;
}

.btn-favorites {
    background: linear-gradient(90deg, var(--sega-red), #ff3366) !important;
    flex: 1;
}

.game-stats-section {
    margin-top: 2.5rem;
}

.game-stats-section h3 {
    color: var(--neon-green);
    margin-bottom: 1rem;
}

.game-stats {
    display: flex;
    gap: 2rem;
}

.game-stat-item {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.game-stat-value {
    font-size: 2rem;
    color: var(--neon-green);
}

.game-stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.game-genres-margin {
    margin: 1rem 0;
}

.game-description {
    margin: 1.5rem 0;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

/* Emulator Modal */
.emulator-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.emulator-modal.active {
    display: flex;
    overflow: hidden;
    touch-action: none;
}

.emulator-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    background-color: var(--secondary-dark);
    border: 2px solid var(--sega-blue);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 102, 204, 0.5);
    overflow: hidden;
}

.emulator-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(0, 102, 204, 0.3);
    z-index: 2001;
}

.close-btn {
    background: none;
    border: none;
    color: var(--sega-red);
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    color: var(--neon-green);
    transform: scale(1.1);
}

.emulator-frame {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
    background-color: #000;
}

/* Footer */
footer {
    flex-shrink: 0;
    background-color: var(--secondary-dark);
    padding: 2rem 1.5rem 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 102, 204, 0.3);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-items: center;
    gap: 1.5rem;
}

.footer-section h3 {
    color: var(--neon-green);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.footer-link {
    color: #e2e2e2;
}

.footer-link:hover {
    color: var(--neon-green);
}

.footer-link-display {
    display: block;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
    color: #fff;
}
.social-icon svg {
    width: 26px;
    height: 24px;
}
.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--neon-green);
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Mobile Menu Modal */
.mobile-menu-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.mobile-menu-modal.active {
    display: flex;
}

.mobile-menu-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    /* Smaller max-width for menu */
    background-color: var(--secondary-dark);
    border: 2px solid var(--sega-blue);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 102, 204, 0.5);
    overflow: hidden;
    padding-bottom: 2rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
}

.mobile-nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
}

.mobile-nav-link:hover {
    background-color: rgba(0, 102, 204, 0.2);
    color: var(--neon-green);
    transform: translateX(5px);
}

.mobile-user-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--sega-blue), var(--neon-purple));
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.mobile-user-profile:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(157, 0, 255, 0.6);
}

/* Top Players Modal Styles */
.player-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 102, 204, 0.3);
    align-items: center;
    transition: background-color 0.2s;
}

.player-list-item:last-child {
    border-bottom: none;
}

.player-list-item:hover {
    background-color: rgba(0, 102, 204, 0.1);
}

.player-rank {
    font-weight: bold;
    color: var(--neon-green);
    width: 60px;
}

.player-name {
    flex-grow: 1;
    color: #fff;
    text-align: left;
}

.player-hours {
    color: var(--sega-blue);
    font-weight: bold;
}

/* User Profile Modal Styles */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--sega-blue);
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.5);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-stats-main {
    display: flex;
    flex-direction: column;
}

.total-time-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.total-time-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.user-game-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    transition: background-color 0.2s;
}

.user-game-item:last-child {
    border-bottom: none;
}

.user-game-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-game-name {
    color: white;
    font-weight: 500;
}

.user-game-time {
    color: var(--sega-blue);
    font-weight: bold;
}

/* Search Modal Styles */
.search-modal-content {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-modal-input {
    width: 100%;
    background: rgba(26, 34, 54, 0.8);
    border: 2px solid rgba(0, 102, 204, 0.3);
    color: white;
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-modal-input:focus {
    border-color: var(--sega-blue);
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.5);
}

.search-modal-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-modal-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sega-blue);
    font-size: 1.2rem;
    pointer-events: none;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
    font-style: italic;
}

.search-result-card {
    background: rgba(26, 34, 54, 0.6);
    border: 1px solid rgba(0, 102, 204, 0.3);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--sega-blue);
    transform: translateX(5px);
}

.search-result-card h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.search-result-card .search-result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}


/* Custom Scrollbar for Modals */
.top-players-list-container::-webkit-scrollbar,
.user-profile-content::-webkit-scrollbar {
    width: 8px;
}

.top-players-list-container::-webkit-scrollbar-track,
.user-profile-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.top-players-list-container::-webkit-scrollbar-thumb,
.user-profile-content::-webkit-scrollbar-thumb {
    background: var(--sega-blue);
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 102, 204, 0.5);
}

.top-players-list-container::-webkit-scrollbar-thumb:hover,
.user-profile-content::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
    background: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.top-players-list-container,
.user-profile-content {
    padding: 1rem 2rem;
    overscroll-behavior: contain;
    /* Prevent scroll chaining to body */
}

/* Page Header Alignment */
.page-header-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    min-height: 50px;
}

.page-header-container .btn-primary {
    position: absolute;
    left: 0;
    margin-bottom: 0;
}

.page-header-container .section-title {
    margin: 0;
    left: auto;
    transform: none;
}



/* Fix double padding in Catalog and My Games pages */
.catalog-page .games-grid,
.my-games-page .games-grid {
    padding-left: 0;
    padding-right: 0;
}

/* Page Transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Secondary Game Actions */
.game-actions-secondary {
    display: flex;
    gap: 0.8rem;
    max-width: 343px;
    width: 100%;
    flex: 1;
}

.icon-share,
.icon-error {
    flex: 1;
}

.icon-share {
    background: linear-gradient(90deg, #cc8d00, var(--neon-yellow));
}

.icon-error {
    background: linear-gradient(90deg, #FF9800, #FF5722);
}

.section-title-game {
    font-size: calc(10px + 12 * (100vw / 1400));
    max-width: 950px;
}

#emulatorModal .emulator-header {
    justify-content: flex-start;
}

.game-page-tg,
.catalog-page-tg,
.my-games-page-tg {
    padding: 8rem 2rem 3rem;
}

.header-padding {
    padding: 3rem 2rem 1rem 2rem;
}

/* Responsive Media Queries */
@media (max-width: 1265px) {
    .btn-primary {
        font-size: 0.7rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }
}

@media (max-width: 1090px) {
    .section-title-game {
        max-width: 600px;
    }
}

@media (max-width: 916px) {
    .nav-links {
        font-size: 0.8rem;
    }

    .search-input::placeholder {
        font-size: 0.8rem;
    }

}

@media (max-width: 880px) {
    .section-title-game {
        max-width: 400px;
    }
}

@media (max-width: 400px) {
    .subscribe_button {
        padding: 0.6rem 1rem;
        font-size: 0.6rem;
    }
}

@media (max-width: 860px) {

    .nav-links,
    .nav-actions .user-icon {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .nav-actions {
        gap: 1rem;
    }
}

@media (max-width: 846px) {

    .hero {
        max-height: 270px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .custom-select__trigger {
        font-size: 0.9rem;
    }

    .footer-content {
        justify-items: start;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-section p {
        font-size: 0.8rem;
    }

    .footer-link {
        font-size: 0.8rem;
    }

    .copyright {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .header-padding {
        padding: 4.5rem 2rem 0.5rem 2rem;
    }

    .hero {
        max-height: 242px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .game-page-content {
        grid-template-columns: 1fr;
    }

    .custom-select__trigger {
        font-size: 0.8rem;
    }

    .custom-option {
        font-size: 0.8rem;
    }

    /* Alphabet filter responsive */
    .alphabet-filter {
        gap: 0.3rem;
        padding: 0.8rem 1rem;
    }

    .section-title {
        left: auto;
        transform: none;
        display: block;
        margin: 1rem auto;
    }

    .alphabet-btn {
        min-width: 30px;
        height: 30px;
        padding: 0.3rem;
        font-size: 0.8rem;
    }

    /* Search modal mobile adjustments */
    .search-modal-content {
        padding: 1rem;
    }
}

@media (max-width: 710px) {
    .section-title-game {
        max-width: 300px;
    }
}

@media (max-width: 660px) {
    .hero-tg {
        margin-top: 120px;
    }

    .search-container {
        display: none;
    }

    .mobile-search-btn {
        display: block;
    }
}

@media (max-width: 600px) {

    .hero {
        max-height: 262px;
    }

    .section-title {
        margin: 1rem 0 1rem;
    }

    .page-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-top: 1rem;
    }

    .page-header-container .btn-primary {
        position: static;
        align-self: flex-start;
    }

    .page-header-container .section-title {
        align-self: center;
        width: 100%;
    }
}

@media (max-width: 496px) {
    .hero {
        max-height: 300px;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .game-media-placeholder {
        height: 300px;
    }

    .section-title {
        font-size: 2rem;
    }

    .top-players-list-container,
    .user-profile-content {
        padding: 1rem 0.8rem;
        font-size: 0.8rem;
    }

    .total-time-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 373px) {
    .yt-share-linkbox {
        flex-direction: column;
    }

    .hero {
        max-height: 340px;
    }

    .hero h1 {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .custom-select__trigger {
        font-size: 0.6rem;
    }

    .custom-option {
        font-size: 0.6rem;
    }
}

.emulator-modal-content.hide-emulator-header {
    border: 0px solid var(--sega-blue);
    border-radius: 0px;
}

:root {
    --yt-share-bg: #111;
    --yt-share-text: #fff;
    --yt-share-border: rgba(255, 255, 255, .12);
    --yt-share-muted: rgba(255, 255, 255, .85);
    --yt-share-surface: rgba(255, 255, 255, .06);
    --yt-share-surface2: rgba(255, 255, 255, .10);
    --yt-share-backdrop: rgba(0, 0, 0, .55);
}

.yt-share-backdrop {
    position: fixed;
    inset: 0;
    background: var(--yt-share-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    padding: 16px;
}

.yt-share-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.yt-share-modal {
    width: min(520px, 100%);
    background: var(--yt-share-bg);
    border: 1px solid var(--yt-share-border);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, .55);
    color: var(--yt-share-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.yt-share-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.yt-share-title {
    font-size: 16px;
    font-weight: 700;
}

.yt-share-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
}

.yt-share-close:hover {
    background: rgba(255, 255, 255, .08);
}

.yt-share-row {
    margin-top: 12px;
}

.yt-share-subtitle {
    font-size: 13px;
    color: var(--yt-share-muted);
    margin-bottom: 8px;
}

.yt-share-linkbox {
    display: flex;
    gap: 8px;
}

.yt-share-input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, .14);
    background: var(--yt-share-surface);
    color: inherit;
    padding: 10px 12px;
    border-radius: 12px;
    outline: none;
}

.yt-share-copy {
    border: 1px solid rgba(255, 255, 255, .14);
    background: var(--yt-share-surface2);
    color: inherit;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.yt-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yt-share-action {
    border: 1px solid rgba(255, 255, 255, .14);
    background: var(--yt-share-surface);
    color: inherit;
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.yt-share-action:hover {
    background: var(--yt-share-surface2);
}

.yt-share-note {
    margin-top: 12px;
    opacity: .8;
    font-size: 12px;
}

.yt-share-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, .95);
    border: 1px solid var(--yt-share-border);
    padding: 10px 12px;
    border-radius: 999px;
    z-index: 1000000;
    font-size: 13px;
    color: var(--yt-share-text);
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
}

.yt-share-toast.show {
    opacity: 1;
}

.layout-game-info {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 660px;
    width: 100%;
    padding: 10px;
}

.img-game-info {
    margin-top: 10px;
}