:root {
    --bg: #0d1117;
    --panel: #151b23;
    --panel-2: #1d2633;
    --text: #f3f6fb;
    --muted: #aeb8c8;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #41d9b5;
    --accent-2: #ffcf5a;
    --danger: #ff6b6b;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(65, 217, 181, 0.16), transparent 32rem),
        linear-gradient(135deg, #0d1117 0%, #111927 46%, #17191f 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header,
.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-header {
    padding: 22px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--accent);
    color: #08110f;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand small,
.muted {
    color: var(--muted);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a,
.button,
button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--accent);
    color: #06110e;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.nav-links a {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.nav-links a.active,
.nav-links a:hover,
.button.ghost,
.filters button + .button {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--line);
}

.hero {
    position: relative;
    min-height: 360px;
    display: grid;
    align-items: end;
    gap: 36px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 72px 32px 36px;
    background:
        linear-gradient(90deg, rgba(13, 17, 23, 0.96) 0%, rgba(13, 17, 23, 0.82) 42%, rgba(13, 17, 23, 0.34) 100%),
        url("/assets/hero-archive.png") center right / cover no-repeat;
    box-shadow: var(--shadow);
}

.hero-copy {
    max-width: 780px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(3rem, 12vw, 8rem);
    line-height: 0.94;
    letter-spacing: 0;
}

.detail-copy h1,
.admin-head h1,
.auth-panel h1 {
    font-size: clamp(2.1rem, 5vw, 4.5rem);
}

.hero-copy p:last-child,
.lead {
    max-width: 740px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.65;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
    box-shadow: var(--shadow);
}

.stat-strip div {
    min-height: 92px;
    padding: 18px;
    background: rgba(21, 27, 35, 0.88);
}

.stat-strip strong,
.stat-strip span {
    display: block;
}

.stat-strip strong {
    font-size: 2rem;
}

.stat-strip span {
    color: var(--muted);
}

.toolbar {
    margin: 22px 0 30px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 27, 35, 0.84);
}

.filters,
.action-row {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #0c121a;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

.filters label {
    flex: 1 1 180px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.title-card {
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 27, 35, 0.9);
    box-shadow: var(--shadow);
}

.poster,
.detail-poster {
    display: grid;
    place-items: center;
    aspect-ratio: 2 / 3;
    background:
        linear-gradient(145deg, rgba(65, 217, 181, 0.18), rgba(255, 207, 90, 0.14)),
        var(--panel-2);
    color: var(--accent-2);
    text-decoration: none;
}

.poster img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster span,
.detail-poster span {
    font-size: 5rem;
    font-weight: 900;
}

.title-card-body {
    padding: 18px;
}

.card-meta,
.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-meta span,
.chip-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.title-card h2 {
    margin: 14px 0 10px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.title-card h2 a {
    text-decoration: none;
}

.title-card p {
    color: var(--muted);
    line-height: 1.55;
}

.empty-state,
.auth-panel {
    padding: 70px 0;
}

.empty-state {
    grid-column: 1 / -1;
    color: var(--muted);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    padding: 46px 0;
}

.detail-poster {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 28px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.facts div {
    padding: 16px;
    background: rgba(21, 27, 35, 0.9);
}

.facts dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.facts dd {
    margin: 7px 0 0;
}

.admin-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 48px 0 18px;
}

.admin-stats {
    margin-bottom: 20px;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 27, 35, 0.88);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.85rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-actions a,
.table-actions button {
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
}

.table-actions form {
    margin: 0;
}

.table-actions button {
    color: var(--danger);
}

.admin-form {
    margin: 0 0 50px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 27, 35, 0.9);
    box-shadow: var(--shadow);
}

.admin-form.compact {
    width: min(460px, 100%);
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.wide {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 20px;
}

.form-error,
.flash {
    border-radius: 8px;
    padding: 12px 14px;
}

.form-error {
    background: rgba(255, 107, 107, 0.14);
    color: #ffdede;
}

.flash {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 12px;
    border: 1px solid rgba(65, 217, 181, 0.38);
    background: rgba(65, 217, 181, 0.12);
}

.site-footer {
    margin-top: 52px;
    padding: 28px 0 36px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 760px) {
    .site-header,
    .site-footer,
    .admin-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        min-height: 300px;
        padding-top: 42px;
        padding-inline: 18px;
        background:
            linear-gradient(180deg, rgba(13, 17, 23, 0.92) 0%, rgba(13, 17, 23, 0.72) 56%, rgba(13, 17, 23, 0.94) 100%),
            url("/assets/hero-archive.png") center / cover no-repeat;
    }

    .stat-strip,
    .form-grid,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        max-width: 320px;
    }
}
