﻿/* ============================================
   GAME HEROES STYLE - DOTA 2 INSPIRED
   ============================================ */

:root {
    --bg-dark: rgb(21, 22, 23);
    --bg-darker: rgb(15, 16, 17);
    --bg-card: rgba(30, 31, 32, 0.9);
    /* Rarity Colors */
    --common: #9ca3af;
    --rare: #3b82f6;
    --epic: #8b5cf6;
    --legendary: #f59e0b;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.5);
}

/* Main Section */
.game-heroes-section {
    position: relative;
    min-height: 100vh;
    /*     background: var(--bg-dark); */

    background: none;
    border-radius: 2rem;
    margin-top: 1rem;
    overflow-x: hidden; /* ИСПРАВЛЕНО: предотвращает горизонтальный overflow */
}

/* Animated Background */
.game-background {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 80% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 15s ease-in-out infinite;
    z-index: 0;
    z-index: -1;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.particle-effects {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 200%;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

.game-heroes-section .container-fluid {
    position: relative;
    z-index: 1;
}

/* ============================================
   HEADER
   ============================================ */

.game-header {
    text-align: center;
    padding: 4rem 0 2rem;
    position: relative;
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

/* Site Branding */
.site-branding {
    margin-bottom: 2rem;
}

.site-title {
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    background: linear-gradient(135deg, #f35959 0%, #fff 50%, #ff7801 100%);
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 40px rgba(236, 72, 153, 0.8));
    }
}

/* Main Artwork - Clean & Centered */
.main-artwork-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem auto 3rem;
    max-width: 100%;
    padding: 0 1rem; /* ДОБАВЛЕНО: отступы на мобильных */
}

.main-artwork-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.game-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

.title-highlight {
    background: linear-gradient(135deg, #fff 0%, #f69d2b 50%, #fff 100%);
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.game-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 1100px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    padding: 0 1rem; 
}

.title-divider {
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
    margin: 0 auto;
}

/* ============================================
   CTA PANEL
   ============================================ */

.game-cta-panel {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 2rem 0 3rem;
}

.game-btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    border: 2px solid #f59e0b;
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.btn-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.game-btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.6), 0 12px 24px rgba(0, 0, 0, 0.5);
    border-color: #fbbf24;
}

    .game-btn-primary:hover .btn-glow {
        transform: translateX(100%);
    }

.game-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

    .game-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.4);
        transform: translateY(-2px);
    }

/* ============================================
   HEROES GRID - ИСПРАВЛЕНО
   ============================================ */

.heroes-grid {
    display: grid;
    /* ИСПРАВЛЕНО: используем auto-fit с minmax для адаптивности */
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 0.4rem;
    padding: 2rem 0 4rem;
    width: 100%; /* ДОБАВЛЕНО */
}

/* Force specific column counts on larger screens */
@media (min-width: 1600px) {
    .heroes-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .heroes-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .heroes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .heroes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .heroes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 767px) {
    .heroes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Hero Card */
.hero-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    /* ИСПРАВЛЕНО: overflow только на card-image, не на всей карточке */
    overflow: visible;
    min-width: 0; /* ДОБАВЛЕНО: предотвращает overflow в grid */
}

    .hero-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }

    .hero-card:hover::before {
        opacity: 1;
    }

/* Card Glow Effect */
.card-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at center, var(--rarity-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    filter: blur(20px);
    z-index: -1;
}

.hero-card:hover .card-glow {
    opacity: 0.6;
}

/* Rarity Borders & Glows */
.hero-card[data-rarity="common"] {
    --rarity-color: var(--common);
}

.hero-card[data-rarity="rare"] {
    --rarity-color: var(--rare);
}

.hero-card[data-rarity="epic"] {
    --rarity-color: var(--epic);
}

.hero-card[data-rarity="legendary"] {
    --rarity-color: var(--legendary);
}

.hero-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--rarity-color);
    box-shadow: 0 0 40px var(--rarity-color), 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Card Image Section */
.card-image {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, var(--bg-darker) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* ИСПРАВЛЕНО: overflow: visible только для персонажей */
    overflow: visible;
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-card) 100%);
    overflow: visible;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Character Image - Can overflow! */
.character-img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 110%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
    pointer-events: none;
    transition: filter 0.4s ease, transform 0.4s ease;
}

.hero-card:hover .character-img {
    filter: drop-shadow(0 0 30px var(--rarity-color));
    transform: translateX(-50%) scale(1.05);
}

.hero-icon {
    position: relative;
    z-index: 1;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 30px var(--rarity-color));
}

.hero-card:hover .hero-icon {
    transform: scale(1.1) rotate(-5deg);
    color: rgba(255, 255, 255, 0.4);
}

/* Card Content */
.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* ДОБАВЛЕНО */
}

/* Hero Stats/Badge */
.hero-stats {
    margin-bottom: 1rem;
}

.stat-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .stat-badge.common {
        color: var(--common);
        border-color: var(--common);
    }

    .stat-badge.rare {
        color: var(--rare);
        border-color: var(--rare);
    }

    .stat-badge.epic {
        color: var(--epic);
        border-color: var(--epic);
    }

    .stat-badge.legendary {
        color: var(--legendary);
        border-color: var(--legendary);
        animation: legendaryPulse 2s ease-in-out infinite;
    }

@keyframes legendaryPulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--legendary);
    }

    50% {
        box-shadow: 0 0 20px var(--legendary);
    }
}

/* Hero Name */
.hero-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    line-height: 1.2;
    letter-spacing: 0.5px;
    word-wrap: break-word; /* ДОБАВЛЕНО */
}

/* Hero Quote */
.hero-quote {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 1.25rem;
    min-height: 60px;
    word-wrap: break-word; /* ДОБАВЛЕНО */
}

/* Hero Abilities */
.hero-abilities {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.ability {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .ability:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--rarity-color);
        transform: translateY(-4px);
    }

    .ability i {
        font-size: 1.5rem;
        color: var(--rarity-color);
    }

    .ability span {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

/* Featured Card Special Effects */
.hero-card.featured {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, var(--bg-card) 50%);
}

    .hero-card.featured .card-image {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.2) 100%);
    }

/* ============================================
   FOOTER
   ============================================ */

.game-footer {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--text-muted);
}

.footer-line {
    width: 300px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
    margin: 0 auto 2rem;
}

.game-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-style: italic;
}

.game-footer i {
    color: var(--epic);
}

/* ============================================
   RESPONSIVE - ДОПОЛНИТЕЛЬНЫЕ ПРАВИЛА
   ============================================ */

@media (max-width: 992px) {
    .game-title {
        font-size: 2rem;
    }

    .site-title {
        font-size: 2.5rem;
    }

    .main-artwork-wrapper {
        margin: 1.5rem auto 2rem;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 2rem 0 1.5rem;
    }

    .site-title {
        font-size: 1.75rem;
        letter-spacing: 1.5px;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .game-subtitle {
        font-size: 1rem;
    }

    .main-artwork-wrapper {
        margin: 1rem auto 1.5rem;
    }

    .game-cta-panel {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1rem 2rem;
    }

    .game-btn-primary,
    .game-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .card-image {
        height: 220px;
    }

    .hero-icon {
        font-size: 6rem;
    }

    .character-img {
        max-height: 260px;
    }
}

@media (max-width: 576px) {
    .site-title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .game-title {
        font-size: 1.25rem;
    }

    .main-artwork-wrapper {
        margin: 1rem auto;
    }

    .card-image {
        height: 200px;
    }

    .hero-icon {
        font-size: 5rem;
    }

    .character-img {
        max-height: 240px;
    }

    .hero-name {
        font-size: 1.125rem;
    }

    .hero-quote {
        font-size: 0.85rem;
        min-height: auto;
    }

    .hero-abilities {
        gap: 0.4rem;
    }

    .ability {
        padding: 0.5rem 0.25rem;
    }

        .ability i {
            font-size: 1.25rem;
        }

        .ability span {
            font-size: 0.7rem;
        }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-header {
    animation: fadeInScale 0.8s ease-out;
}

.game-cta-panel {
    animation: fadeInScale 0.8s ease-out 0.2s backwards;
}

.hero-card {
    animation: fadeInScale 0.6s ease-out backwards;
}

    .hero-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .hero-card:nth-child(2) {
        animation-delay: 0.15s;
    }

    .hero-card:nth-child(3) {
        animation-delay: 0.2s;
    }

    .hero-card:nth-child(4) {
        animation-delay: 0.25s;
    }

    .hero-card:nth-child(5) {
        animation-delay: 0.3s;
    }

    .hero-card:nth-child(6) {
        animation-delay: 0.35s;
    }

    .hero-card:nth-child(7) {
        animation-delay: 0.4s;
    }

    .hero-card:nth-child(8) {
        animation-delay: 0.45s;
    }

    .hero-card:nth-child(9) {
        animation-delay: 0.5s;
    }

    .hero-card:nth-child(10) {
        animation-delay: 0.55s;
    }

    .hero-card:nth-child(11) {
        animation-delay: 0.6s;
    }

    .hero-card:nth-child(12) {
        animation-delay: 0.65s;
    }

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--epic), var(--rare));
    border-radius: 6px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, var(--legendary), var(--epic));
    }

html {
    scroll-behavior: smooth;
}

/* КРИТИЧНО: предотвращение overflow на body */
body {
    overflow-x: hidden;
}
