:root {
    --bg: #12151c;
    --surface: #1a1f29;
    --line: #2c3442;
    --text: #e8e6df;
    --text-dim: #8b93a3;
    --amber: #e3a94e;
    --amber-deep: #b97f2a;
    --green: #7fb4a8;
    --filter-color: #7c8592;
    --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-data: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
}

a {
    color: var(--amber);
}

::selection {
    background: var(--amber);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ---------- Topbar ---------- */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

header a {
    margin-top: 0.8rem;
    margin-right: 1rem;
    display: block;
}

header h1 {
    margin: 0;
    padding: 0;
}

header svg {
    width: 1rem;
    vertical-align: baseline;
}

.brand {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.brand-beam {
    display: inline-block;
    width: 0.45em;
    height: 0.45em;
    margin: 0 0.18em;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 8px 1px rgba(227, 169, 78, 0.65);
    vertical-align: baseline;
}

/* ---------- Layout ---------- */

.container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 1rem 4rem;
}

.content {
    font-family: var(--font-display);
    margin: 2rem 0;
}

.feed-icon svg {
    height: 16px;
}

/* ---------- Suche ---------- */

input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    /* Mindestens 16px, sonst zoomt iOS Safari beim Fokussieren automatisch */
    font-size: 1rem;
}

input::placeholder {
    color: var(--text-dim);
}

input:focus {
    outline: 2px solid var(--amber);
    outline-offset: 0;
    border-color: var(--amber-deep);
}

/* ---------- Filterleiste ---------- */

.movie-tracker-filter {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 2rem 0;
}

.movie-tracker-filter a {
    color: var(--text-dim);
    text-decoration: none;
}

.movie-tracker-filter a:hover {
    color: var(--text);
}

.movie-tracker-filter a.active {
    color: var(--text);
}

/* ---------- Filmliste: das Logbuch ---------- */

.movie-row {
    margin: .5rem 0;
    padding: 0 1rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.movie-row[open] {
    padding-bottom: .5rem;
}

.movie-row summary {
    display: block;
    padding: 0.6rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.movie-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.6rem;
}

.movie-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.movie-original {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.85rem;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin-top: 0.25rem;
}

.data {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.badge {
    font-family: var(--font-data);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: .2rem .5rem .1rem .5rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    white-space: nowrap;
}

.badge.filter {
    border-color: var(--filter-color);
    color: var(--filter-color);
}

.badge.filter a {
    color: var(--filter-color);
}

.badge.type-movie {
    border-color: var(--amber-deep);
    color: var(--amber);
}

.badge.type-series {
    border-color: var(--green);
    color: var(--green);
}

.stars {
    position: relative;
    display: inline-block;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 2px;
    color: var(--line);
    white-space: nowrap;
}

.stars .fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--amber);
}

/* ---------- Darsteller ---------- */

.cast-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

.cast-member a {
    text-decoration: none;
}

/* ---------- Größere Screens ---------- */

@media (min-width: 44rem) {
    .container {
        padding: 1.5rem 2rem 5rem;
    }

    input {
        font-size: 0.95rem;
    }

    .movie-row summary {
        display: flex;
        align-items: baseline;
        gap: 1rem;
        padding: 0.45rem 0.75rem;
    }

    .movie-main {
        flex: 1;
        min-width: 0;
    }

    .movie-meta {
        margin-top: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .data.seen {
        min-width: 5.5rem;
        text-align: right;
    }
}
