/* ==========================================================================
   Plotwist – Stylesheet
   Petrol canvas inside a cream frame, condensed display type, cream cards.
   1. Fonts & tokens  2. Base  3. Shell & navbar  4. Typography  5. Components
   6. Pages  7. Responsive
   ========================================================================== */

/* 1. Fonts & tokens ------------------------------------------------------- */

@font-face {
    font-family: Anton;
    src: url(../assets/fonts/Anton-Regular.woff2) format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url(../assets/fonts/Manrope-Variable.woff2) format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

/* Colours are role-based; [data-theme="dark"] only swaps the values. */
:root {
    color-scheme: light;

    --frame: #e9e4d6;            /* page background around the canvas, navbar tab */
    --on-frame: #0d3a44;
    --canvas: #177c8e;           /* the big rounded app surface */
    --on-canvas: #e9e4d6;
    --on-canvas-muted: rgba(233, 228, 214, 0.75);
    --canvas-hover: rgba(233, 228, 214, 0.1);
    --line: rgba(233, 228, 214, 0.35);
    --line-soft: rgba(233, 228, 214, 0.25);
    --line-strong: rgba(233, 228, 214, 0.55);
    --surface: #e9e4d6;          /* cards, panels */
    --surface-raised: #f4f0e6;   /* dropdown */
    --on-surface: #0d3a44;
    --on-surface-soft: #4f6d74;
    --field: #f4f0e6;
    --field-border: rgba(13, 58, 68, 0.15);
    --strong: #0d3a44;           /* dark accents: buttons on cards, strips, tabs */
    --on-strong: #e9e4d6;
    --accent: #177c8e;
    --accent-strong: #0f6070;
    --outline: #e9e4d6;          /* borders around images */
    --scrim: #08282f;
    --rating: #c2621a;
    --rating-light: #ffc477;
    --danger: #b3261e;
    --danger-bg: #fbe3df;
    --success: #2e7d4f;

    --font-display: Anton, "Arial Narrow", Impact, sans-serif;
    --font-body: Manrope, "Segoe UI", system-ui, sans-serif;

    --radius-lg: 32px;
    --radius: 24px;
    --radius-sm: 14px;
    --shadow: 0 18px 40px -24px rgba(5, 30, 36, 0.55);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;
    --space-7: 72px;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --frame: #0a0e0f;
    --on-frame: #e9e4d6;
    --canvas: #121a1c;
    --on-canvas: #e9e4d6;
    --on-canvas-muted: rgba(233, 228, 214, 0.6);
    --canvas-hover: rgba(233, 228, 214, 0.06);
    --line: rgba(233, 228, 214, 0.14);
    --line-soft: rgba(233, 228, 214, 0.1);
    --line-strong: rgba(233, 228, 214, 0.28);
    --surface: #1c2528;
    --surface-raised: #242f33;
    --on-surface: #e9e4d6;
    --on-surface-soft: #98a9ad;
    --field: #141b1d;
    --field-border: rgba(233, 228, 214, 0.12);
    --strong: #e9e4d6;
    --on-strong: #121a1c;
    --accent: #4cb5c6;
    --accent-strong: #6cc7d5;
    --outline: #2a3538;
    --scrim: #040707;
    --rating: #f2a65a;
    --rating-light: #ffc477;
    --danger: #ff8a7a;
    --danger-bg: #3a1f1c;
    --success: #6fd38a;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}
/* 2. Base ----------------------------------------------------------------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    padding: var(--space-3);
    background: var(--frame);
    color: var(--on-canvas);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--rating-light); outline-offset: 3px; }

.hidden { display: none !important; }

/* 3. Shell & navbar ------------------------------------------------------- */

.app-shell {
    position: relative;
    min-height: calc(100vh - 2 * var(--space-3));
    border-radius: var(--radius-lg);
    background: var(--canvas);
    overflow: clip;
}

.page {
    position: relative;
    width: min(1240px, 100% - 2 * var(--space-6));
    margin: 0 auto;
    padding: var(--space-5) 0 var(--space-7);
}

/* Footer: only the logo for now */
.app-shell { display: flex; flex-direction: column; }
.page { flex: 1 0 auto; }
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
    position: relative;
    margin-top: calc(var(--space-5) + var(--radius-lg));
    padding: var(--space-5) var(--space-4) var(--space-6);
    background: var(--frame);
    color: var(--on-frame);
}

/* The canvas gets rounded bottom corners that curve into the footer (like the frame around it) */
.footer::before,
.footer::after {
    content: "";
    position: absolute;
    bottom: 100%;
    width: var(--radius-lg);
    height: var(--radius-lg);
    pointer-events: none;
}
.footer::before { left: 0; background: radial-gradient(circle at 100% 0, transparent calc(var(--radius-lg) - 0.5px), var(--frame) var(--radius-lg)); }
.footer::after { right: 0; background: radial-gradient(circle at 0 0, transparent calc(var(--radius-lg) - 0.5px), var(--frame) var(--radius-lg)); }
.footer__logo { padding-top: 0; color: inherit; font-size: 24px; opacity: 0.85; transition: opacity 0.15s ease; }
.footer__logo:hover { opacity: 1; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-5); font-weight: 700; font-size: 14px; }
.footer__links a,
.footer__credit a { opacity: 0.8; text-decoration: underline; text-underline-offset: 3px; }
.footer__links a:hover,
.footer__credit a:hover { opacity: 1; }
.footer__credit { max-width: 520px; font-size: 12px; line-height: 1.5; opacity: 0.6; }

/* Imprint and privacy policy */
.legal { display: grid; gap: var(--space-5); max-width: 760px; }
.legal .page-head { margin-bottom: 0; }
.legal section { display: grid; gap: var(--space-2); }
.legal h2 { font-weight: 800; font-size: 19px; }
.legal p { line-height: 1.7; opacity: 0.9; overflow-wrap: anywhere; }
.legal code { font-size: 0.9em; }
.legal__updated { font-size: 14px; opacity: 0.6; }

.field__note { font-weight: 600; font-size: 12px; letter-spacing: 0; opacity: 0.65; }

.navbar {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    padding: 0 var(--space-5);
}

.logo {
    justify-self: start;
    padding-top: 22px;
    color: var(--on-canvas);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.logo__mark { margin-left: 2px; font-size: 0.6em; vertical-align: super; }

/* The cream tab "cut out" of the top edge of the canvas */
.navbar__tab {
    position: relative;
    display: flex;
    gap: var(--space-5);
    padding: 16px 44px 18px;
    border-radius: 0 0 28px 28px;
    background: var(--frame);
    color: var(--on-frame);
    font-weight: 600;
    font-size: 15px;
}

.navbar__tab::before,
.navbar__tab::after {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 28px;
}

.navbar__tab::before {
    left: -28px;
    background: radial-gradient(circle at 0 100%, transparent 27.5px, var(--frame) 28px);
}

.navbar__tab::after {
    right: -28px;
    background: radial-gradient(circle at 100% 100%, transparent 27.5px, var(--frame) 28px);
}

.navbar__link { position: relative; padding: 2px 0; }
.navbar__icon { display: none; }

.navbar__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    border-radius: 2px;
    background: var(--on-frame);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.navbar__link:hover::after,
.navbar__link.is-active::after { transform: scaleX(1); }

.navbar__end {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-top: 14px;
}

.navbar__user { position: relative; }

.navbar__avatar-button {
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}

.dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    display: flex;
    flex-direction: column;
    width: 250px;
    padding: var(--space-2);
    border: 1px solid var(--field-border);
    border-radius: 20px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
    color: var(--on-surface);
    transform-origin: top right;
    animation: dropdown-in 0.15s ease-out;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

.dropdown__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    padding: var(--space-2) var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--field-border);
}

.dropdown__header div { display: grid; min-width: 0; }
.dropdown__header strong { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__header span { color: var(--on-surface-soft); font-weight: 600; font-size: 13px; }

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: none;
    font-weight: 700;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.dropdown__item svg {
    width: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.dropdown__item:hover { background: var(--surface); }
.dropdown__item:hover svg { opacity: 1; }

.dropdown__footer {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--field-border);
}

.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* Theme toggle */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: transparent;
    color: var(--on-canvas);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover { border-color: var(--on-canvas); background: var(--canvas-hover); }

.theme-toggle svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle__sun,
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }


/* Search pill */
.search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 18px;
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search:focus-within { border-color: var(--on-canvas); background: var(--canvas-hover); }

.search__input {
    width: 13em;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
}

.search__input::placeholder { color: var(--on-canvas-muted); }
.search__input::-webkit-search-cancel-button { display: none; }

.search__button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--on-canvas);
    color: var(--canvas);
    cursor: pointer;
}

.search__button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

.search--large {
    max-width: 640px;
    padding: 6px 6px 6px 24px;
    border-color: var(--surface);
    background: var(--surface);
    color: var(--on-surface);
}

.search--large .search__input { width: 100%; font-size: 17px; }
.search--large .search__input::placeholder { color: var(--on-surface-soft); }
.search--large .search__button { width: 48px; height: 48px; background: var(--strong); color: var(--on-strong); }

/* Series backdrop, tinted into the petrol canvas */
.backdrop {
    position: absolute;
    inset: 0 0 auto;
    height: 640px;
    background:
        linear-gradient(to bottom, color-mix(in srgb, var(--canvas) 72%, transparent), var(--canvas) 92%),
        var(--backdrop-image) center 25% / cover no-repeat;
    pointer-events: none;
}

/* 4. Typography ----------------------------------------------------------- */

.display {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(56px, 8vw, 120px);
    line-height: 0.92;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.display--medium { font-size: clamp(44px, 5.6vw, 84px); }

.eyebrow {
    display: inline-block;
    margin-bottom: var(--space-3);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.8;
}

.lead {
    max-width: 58ch;
    margin-top: var(--space-4);
    font-size: 17px;
    opacity: 0.9;
}

.section-title {
    margin: var(--space-6) 0 var(--space-4);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 36px;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.hint { color: var(--on-surface-soft); font-size: 15px; }

.link { font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }

/* 5. Components ----------------------------------------------------------- */

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 46px;
    padding: 0 26px;
    border: 2px solid var(--on-canvas);
    border-radius: 999px;
    background: var(--on-canvas);
    color: var(--canvas);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.button:hover { background: transparent; color: var(--on-canvas); }
.button:active { transform: translateY(1px); }

.button--ghost { background: transparent; color: var(--on-canvas); }
.button--ghost:hover { background: var(--on-canvas); color: var(--canvas); }

/* Buttons on cream cards are inverted */
:is(.card, .sheet) .button { border-color: var(--strong); background: var(--strong); color: var(--on-strong); }
:is(.card, .sheet) .button:hover { background: transparent; color: var(--strong); }
:is(.card, .sheet) .button--ghost { background: transparent; color: var(--on-surface); }
:is(.card, .sheet) .button--ghost:hover { background: var(--strong); color: var(--on-strong); }
:is(.card, .sheet) .button--danger,
.button--danger { border-color: var(--danger); background: transparent; color: var(--danger); }
:is(.card, .sheet) .button--danger:hover { background: var(--danger); color: var(--surface-raised); }

.button--block { width: 100%; }

/* Cards */
.card {
    position: relative;
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--on-surface);
    box-shadow: var(--shadow);
}

.card__title {
    margin-bottom: var(--space-3);
    padding-right: 72px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card__title--small { margin-top: var(--space-4); font-size: 14px; }

.card-tab {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--strong);
}

.card-tab i {
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--on-strong);
    border-radius: 50%;
}

.empty-panel { display: grid; gap: var(--space-2); }

/* Forms */
.form { display: flex; flex-direction: column; gap: var(--space-3); }

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--field-border);
    border-radius: var(--radius-sm);
    background: var(--field);
    color: var(--on-surface);
    font-weight: 500;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.input:focus { outline: none; border-color: var(--accent); }
.input:disabled { opacity: 0.5; }
textarea.input { resize: vertical; }

.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: 14px;
}

.checkbox input { width: 18px; height: 18px; accent-color: var(--strong); }

/* Errors & toast */
.errors {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.page-errors {
    width: min(1240px, 100% - 2 * var(--space-6));
    margin: var(--space-4) auto 0;
}

.error {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: var(--space-5);
    z-index: 1000;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--strong);
    box-shadow: var(--shadow);
    color: var(--on-strong);
    font-weight: 700;
    transform: translateX(-50%);
    transition: opacity 0.4s ease;
}

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
    padding: 4px 12px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge--light { color: var(--on-canvas); }

/* Rating */
.rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--rating);
    font-weight: 800;
    font-size: 18px;
    white-space: nowrap;
}

.rating__icon { width: 0.7em; }

.rating--inline { font-size: 15px; vertical-align: -1px; }

/* Avatars */
.avatar {
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
}

.avatar--tiny { width: 24px; height: 24px; border: 2px solid var(--outline); }
.avatar--small { width: 44px; height: 44px; }
.avatar--nav { width: 46px; height: 46px; border: 2px solid var(--outline); }
.avatar--hero { width: 88px; height: 88px; border: 5px solid var(--outline); }
.avatar--profile { width: 148px; height: 148px; border: 7px solid var(--canvas); }

.avatar-stack {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: 13px;
}

.avatar-stack__images { display: flex; }
.avatar-stack__images .avatar + .avatar { margin-left: -8px; }

/* Quote (comments) */
.quote {
    padding: 10px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    font-size: 14px;
    font-style: italic;
}

.quote--light {
    border-left-color: var(--on-canvas);
    background: var(--canvas-hover);
}

/* Rotating badge */
.spin-badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 176px;
    height: 176px;
    flex-shrink: 0;
}

.spin-badge__ring {
    position: absolute;
    inset: 0;
    width: 100%;
    animation: spin 22s linear infinite;
}

.spin-badge__ring text {
    fill: var(--on-canvas);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.08em;
}

.spin-badge__label {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    background: var(--surface);
    color: var(--on-surface);
    clip-path: polygon(100% 50%, 93.6% 55.7%, 98.3% 62.9%, 90.7% 66.8%, 93.3% 75%, 84.9% 76.8%, 85.4% 85.4%, 76.8% 84.9%, 75% 93.3%, 66.8% 90.7%, 62.9% 98.3%, 55.7% 93.6%, 50% 100%, 44.3% 93.6%, 37.1% 98.3%, 33.2% 90.7%, 25% 93.3%, 23.2% 84.9%, 14.6% 85.4%, 15.1% 76.8%, 6.7% 75%, 9.3% 66.8%, 1.7% 62.9%, 6.4% 55.7%, 0% 50%, 6.4% 44.3%, 1.7% 37.1%, 9.3% 33.2%, 6.7% 25%, 15.1% 23.2%, 14.6% 14.6%, 23.2% 15.1%, 25% 6.7%, 33.2% 9.3%, 37.1% 1.7%, 44.3% 6.4%, 50% 0%, 55.7% 6.4%, 62.9% 1.7%, 66.8% 9.3%, 75% 6.7%, 76.8% 15.1%, 85.4% 14.6%, 84.9% 23.2%, 93.3% 25%, 90.7% 33.2%, 98.3% 37.1%, 93.6% 44.3%);
    font-weight: 800;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
    transition: transform 0.3s ease;
}

a.spin-badge:hover .spin-badge__label { transform: rotate(-12deg) scale(1.06); }

@keyframes spin { to { transform: rotate(360deg); } }

/* Carousel */
.carousel { position: relative; }

.carousel__wrapper { position: relative; }

.carousel__track {
    display: flex;
    gap: var(--space-3);
    padding: 4px 4px var(--space-4);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar { display: none; }

.carousel__button {
    position: absolute;
    top: calc(50% - 34px);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--strong);
    box-shadow: var(--shadow);
    color: var(--on-strong);
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.carousel__button:hover { transform: scale(1.08); }
.carousel__button--prev { left: -18px; }
.carousel__button--next { right: -18px; }

/* Backdrop tile (16:9 with title overlay) */
.tile {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tile__image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover .tile__image { transform: scale(1.05); }

.tile__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    padding: var(--space-4);
    background: linear-gradient(to top, color-mix(in srgb, var(--scrim) 92%, transparent), transparent 65%);
}

.tile__eyebrow { font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }

.tile__title {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
    text-transform: uppercase;
}

.tile--large { border: 6px solid var(--outline); border-radius: 28px; }
.tile--large .tile__overlay { padding: var(--space-5); }
.tile--large .tile__title { font-size: clamp(36px, 4vw, 60px); }

/* Spotlight: big tile + compact list */
.spotlight {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-5);
}

.spotlight__list { display: grid; gap: var(--space-2); }

.mini-tile {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: 18px;
    transition: background-color 0.2s ease;
}

.mini-tile:hover { background: var(--canvas-hover); }
.mini-tile > img { width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.mini-tile__text { display: grid; gap: 6px; }
.mini-tile__title { font-weight: 800; font-size: 16px; line-height: 1.25; }

/* Bare poster (no card) */
.poster {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 0 0 168px;
    scroll-snap-align: start;
}

.poster__frame { position: relative; display: block; }

.poster__frame img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: var(--shadow);
    outline: 3px solid transparent;
    outline-offset: 3px;
    transition: outline-color 0.2s ease, transform 0.2s ease;
}

.poster:hover .poster__frame img { outline-color: var(--on-canvas); transform: translateY(-3px); }

.poster__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.3;
}

.poster__rating {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface);
    font-size: 14px;
}

/* Profile: top 10 with a series / movies switch */
.top-lists__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.top-lists__head .section-title { margin: 0; }

.switch { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--canvas-hover); }
.switch__option span {
    display: block;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.switch__option input:checked + span { background: var(--on-canvas); color: var(--canvas); }
.switch__option input:focus-visible + span { outline: 3px solid var(--rating-light); outline-offset: 2px; }

.top-lists:has(input[value="serien"]:checked) .top-lists__panel--filme,
.top-lists:has(input[value="filme"]:checked) .top-lists__panel--serien { display: none; }
.top-lists__panel--filme .poster__type { display: none; }

/* Feedback button (bottom right) */
.feedback-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 12px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--on-strong);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.feedback-button:hover { transform: translateY(-2px); }
.feedback-button svg { width: 22px; height: 22px; fill: var(--strong); }
.feedback-button__bubble { fill: currentColor; }

.sheet__head--plain { min-height: 0; padding-top: var(--space-5); background: none; }
.segmented--wrap { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Administration: feedback inbox */
.feedback-list { display: grid; gap: var(--space-3); }
.feedback-item { display: grid; gap: var(--space-2); }
.feedback-item.is-done { opacity: 0.7; }
.feedback-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); font-size: 14px; }
.feedback-item__category { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 800; font-size: 13px; }
.feedback-item__category--bug { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.feedback-item__meta { color: var(--on-surface-soft); font-weight: 600; }
.feedback-item__meta a { font-weight: 800; color: var(--on-surface); }
.feedback-item__message { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.feedback-item__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.feedback-item__actions form { display: contents; }

/* Detail page: runtime, seasons, episodes, status */
.title-facts { display: flex; flex-wrap: wrap; gap: 4px 0; font-weight: 800; font-size: 15px; }
.title-facts li + li::before { content: "·"; margin: 0 10px; opacity: 0.6; }

/* Detail page: trailer player */
.trailer { position: relative; width: min(1000px, 100%); }
.trailer .sheet__close { top: -48px; right: 0; }
.trailer__video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 18px; background: #000; box-shadow: var(--shadow); }

/* Detail page: where to watch */
.providers { display: grid; gap: var(--space-4); }
.providers__group { display: grid; gap: var(--space-2); }
.providers__group .eyebrow { margin: 0; }
.providers__list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.provider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 14px;
    background: var(--surface);
    color: var(--on-surface);
    font-weight: 700;
    font-size: 14px;
}
.provider__logo { width: 36px; height: 36px; border-radius: 9px; }
.providers__credit { margin-top: var(--space-3); font-size: 13px; opacity: 0.7; }
.providers__credit a { text-decoration: underline; text-underline-offset: 3px; }

/* Discover page: suggestions */
.recommendation__reason {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: -4px;
    color: var(--on-canvas-muted);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.35;
}

/* Marks movies in mixed lists */
.poster__type {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scrim) 75%, transparent);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Ranked poster: huge outlined number behind the poster */
.poster--ranked { flex-basis: 236px; position: relative; padding-left: 68px; }

.poster__rank {
    position: absolute;
    left: 0;
    top: 50%;
    z-index: 0;
    color: transparent;
    font-family: var(--font-display);
    font-size: 170px;
    line-height: 1;
    -webkit-text-stroke: 3px var(--on-canvas);
    transform: translateY(-62%);
}

.poster--ranked .poster__frame,
.poster--ranked .poster__title { position: relative; z-index: 1; }

/* Own lists side by side */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-6);
}

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

.numbered { border-top: 2px solid var(--line); }

.numbered__item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: var(--space-3);
    padding: 14px 0;
    border-bottom: 2px solid var(--line);
}

.numbered__index {
    color: transparent;
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1;
    -webkit-text-stroke: 1.5px var(--on-canvas);
    transition: color 0.2s ease;
}

.numbered__item:hover .numbered__index { color: var(--on-canvas); }
.numbered__title { font-weight: 800; font-size: 18px; }
.numbered__meta { font-weight: 600; font-size: 13px; opacity: 0.7; }
/* Two-column layout (home & profile) */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-6);
}

.content-layout__main { min-width: 0; }

.content-layout__sidebar { padding-top: calc(var(--space-6) + 36px + var(--space-4)); }

.sidebar-panel { position: sticky; top: var(--space-4); }

/* Activity timeline: no cards, a line with avatars */
.timeline { position: relative; display: grid; }

.timeline::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 21px;
    width: 2px;
    background: var(--line);
}

.timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 56px;
    align-items: start;
    gap: var(--space-4);
    padding: var(--space-3) 0;
}

.timeline__item + .timeline__item { border-top: 1px dashed var(--line-soft); }

.timeline__avatar .avatar { box-shadow: 0 0 0 4px var(--canvas); }
.timeline__body { display: grid; gap: var(--space-2); }
.timeline__text { font-size: 16px; line-height: 1.6; }
.timeline__user { font-weight: 800; }
.timeline__series { font-weight: 800; color: var(--rating-light); }
.timeline__user:hover,
.timeline__series:hover { text-decoration: underline; }
.timeline__time { font-weight: 600; font-size: 12px; opacity: 0.7; }
.timeline .rating { color: var(--rating-light); }

.timeline__poster img {
    width: 56px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.timeline__poster:hover img { transform: rotate(-4deg) scale(1.05); }
/* Ranking (sidebar) */
.ranking { display: grid; gap: var(--space-3); }

.ranking__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ranking__place {
    width: 26px;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 30px;
    text-align: center;
}

.ranking__poster {
    width: 46px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.ranking__text { display: grid; gap: 2px; }
.ranking__title { font-weight: 800; font-size: 14px; line-height: 1.3; }
.ranking__item:hover .ranking__title { text-decoration: underline; }
.ranking__meta { color: var(--on-surface-soft); font-weight: 600; font-size: 12px; }

/* Entry card (friends' comments on a series) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.entry-card { display: grid; gap: var(--space-3); align-content: start; }

.entry-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.entry-card__head > div { display: grid; flex: 1; }
.entry-card__name { font-weight: 800; }
.entry-card__name:hover { text-decoration: underline; }
.entry-card__meta { color: var(--on-surface-soft); font-weight: 600; font-size: 12px; }
.entry-card__series { font-weight: 800; color: var(--accent-strong); }

/* Stat strip (profile): big numbers, no box */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin-top: var(--space-5);
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
}

.stat-strip > li + li { border-left: 2px solid var(--line); }

.stat-strip__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    padding: var(--space-3);
}

.stat-strip__label { font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.stat-strip__label span { display: inline-block; transition: transform 0.2s ease; }
.stat-strip__value { font-family: var(--font-display); font-size: 48px; line-height: 1; }

.stat-strip__item--link { transition: background-color 0.2s ease; }
.stat-strip__item--link:hover { background: var(--canvas-hover); }
.stat-strip__item--link:hover .stat-strip__label { opacity: 1; }
.stat-strip__item--link:hover .stat-strip__label span { transform: translateX(4px); }

/* Profile list page */
.list-head { display: grid; gap: var(--space-4); padding-top: var(--space-3); }

.list-head__back { justify-self: start; font-weight: 700; font-size: 14px; opacity: 0.8; }
.list-head__back:hover { opacity: 1; text-decoration: underline; }

.list-head__user { display: flex; align-items: center; gap: var(--space-4); }
.list-head__user .eyebrow { margin-bottom: var(--space-2); }

.avatar--list { width: 96px; height: 96px; border: 4px solid var(--outline); }

.list-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.list-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 18px;
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.list-tabs__tab:hover { border-color: var(--on-canvas); }
.list-tabs__tab.is-active { border-color: var(--on-canvas); background: var(--on-canvas); color: var(--canvas); }

.list-tabs__count {
    min-width: 26px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--canvas-hover);
    font-size: 13px;
    text-align: center;
}

.list-tabs__tab.is-active .list-tabs__count { background: color-mix(in srgb, var(--canvas) 15%, transparent); }

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-5) 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--line);
}

.list-toolbar__count { font-weight: 700; opacity: 0.8; }

.sort { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; }
.sort__label { opacity: 0.7; font-weight: 600; }

.sort__option {
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    opacity: 0.75;
}

.sort__option:hover { opacity: 1; background: var(--canvas-hover); }
.sort__option.is-active { opacity: 1; background: var(--canvas-hover); box-shadow: inset 0 0 0 2px var(--line-strong); }

.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-5) var(--space-4);
}

.poster-grid .poster { flex: none; }

/* Profile: #1 pick next to its score */
.top-pick {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-5);
}

.top-pick__score { display: grid; gap: var(--space-2); justify-items: start; }
.top-pick__score .eyebrow { margin: 0; }

.top-pick__number {
    font-family: var(--font-display);
    font-size: clamp(96px, 12vw, 180px);
    line-height: 0.85;
    color: var(--rating-light);
}

.carousel--plain .section-title { font-size: 22px; margin-top: var(--space-5); }

/* Profile: recent history as rows */
.history { border-top: 2px solid var(--line); }

.history__item {
    display: grid;
    grid-template-columns: 56px 48px minmax(0, 1fr) auto 90px;
    align-items: center;
    gap: var(--space-4);
    padding: 12px var(--space-2);
    border-bottom: 2px solid var(--line);
    transition: background-color 0.2s ease;
}

.history__item:hover { background: var(--canvas-hover); }

.history__date {
    display: grid;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    opacity: 0.85;
}

.history__date span { font-family: var(--font-display); font-size: 30px; letter-spacing: 0; }

.history__poster { width: 48px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; }
.history__title { font-weight: 800; font-size: 17px; }
.history__rating { justify-self: end; --rating: var(--rating-light); }
.history__rating .rating { color: var(--rating-light); }
/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: var(--space-3);
    background: color-mix(in srgb, var(--scrim) 70%, transparent);
    backdrop-filter: blur(4px);
}

/* Library sheet (add / edit a series) */
.sheet {
    width: min(520px, 100%);
    max-height: calc(100vh - 2 * var(--space-3));
    overflow-y: auto;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--on-surface);
}

.sheet__head {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    min-height: 170px;
    padding: var(--space-5) var(--space-4) var(--space-3);
    background:
        linear-gradient(to top, var(--surface) 8%, color-mix(in srgb, var(--surface) 35%, transparent)),
        var(--sheet-image) center / cover no-repeat;
}

.sheet__poster {
    width: 76px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 3px solid var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sheet__heading { min-width: 0; padding-right: 40px; }
.sheet__heading .eyebrow { margin-bottom: 4px; }

.sheet__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 40px;
    line-height: 0.95;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.sheet__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--scrim) 55%, transparent);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sheet__close:hover { background: var(--scrim); }

.sheet__body {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.sheet__footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--field-border);
    text-align: center;
}

.field-label {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.field-label--split { display: flex; justify-content: space-between; align-items: baseline; }
.field-label small { color: var(--on-surface-soft); font-weight: 600; font-size: 12px; }

/* Status as selectable tiles */
.segmented {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    border: 0;
}

.segmented legend { margin-bottom: var(--space-2); padding: 0; }

.segmented__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented__option > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    border: 2px solid var(--field-border);
    border-radius: 16px;
    background: var(--field);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.segmented__option > span:hover { border-color: var(--on-surface-soft); }
.segmented__option > span:active { transform: scale(0.97); }

.segmented__icon { font-size: 20px; line-height: 1; }

.segmented__option input:checked + span {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--field));
}

.segmented__option input:checked + span .segmented__icon { color: var(--accent); }
.segmented__option input:focus-visible + span { outline: 3px solid var(--rating-light); outline-offset: 2px; }

/* Rating slider */
.rating-input { display: grid; gap: var(--space-2); }

.rating-input__head { display: flex; justify-content: space-between; align-items: flex-end; }

.rating-input__value {
    color: var(--rating);
    font-family: var(--font-display);
    font-size: 48px;
    line-height: 0.9;
}

.range {
    --fill: 50%;
    width: 100%;
    height: 10px;
    margin: 0;
    border-radius: 999px;
    background: linear-gradient(to right, var(--rating) var(--fill), var(--field-border) var(--fill));
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.range::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    border: 5px solid var(--surface);
    border-radius: 50%;
    background: var(--rating);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    -webkit-appearance: none;
}

.range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 5px solid var(--surface);
    border-radius: 50%;
    background: var(--rating);
}

.rating-input__scale {
    display: flex;
    justify-content: space-between;
    color: var(--on-surface-soft);
    font-weight: 600;
    font-size: 12px;
}

.link-button {
    padding: 4px;
    border: 0;
    background: none;
    font-weight: 700;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

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

/* 6. Pages ---------------------------------------------------------------- */

/* Login / register */
.auth-page .page { padding-top: var(--space-4); }

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-6);
    align-items: center;
    min-height: calc(100vh - 2 * var(--space-3) - var(--space-7));
}

.auth-intro { display: flex; flex-direction: column; align-items: flex-start; }
.auth-intro .logo { margin-bottom: var(--space-5); padding-top: 0; }
.auth-intro .display { font-size: clamp(64px, 9vw, 140px); }

.auth-intro__footer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.auth-intro__footer .lead { margin: 0; max-width: 34ch; }

.auth-form .errors { width: 100%; }
.card--form { width: 100%; padding: var(--space-5); }

/* Home hero */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 400px;
    align-items: center;
    gap: var(--space-5);
    padding-top: var(--space-4);
}

.hero__media {
    position: relative;
    display: block;
    height: 300px;
    border: 6px solid var(--outline);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero__banner { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hero__media:hover .hero__banner { transform: scale(1.04); }

.hero__media .avatar--hero { position: absolute; left: 16px; bottom: 16px; }

.hero__media-label {
    position: absolute;
    right: 16px;
    bottom: 16px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--on-surface);
    font-weight: 800;
    font-size: 13px;
}

/* Search page */
.page-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-head .eyebrow { margin-bottom: 0; }

.search-results { display: grid; gap: var(--space-3); }

.search-result {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-4);
    padding: 12px var(--space-4) 12px 12px;
    transition: transform 0.2s ease;
}

.search-result:hover { transform: translateX(4px); }

.search-result__poster {
    width: 110px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
}

.search-result__body { display: grid; gap: var(--space-2); }

.search-result__meta { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }

.search-result__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.05;
    text-transform: uppercase;
}

.search-result__overview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--on-surface-soft);
    font-size: 14px;
}

.search-result__arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--strong);
    color: var(--on-strong);
    font-size: 18px;
}

/* Series detail */
.series-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-6);
    padding-top: var(--space-4);
}

.series-hero .badges { margin-top: var(--space-4); }

.series-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.series-hero__stat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: 14px;
    --rating: var(--rating-light);
}

.series-hero__stat .rating { color: var(--rating-light); }

/* Poster in a cream frame with a dark side strip */
.framed {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.framed img {
    width: 280px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 21px;
}

.framed__strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 54px;
    padding: 16px 0;
    border-radius: 20px;
    background: var(--strong);
    color: var(--on-strong);
}

.framed__score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 30px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.framed__score small {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.14em;
}

/* Profile */
.profile-hero { margin-top: var(--space-2); }

.profile-hero__banner {
    height: 300px;
    border: 6px solid var(--outline);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.profile-hero__banner img { width: 100%; height: 100%; object-fit: cover; }

.profile-hero__info {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
    margin-top: -64px;
    padding-left: var(--space-5);
}

.profile-hero__names { flex: 1; min-width: 240px; }
.profile-hero__names .eyebrow { margin: var(--space-2) 0 0; font-size: 15px; letter-spacing: 0.02em; text-transform: none; }

.profile-hero__action { margin-bottom: 10px; }

/* The page stretches to the bottom of the frame so the cat can sit on its lower edge */
.app-shell:has(.empty-state) { display: flex; flex-direction: column; }
.app-shell:has(.empty-state) .page { display: flex; flex: 1; flex-direction: column; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin: auto auto calc(-1 * var(--space-7)); /* bottom: cancels the page padding */
    padding-top: var(--space-6);
}

.empty-state__image { display: block; width: 220px; height: auto; }

.speech-bubble {
    position: relative;
    max-width: 420px;
    text-align: center;
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--on-surface);
    font-weight: 600;
}

.speech-bubble::before {
    content: "";
    position: absolute;
    bottom: -18px;
    left: 50%;
    border-right: 14px solid transparent;
    border-left: 14px solid transparent;
    border-top: 20px solid var(--surface);
    transform: translateX(-50%);
}

/* Settings */
.settings {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
}

.settings__nav {
    position: sticky;
    top: var(--space-4);
    display: grid;
    gap: 4px;
    padding-top: var(--space-6);
}

.settings__nav a {
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    opacity: 0.8;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.settings__nav a:hover { opacity: 1; background: var(--canvas-hover); }

.settings__sections { display: grid; gap: var(--space-4); max-width: 760px; }
.settings__section { scroll-margin-top: var(--space-4); }
.settings__section .section-title { margin-top: var(--space-5); }
.settings__hint { margin-top: var(--space-3); font-size: 14px; opacity: 0.7; }

.image-preview { position: relative; padding-bottom: 56px; }

.image-preview__banner {
    height: 220px;
    border: 6px solid var(--outline);
    border-radius: 28px;
    overflow: hidden;
}

.image-preview__banner img { width: 100%; height: 100%; object-fit: cover; user-select: none; }

/* Banner crop: drag the preview to choose the visible part */
.image-preview__banner[data-banner-drag] { position: relative; cursor: grab; touch-action: none; }
.image-preview__banner.is-dragging { cursor: grabbing; }
.image-preview__drag-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scrim) 65%, transparent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 0.2s;
}
.image-preview__banner.is-dragging .image-preview__drag-hint { opacity: 0; }

.banner-position {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
    font-weight: 700;
}
.image-preview__avatar { position: absolute; left: var(--space-5); bottom: 0; }

.image-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.image-actions__group { display: grid; gap: var(--space-2); }
.image-actions__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

.file-button { position: relative; cursor: pointer; }
.file-button:focus-within { outline: 3px solid var(--rating-light); outline-offset: 3px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.link-button--muted { color: inherit; opacity: 0.75; }
.link-button--muted:hover { opacity: 1; }

.profile-hero__action.button { margin-bottom: 10px; }

/* Banner from a series */
.banner-picker {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 2px solid var(--line);
    scroll-margin-top: var(--space-4);
}

.banner-picker__title { font-weight: 800; font-size: 17px; }
.banner-picker__caption { font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.banner-picker__caption .link { text-transform: none; letter-spacing: 0; }

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
}

.banner-option {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 3px solid transparent;
    border-radius: 18px;
    background: var(--surface);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.banner-option img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.banner-option:hover { border-color: var(--on-canvas); }
.banner-option:hover img { transform: scale(1.05); }
.banner-option.is-current { border-color: var(--accent); }

.banner-option__title {
    position: absolute;
    inset: auto 0 0;
    padding: var(--space-4) 12px 10px;
    background: linear-gradient(to top, color-mix(in srgb, var(--scrim) 90%, transparent), transparent);
    font-weight: 800;
    font-size: 14px;
    text-align: left;
}

.banner-option__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-strong);
    font-weight: 800;
    font-size: 12px;
}

.profile-hero__banner { position: relative; }

.profile-hero__banner-source {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--scrim) 65%, transparent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    backdrop-filter: blur(6px);
}

.profile-hero__banner-source:hover { background: var(--scrim); }

/* Roles */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--canvas-hover);
    box-shadow: inset 0 0 0 1.5px var(--line-strong);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.role-badge--moderator { background: color-mix(in srgb, #4cb5c6 22%, transparent); box-shadow: inset 0 0 0 1.5px #4cb5c6; }
.role-badge--admin { background: color-mix(in srgb, #f2a65a 22%, transparent); box-shadow: inset 0 0 0 1.5px #f2a65a; }
.role-badge--owner { background: #ffc477; box-shadow: none; color: #3a2405; }

.profile-hero__names .role-badge { margin-left: var(--space-2); }

.status-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* User management */
.admin-filters { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }

.user-table { border-top: 2px solid var(--line); }

.user-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 330px;
    align-items: center;
    gap: var(--space-4);
    padding: 14px var(--space-2);
    border-bottom: 2px solid var(--line);
}

.user-row.is-banned .user-row__identity { opacity: 0.55; }

.user-row__identity { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.user-row__identity:hover strong { text-decoration: underline; }
.user-row__names { display: grid; min-width: 0; }
.user-row__names strong { font-weight: 800; }
.user-row__names > span { overflow: hidden; font-size: 13px; opacity: 0.75; text-overflow: ellipsis; white-space: nowrap; }

.user-row__you {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--on-canvas);
    color: var(--canvas);
    font-size: 11px;
}

.user-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.user-row__detail { font-size: 13px; opacity: 0.7; }

.user-row__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }

.input--small {
    width: auto;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.pill-button {
    padding: 7px 14px;
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--on-canvas);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pill-button:hover { border-color: var(--on-canvas); background: var(--canvas-hover); }
.pill-button--danger { border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.pill-button--danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

.role-help {
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--canvas-hover);
}

.role-help summary { font-weight: 800; cursor: pointer; }
.role-help ul { display: grid; gap: var(--space-2); margin-top: var(--space-3); font-size: 14px; }
.role-help .role-badge { margin-right: var(--space-2); }

/* Administration: tabs, comments, hints */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--canvas-hover); justify-self: start; }

.admin-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.admin-nav__link:hover { background: var(--canvas-hover); }
.admin-nav__link.is-active { background: var(--on-canvas); color: var(--canvas); }

.admin-nav__count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-strong);
    font-size: 12px;
    text-align: center;
}

.admin-hint { margin-top: var(--space-5); font-size: 14px; opacity: 0.8; }
.admin-hint a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.comment-table { border-top: 2px solid var(--line); }

.comment-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-4);
    padding: 14px var(--space-2);
    border-bottom: 2px solid var(--line);
}

.comment-row__poster img { width: 52px; aspect-ratio: 2 / 3; border-radius: 8px; object-fit: cover; }
.comment-row__body { display: grid; gap: 6px; min-width: 0; }
.comment-row__meta { font-size: 14px; }
.comment-row__meta a:hover strong { text-decoration: underline; }
.comment-row__meta time { opacity: 0.7; }
.comment-row__text { overflow-wrap: anywhere; white-space: pre-line; font-size: 15px; line-height: 1.5; }

.pager { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-5); font-weight: 700; font-size: 14px; }

.entry-card__moderation { justify-self: start; }
.entry-card__moderation .link-button { padding: 0; font-size: 13px; }

.sheet__notice {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}


/* Administration: row menu, one-time password, registration */
.row-menu { position: relative; }
.row-menu__toggle { padding: 7px 12px; letter-spacing: 0.1em; }
.row-menu .dropdown { top: calc(100% + 6px); z-index: 20; width: 230px; }
.row-menu form { display: contents; }
.row-menu .dropdown__item { width: 100%; text-align: left; }

.temp-password {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.temp-password__value {
    justify-self: start;
    padding: 6px 14px;
    border-radius: 10px;
    background: var(--canvas);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.06em;
    user-select: all;
}

.temp-password__hint { font-size: 13px; opacity: 0.8; }

.registration-settings { display: grid; gap: var(--space-5); max-width: 720px; }

.invite-card {
    display: grid;
    gap: var(--space-3);
    border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 60%);
}
.invite-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.invite-card .eyebrow { margin: 0; }
.invite-card__status { font-size: 13px; font-weight: 800; color: var(--success); }
.invite-card__code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 800; font-size: clamp(22px, 4vw, 32px); letter-spacing: 0.05em; overflow-wrap: anywhere; user-select: all; }
.invite-card__link { font-size: 14px; }

.callout {
    display: grid;
    gap: 4px;
    padding: 14px 18px 14px 50px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}
.callout::before {
    content: "!";
    position: absolute;
    left: 16px;
    top: 14px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 13px;
}
.callout--warning { background: var(--danger-bg); color: var(--danger); }
.callout--warning::before { background: var(--danger); color: var(--danger-bg); }
.callout strong { font-size: 15px; }

.registration-form { gap: var(--space-5); }
.registration-form__title { padding: 0; margin-bottom: var(--space-3); font-weight: 800; font-size: 17px; }

.mode-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }

.mode-option {
    position: relative;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--field-border);
    border-radius: 18px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.mode-option:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--field-border)); transform: translateY(-2px); }
.mode-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.mode-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.mode-option__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
}
.mode-option__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-option:has(input:checked) .mode-option__icon { background: var(--accent); color: var(--surface); }
.mode-option__title { font-size: 15px; }
.mode-option__text { color: var(--on-surface-soft); font-weight: 600; font-size: 13px; line-height: 1.45; }

.mode-option__check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--surface);
    font-size: 12px;
    font-weight: 900;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.mode-option:has(input:checked) .mode-option__check { opacity: 1; transform: none; }

/* The code only matters in invite mode */
.invite-code { display: grid; gap: var(--space-2); }
.registration-form:not(:has(input[name="mode"][value="invite"]:checked)) .invite-code { display: none; }
.invite-code__row { display: flex; gap: var(--space-2); }
.invite-code__row .input { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 0.03em; }
.invite-code__row .button { flex: none; }
.invite-code .settings__hint { margin: 0; }

@media (max-width: 720px) {
    /* Compact rows: icon left, text right */
    .mode-grid { grid-template-columns: 1fr; gap: var(--space-2); }
    .mode-option { grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--space-3); row-gap: 2px; padding: 12px 44px 12px 12px; }
    .mode-option__icon { grid-row: span 2; align-self: center; margin: 0; }
    .mode-option__check { top: 50%; margin-top: -11px; }
    .mode-option:hover { transform: none; }
    .invite-code__row { flex-wrap: wrap; }
    .invite-code__row .input,
    .invite-code__row .button { flex: 1 1 100%; }
}

.settings__notice { margin-bottom: var(--space-3); }
.form__text { line-height: 1.6; opacity: 0.85; }


/* Friends: find people */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.section-head .section-title { margin: 0; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-4); }

.person-card { display: grid; gap: var(--space-3); padding: 0 0 var(--space-4); overflow: hidden; }
.person-card__link { position: relative; display: block; }
.person-card__banner { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; transition: transform 0.3s ease; }
.person-card__link:hover .person-card__banner { transform: scale(1.04); }

.person-card__avatar {
    position: absolute;
    left: var(--space-4);
    bottom: -30px;
    width: 64px;
    height: 64px;
    border: 4px solid var(--surface);
}

.person-card__body { display: grid; gap: 2px; padding: 30px var(--space-4) 0; min-width: 0; }
.person-card__name { overflow: hidden; font-weight: 800; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.person-card__name:hover { text-decoration: underline; }
.person-card__meta { overflow: hidden; color: var(--on-surface-soft); font-weight: 600; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.person-card__action { align-self: end; padding: 0 var(--space-4); }
.person-card__action .button { padding-top: 10px; padding-bottom: 10px; font-size: 14px; }


/* Auth: password reset */
.password-rules { display: grid; gap: 4px; margin-top: calc(var(--space-2) * -1); font-size: 13px; line-height: 1.5; }
.password-rules__item { display: flex; align-items: center; gap: 8px; opacity: 0.7; transition: color 0.15s, opacity 0.15s; }
.password-rules__item::before { content: "✕"; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid currentColor; font-size: 10px; font-weight: 800; }
.password-rules__item.is-met { color: var(--success); opacity: 1; }
.password-rules__item.is-met::before { content: "✓"; border-color: var(--success); background: var(--success); color: var(--surface, #fff); }
.form__between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }

.form__success {
    padding: 10px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5;
}


/* Landing page for guests ------------------------------------------------- */
.landing-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.landing-bar .logo { padding-top: 0; }
.landing-bar__actions { display: flex; gap: var(--space-2); }
.landing-bar__actions .button { white-space: nowrap; }

.landing-hero { grid-template-columns: minmax(0, 1fr) auto 360px; padding-top: var(--space-6); }
.landing-hero .display { font-size: clamp(64px, 8vw, 128px); }
.landing-hero .lead { max-width: 560px; }
.landing-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

/* Three posters fanned out like cards */
.landing-stack { position: relative; height: 380px; }
.landing-stack__poster {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 190px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 6px solid var(--outline);
    border-radius: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}
.landing-stack__poster:nth-child(1) { transform: translateX(-105%) rotate(-9deg); z-index: 1; }
.landing-stack__poster:nth-child(2) { transform: translateX(-50%) translateY(-24px); z-index: 3; }
.landing-stack__poster:nth-child(3) { transform: translateX(5%) rotate(9deg); z-index: 2; }
.landing-stack:hover .landing-stack__poster:nth-child(1) { transform: translateX(-115%) rotate(-12deg); }
.landing-stack:hover .landing-stack__poster:nth-child(3) { transform: translateX(15%) rotate(12deg); }
.landing-stack__poster--empty {
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-display);
    font-size: 30px;
    text-transform: uppercase;
}

.landing-focus { display: grid; gap: var(--space-3); max-width: 900px; margin: var(--space-7) auto var(--space-6); text-align: center; }
.landing-focus .eyebrow { justify-self: center; margin: 0; }
.landing-focus__text {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.4vw, 58px);
    line-height: 1.05;
    text-transform: uppercase;
}
.landing-focus__text em { font-style: normal; color: var(--rating-light); }
.landing-focus .lead { justify-self: center; max-width: 620px; }

.landing-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.landing-feature { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5); }
.landing-feature p { line-height: 1.6; opacity: 0.85; }
.landing-feature__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-2);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
    font-size: 22px;
    font-weight: 900;
}
.landing-feature__title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; text-transform: uppercase; }

/* Endless poster rows ("Gerade beliebt") */
.marquee {
    display: grid;
    gap: var(--space-4);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee__row { overflow: hidden; }
.marquee__track {
    display: flex;
    gap: var(--space-3);
    width: max-content;
    animation: marquee-left 60s linear infinite;
}
/* Moving right: start shifted by one copy and slide back to 0 */
.marquee__row--reverse .marquee__track { animation-name: marquee-right; }

/* The track holds the row twice: shifting by one copy (half the track plus half a gap) loops seamlessly */
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(calc(-50% - var(--space-3) / 2)); } }
@keyframes marquee-right { from { transform: translateX(calc(-50% - var(--space-3) / 2)); } to { transform: translateX(0); } }

.marquee__item { flex: none; display: grid; gap: var(--space-2); width: 140px; margin: 0; font-weight: 800; font-size: 13px; line-height: 1.3; }
.marquee__item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); }
.marquee__item figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); counter-reset: none; }
.landing-steps__item { display: flex; gap: var(--space-3); align-items: flex-start; }
.landing-steps__item h3 { margin-bottom: 4px; font-weight: 800; font-size: 18px; }
.landing-steps__item p { line-height: 1.6; opacity: 0.85; }
.landing-steps__number {
    flex: none;
    font-family: var(--font-display);
    font-size: 64px;
    line-height: 0.85;
    color: transparent;
    -webkit-text-stroke: 2px var(--on-canvas);
}

.landing-cta { display: grid; justify-items: center; gap: var(--space-3); margin-top: var(--space-7); padding: var(--space-6) var(--space-5); text-align: center; }
.landing-cta .lead { max-width: 560px; }
.landing-cta .landing-hero__actions { justify-content: center; margin-top: var(--space-2); }

@media (max-width: 1100px) {
    .landing-hero { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 860px) {
    .landing-bar { padding-top: var(--space-3); }
    .landing-bar .button { padding: 7px 12px; font-size: 13px; }
    .landing-bar .logo { font-size: 22px; }
    .landing-hero { grid-template-columns: 1fr; padding-top: var(--space-4); }
    .landing-hero .display { font-size: 64px; }
    .landing-stack { order: -1; height: 250px; }
    .landing-stack__poster { width: 130px; top: 20px; border-width: 4px; border-radius: 16px; }
    .landing-features,
    .landing-steps { grid-template-columns: 1fr; }
    .landing-focus { margin: var(--space-6) auto var(--space-5); }
    .marquee__item { width: 110px; font-size: 12px; }
    .marquee__track { animation-duration: 45s; }
}


/* 7. Responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
    .hero { grid-template-columns: minmax(0, 1fr) 340px; }
    .hero__badge { display: none; }
    .content-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); }
}

@media (max-width: 860px) {
    body { padding: var(--space-2); }
    .app-shell { min-height: calc(100vh - 2 * var(--space-2)); border-radius: 24px; }
    .page,
    .page-errors { width: calc(100% - 2 * var(--space-4)); }

    .navbar {
        grid-template-columns: auto 1fr;
        grid-template-areas: "logo end";
        padding: 0 var(--space-4);
    }

    .logo { grid-area: logo; }
    .navbar__end { grid-area: end; }
    .navbar__tab::before,
    .navbar__tab::after { display: none; }
    .navbar__end .search { display: none; }

    .hero,
    .series-hero,
    .content-layout,
    .auth-layout { grid-template-columns: 1fr; }

    .hero__media { height: 200px; }
    .avatar--hero { width: 64px; height: 64px; border-width: 4px; }

    .tile--large { aspect-ratio: 4 / 3; border-width: 5px; }
    .tile--large .tile__overlay { padding: var(--space-4); }
    .tile--large .tile__title { font-size: 34px; }
    .series-hero .framed { justify-self: center; order: -1; }
    .framed img { width: 200px; }
    .content-layout__sidebar { padding-top: 0; }

    .auth-intro .display { font-size: 52px; }
    .auth-intro .display br { display: none; }
    .auth-intro .logo { margin-bottom: var(--space-4); }
    .auth-intro__footer { margin-top: var(--space-3); }
    .auth-layout { gap: var(--space-5); min-height: 0; }
    .auth-intro__footer .spin-badge { display: none; }
    .form__row { grid-template-columns: 1fr; }

    .user-row { grid-template-columns: 1fr; gap: var(--space-2); }
    .user-row__actions { justify-content: flex-start; }
    .comment-row { grid-template-columns: 44px minmax(0, 1fr); }
    .comment-row__poster img { width: 44px; }
    .comment-row__actions { grid-column: 2; }
    .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
    .person-card__avatar { width: 52px; height: 52px; bottom: -24px; left: var(--space-3); }
    .person-card__body { padding: 26px var(--space-3) 0; }
    .person-card__action { padding: 0 var(--space-3); }

    .settings { grid-template-columns: 1fr; gap: 0; }
    .settings__nav { position: static; display: flex; flex-wrap: wrap; padding-top: 0; }
    .image-preview__banner { height: 160px; }
    .image-preview__avatar { left: var(--space-3); }
    .image-actions { grid-template-columns: 1fr; }

    .spotlight,
    .split,
    .top-pick { grid-template-columns: 1fr; }
    .tile-grid { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: repeat(3, 1fr); }
    .stat-strip > li:nth-child(3n + 1) { border-left: 0; }
    .stat-strip > li:nth-child(n + 4) { border-top: 2px solid var(--line); }
    .stat-strip__value { font-size: 40px; }

    .avatar--list { width: 72px; height: 72px; }
    .list-tabs__tab { padding: 8px 14px; font-size: 14px; }
    .poster-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-3); }
    .history__item { grid-template-columns: 48px 44px minmax(0, 1fr) auto; }
    .history__item .badge { display: none; }
    .timeline__item { grid-template-columns: 44px minmax(0, 1fr); }
    .timeline__poster { display: none; }

    .profile-hero__banner { height: 200px; }
    .profile-hero__info { margin-top: -48px; padding-left: var(--space-3); }
    .avatar--profile { width: 112px; height: 112px; }

    .search-result { grid-template-columns: 80px minmax(0, 1fr); }
    .search-result__poster { width: 80px; }
    .search-result__arrow { display: none; }
    .search-result__title { font-size: 22px; }

    .empty-state__image { width: 170px; }
    .carousel__button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 8. Phones: app-like layout ---------------------------------------------- */

@media (max-width: 860px) {
    /* Full-bleed shell instead of the framed desktop card */
    body { padding: 0; }
    .app-shell { min-height: 100vh; min-height: 100dvh; border-radius: 0; }
    .page { padding-bottom: var(--space-6); }
    .navbar ~ .footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
    .card--form { padding: var(--space-4); }

    .logo { padding-top: 18px; font-size: 26px; }
    .navbar__end { padding-top: 12px; }

    /* Main navigation becomes a floating tab bar at the bottom */
    .navbar__tab {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 6px;
        border: 1px solid color-mix(in srgb, var(--on-frame) 12%, transparent);
        border-radius: 24px;
        background: color-mix(in srgb, var(--frame) 92%, transparent);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }

    .navbar__link {
        display: grid;
        justify-items: center;
        gap: 3px;
        padding: 8px 2px 7px;
        border-radius: 18px;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.2;
        opacity: 0.65;
        transition: background-color 0.15s ease, opacity 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .navbar__link::after { display: none; }
    .navbar__link.is-active { opacity: 1; background: color-mix(in srgb, var(--on-frame) 14%, transparent); }
    .navbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .navbar__icon {
        display: block;
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .navbar__link.is-active .navbar__icon { stroke-width: 2.2; }

    /* Feedback: round icon button above the tab bar */
    .feedback-button { right: 14px; bottom: calc(92px + env(safe-area-inset-bottom)); padding: 12px; }
    .feedback-button__label { display: none; }
    .segmented--wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Toast and dialogs stay clear of the tab bar */
    .toast { bottom: calc(96px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }

    .modal { align-items: end; padding: 0; }
    .modal:has(.trailer) { align-items: center; padding: var(--space-3); }
    .sheet {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 28px 28px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Tab rows scroll sideways instead of wrapping into several lines */
    .admin-nav,
    .list-tabs,
    .settings__nav {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .admin-nav::-webkit-scrollbar,
    .list-tabs::-webkit-scrollbar,
    .settings__nav::-webkit-scrollbar { display: none; }
    .admin-nav__link,
    .list-tabs__tab,
    .settings__nav a { flex: none; white-space: nowrap; }
    .admin-nav { border-radius: 22px; }
    .list-tabs { padding-bottom: 2px; }
    .settings__nav { margin: 0 calc(var(--space-4) * -1); padding: 0 var(--space-4) var(--space-3); gap: var(--space-2); }
    .settings__nav a { padding: 8px 14px; border: 2px solid var(--line-strong); border-radius: 999px; font-size: 14px; }

    /* Carousels: smaller posters, so more than one fits */
    .poster { flex-basis: 132px; }
    .poster__frame img { border-radius: 14px; }
    .poster__title { font-size: 13px; }
    .poster__rating { right: 6px; bottom: 6px; padding: 3px 8px; font-size: 12px; }
    .poster--ranked { flex-basis: 178px; padding-left: 46px; }
    .poster__rank { font-size: 118px; -webkit-text-stroke-width: 2px; }

    /* Lists */
    .history__item { grid-template-columns: 38px 40px minmax(0, 1fr) auto; gap: var(--space-3); padding: 10px 4px; }
    .history__date { font-size: 10px; }
    .history__date span { font-size: 24px; }
    .history__poster { width: 40px; border-radius: 6px; }
    .history__title { font-size: 15px; line-height: 1.3; }

    .stat-strip__label { font-size: 10px; letter-spacing: 0.06em; }
    .stat-strip__value { font-size: 34px; }

    /* Search results: compact, at most two genres */
    .search-result { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); }
    .search-result__poster { width: 72px; }
    .search-result__title { font-size: 20px; }
    .search-result .badge:nth-child(n + 3) { display: none; }

    /* Settings: series banners two per row */
    .banner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
    .banner-option__title { font-size: 12px; }
}

/* Friends: rows instead of cards on phones */
@media (max-width: 600px) {
    .people-grid { grid-template-columns: 1fr; gap: var(--space-2); }
    .person-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: var(--space-3);
        padding: 12px;
    }
    .person-card__link { flex: none; }
    .person-card__banner { display: none; }
    .person-card__avatar { position: static; width: 52px; height: 52px; border: 0; }
    .person-card__body { padding: 0; }
    .person-card__name { font-size: 16px; }
    .person-card__action { padding: 0; }
    .person-card__action .button { width: auto; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
}
