/* ====================================================
   ОСНОВНЫЕ СТИЛИ
   ==================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: #0a0a1a;
    color: #f0eef8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(124, 77, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(106, 61, 232, 0.05) 0%, transparent 50%);
}

/* ====================================================
   HEADER
   ==================================================== */
.header {
    background: rgba(10, 10, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(124, 77, 255, 0.15);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #b388ff, #7c4dff, #6a3de8);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    letter-spacing: 1px;
    text-shadow: 0 0 40px rgba(124, 77, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '✦';
    -webkit-text-fill-color: initial;
    color: #7c4dff;
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a {
    color: #8888bb;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 8px 18px;
    border-radius: 30px;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7c4dff, #b388ff);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 60%;
}

nav a:hover {
    color: #f0eef8;
    background: rgba(124, 77, 255, 0.08);
}

nav a.active {
    color: #b388ff;
    background: rgba(124, 77, 255, 0.12);
}

/* ====================================================
   MAIN
   ==================================================== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px 24px 60px;
    flex: 1;
}

/* ===== HERO SECTION ===== */
.hero-section {
    margin-bottom: 40px;
    padding: 20px 0;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #c084fc, #818cf8, #7c4dff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: #666699;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ====================================================
   КАТАЛОГ
   ==================================================== */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 30px;
}

/* ====================================================
   КАРТОЧКА
   ==================================================== */
.card {
    background: linear-gradient(145deg, #14142e, #111127);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    border: 1px solid rgba(124, 77, 255, 0.08);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.3), transparent, rgba(124, 77, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-16px) scale(1.02);
    border-color: rgba(124, 77, 255, 0.3);
    box-shadow: 0 20px 60px rgba(124, 77, 255, 0.2), 0 0 80px rgba(124, 77, 255, 0.05);
}

.card:active {
    transform: scale(0.97);
}

.card-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #1a1a3a;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-poster {
    transform: scale(1.03);
}

.card-info {
    padding: 18px 18px 22px;
    background: linear-gradient(180deg, transparent, rgba(10, 10, 30, 0.5));
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #f0eef8;
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: #b388ff;
}

.card-year {
    font-size: 13px;
    color: #666699;
    font-weight: 500;
}

/* ====================================================
   ФУТЕР
   ==================================================== */
.footer {
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: #444466;
    font-size: 14px;
    margin-top: auto;
    background: rgba(10, 10, 30, 0.5);
}

.footer span {
    color: #7c4dff;
}

/* ====================================================
   СТРАНИЦА АНИМЕ
   ==================================================== */
.anime-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: #8888bb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(124, 77, 255, 0.05);
}

.anime-page .back-link:hover {
    color: #b388ff;
    background: rgba(124, 77, 255, 0.12);
    transform: translateX(-4px);
}

.anime-page .anime-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: linear-gradient(145deg, #12122a, #0e0e22);
    border-radius: 32px;
    padding: 35px;
    border: 1px solid rgba(124, 77, 255, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.anime-page .anime-detail::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 77, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.anime-page .anime-poster {
    flex: 0 0 260px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(124, 77, 255, 0.05);
    position: relative;
    z-index: 1;
}

.anime-page .anime-poster img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.anime-page .anime-poster:hover img {
    transform: scale(1.02);
}

.anime-page .anime-info {
    flex: 1;
    min-width: 280px;
    position: relative;
    z-index: 1;
}

.anime-page .anime-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.anime-page .anime-meta {
    color: #666699;
    margin-bottom: 16px;
    font-size: 15px;
}

.anime-page .anime-desc {
    line-height: 1.8;
    margin-bottom: 24px;
    color: #c8c6e0;
    font-size: 15px;
}

.anime-page .anime-genre {
    display: inline-block;
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.15);
    padding: 4px 16px;
    border-radius: 20px;
    color: #b388ff;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.anime-page .anime-genre:hover {
    background: rgba(124, 77, 255, 0.2);
    transform: translateY(-2px);
}

/* ===== ВЫБОР СЕРИЙ ===== */
.episodes-section {
    margin-top: 28px;
    background: rgba(10, 10, 30, 0.6);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(124, 77, 255, 0.06);
}

.episodes-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #b388ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.episodes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 2px;
}

.episodes-grid::-webkit-scrollbar {
    width: 4px;
}

.episodes-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.episodes-grid::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.3);
    border-radius: 10px;
}

.episodes-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 77, 255, 0.5);
}

/* ===== КНОПКИ СЕРИЙ ===== */
.episode-btn {
    background: rgba(124, 77, 255, 0.06);
    border: 1px solid rgba(124, 77, 255, 0.1);
    color: #a8a8c8;
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 15px;
    font-family: inherit;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.episode-btn:hover {
    background: rgba(124, 77, 255, 0.15);
    border-color: rgba(124, 77, 255, 0.3);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.15);
}

.episode-btn.active {
    background: linear-gradient(135deg, #6a3de8, #4a1db8);
    border-color: #6a3de8;
    color: #fff;
    box-shadow: 0 4px 25px rgba(106, 61, 232, 0.3);
}

.episode-btn.active:hover {
    box-shadow: 0 4px 40px rgba(106, 61, 232, 0.5);
}

.episode-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.episode-input-group label {
    color: #666699;
    font-size: 14px;
}

.episode-input-group input {
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 30px;
    padding: 10px 18px;
    color: #f0eef8;
    font-size: 15px;
    width: 90px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.episode-input-group input:focus {
    border-color: #6a3de8;
    box-shadow: 0 0 30px rgba(106, 61, 232, 0.1);
}

.episode-input-group input::-webkit-inner-spin-button {
    opacity: 1;
}

.episode-go-btn {
    background: linear-gradient(135deg, #6a3de8, #4a1db8);
    border: none;
    color: #fff;
    padding: 10px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 15px;
    font-family: inherit;
}

.episode-go-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 30px rgba(106, 61, 232, 0.4);
}

.episode-go-btn:active {
    transform: scale(0.95);
}

.current-episode {
    color: #8888bb;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-episode span {
    color: #b388ff;
    font-weight: 700;
}

/* ===== ПЛЕЕРЫ ===== */
.player-section {
    margin-top: 28px;
}

.player-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #b388ff;
}

.player-box {
    background: #08081a;
    border-radius: 16px;
    padding: 6px;
    border: 1px solid rgba(124, 77, 255, 0.06);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.player-box:hover {
    border-color: rgba(124, 77, 255, 0.2);
    box-shadow: 0 0 40px rgba(124, 77, 255, 0.05);
}

.player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== КНОПКА КОПИРОВАНИЯ ===== */
.copy-btn {
    background: linear-gradient(135deg, #6a3de8, #4a1db8);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(106, 61, 232, 0.2);
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.copy-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 50px rgba(106, 61, 232, 0.4);
}

.copy-btn.copied {
    background: #2e7d32;
    box-shadow: 0 4px 40px rgba(46, 125, 50, 0.3);
}

/* ====================================================
   АДАПТИВ
   ==================================================== */
@media (max-width: 900px) {
    .anime-page .anime-poster {
        flex: 0 0 220px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    nav a {
        font-size: 14px;
        padding: 6px 14px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .page-subtitle {
        font-size: 15px;
    }
    
    .catalog {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .anime-page .anime-detail {
        padding: 20px;
        gap: 24px;
    }
    
    .anime-page .anime-poster {
        flex: 0 0 100%;
        max-width: 240px;
        margin: 0 auto;
    }
    
    .anime-page .anime-title {
        font-size: 28px;
    }
    
    .episodes-grid {
        gap: 8px;
        max-height: 160px;
    }
    
    .episode-btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 40px;
    }
    
    .episode-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .episode-input-group input {
        width: 100%;
    }
    
    .player-wrapper iframe {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px 40px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .catalog {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .card-info {
        padding: 12px 12px 16px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .logo::before {
        font-size: 18px;
    }
    
    nav a {
        font-size: 13px;
        padding: 4px 10px;
    }
    }
