/* Cinemax design tokens */
:root {
    --bg: #0b0b0f;
    --surface: #15151b;
    --surface-2: #1e1e26;
    --surface-3: #282832;
    --line: #2c2c37;
    --ink: #f6f4f0;
    --muted: #a7a5b0;
    --accent: #ff5a36;
    --accent-hover: #ff7a5c;
    --on-accent: #190d09;
    --gold: #f7bd4b;
    --good: #5fd08f;
    --danger: #ff7b72;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-link-color-rgb: 255, 90, 54;
    --bs-link-hover-color-rgb: 255, 122, 92;
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--muted);
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
}

/* Base */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.75rem);
    margin: 0 0 8px;
}

h2 {
    font-size: 1.4rem;
    margin: 0 0 12px;
}

h3 {
    font-size: 1.15rem;
    margin: 0 0 10px;
}

hr {
    border-color: var(--line);
    opacity: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

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

code {
    color: var(--gold);
}

.lead-text {
    color: var(--muted);
    margin: 0;
}

.text-link {
    font-weight: 600;
    font-size: 0.9rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    --bs-btn-border-radius: var(--radius-sm);
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: 18px;
    --bs-btn-padding-y: 9px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    --bs-btn-padding-x: 12px;
    --bs-btn-padding-y: 5px;
    --bs-btn-border-radius: 8px;
    --bs-btn-font-size: 0.84rem;
}

.btn-lg {
    --bs-btn-padding-x: 24px;
    --bs-btn-padding-y: 12px;
    --bs-btn-font-size: 1rem;
    --bs-btn-border-radius: var(--radius);
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-color: var(--on-accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-active-color: var(--on-accent);
    --bs-btn-disabled-bg: var(--surface-3);
    --bs-btn-disabled-border-color: var(--surface-3);
    --bs-btn-disabled-color: var(--muted);
}

.btn-ghost,
.btn-outline-light,
.btn-outline-primary,
.btn-secondary,
.btn-link {
    --bs-btn-bg: rgba(255, 255, 255, 0.06);
    --bs-btn-border-color: rgba(255, 255, 255, 0.14);
    --bs-btn-color: var(--ink);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.13);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.26);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: rgba(255, 255, 255, 0.16);
    --bs-btn-active-border-color: rgba(255, 255, 255, 0.26);
    --bs-btn-active-color: var(--ink);
    text-decoration: none;
    backdrop-filter: blur(6px);
}

.btn-danger,
.btn-danger-soft {
    --bs-btn-bg: rgba(255, 123, 114, 0.12);
    --bs-btn-border-color: rgba(255, 123, 114, 0.32);
    --bs-btn-color: var(--danger);
    --bs-btn-hover-bg: var(--danger);
    --bs-btn-hover-border-color: var(--danger);
    --bs-btn-hover-color: #2a0c09;
    --bs-btn-active-bg: var(--danger);
    --bs-btn-active-border-color: var(--danger);
    --bs-btn-active-color: #2a0c09;
}

/* Forms */
.form-card,
.prose-card,
.settings-body > form:not(.form-card),
.settings-body > .row {
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.field {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.field label,
.field legend,
.settings-body label:not(.form-check-label):not(.form-floating > label) {
    display: block;
    float: none;
    width: auto;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

.optional {
    color: var(--muted);
    font-weight: 400;
    margin-left: 4px;
}

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

.form-control,
.form-select {
    --bs-body-bg: var(--surface-2);
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: var(--surface-2);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
    color: #7d7b87;
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    background-color: var(--surface-2);
    color: var(--ink);
    box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.22);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--surface);
    color: var(--muted);
}

.form-control-lg {
    min-height: 52px;
    font-size: 1rem;
    border-radius: var(--radius);
}

textarea.form-control {
    min-height: 120px;
}

.form-floating > .form-control {
    height: calc(3.5rem + 2px);
}

.form-floating > label {
    color: var(--muted);
}

.form-floating > label::after {
    background: transparent !important;
}

.form-check-input {
    background-color: var(--surface-2);
    border-color: #4b4b58;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.field-error,
.text-danger {
    display: block;
    color: var(--danger) !important;
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-error:empty,
.form-error.validation-summary-valid {
    display: none;
}

.form-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 123, 114, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(255, 123, 114, 0.1);
    color: var(--danger);
    font-size: 0.9rem;
}

.form-error ul {
    margin: 0;
    padding-left: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.tip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0 16px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 90, 54, 0.3);
    border-radius: var(--radius);
    background: rgba(255, 90, 54, 0.08);
}

.tip-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Star rating input */
.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
}

.star-input input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.star-input label {
    margin: 0 !important;
    color: #54545f !important;
    font-size: 2.2rem !important;
    line-height: 1;
    cursor: pointer;
    transition: color 0.1s ease, transform 0.1s ease;
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: var(--gold) !important;
}

.star-input label:hover {
    transform: scale(1.12);
}

.star-input input:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.review-target {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.review-target img {
    width: 58px;
    height: auto;
    border-radius: 7px;
}

.review-target small,
.review-target span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.review-target strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
}

/* Navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(11, 11, 15, 0.86);
    backdrop-filter: blur(14px);
}

.nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-nav .navbar-brand,
.footer-brand {
    margin: 0;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.site-nav .navbar-toggler {
    margin-left: auto;
    padding: 5px 9px;
    border-color: var(--line);
}

.site-nav .nav-link {
    color: var(--muted);
    font-weight: 500;
    padding: 6px 11px;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav .nav-link:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}

.navbar-collapse {
    flex-grow: 0;
    margin-left: auto;
}

.nav-account {
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.nav-account form {
    margin: 0;
}

/* Search */
.search-box {
    position: relative;
}

.nav-search {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 460px;
}

.nav-search .form-control {
    min-height: 40px;
    border-radius: 999px;
    padding-left: 18px;
    font-size: 0.92rem;
}

.page-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 0 0 16px;
}

.lead-text + .page-search {
    margin-top: 16px;
}

.search-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: min(360px, calc(100vw - 40px));
    max-height: min(62vh, 480px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transition: opacity 0.12s ease;
}

.search-panel.loading {
    opacity: 0.7;
}

.search-label {
    margin: 8px 10px 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.search-none {
    margin: 12px;
    color: var(--muted);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.search-row:hover,
.search-row.active {
    background: var(--surface-3);
    color: var(--ink);
}

.search-row img,
.search-row-empty {
    flex: none;
    display: block;
    width: 38px;
    height: 57px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--surface-3);
}

.search-row-text {
    min-width: 0;
}

.search-row-text strong,
.search-row-text small {
    display: block;
}

.search-row-text strong {
    font-weight: 600;
    line-height: 1.25;
}

.search-row-text small {
    color: var(--muted);
}

/* Layout */
.page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.page.narrow {
    max-width: 760px;
}

.page-head {
    margin-bottom: 22px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.section-head h2 {
    margin: 0;
}

.section-head.page-head {
    align-items: flex-end;
    margin-bottom: 22px;
}

.head-actions,
.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page > section,
.home-rows > section {
    margin-top: 40px;
}

.page > section:first-child {
    margin-top: 0;
}

.toast-stack {
    position: fixed;
    z-index: 60;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
}

.toast-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    box-shadow: var(--shadow);
    font-size: 0.93rem;
    animation: toast-in 0.2s ease-out;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-note.leaving {
    opacity: 0;
    transform: translateY(8px);
}

.toast-note > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.toast-note.success {
    border-left-color: var(--good);
}

.toast-note.warning {
    border-left-color: var(--gold);
}

.toast-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--bg);
    font-size: 0.85rem;
    font-weight: 800;
}

.success .toast-icon {
    background: var(--good);
}

.warning .toast-icon {
    background: var(--gold);
}

.toast-close {
    flex: none;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.toast-close:hover {
    color: var(--ink);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.empty-state {
    padding: 32px 18px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.state-page {
    padding-top: 12vh;
    text-align: center;
}

.state-page .hero-actions {
    justify-content: center;
    margin-top: 22px;
}

.state-page > .btn {
    margin-top: 22px;
}

.state-code {
    margin: 0 0 6px;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 6rem);
    font-weight: 800;
    line-height: 1;
}

/* Hero */
.hero,
.detail-hero {
    position: relative;
    background-color: var(--bg);
}

.hero {
    background-image:
        linear-gradient(90deg, rgba(11, 11, 15, 0.97) 12%, rgba(11, 11, 15, 0.55) 58%, rgba(11, 11, 15, 0.12)),
        linear-gradient(0deg, var(--bg) 1%, transparent 42%),
        var(--hero-image, none);
    background-position: center 22%;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    max-width: 1240px;
    min-height: min(74vh, 620px);
    margin: 0 auto;
    padding: 64px 20px 44px;
}

.hero-plain .hero-inner {
    min-height: 340px;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(2.4rem, 6.5vw, 4.4rem);
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin: 0 0 12px;
    color: #cfccd4;
    font-size: 0.95rem;
}

.meta-score {
    color: var(--gold);
    font-weight: 700;
}

.hero-text {
    max-width: 620px;
    margin: 0 0 22px;
    color: #dcdae0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* Movie cards */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 26px 18px;
}

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 176px;
    gap: 16px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}

.rail .movie-card {
    scroll-snap-align: start;
}

.movie-card,
.import-card {
    display: block;
    min-width: 0;
    color: var(--ink);
}

.movie-card:hover {
    color: var(--ink);
}

.movie-card-button {
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.poster {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 16px;
    background: linear-gradient(150deg, var(--surface-3), #3a1c15);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.movie-card:hover .poster,
.movie-card:focus-visible .poster {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--accent);
}

.score-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(11, 11, 15, 0.82);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
}

.movie-card-title {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.movie-card-meta {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.import-card form,
.import-action {
    margin-top: 8px;
}

.added-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--good);
    color: #08210f;
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-row form {
    margin: 0;
}

/* Chips */
.chips {
    display: flex;
    gap: 8px;
    margin-bottom: 26px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.chip {
    flex: none;
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.87rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.chip:hover {
    border-color: #4a4a58;
    color: var(--ink);
}

.chip.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

/* Pager */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.pager-count {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Movie page */
.detail-hero {
    background-image:
        linear-gradient(0deg, var(--bg) 1%, rgba(11, 11, 15, 0.86) 55%, rgba(11, 11, 15, 0.62)),
        var(--hero-image, none);
    background-position: center 20%;
    background-repeat: no-repeat;
    background-size: cover;
}

.detail-inner {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 20px 30px;
}

.detail-copy .chip {
    margin-bottom: 12px;
}

.detail-poster {
    display: flex;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.overview {
    max-width: 720px;
    color: #e2e0e6;
}

.scores {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.score-box {
    min-width: 104px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
}

.score-box strong {
    display: block;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.1;
}

.score-box strong span {
    font-size: 0.9rem;
    color: var(--muted);
}

.score-box small {
    color: var(--muted);
}

.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
    max-width: 720px;
    margin: 0 0 20px;
}

.facts dt {
    color: var(--muted);
    font-weight: 400;
}

.facts dd {
    margin: 0;
}

/* Reviews */
.review-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 14px;
}

.review-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.15s ease;
}

.review-card:hover {
    border-color: #3d3d4a;
}

.review-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.review-who {
    flex: 1;
    min-width: 0;
}

.review-who strong,
.review-who small {
    display: block;
    line-height: 1.3;
}

.review-who small {
    color: var(--muted);
    font-size: 0.8rem;
}

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

.review-text {
    margin: 0;
    color: #dcdae0;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    overflow: hidden;
}

.avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), #b23a7a);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
}

.avatar-lg {
    width: 62px;
    height: 62px;
    font-size: 1.5rem;
}

.stars {
    flex: none;
    color: var(--gold);
    letter-spacing: 1px;
}

.stars-empty {
    color: var(--surface-3);
}

/* Genres */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 16px;
}

.genre-tile {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 150px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: var(--surface-2);
    background-image: linear-gradient(0deg, rgba(11, 11, 15, 0.94), rgba(11, 11, 15, 0.3)), var(--hero-image, none);
    background-position: center;
    background-size: cover;
    color: var(--ink);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.genre-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--ink);
}

.genre-tile strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.2;
}

.genre-tile small {
    color: #cfccd4;
}

/* Profile and account pages */
.account-form {
    max-width: 440px;
    margin: 4vh auto 0;
}

.account-form h1 {
    text-align: center;
    margin-bottom: 20px;
}

.account-switch {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.account-form .sub-label {
    margin: 24px 0 8px;
    color: var(--muted);
    text-align: center;
}

.settings {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.settings-nav {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.settings-nav a {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
}

.settings-nav a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.settings-nav a.active {
    background: rgba(255, 90, 54, 0.14);
    color: var(--accent-hover);
    font-weight: 600;
}

.settings-body {
    min-width: 0;
    max-width: 680px;
}

.settings-body .row {
    --bs-gutter-x: 0;
    margin: 0;
}

.settings-body [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
}

.settings-body h3,
.settings-body h4 {
    margin-bottom: 14px;
}

.settings-body .btn + .btn {
    margin-left: 6px;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(255, 90, 54, 0.14), var(--surface) 62%);
}

.profile-card small,
.profile-card strong {
    display: block;
}

.profile-card small {
    color: var(--muted);
}

.profile-card strong {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    overflow-wrap: anywhere;
}

.profile-card > div {
    min-width: 0;
}

.alert {
    --bs-alert-bg: var(--surface-2);
    --bs-alert-color: var(--ink);
    --bs-alert-border-color: var(--line);
    border-radius: var(--radius-sm);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 30px 20px 22px;
    border-top: 1px solid var(--line);
    background: #0e0e13;
    color: var(--muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-inner p {
    max-width: 520px;
    margin: 8px 0 0;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--ink);
}

.site-footer small {
    display: block;
    max-width: 1200px;
    margin: 18px auto 0;
}

/* Tablet and phone */
@media (max-width: 991.98px) {
    .nav-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .navbar-collapse {
        order: 4;
        flex-basis: 100%;
    }

    .nav-account {
        align-items: flex-start;
        margin: 6px 0 0;
    }

    .settings {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .settings-nav {
        position: static;
        display: flex;
        overflow-x: auto;
    }

    .settings-nav a {
        flex: none;
    }

    .settings-body {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .movie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 14px;
    }

    .rail {
        grid-auto-columns: 148px;
    }

    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-search {
        grid-template-columns: minmax(0, 1fr);
    }

    .page {
        padding: 24px 16px 48px;
    }

    .nav-inner {
        padding: 0 16px;
    }

    .hero {
        background-image:
            linear-gradient(0deg, var(--bg) 6%, rgba(11, 11, 15, 0.45) 70%, rgba(11, 11, 15, 0.2)),
            var(--hero-image, none);
    }

    .hero-inner {
        min-height: 66vh;
        padding: 40px 16px 26px;
    }

    .detail-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 26px 16px 20px;
    }

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

    .tip-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

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