* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:           #100f0d;
    --surface:      #1a1814;
    --surface-up:   #221f1a;
    --gold:         #c9974a;
    --gold-light:   #ddb870;
    --cream:        #ede0cc;
    --muted:        #8a7a68;
    --dim:          #4a4038;
    --red:          #a83c3c;
    --border:       #2a251e;
    --radius:       10px;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--bg);
    color: var(--cream);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── Film strip ── */
.filmstrip {
    background: var(--gold);
    height: 24px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
}

.filmstrip-holes {
    display: flex;
    gap: 10px;
    width: 100%;
}

.hole {
    width: 15px;
    height: 11px;
    background: var(--bg);
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.9;
}

/* ── Header ── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 44px 40px 36px;
    text-align: center;
}

.marquee-label {
    font-size: 0.72em;
    letter-spacing: 0.28em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 14px;
    opacity: 0.65;
}

h1 {
    font-size: 2.9em;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--cream);
    line-height: 1.1;
}

h1 span {
    color: var(--gold);
}

.tagline {
    margin-top: 10px;
    font-style: italic;
    color: var(--muted);
    font-size: 1.02em;
}

.about-link {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.78em;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--dim);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
}

.about-link:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* ── Main layout ── */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ── Tabs ── */
.tab-bar {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px;
    border-radius: 50px;
}

.tab-btn {
    font-family: Georgia, serif;
    font-size: 0.9em;
    color: var(--muted);
    background: none;
    border: none;
    border-radius: 50px;
    padding: 9px 22px;
    cursor: pointer;
    transition: background 0.2s, color 0.15s;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--gold);
    color: var(--bg);
    font-weight: bold;
}

.tab-btn:hover:not(.active) {
    color: var(--cream);
    background: var(--surface-up);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── Section intro ── */
.section-intro {
    font-size: 0.97em;
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 540px;
}

.section-intro em {
    color: var(--cream);
    font-style: italic;
}

/* ── Form ── */
.field {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 0.82em;
    color: var(--muted);
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--cream);
    font-family: Georgia, serif;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--gold);
    background: var(--surface-up);
}

input[type="text"]::placeholder {
    color: var(--dim);
    font-style: italic;
}

input[type="number"] {
    max-width: 100px;
}

/* ── Field hint & chips ── */
.field-hint {
    font-size: 0.78em;
    color: var(--dim);
    margin-top: 10px;
    line-height: 2;
}

.id-chip {
    font-family: Georgia, serif;
    font-size: 0.88em;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 3px 13px;
    margin: 2px 4px 2px 0;
    cursor: pointer;
    border-radius: 50px;
    transition: border-color 0.15s, color 0.15s;
}

.id-chip:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ── Submit button ── */
.submit-btn {
    margin-top: 10px;
    background: var(--gold);
    border: none;
    color: var(--bg);
    font-family: Georgia, serif;
    font-size: 0.95em;
    font-weight: bold;
    padding: 13px 36px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.submit-btn:hover {
    background: var(--gold-light);
}

.submit-btn:active {
    transform: scale(0.97);
}

/* ── Messages ── */
.msg {
    font-size: 0.85em;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: none;
    line-height: 1.5;
}

.msg.error {
    background: rgba(168, 60, 60, 0.1);
    border: 1px solid rgba(168, 60, 60, 0.3);
    color: #d47070;
}

.msg.loading {
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    display: none;
}

/* ── Results ── */
.results {
    margin-top: 44px;
}

.results-heading {
    font-size: 0.7em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Cards ── */
.cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    display: flex;
    flex-direction: row;
    gap: 18px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
}

.card:hover {
    border-color: var(--dim);
    background: var(--surface-up);
}

.card-poster {
    width: 76px;
    flex-shrink: 0;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    align-self: flex-start;
    border-radius: 6px;
    background: var(--surface-up);
}

.card-poster-placeholder {
    width: 76px;
    flex-shrink: 0;
    aspect-ratio: 2/3;
    background: var(--surface-up);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62em;
    color: var(--dim);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
}

.card-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.card-num {
    font-size: 0.64em;
    color: var(--gold);
    margin-bottom: 5px;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

.card-title {
    font-size: 1.02em;
    font-weight: bold;
    color: var(--cream);
    line-height: 1.3;
    margin-bottom: 9px;
}

.card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 9px;
}

.genre-badge {
    font-size: 0.7em;
    color: var(--gold);
    background: rgba(201, 151, 74, 0.1);
    border: 1px solid rgba(201, 151, 74, 0.22);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.card-score {
    font-size: 0.78em;
    color: var(--muted);
    margin-bottom: 9px;
}

.card-overview {
    font-size: 0.84em;
    color: var(--muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Two-column panel layout (desktop) ── */
.panel-layout {
    display: block;
}

.panel-results .results {
    margin-top: 44px;
}

@media (min-width: 721px) {
    .panel-layout.has-results {
        display: flex;
        gap: 48px;
        align-items: flex-start;
    }

    .panel-layout.has-results .panel-form {
        flex: 0 0 320px;
        position: sticky;
        top: 24px;
    }

    .panel-layout.has-results .panel-results {
        flex: 1;
        min-width: 0;
    }

    .panel-layout.has-results .panel-results .results {
        margin-top: 0;
    }
}

/* ── Footer ── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
}

footer p {
    text-align: center;
    font-size: 0.7em;
    letter-spacing: 0.1em;
    color: var(--dim);
    padding: 18px;
}
