/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #0f1117;
    color: #ffffff;
    min-height: 200vh; /* Для демонстрации скролла */
}

/* Контейнер */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Верхняя служебная панель */
.top-bar {
    background: linear-gradient(to bottom, #0a0b10, #0f1117);
    height: 32px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    color: #8b949e;
}

.status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff9d;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.announcement {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Модальное окно авторизации */
.auth-modal {
    display: none;
    position: absolute;
    top: 32px;
    right: 24px;
    width: 300px;
    background-color: #1a1d28;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2000;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.auth-modal.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-header h3 {
    font-family: 'Exo 2', sans-serif;
    font-size: 18px;
    color: #ffffff;
}

.close-auth {
    color: #8b949e;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.close-auth:hover {
    color: #ffffff;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-btn {
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ddd;
}

.google-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.yandex-btn {
    background-color: #fc3f1d;
    color: white;
}

.yandex-btn:hover {
    background-color: #e63616;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 63, 29, 0.3);
}

.email-btn {
    background-color: transparent;
    color: #8b949e;
    border: 1px solid #434956;
}

.email-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #434956;
}

.auth-divider span {
    background-color: #1a1d28;
    padding: 0 10px;
    color: #8b949e;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.auth-footer {
    text-align: center;
    font-size: 13px;
    color: #8b949e;
}

.register-link {
    color: #00d1ff;
    text-decoration: none;
    font-weight: 500;
}

.register-link:hover {
    text-decoration: underline;
}

/* Затемнение фона при открытой модалке */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
}

.overlay.active {
    display: block;
}

.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-switcher a {
    color: #8b949e;
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: #00d1ff;
}

.top-links a {
    color: #8b949e;
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.top-links a:hover {
    color: #ffffff;
}

.separator {
    color: #434956;
}

/* Основной хедер */
.main-header {
    background-color: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-header.scrolled {
    height: 64px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d1ff, #8a2be2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-family: 'Exo 2', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(to right, #00d1ff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Навигационное меню */
.nav-menu {
    display: flex;
    gap: 32px;
    margin-left: 40px;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    color: #00d1ff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00d1ff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.dropdown-arrow {
    font-size: 12px;
    margin-top: 2px;
}

.badge {
    background-color: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Правая часть хедера */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-icon {
    width: 24px;
    height: 24px;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.action-icon:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.icon-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #00d1ff;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопка "Играть сейчас" */
.play-button {
    background: linear-gradient(45deg, #00d1ff, #0099ff);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 209, 255, 0.4);
    margin-left: 12px;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 209, 255, 0.6);
}

/* Поиск */
.search-container {
    position: relative;
}

.search-input {
    width: 0;
    opacity: 0;
    padding: 8px 16px 8px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s ease;
    position: absolute;
    right: 0;
    top: -8px;
}

.search-input.active {
    width: 240px;
    opacity: 1;
}

.search-input:focus {
    outline: none;
    border-color: #00d1ff;
    background-color: rgba(255, 255, 255, 0.08);
}

.search-icon {
    position: relative;
    z-index: 2;
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #8b949e;
}

/* Контент для демонстрации */
.demo-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background-color: rgba(26, 29, 40, 0.5);
    border-radius: 20px;
    text-align: center;
}

.demo-content h1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 36px;
    margin-bottom: 20px;
    color: #00d1ff;
}

.demo-content p {
    color: #b0b7c3;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 20px;
        margin-left: 20px;
    }
}

@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .top-bar {
        font-size: 11px;
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 8px 16px;
        gap: 8px;
        text-align: center;
    }
    
    .status, .top-links {
        width: 100%;
        justify-content: center;
    }
    
    .main-header {
        height: 70px;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .play-button {
        padding: 10px 16px;
        font-size: 14px;
        margin-left: 0;
    }
    
    .logo-text {
        display: none;
    }

    .auth-modal {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        width: 280px;
    }
    
    .auth-modal.active {
        transform: translateX(50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .header-actions .action-icon:nth-child(2),
    .header-actions .action-icon:nth-child(3) {
        display: none;
    }
    
    .play-button span {
        display: none;
    }
    
    .play-button::before {
        content: "🎮";
        font-size: 18px;
    }
}

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #667eea;
    color: #ffffff;
    min-height: 100vh;
}

/* Контейнер */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Верхняя служебная панель */
.top-bar {
    background: linear-gradient(to bottom, #0a0b10, #0f1117);
    height: 32px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    color: #8b949e;
}

.status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff9d;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.announcement {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-switcher a {
    color: #8b949e;
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: #00d1ff;
}

.top-links a {
    color: #8b949e;
    text-decoration: none;
    transition: color 0.2s;
}

.top-links a:hover {
    color: #ffffff;
}

.separator {
    color: #434956;
}

/* Основной хедер */
.main-header {
    background-color: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-header.scrolled {
    height: 64px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d1ff, #8a2be2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-family: 'Exo 2', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(to right, #00d1ff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Навигационное меню */
.nav-menu {
    display: flex;
    gap: 32px;
    margin-left: 40px;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    color: #00d1ff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00d1ff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.dropdown-arrow {
    font-size: 12px;
    margin-top: 2px;
}

.badge {
    background-color: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Правая часть хедера */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-icon {
    width: 24px;
    height: 24px;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.action-icon:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.icon-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #00d1ff;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопка "Играть сейчас" */
.play-button {
    background: linear-gradient(45deg, #00d1ff, #0099ff);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 209, 255, 0.4);
    margin-left: 12px;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 209, 255, 0.6);
}

/* Поиск */
.search-container {
    position: relative;
}

.search-input {
    width: 0;
    opacity: 0;
    padding: 8px 16px 8px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s ease;
    position: absolute;
    right: 0;
    top: -8px;
}

.search-input.active {
    width: 240px;
    opacity: 1;
}

.search-input:focus {
    outline: none;
    border-color: #00d1ff;
    background-color: rgba(255, 255, 255, 0.08);
}

.search-icon {
    position: relative;
    z-index: 2;
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #8b949e;
}

/* Контент для демонстрации */
.demo-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background-color: rgba(26, 29, 40, 0.5);
    border-radius: 20px;
    text-align: center;
}

.demo-content h1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 36px;
    margin-bottom: 20px;
    color: #00d1ff;
}

.demo-content p {
    color: #b0b7c3;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 20px;
        margin-left: 20px;
    }
}

@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .top-bar {
        font-size: 11px;
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 8px 16px;
        gap: 8px;
        text-align: center;
    }
    
    .status, .top-links {
        width: 100%;
        justify-content: center;
    }
    
    .main-header {
        height: 70px;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .play-button {
        padding: 10px 16px;
        font-size: 14px;
        margin-left: 0;
    }
    
    .logo-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-actions .action-icon:nth-child(2),
    .header-actions .action-icon:nth-child(3) {
        display: none;
    }
    
    .play-button span {
        display: none;
    }
    
    .play-button::before {
        content: "🎮";
        font-size: 18px;
    }
}

/* Глобальные стили таймеров для игр на время */

.stopwatch-display.hidden {
    display: none !important;
}

.stopwatch-display {
    z-index: 100;
    position: absolute;
    top: 20px; 
    left: 20px; /* На десктопе слева */
    transform: none; /* Убираем центрирование */
    background: #fff;
    border: 2px solid #333;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: #1a1a1a;
    font-family: monospace;
    padding: 10px 15px;
}

.stopwatch-display .time-row {
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.stopwatch-display .time-row:last-child {
    margin-bottom: 0;
}

.stopwatch-display .time-row .time {
    color: #1a1a1a;
    font-weight: bold;
    font-size: 1.5rem;
    font-family: 'Courier New', Courier, monospace; /* Явно указываем моноширинный шрифт для цифр */
    letter-spacing: 1px; /* Чуть разрядим для читаемости */
}

.stopwatch-display .time-row .label {
    color: #555;
    font-weight: bold;
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stopwatch-display .time-row.active {
    background: rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    padding: 4px;
    border: 1px solid #10b981;
}

@media (max-width: 1000px) {

.stopwatch-display.hidden {
    display: none !important;
}

.stopwatch-display {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center; /* Выравнивание элементов по одной линии */
        gap: 15px;
        width: fit-content;
        padding: 8px 12px;
    }
    .stopwatch-display .time-row {
        margin-bottom: 0; /* Убираем margin, чтобы они стояли ровно */
        flex: 1; /* Чтобы были одинаковой ширины */
    }
    .stopwatch-display .time-row .time {
        font-size: 1.2rem; /* Чуть меньше шрифт, чтобы меньше места занимали */
    }
    .stopwatch-display .time-row .label {
        font-size: 0.65rem;
    }
}

/* Динамические отступы в зависимости от видимости таймера */

/* Десктоп - таймер виден (таймер слева, поэтому поле не сдвигаем) */
.stopwatch-display:not(.hidden) ~ .game-area {
    padding-top: 20px;
}

/* Мобилка - таймер виден */
@media (max-width: 1000px) {
    .stopwatch-display:not(.hidden) ~ .game-area {
        padding-top: 90px;
    }
}

/* Когда таймер скрыт, поле подтягивается */
.stopwatch-display.hidden ~ .game-area {
    padding-top: 20px; /* Либо 50px если нужно чуть ниже меню */
}
