/* index.html (вход и выбор игры) — стили только для этой страницы (вынесено из style.css) */
#playArea h2 {
    margin-bottom: 18px;
}

#playersNamesBlock {
    display: none;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 600;
    color: #3e2c3b;
    padding: 14px 20px;
    background: rgba(255,255,255,0.5);
    border-radius: 60px;
    backdrop-filter: blur(8px);
    margin-bottom: 20px;
    border: 1px solid rgba(199,125,154,0.2);
    box-shadow: 0 4px 20px rgba(199,125,154,0.08);
}
#playersNamesBlock .heart {
    color: #e57373;
    margin: 0 10px;
}
#playersNamesBlock span:first-child { color: #c77d9a; }
#playersNamesBlock span:last-child { color: #c77d9a; }

.mode-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin: 20px 0;
}
.mode-card {
    flex: 1 1 200px;
    max-width: 280px;
    background: white;
    padding: 24px 16px;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    transition: 0.25s ease;
    text-align: center;
}
.mode-card .icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}
.mode-card h3 {
    font-size: 1.2rem;
    color: #3e2c3b;
    margin-bottom: 8px;
}
.mode-card p {
    color: #6a5a66;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}
.mode-card .btn {
    font-size: 1rem;
    padding: 12px 24px;
    width: 100%;
}

.games-loading {
    text-align: center;
    color: #8f7a8a;
    padding: 24px 0;
}
.games-empty {
    text-align: center;
    color: #8f7a8a;
    padding: 24px 0;
}
.games-section {
    margin-bottom: 16px;
    background: #fbf6f8;
    border: 1px solid #eedfe7;
    border-radius: 18px;
    padding: 8px;
}
.games-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 14px;
    font-family: inherit;
    text-align: left;
    border-radius: 12px;
}
.games-section-head:focus-visible {
    outline: 2px solid #c77d9a;
    outline-offset: -2px;
}
.games-caret {
    font-size: 0.85rem;
    color: #b08ba0;
    width: 14px;
}
.games-section-title {
    font-size: 1rem;
    color: #6a5a66;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.games-section-count {
    font-size: 0.8rem;
    color: #b08ba0;
    margin-left: auto;
}
.games-section.open .games-section-title {
    color: #3e2c3b;
}
.partner-game-chip {
    display: inline-block;
    background: linear-gradient(135deg, #ffd6e8, #ffe9f2);
    color: #8f3058;
    border: 1px solid #efb9d0;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    vertical-align: middle;
}
.games-section.has-my-game {
    border-color: #ffd9a8;
    background: #fffbf4;
}
.games-section.has-partner-game {
    border-color: #c77d9a;
    background: #fdf3f7;
    box-shadow: 0 0 0 3px rgba(199, 125, 154, 0.16);
}
.games-section.has-partner-game .games-section-title,
.games-section.has-my-game .games-section-title {
    color: #3e2c3b;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}
.games-grid[hidden] {
    display: none;
}
.game-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    background: white;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    transition: 0.2s ease;
}
.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.09);
    border-color: #e3cfda;
}
.game-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #3e2c3b;
    flex: 1 1 auto;
    min-width: 0;
}
.game-card.selected-by-me {
    border-color: #c77d9a;
    background: #fdf3f7;
}
.game-card.selected-to-match {
    border-color: #ffb86b;
    background: #fff7ed;
}
.game-card.selected-by-me.selected-to-match {
    border-color: #c77d9a;
    box-shadow: 0 0 0 3px rgba(199,125,154,0.25);
}
.game-card .partner-badge {
    display: none;
    flex-basis: 100%;
    font-size: 0.82rem;
    color: #c07a2d;
    font-weight: 600;
}
.game-card.selected-to-match .partner-badge {
    display: block;
}
.game-card .game-mode-label {
    flex-basis: 100%;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #9a8a96;
}
.game-card .premium-star {
    color: #d4a500;
    font-weight: 800;
    margin-left: 4px;
}
.purchase-link {
    color: #c77d9a;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

    /* Лобби */
    #playersNamesBlock {
        font-size: 1.6rem;
        padding: 12px 16px;
    }
    .mode-card {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 20px 16px;
    }
    .mode-card .btn {
        font-size: 1.1rem;
        padding: 14px;
    }
}

#selectionStatus {
    background: rgba(255,255,255,0.4);
    padding: 12px 16px;
    border-radius: 30px;
    margin: 8px 0 16px;
    text-align: left;
    font-size: 0.95rem;
    color: #3e2c3b;
}
#selectionStatus div {
    margin: 4px 0;
}
#countdownDisplay {
    background: rgba(199,125,154,0.1);
    padding: 10px;
    border-radius: 60px;
    margin: 10px 0;
    text-align: center;
    border: 1px solid #c77d9a;
}
#countdownSeconds {
    font-size: 2.5rem;
    color: #c77d9a;
}

/* Подсветка карточки, которую выбрал партнёр */
.mode-card.selected-by-partner {
    border: 3px solid #c77d9a;
    background: #fce8f0;
    box-shadow: 0 0 20px rgba(199,125,154,0.3);
}
.mode-card.selected-by-partner .btn {
    opacity: 0.6;
    pointer-events: none;
}
.mode-card .partner-badge {
    display: none;
    font-weight: 500;
}
.mode-card.selected-by-partner .partner-badge {
    display: block;
}
/* Подсветка карточки, которую выбрал партнёр */
.mode-card.selected-by-partner {
    border: 3px solid #c77d9a;
    background: #fce8f0;
    box-shadow: 0 0 20px rgba(199,125,154,0.3);
}
.mode-card .partner-badge {
    display: none;
    font-weight: 500;
}
.mode-card.selected-by-partner .partner-badge {
    display: block;
}
/* Кнопки остаются активными, даже если карточка подсвечена */
.mode-card.selected-by-partner .btn {
    opacity: 1;
    pointer-events: auto;
}

/* ===== АВТОРИЗАЦИЯ (index) ===== */
.auth-tabs {
    display: flex;
    gap: 6px;
    margin: 8px 0 22px;
    background: rgba(199,125,154,0.1);
    border-radius: 60px;
    padding: 5px;
}
.auth-tabs button {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 60px;
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
    color: #8f7a8a;
    cursor: pointer;
    transition: 0.2s;
}
.auth-tabs button.active {
    background: #c77d9a;
    color: white;
    box-shadow: 0 6px 16px rgba(199,125,154,0.3);
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-panel input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8dce4;
    border-radius: 16px;
    font-size: 1rem;
    background: white;
    transition: 0.2s;
    min-height: 50px;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.auth-panel input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8dce4;
    border-radius: 16px;
    font-size: 1rem;
    background: white;
    min-height: 50px;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.auth-panel label {
    text-align: left;
    font-weight: 500;
    color: #3e2c3b;
    margin-bottom: 6px;
    display: block;
}
.auth-panel .btn {
    width: 100%;
    margin-top: 6px;
}

/* ============================================================
   ПОПАП ПОДПИСКИ
   ============================================================ */
.sub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 25, 35, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}
.sub-modal {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 24px;
    padding: 28px 26px 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    text-align: center;
    font-family: inherit;
}
.sub-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #b9a6b2;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: 0.2s ease;
}
.sub-close:hover {
    color: #7a5c6e;
    background: #f6eef3;
}
.sub-icon {
    font-size: 2.4rem;
    margin-bottom: 6px;
}
.sub-modal h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    color: #3e2c3b;
}
.sub-text {
    margin: 0 0 14px;
    color: #8f7a8a;
    font-size: 0.95rem;
}
.sub-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    text-align: left;
    display: inline-block;
}
.sub-list li {
    color: #5c4653;
    font-size: 0.92rem;
    padding: 4px 0;
}
.sub-price {
    font-size: 1.1rem;
    color: #3e2c3b;
    margin-bottom: 14px;
}
.sub-price b {
    font-size: 1.8rem;
    color: #c77d9a;
}
.sub-price span {
    color: #8f7a8a;
    font-size: 0.9rem;
}
.sub-buy {
    width: 100%;
}
.sub-never {
    display: block;
    margin: 14px auto 0;
    background: transparent;
    border: none;
    color: #b3a4ad;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}
.sub-never:hover {
    color: #8f7a8a;
}
