/* ============================================================
   game.css — Игровая страница
   Команда InIProject | Code & Games
   ============================================================ */

.game {
    background: var(--bg-primary);
}

.game__intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game__intro-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.game__back-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.game__back-link:hover {
    color: var(--accent-hover);
}

.game__section {
    margin-bottom: 3rem;
}

.game__section-title {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    padding-left: 0;
    border-left: none;
}

.game__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.game__card {
    background: var(--bg-card);
    border: 1px solid rgba(230, 57, 70, 0.15);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.game__card:hover {
    border-color: var(--accent-text);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.game__card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.game__card--soon {
    opacity: 0.5;
}

.game__card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.game__card-name {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.game__card-info {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.game__card-tags {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.game__tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--accent-text);
    background: rgba(230, 57, 70, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Серверы */
.game__servers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game__server {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--bg-card);
    border: 1px solid rgba(230, 57, 70, 0.1);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.game__server-icon {
    font-size: 1.2rem;
}

.game__server-name {
    color: var(--text-primary);
    flex: 1;
}

.game__server-status {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
}

.game__server-status--online {
    background: rgba(39, 201, 63, 0.15);
    color: #27C93F;
}

.game__server-status--offline {
    background: rgba(230, 57, 70, 0.15);
    color: #FF4D5A;
}

.game__server-status--soon {
    background: rgba(255, 189, 46, 0.15);
    color: #FFBD2E;
}

.game__server-ip {
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
}

.game__server-ip:hover {
    color: var(--accent-text);
}

/* Скидки */
.game__deals {
    background: var(--bg-card);
    border: 1px solid rgba(230, 57, 70, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.game__deals-loading {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

.game__deal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(230, 57, 70, 0.06);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.game__deal:hover {
    background: rgba(230, 57, 70, 0.05);
    color: var(--text-primary);
}

.game__deal:last-child {
    border-bottom: none;
}

.game__deal--locked {
    opacity: 0.6;
}

.game__deal-discount {
    background: var(--accent);
    color: #FFF;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.game__deal-discount--free {
    background: #27C93F;
}

.game__deal-name {
    flex: 1;
}

.game__deal-name--locked {
    color: var(--text-muted);
}

.game__deal-lock {
    margin-right: 4px;
    font-size: 0.65rem;
}

.game__deal-source {
    font-size: 0.6rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.game__deal-price {
    flex-shrink: 0;
    text-align: right;
}

.game__deal-price-main {
    display: block;
}

.game__deal-price-main s {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.game__deal-price-other {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.game__deals-note {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
    border-top: 1px solid rgba(230, 57, 70, 0.06);
    opacity: 0.7;
}

/* Новости Steam */
.game__news {
    background: var(--bg-card);
    border: 1px solid rgba(230, 57, 70, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.game__news-loading {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
}

.game__news-list {
    display: flex;
    flex-direction: column;
}

.game__news-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(230, 57, 70, 0.06);
    transition: background var(--transition-fast);
}

.game__news-item:last-child {
    border-bottom: none;
}

.game__news-item:hover {
    background: rgba(230, 57, 70, 0.03);
}

.game__news-header {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.game__news-game {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--accent-text);
    background: rgba(230, 57, 70, 0.12);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.game__news-date {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.game__news-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.game__news-excerpt,
.game__news-full {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.game__news-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.game__news-expand {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.game__news-expand:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.game__news-link {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.game__news-link:hover {
    color: var(--accent-text);
}

.game__news-load {
    display: block;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-text);
    background: rgba(230, 57, 70, 0.05);
    border: none;
    border-top: 1px solid rgba(230, 57, 70, 0.1);
    padding: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.game__news-load:hover {
    background: rgba(230, 57, 70, 0.1);
    color: var(--accent-hover);
}

/* Модальное окно игры */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.game-modal--open {
    display: flex;
}

.game-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.game-modal__window {
    position: relative;
    width: 95%;
    max-width: 550px;
    max-height: 85vh;
    background: var(--bg-terminal);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent-glow);
    display: flex;
    flex-direction: column;
}

.game-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(230, 57, 70, 0.15);
}

.game-modal__dots {
    display: flex;
    gap: 6px;
}

.game-modal__dot {
    width: 10px; height: 10px; border-radius: 50%;
}
.game-modal__dot--red    { background: #FF5F56; }
.game-modal__dot--yellow { background: #FFBD2E; }
.game-modal__dot--green  { background: #27C93F; }

.game-modal__title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.game-modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    transition: color var(--transition-fast);
}

.game-modal__close:hover {
    color: var(--accent-text);
}

.game-modal__body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-modal__image {
    width: 100%;
    border-radius: 4px;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.game-modal__game-name {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.game-modal__discount {
    display: inline-block;
    background: var(--accent);
    color: #FFF;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

.game-modal__prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-modal__price-row {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.game-modal__price-row s {
    color: var(--text-muted);
    margin-right: 6px;
}

.game-modal__price-current {
    color: #27C93F;
    font-weight: 700;
}

.game-modal__note {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
}

.game-modal__footer {
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(230, 57, 70, 0.15);
    text-align: center;
}

.game-modal__btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.6rem 2rem;
    background: var(--accent);
    color: #FFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.game-modal__btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 768px) {
    .game__grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }

    .game__card {
        padding: 1.2rem;
    }

    .game__card-icon {
        font-size: 1.5rem;
    }

    .game__card-name {
        font-size: 0.9rem;
    }

    .game__deal {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .game__deal-name {
        width: 100%;
        order: 1;
        font-size: 0.75rem;
    }

    .game__deal-discount {
        order: 0;
    }

    .game__deal-price {
        width: 100%;
        order: 2;
        text-align: left;
    }

    .game__deal-price-other {
        font-size: 0.55rem;
    }

    .game__deal-source {
        width: 100%;
        order: 3;
    }

    .game__server {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .game__server-ip {
        width: 100%;
        margin-left: 2rem;
    }

    .game-modal__window {
        height: 90vh;
    }
}

@media (max-width: 480px) {
    .game__intro {
        flex-direction: column;
        align-items: flex-start;
    }

    .game__section {
        margin-bottom: 2rem;
    }

    .game__section-title {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    .game__grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .game__card {
        padding: 1rem;
    }

    .game__card-icon {
        font-size: 1.3rem;
    }

    .game__card-name {
        font-size: 0.85rem;
    }

    .game__card-info {
        font-size: 0.65rem;
    }

    .game__deal {
        padding: 0.6rem;
        gap: 0.3rem;
    }

    .game__deal-name {
        font-size: 0.7rem;
    }

    .game__deal-discount {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .game__deal-price-main {
        font-size: 0.7rem;
    }

    .game__deal-price-main s {
        font-size: 0.6rem;
    }

    .game__deal-price-other {
        font-size: 0.5rem;
    }

    .game__server {
        padding: 0.6rem 0.8rem;
        font-size: 0.7rem;
    }

    .game__server-icon {
        font-size: 1rem;
    }

    .game__server-status {
        font-size: 0.6rem;
    }

    .game__deals-note {
        font-size: 0.55rem;
        padding: 0.4rem;
    }

    .game__news-item {
        padding: 0.8rem;
    }

    .game__news-title {
        font-size: 0.8rem;
    }

    .game__news-excerpt,
    .game__news-full {
        font-size: 0.65rem;
    }
}


/* ============================================================
   Новости — сетка карточек с обложками
   ============================================================ */
.game__news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
    padding: 0.8rem;
}
.news-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-terminal);
    border: 1px solid rgba(230, 57, 70, 0.12);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}
.news-card:hover {
    border-color: var(--accent-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-glow);
}
.news-card__img {
    width: 100%;
    aspect-ratio: 460 / 215;
    object-fit: cover;
    background: #151515;
}
.news-card__body { padding: 0.7rem 0.9rem 0.9rem; display: flex; flex-direction: column; flex: 1; }
.news-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    margin-bottom: 0.4rem;
}
.news-card__game { color: var(--accent-text); }
.news-card__date { color: var(--text-muted); }
.news-card__title {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================================
   Сделки — сетка карточек с обложками
   ============================================================ */
.game__deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
    padding: 0.8rem;
}
.game__deal-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-terminal);
    border: 1px solid rgba(230, 57, 70, 0.12);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}
.game__deal-card:hover {
    border-color: var(--accent-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-glow);
}
.game__deal-img { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; background: #151515; }
.game__deal-card-body { padding: 0.7rem 0.9rem 0.9rem; display: flex; flex-direction: column; flex: 1; }
.game__deal-badge { align-self: flex-start; background: var(--accent); color: #FFF; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.game__deal-badge--free { background: #27C93F; }
.game__deal-card-name {
    margin-top: 0.5rem; font-size: 0.78rem; color: var(--text-primary); line-height: 1.35; min-height: 2.7em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game__deal-card-source { margin-top: auto; padding-top: 0.5rem; font-size: 0.66rem; color: var(--text-muted); }
.game__deal-card-price { margin-top: auto; padding-top: 0.5rem; font-size: 0.78rem; color: var(--text-primary); }
.game__deal-card-price s { color: var(--text-muted); font-size: 0.7rem; margin-left: 4px; }


/* Фильтр источников сделок */
.game__deals-filter { display: flex; gap: 0.5rem; padding: 0.6rem 0.8rem 0; flex-wrap: wrap; }
.game__filter-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(230, 57, 70, 0.2);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.game__filter-btn:hover { border-color: var(--accent-text); color: var(--accent-text); }
.game__filter-btn--active { background: var(--accent); border-color: var(--accent-text); color: #fff; }
.game__deal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.game__deal-src { font-size: 0.62rem; color: var(--text-muted); }

.game__deal-timer { margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.66rem; color: #FEBC2E; }

.team-games__member { margin-bottom: 1rem; }
.team-games__name { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-text); margin: 0.5rem 0.8rem; }

.team-games__head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.5rem 0.8rem; }
.team-games__avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--accent); }
.team-games__status { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); display: inline-block; }
.team-games__status.is-online { background: #28C840; box-shadow: 0 0 8px rgba(40,200,64,0.7); }
.team-games__now { font-family: var(--font-mono); font-size: 0.72rem; color: #28C840; }
.team-games__total { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
