﻿:root {
    --bg-primary: #0d0709;
    --bg-secondary: #1a0b0f;
    --bg-card: #270f13;
    --bg-elev: #450f17;
    --accent: #6e121e;
    --accent-dark: #9e1622;
    --accent-light: #c41e3a;
    --accent-glow: rgba(110, 18, 30, 0.48);
    --gold: #c89b3c;
    --gold-dark: #b8902e;
    --text: #e5d2d6;
    --text-muted: #b8949a;
    --border: rgba(255, 200, 210, 0.08);
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-glow: 0 8px 30px rgba(110, 18, 30, 0.3);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, Arial, sans-serif;
    font-weight: 400;
    background-color: var(--bg-primary);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Виньетка: фокусировка взгляда к центру (как у Юмэко в игре) ===
   Затемнение краёв, чтобы пользователь подсознательно «втягивался» в контент. */
html::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: radial-gradient(ellipse 110% 80% at center, transparent 35%, rgba(8, 2, 4, 0.65) 100%);
}

/* === Плёночное зерно: эффект кинематографичной старой плёнки.
   Невидимое глазу но создаёт атмосферу. */
html::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.7  0 0 0 0 0.2  0 0 0 0 0.2  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.06;
    mix-blend-mode: overlay;
}

/* === Декоративные фоновые орбы === */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

body::before {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #6e121e, transparent 70%);
    top: -120px;
    left: -120px;
    animation: float-1 18s ease-in-out infinite;
}

body::after {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #9e1622, transparent 70%);
    top: 40%;
    right: -160px;
    animation: float-2 22s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.32; }
    50%      { transform: translate(60px, 80px) scale(1.1); opacity: 0.42; }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.28; }
    50%      { transform: translate(-80px, -60px) scale(1.08); opacity: 0.38; }
}

/* Юмэко-пульс — медленное «дыхание» свечения как у глаз в режиме азарта */
@keyframes yumeko-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(110, 18, 30, 0.45),
                    inset 0 1px 0 rgba(200, 155, 60, 0.18);
    }
    50% {
        box-shadow: 0 6px 32px rgba(196, 30, 58, 0.6),
                    0 0 0 1px rgba(196, 30, 58, 0.25),
                    inset 0 1px 0 rgba(200, 155, 60, 0.3);
    }
}

main, header, footer {
    position: relative;
    z-index: 1;
}

/* === Header (glassmorphism) === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 40px;
    background-color: rgba(26, 11, 15, 0.7);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 900;
    font-style: italic;
    margin: 0;
    background: linear-gradient(120deg, #c41e3a 0%, #6e121e 35%, #e5d2d6 50%, #6e121e 65%, #c41e3a 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    animation: shine 5s linear infinite;
    filter: drop-shadow(0 0 18px rgba(110, 18, 30, 0.6));
}

/* === Заголовки секций — Playfair Display === */
.hero h2, .about-us h2,
.manga-title, .section-header h2,
.comments-section h2, .settings-head h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

/* === Логотип-ссылка — тот же градиент, что и у h1 (для всех страниц где h1 обёрнут в <a>) === */
header h1 .logo-link,
.logo-link {
    text-decoration: none;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 900;
    letter-spacing: 0.5px;
    background: linear-gradient(120deg, #c41e3a 0%, #6e121e 35%, #e5d2d6 50%, #6e121e 65%, #c41e3a 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: shine 5s linear infinite;
    filter: drop-shadow(0 0 18px rgba(110, 18, 30, 0.6));
}

@keyframes shine {
    to { background-position: 200% center; }
}

header nav {
    display: flex;
    gap: 28px;
}

header nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
    transition: color 0.25s;
}

header nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 2px;
    transition: width 0.3s ease;
}

header nav a:hover,
header nav a:focus {
    color: var(--accent-light);
    outline: none;
}

header nav a:hover::after,
header nav a:focus::after {
    width: 100%;
}

/* === Hero === */
.hero {
    position: relative;
    margin: 32px auto 0;
    max-width: 1200px;
    padding: 0 40px;
}

.hero-inner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    background:
        linear-gradient(135deg, rgba(122, 10, 31, 0.88), rgba(17, 6, 8, 0.5)),
        linear-gradient(135deg, #1a0b0f 0%, #6e121e 100%);
    border: 1px solid rgba(200, 155, 60, 0.18);
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(200, 155, 60, 0.12);
}

.hero-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(196, 30, 58, 0.28), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(200, 155, 60, 0.12), transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(110, 18, 30, 0.45), transparent 60%);
    pointer-events: none;
    animation: hero-breath 6s ease-in-out infinite;
}

@keyframes hero-breath {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 1;    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-light);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.hero h2 {
    margin: 0 0 12px;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.hero p {
    margin: 0 0 24px;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 100px;
    border: 1px solid rgba(200, 155, 60, 0.35);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, filter 0.2s;
    letter-spacing: 0.3px;
    animation: yumeko-pulse 3.4s ease-in-out infinite;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    border-color: var(--gold);
    animation-duration: 1.5s;   /* учащённый пульс на ховере */
}

.btn-primary:active {
    transform: translateY(0);
}

/* === Search === */
.search-section {
    padding: 32px 40px 0;
    max-width: 880px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(39, 15, 19, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px 22px;
    font-size: 0.95rem;
    color: var(--text);
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: #fff;
    width: 42px;
    height: 42px;
    margin-right: 5px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.search-box .search-btn:hover {
    filter: brightness(1.12);
    transform: scale(1.06);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.search-box .search-btn:active {
    transform: scale(0.98);
}

.search-box .search-btn svg {
    display: block;
}

/* === Cards section === */
.cards-section {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.section-header h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    padding-left: 14px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    border-radius: 4px;
}

.section-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 22px;
}

/* === Cards === */
.card {
    position: relative;
    display: block;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(.2, .8, .2, 1),
                box-shadow 0.3s,
                border-color 0.3s;
}

.card:hover,
.card:focus {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(110, 18, 30, 0.4),
                0 0 0 1px rgba(200, 155, 60, 0.4),
                inset 0 0 60px rgba(110, 18, 30, 0.18);
    border-color: var(--gold);
    outline: none;
}

.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}

.card:hover .card-cover img {
    transform: scale(1.08);
}

.card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(21, 19, 26, 0.92) 0%, transparent 50%);
    pointer-events: none;
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px var(--accent-glow);
    border: 1px solid rgba(200, 155, 60, 0.4);
}

.card-badge.muted {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    backdrop-filter: blur(6px);
}

.card-text {
    padding: 12px 14px 14px;
}

.card-text h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card.placeholder {
    opacity: 0.32;
    pointer-events: none;
    cursor: default;
}

/* === About us === */
.about-us {
    position: relative;
    background: linear-gradient(135deg, #1a0b0f 0%, #6e121e 100%);
    color: #fff;
    padding: 80px 40px;
    text-align: center;
    margin-top: 40px;
    overflow: hidden;
}

.about-us::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(196, 30, 58, 0.24), transparent 35%),
        radial-gradient(circle at 85% 30%, rgba(200, 155, 60, 0.18), transparent 30%);
    pointer-events: none;
}

.about-us > * {
    position: relative;
    z-index: 1;
}

.about-us h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.about-us p {
    font-size: 1.1rem;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
    opacity: 0.92;
}

/* === Footer === */
footer {
    background-color: #0a0406;
    color: var(--text-muted);
    padding: 32px 40px;
    text-align: center;
    border-top: 1px solid rgba(200, 155, 60, 0.12);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    font-size: 0.9rem;
}

.footer-content p {
    margin: 0;
}

footer a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

/* === Фильтр-чипы по жанрам === */
.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.tag-chip {
    background: rgba(110, 18, 30, 0.12);
    border: 1px solid rgba(110, 18, 30, 0.35);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tag-chip:hover { border-color: var(--accent); background: rgba(110, 18, 30, 0.22); }
.tag-chip.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 3px 12px rgba(110, 18, 30, 0.4);
}
.tag-chip .tag-count {
    margin-left: 4px;
    opacity: 0.6;
    font-size: 0.72rem;
}
.tag-chip.active .tag-count { opacity: 0.85; }

/* Карточка «Продолжить чтение» */
.continue-progress {
    margin: 6px 0 0 !important;
}
.continue-bar {
    display: block;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 100px;
    overflow: hidden;
}
.continue-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--accent-light), var(--accent));
    box-shadow: 0 0 6px rgba(110, 18, 30, 0.5);
    transition: width 0.4s ease;
}
.continue-card .card-badge {
    background: linear-gradient(135deg, var(--gold), var(--accent-dark)) !important;
}

/* Мини-теги в карточке */
.card-mini-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
}
.card-mini-tag {
    font-size: 0.66rem;
    color: var(--accent-light);
    background: rgba(110, 18, 30, 0.18);
    padding: 1px 7px;
    border-radius: 100px;
    font-weight: 500;
    text-transform: lowercase;
}

.loading-shell { text-align: center; padding: 40px; color: var(--text-muted); }
.comments-empty {
    color: var(--text-muted); text-align: center;
    padding: 30px 20px;
    background: rgba(44, 22, 32, 0.3);
    border-radius: 12px;
    border: 1px dashed var(--border);
    grid-column: 1 / -1;
}

/* === Scroll-reveal === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
    header {
        padding: 12px 20px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .hero {
        padding: 0 20px;
        margin-top: 24px;
    }

    .hero-inner {
        padding: 28px;
        min-height: 260px;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .search-section,
    .cards-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .about-us {
        padding: 56px 20px;
    }

    .about-us h2 {
        font-size: 1.7rem;
    }

    footer {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    header nav {
        gap: 14px;
    }

    header nav a {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* === Адаптивный логотип (MonoBlock Canvas Studio / MBCS) ===
   Полное название на широких экранах, короткое MBCS — на планшете/мобиле. */
.logo-short { display: none; }
@media (max-width: 900px) {
  .logo-full  { display: none; }
  .logo-short { display: inline; }
}