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

:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-2: #1f2430;
    --text: #f3f4f6;
    --muted: #a9b0bd;
    --border: #2a3140;
    --accent: #4f8cff;
    --accent-hover: #72a3ff;
    --tag: #263247;
    --danger: #ff6b6b;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

.site-container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.hero {
    margin-bottom: 2rem;
}

.hero h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

input,
select,
button {
    width: 100%;
    min-height: 44px;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    background: var(--panel-2);
    color: var(--text);
    font-size: 1rem;
}

button,
.button-link {
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover,
.button-link:hover {
    background: var(--accent-hover);
    color: white;
}

.button-link {
    display: inline-block;
    padding: 0.7rem 1rem;
    border-radius: 0.75rem;
    margin-top: 0.75rem;
}

.status {
    color: var(--muted);
}

.results-grid,
.cast-grid,
.video-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.card,
.video-card,
.cast-card,
.fact-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
}

.card-body,
.video-card,
.cast-card,
.fact-card {
    padding: 1rem;
}

.card-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #111;
}

.placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.badge,
.tag {
    display: inline-block;
    background: var(--tag);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.genres-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none;
}

.details-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.details-poster {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.details-main h1 {
    margin-top: 0.5rem;
    margin-bottom: 0.4rem;
}

.tagline {
    font-style: italic;
    color: var(--muted);
}

.details-meta {
    margin: 0.7rem 0 1rem;
    color: var(--muted);
}

.facts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
}

@media (min-width: 700px) {
    .search-form {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: end;
    }

    .results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .genres-grid {
        grid-template-columns: 1fr 1fr;
    }

    .facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cast-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .details-hero {
        grid-template-columns: 320px 1fr;
        align-items: start;
    }

    .facts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cast-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}