/* Filmabend: Farben, Schriften und Komponenten aus docs/prototype.html, auf Bootstrap 5.3 abgebildet. */

/* ---------- Tokens ---------- */
:root,
:root[data-bs-theme="light"] {
  --bg: #F4F3F7; --surface: #FFFFFF; --surface-2: #EEECF3; --ink: #1E1A2B; --muted: #6B6578; --line: #E1DEE8;
  --curtain: #7A1F3D; --curtain-rgb: 122, 31, 61; --curtain-hover: #651632; --on-curtain: #FFFFFF;
  --popcorn: #E39A21; --popcorn-soft: #FBEBCF;
  --avail: #1D7466; --avail-bg: #DDF1EC;
  --warn: #9A5B00; --warn-bg: #FFF1D6;
  --bad: #A3271F; --bad-bg: #FBE3E1;
  --seen: #34539A; --seen-bg: #E2E9F8;
  --shadow: 0 1px 2px rgba(30,26,43,.06), 0 8px 24px rgba(30,26,43,.06);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}
:root[data-bs-theme="dark"] {
  --bg: #15121D; --surface: #201C2A; --surface-2: #2A2536; --ink: #EEEBF4; --muted: #A39DB1; --line: #342E42;
  --curtain: #C9507A; --curtain-rgb: 201, 80, 122; --curtain-hover: #D96A90; --on-curtain: #1A0F15;
  --popcorn: #F2B54A; --popcorn-soft: #3A2E18;
  --avail: #63C7B3; --avail-bg: #16362F;
  --warn: #F0B860; --warn-bg: #3A2C12;
  --bad: #F08A80; --bad-bg: #3D1C1A;
  --seen: #93B0F0; --seen-bg: #1E2A45;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

/* Bootstrap-Variablen auf die Tokens legen */
:root,
:root[data-bs-theme="light"],
:root[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line);
  --bs-primary: var(--curtain);
  --bs-primary-rgb: var(--curtain-rgb);
  --bs-link-color: var(--curtain);
  --bs-link-color-rgb: var(--curtain-rgb);
  --bs-link-hover-color: var(--curtain-hover);
  --bs-body-font-family: var(--body);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.5;
  --bs-border-radius: 9px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
  --bs-focus-ring-color: rgba(var(--curtain-rgb), .25);
  --bs-danger: var(--bad);
  --bs-danger-text-emphasis: var(--bad);
  --bs-danger-bg-subtle: var(--bad-bg);
  --bs-danger-border-subtle: var(--bad-bg);
  --bs-warning-text-emphasis: var(--warn);
  --bs-warning-bg-subtle: var(--warn-bg);
  --bs-warning-border-subtle: var(--warn-bg);
}

html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3, .display { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--curtain); outline-offset: 2px; border-radius: 6px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

/* ---------- Bootstrap-Komponenten angleichen ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-font-size: .95rem; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; white-space: nowrap; }
.btn-sm { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .85rem; }
.btn-primary {
  --bs-btn-bg: var(--curtain); --bs-btn-border-color: var(--curtain); --bs-btn-color: var(--on-curtain);
  --bs-btn-hover-bg: var(--curtain-hover); --bs-btn-hover-border-color: var(--curtain-hover); --bs-btn-hover-color: var(--on-curtain);
  --bs-btn-active-bg: var(--curtain-hover); --bs-btn-active-border-color: var(--curtain-hover); --bs-btn-active-color: var(--on-curtain);
  --bs-btn-disabled-bg: var(--curtain); --bs-btn-disabled-border-color: var(--curtain); --bs-btn-disabled-color: var(--on-curtain);
  --bs-btn-focus-shadow-rgb: var(--curtain-rgb);
}
.btn-ghost {
  --bs-btn-bg: transparent; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line); --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--line); --bs-btn-active-color: var(--ink);
}
.btn-link { --bs-btn-color: var(--curtain); --bs-btn-hover-color: var(--curtain-hover); font-weight: 600; text-underline-offset: 3px; }
.form-control, .form-select { background-color: var(--surface); border-color: var(--line); color: var(--ink); font-size: .95rem; padding: .6rem .8rem; }
.form-select { padding-right: 2.25rem; }
.form-control:focus, .form-select:focus { border-color: var(--curtain); box-shadow: 0 0 0 3px rgba(var(--curtain-rgb), .2); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--muted); }
.form-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--curtain); border-color: var(--curtain); }
.form-check-input:focus { border-color: var(--curtain); box-shadow: 0 0 0 3px rgba(var(--curtain-rgb), .2); }
.alert { --bs-alert-border-radius: 12px; }
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-radius: 16px; --bs-modal-border-width: 0; }
.text-body-secondary { color: var(--muted) !important; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1020;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .65rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand svg { color: var(--curtain); }
.mainnav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; }
.mainnav a { padding: .45rem .75rem; border-radius: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; }
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.live { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--avail); box-shadow: 0 0 0 3px var(--avail-bg); }
.live.offline i { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }
.me { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  padding: .2rem .7rem .2rem .2rem; font-weight: 600; font-size: .9rem; color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .live > span { display: none; } .me .me-name { display: none; } .me { padding: .2rem; } .brand span { display: none; } }

.page { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.narrow { max-width: 420px; margin: 3rem auto; }

/* ---------- Avatare ---------- */
.av { --c: #666; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff;
  font-weight: 700; font-size: .8rem; flex: none; font-family: var(--display); }
.av-lg { width: 56px; height: 56px; font-size: 1.4rem; }
.av-xs { width: 20px; height: 20px; font-size: .65rem; border: 2px solid var(--surface); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -6px; }

/* ---------- Poster (das eine laute Element) ---------- */
.poster { --h: 330; position: relative; overflow: hidden; border-radius: 6px; color: #fff; flex: none;
  background:
    radial-gradient(120% 70% at 20% 0%, hsl(calc(var(--h) + 30) 75% 55% / .55), transparent 60%),
    linear-gradient(165deg, hsl(var(--h) 55% 34%), hsl(calc(var(--h) + 50) 60% 14%));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.poster::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 4px); pointer-events: none; }
.poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster:has(> img)::after { display: none; }  /* Rasterlinien nur auf dem Platzhalter */
.poster-sm { width: 44px; height: 64px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.poster-md { width: 100%; aspect-ratio: 2/3; display: flex; flex-direction: column; justify-content: flex-end; padding: .75rem; }
.poster-lg { width: 100%; aspect-ratio: 2/3; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.25rem; }
.poster-title { font-family: var(--display); font-weight: 800; line-height: 1; letter-spacing: -.02em; text-wrap: balance; position: relative; z-index: 1; }
.poster-md .poster-title { font-size: 1.05rem; }
.poster-lg .poster-title { font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem); }
.poster-year { position: relative; z-index: 1; font-size: .8rem; opacity: .8; margin-top: .3rem; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.chip-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip-badge.avail { background: var(--avail-bg); color: var(--avail); }
.chip-badge.avail::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-badge.stale::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
.chip-badge.warn { background: var(--warn-bg); color: var(--warn); }
.chip-badge.seerr { background: var(--seen-bg); color: var(--seen); }

/* ---------- Login & Profilwahl ---------- */
.login { min-height: calc(100vh - 2rem); display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-card { width: min(460px, 100%); }
.login-mark { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 2rem + 6vw, 5rem); line-height: .9; letter-spacing: -.04em; margin-bottom: .5rem; }
.login-mark span { display: block; color: var(--curtain); }
.login-sub { color: var(--muted); margin-bottom: 2rem; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .6rem; margin-bottom: 1.5rem; }
.who button { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .8rem .4rem; background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; font-weight: 600; color: var(--ink); }
.who button:hover, .who button[aria-pressed="true"] { border-color: var(--curtain); background: color-mix(in srgb, var(--curtain) 8%, var(--surface)); }

/* ---------- Seitenkopf, Übersicht ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { color: var(--muted); margin-top: .35rem; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }
.list-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
  display: flex; flex-direction: column; gap: .9rem; transition: border-color .15s; color: var(--ink); text-decoration: none; }
a.list-card:hover, button.list-card:hover { border-color: var(--curtain); color: var(--ink); }
.list-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.list-strip .poster-md { padding: .45rem; }
.list-strip .poster-title { font-size: .7rem; }
.list-strip .poster-year { display: none; }
.list-card h2 { font-size: 1.2rem; }
.list-card .counts { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); }
.list-card .counts b { color: var(--ink); }
.new-list { border-style: dashed; justify-content: center; align-items: center; min-height: 200px; color: var(--muted); font-weight: 600; }

/* ---------- Listenansicht ---------- */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3rem .85rem; font-weight: 600; font-size: .88rem;
  color: var(--muted); text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"], .tab[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.toolbar .form-control { max-width: 260px; }
.toolbar .form-select { width: auto; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button, .seg a { border: none; background: none; padding: .35rem .75rem; border-radius: 7px; font-weight: 600; font-size: .88rem; color: var(--muted); text-decoration: none; text-align: center; }
.seg label { padding: .35rem .75rem; border-radius: 7px; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg-radio:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-radio:focus-visible + label { outline: 2px solid var(--curtain); outline-offset: 2px; }
.seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.sort-hint { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; max-width: 70ch; }

.entries { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.entry-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 120px 150px 130px; gap: 1rem; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.entry-row:first-child { border-top: none; }
.entry-head { padding: .55rem 1rem; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.entry-head > :first-child { grid-column: 1 / 3; }
.entry-row.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { background: var(--popcorn-soft); } 100% { background: transparent; } }
.row-poster { text-decoration: none; }
.row-title { font-weight: 650; font-size: 1rem; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--curtain); }
.row-meta { font-size: .82rem; color: var(--muted); }
.avg { display: flex; flex-direction: column; gap: .15rem; }
.avg strong { font-family: var(--display); font-size: 1.25rem; font-weight: 750; line-height: 1; }
.avg span { font-size: .75rem; color: var(--muted); }
.avg-none { color: var(--muted); font-size: .85rem; }
.mine-label { display: none; }
.status-sel { border: none; border-radius: 8px; padding: .35rem .5rem; font-weight: 600; font-size: .85rem; width: 100%; cursor: pointer; }
.s-offen { background: var(--surface-2); color: var(--ink); }
.s-gesehen { background: var(--seen-bg); color: var(--seen); }
.s-abgelehnt { background: var(--bad-bg); color: var(--bad); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 1rem; }
@media (max-width: 820px) {
  .entry-head { display: none; }
  .entry-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "p m m" "p avg st" "p mine mine"; row-gap: .6rem; }
  .row-poster { grid-area: p; align-self: start; }
  .row-main { grid-area: m; }
  .avg { grid-area: avg; flex-direction: row; align-items: baseline; gap: .4rem; }
  .row-mine { grid-area: mine; display: flex; align-items: center; gap: .6rem; }
  .mine-label { display: inline; font-size: .8rem; color: var(--muted); }
  .row-status { grid-area: st; }
}

/* ---------- Prioritäten & Sterne ---------- */
.pips { display: inline-flex; gap: 4px; }
.pip { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: transparent; padding: 0; transition: transform .1s; }
.pip.on { background: var(--popcorn); border-color: var(--popcorn); }
.pip:not([disabled]):hover { transform: scale(1.12); border-color: var(--popcorn); }
.pip[disabled] { cursor: default; }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: none; padding: 0 1px; font-size: 1.25rem; line-height: 1; color: var(--line); }
.star.on { color: var(--curtain); }
.star[disabled] { cursor: default; }

/* ---------- Detailansicht ---------- */
.back { color: var(--muted); font-weight: 600; margin-bottom: 1.25rem; display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; }
.back:hover { color: var(--ink); }
.detail { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 2.25rem; align-items: start; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } .detail-side { max-width: 260px; } }
.detail-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); display: flex; flex-direction: column; gap: .75rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); margin: .5rem 0 1.1rem; font-size: .95rem; }
.overview { max-width: 65ch; margin-bottom: 1.1rem; }
.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.ext-rating { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: .15rem; }
.ext-star { color: var(--popcorn); margin-right: .15rem; }
.section { margin-bottom: 2rem; }
.section h2 { margin-bottom: .75rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.inst-list { display: flex; flex-direction: column; }
.inst { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.inst:first-child { border-top: none; padding-top: 0; }
.inst:last-child { padding-bottom: 0; }
.inst-name { font-weight: 600; }
.inst-state { font-size: .85rem; }
.ok { color: var(--avail); }
.no { color: var(--muted); }
.seerr-box { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: .75rem; padding: 1rem; border-radius: 12px; background: var(--seen-bg); color: var(--seen); }
.seerr-box p { color: var(--ink); font-size: .92rem; max-width: 48ch; }
.votes { width: 100%; border-collapse: collapse; }
.votes th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 .5rem .5rem 0; }
.votes td { padding: .55rem .5rem .55rem 0; border-top: 1px solid var(--line); vertical-align: middle; }
.votes .who-cell { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.votes tr.me-row td { background: color-mix(in srgb, var(--popcorn) 7%, transparent); }
.table-wrap { overflow-x: auto; }

/* ---------- Dialog „Hinzufügen“ ---------- */
.results { display: flex; flex-direction: column; gap: 2px; margin: .75rem 0 1rem; }
.result { display: flex; gap: .85rem; align-items: center; text-align: left; width: 100%; background: none; border: 1px solid transparent; border-radius: 10px; padding: .5rem; color: var(--ink); }
.result:hover, .result:focus-visible { background: var(--surface-2); }
.result-main { flex: 1; min-width: 0; }
.result-title { font-weight: 650; }
.dup-box { background: var(--warn-bg); color: var(--ink); border-radius: 12px; padding: 1rem; margin: .5rem 0 1rem; }
.dup-box strong { color: var(--warn); }
.dup-actions { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 140px; gap: .75rem; }
.trailer { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; }
.trailer iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Heute gucken ---------- */
.tonight { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.75rem; align-items: start; }
@media (max-width: 860px) { .tonight { grid-template-columns: 1fr; } }
.present { display: flex; flex-wrap: wrap; gap: .4rem; }
.present label { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: .2rem .7rem .2rem .2rem; font-weight: 600; font-size: .88rem; opacity: .5; cursor: pointer; }
.present input { position: absolute; opacity: 0; pointer-events: none; }
.present label:has(input:checked) { opacity: 1; border-color: var(--ink); }
.present label:has(input:focus-visible) { outline: 2px solid var(--curtain); outline-offset: 2px; }
.stage { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.25rem; margin-bottom: 1.75rem; min-height: 300px; }
@media (max-width: 560px) { .stage { grid-template-columns: 1fr; } .stage .poster-md { max-width: 180px; } }
.stage-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); }
.stage-result { display: contents; }
.present label { position: relative; }
.stage h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); margin-bottom: .4rem; }
.stage .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.spinning .poster-md { animation: wobble .09s linear infinite alternate; }
@keyframes wobble { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.reveal .poster-md { animation: land .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes land { from { transform: scale(.85) rotate(-4deg); } }
.rank { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 2ch 44px minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: none; }
.rank-n { font-family: var(--display); font-weight: 800; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; gap: 1.25rem; }
.admin-grid .panel { padding: 1.25rem; }
.admin-grid .panel > h2 { margin-bottom: .35rem; }
.admin-grid .panel > p.text-body-secondary { margin-bottom: 1rem; font-size: .92rem; max-width: 70ch; }
.atable { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 620px; }
.atable th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 .75rem .5rem 0; }
.atable td { padding: .6rem .75rem .6rem 0; border-top: 1px solid var(--line); vertical-align: middle; }
.atable code { font-size: .82rem; color: var(--muted); }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.add-inst { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: .6rem; margin-top: 1rem; align-items: end; }
@media (max-width: 760px) { .add-inst { grid-template-columns: 1fr; } }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
@media (max-width: 640px) { .form-2 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.chip { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 99px; padding: .2rem .3rem .2rem .2rem; font-weight: 600; font-size: .9rem; }
.chip button { background: none; border: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 .35rem; }
.inline-form { display: flex; gap: .5rem; max-width: 420px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(1turn); } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 1090; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, calc(100% - 2rem)); }
.toast-msg { display: flex; gap: .6rem; align-items: center; background: var(--ink); color: var(--bg); padding: .7rem .9rem; border-radius: 12px; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop2 .2s ease-out; }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Footer ---------- */
.site-footer { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem 2rem; font-size: .8rem; color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.tmdb-logo img { display: block; height: 14px; width: auto; }

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