/* palette: #493628 dark brown as the ground, #AB886D tan, #D6C0B3 sand, #E4E0E1 greige for type */
:root {
  --text: #ece7e5;
  --muted: #c2ab9c;
  --faint: #8a7363;
  --line: rgb(228 224 225 / 0.12);
  --card: rgb(255 255 255 / 0.06);
  --card-strong: rgb(255 255 255 / 0.11);
  --card-line: rgb(255 255 255 / 0.1);
  --shadow: 0 14px 34px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.18);
  --blur: blur(18px) saturate(1.15);
  /* the content column: on wide screens the sides stay empty */
  --page: 1200px;
  --side: max(var(--gutter), calc((100% - var(--page)) / 2));
  --accent: #d6c0b3;
  --accent-strong: #e4e0e1;
  --on-accent: #3a2a1f;
  --empty-icon: #e4e0e1;
  /* one colour per person: the avatar letter, the chosen pill and their note paper */
  --a: #ab886d;
  --b: #8c7666;
  --note-a: rgb(255 255 255 / 0.07);
  --note-b: rgb(255 255 255 / 0.07);

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --gutter: clamp(16px, 4vw, 40px);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  color-scheme: dark;
}

@media (prefers-reduced-transparency: reduce) {
  :root { --card: #fffaf4; --card-strong: #fffaf4; --blur: none; }
}

* { box-sizing: border-box; }

/* the bottom of the page gradient, for overscroll; liquidGL's canvas is wider than the page */
/* the scrollbar's room is kept even on short pages, so the centred column doesn't shift between pages */
html { background: #2a1e16; overflow-x: clip; scrollbar-gutter: stable; }

body {
  margin: 0;
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* its background is set by background.js */
/* Layers, bottom up: #app's ground, the backdrop (0), the cards' liquidGL canvas (1, a sibling before #app),
   then the home and log content (2) on top of it. #app must not be a stacking context, or the canvas would sit
   either under its opaque ground or over all of its content. */
#app { position: relative; min-height: 100vh; }
.home, .log, .login { position: relative; z-index: 2; }
/* liquidGL turns pointer events off on a lens; the panes' contents take them back */
.home .latest > *, .home .extreme > *, .login form > * { pointer-events: auto; }

/* The mouse is reflected on the glass: the pane's edge catches a thin line of light nearest the pointer, with a
   faint sheen inside. Each pane is its own stacking context so both sit above the glass canvas but under the
   pane's contents. */
.top-bar, .home .latest, .home .extreme, .login form { position: relative; z-index: 0; }
.top-bar::before, .home .latest::before, .home .extreme::before, .login form::before,
.top-bar::after, .home .latest::after, .home .extreme::after, .login form::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.top-bar::before, .home .latest::before, .home .extreme::before, .login form::before {
  background: radial-gradient(circle 90px at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / 0.05), transparent);
}
/* only the 1px border ring shows: the content box is cut out of the gradient */
.top-bar::after, .home .latest::after, .home .extreme::after, .login form::after {
  padding: 1px;
  background: radial-gradient(circle 130px at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / 0.6), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.top-bar.lit::before, .home .latest.lit::before, .home .extreme.lit::before, .login form.lit::before,
.top-bar.lit::after, .home .latest.lit::after, .home .extreme.lit::after, .login form.lit::after { opacity: 1; }

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.heavy { font-weight: 800; letter-spacing: -0.01em; }
.a { color: var(--text); }
.b { color: var(--text); }
.hint { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* a frosted pastel card: the shared look of every surface */
.latest, .extreme, .pool-item, .login form, .sheet {
  border: 1px solid var(--card-line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn:hover { background: rgb(255 255 255 / 0.16); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: rgb(255 255 255 / 0.08); color: var(--text); }
.btn.danger { background: none; border-color: transparent; color: var(--muted); }
.btn.danger:hover { background: var(--note-a); color: #e8907a; }
.btn:disabled, .btn:disabled:hover { opacity: 0.5; cursor: default; }
/* icon-only buttons never show a shape: on hover only the icon changes colour */
.btn.icon-btn, .btn.icon-btn:hover { width: 38px; padding: 0; background: none; border-color: transparent; }
.btn.icon-btn { color: var(--muted); }
.btn.icon-btn:hover { color: var(--text); }
.btn.danger.icon-btn:hover { color: #e8907a; }
/* icon-only buttons never draw a shape, focused included (a dialog focuses its × on opening): the icon lights up */
.btn.icon-btn:focus-visible, .save-btn:focus-visible { outline: none; color: var(--accent-strong); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(171 136 109 / 0.3); outline: none; }
.error { color: #e8907a; font-size: 14px; min-height: 1.4em; margin: 0; }

.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); transition: opacity 0.3s ease; }
.login.waiting { opacity: 0; }
/* a random still from a black and white classic; its grey and vignette are drawn into the canvas */
.login-still {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.login-still.ready { opacity: 0.8; }
.login form { width: min(380px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: var(--r-lg); }
.login h1 { display: flex; align-items: center; gap: 10px; font-size: 32px; line-height: 1.1; margin: 0; }
.login-row { position: relative; }
.login-row .input { padding-right: 46px; }
.login-go {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: background 0.15s;
}
.login-go:hover { background: var(--accent-strong); }
.login .error:empty { display: none; }

.top { position: sticky; top: 0; z-index: 20; padding: 12px var(--side) 0; }
/* liquidGL paints the bar's glass and sets pointer-events: none on it, so its contents switch them back on */
.top-bar { position: relative; border-radius: 999px; }
@media (prefers-reduced-transparency: reduce) {
  .top-bar { background: var(--card-strong); }
}
.top-content {
  pointer-events: auto;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 20px;
}
.top-content > :not(.btn.primary) { text-shadow: 0 1px 3px rgb(0 0 0 / 0.6); }
.top .spacer { flex: 1; }
.wordmark { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; margin: 0; line-height: 1; text-decoration: none; }
.top-content a.btn { text-decoration: none; }
.top-content .nav { font-weight: 600; }
.top-content .nav.current { color: var(--text); background: rgb(255 255 255 / 0.12); }
.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.who:hover { background: rgb(255 255 255 / 0.1); }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #6b5242;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.18);
}
span.avatar.a { background: var(--note-a); color: var(--a); }
span.avatar.b { background: var(--note-b); color: var(--accent-strong); }

.picker { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; color: var(--muted); white-space: nowrap; }
.picker .avatar { width: 22px; height: 22px; font-size: 10px; }
.picker-name { margin-left: -2px; color: var(--text); font-weight: 700; }

.marks { display: inline-flex; gap: 0.12em; font-size: 14px; line-height: 0; }
.marks-gap { width: 0.6em; flex: none; }
/* two copies of the same picture: a faded grey one for the empty slot, the real one on top when filled */
.mark { position: relative; display: inline-block; flex: none; width: 1em; height: 1em; }
.mark.ates { --pic: url(/icons/flame.png); }
.mark.bok { --pic: url(/icons/poo.png); }
.mark::before, .mark::after { content: ""; position: absolute; inset: 0; background: var(--pic) center / contain no-repeat; }
.mark::before { filter: grayscale(1); opacity: 0.22; }
.mark::after { display: none; }
.mark.on::after { display: block; }
.mark.half::after { display: block; clip-path: inset(0 50% 0 0); }

.scale-line { display: inline-flex; align-items: center; gap: 10px; }
.scale-line .icons { display: inline-flex; gap: 2px; line-height: 0; }
.count { min-width: 2.6em; color: var(--muted); font-size: 13px; font-weight: 600; }

.poster { display: block; aspect-ratio: 2 / 3; width: 100%; object-fit: cover; background: #3a2b21; border-radius: 12px; }
div.poster { display: flex; align-items: flex-end; padding: 6px; font-size: 9px; line-height: 1.15; color: var(--muted); overflow: hidden; }

/* home: the latest film on the left, the most cooked and most bok films stacked on the right */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin: 20px var(--side) 18px;
}
.home:empty { display: none; }
/* room is kept for the still before it loads, so the cards don't jump down when it arrives */
.page.has-backdrop .home { margin-top: clamp(90px, 17vw, 240px); }

/* the latest film's still, behind the bar, fading out at the sides and into the page at the bottom */
.backdrop {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: min(100%, 1500px);
  height: min(56vw, 640px);
  translate: -50% 0;
  pointer-events: none;
}
.backdrop canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s ease; }
.backdrop canvas.ready { opacity: 0.7; }

/* son film */
.latest {
  position: relative;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  grid-template-areas:
    "poster head avg"
    "poster verdicts verdicts"
    "poster action action";
  gap: 16px 24px;
  align-content: start;
  padding: 22px;
  border-radius: var(--r-lg);
}
.latest .poster { grid-area: poster; align-self: start; border-radius: 16px; box-shadow: 0 16px 34px rgb(0 0 0 / 0.28); }
.latest-head { grid-area: head; display: grid; gap: 4px; align-content: start; min-width: 0; }
.latest-title { margin: 0; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; overflow-wrap: anywhere; }
.latest .meta { margin: 0; color: var(--muted); }
.kicker { margin: 0; color: var(--muted); font-size: 14px; }
.film-avg { margin: 4px 0 0; color: var(--muted); }
.film-avg strong { color: var(--text); font-size: 20px; font-weight: 800; }
.latest-action { grid-area: action; }

/* the shared average: a label, the number with its side's icon, the side's word */
.avg-block { display: grid; justify-items: start; align-content: start; line-height: 1.1; }
.avg-block small { font-size: 12px; color: var(--muted); }
.avg-block strong { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 800; }
.avg-block .mark { width: 20px; height: 20px; }
.latest > .avg-block { grid-area: avg; padding-left: 20px; border-left: 1px solid var(--line); }
.latest > .avg-block strong { font-size: 30px; }
.latest > .avg-block .mark { width: 28px; height: 28px; }

.verdicts { grid-area: verdicts; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.verdict {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgb(255 255 255 / 0.05);
  border: 1px solid var(--card-line);
  cursor: pointer;
  transition: background 0.35s ease;
}
.verdict:hover { background: rgb(255 255 255 / 0.1); }
.verdict-head { display: flex; align-items: center; gap: 10px; }
.verdict-head .avatar { width: 40px; height: 40px; font-size: 17px; }
.verdict-head .name { font-weight: 800; font-size: 16px; }

/* our notes read like handwriting on a light slip of paper */
.note-box { padding: 10px 14px; border-radius: var(--r-sm); font-family: var(--hand); font-size: 19px; line-height: 1.25; }
.verdict.a .note-box, .take.a .note-box { background: var(--note-a); }
.verdict.b .note-box, .take.b .note-box { background: var(--note-b); }
.note { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.note + .note { margin-top: 6px; }
.note .mark { width: 15px; height: 15px; margin-top: 4px; }
.note span { overflow-wrap: anywhere; white-space: pre-wrap; }

/* en pismis / en boktan */
.extremes { display: grid; grid-template-rows: 1fr 1fr; gap: 18px; min-width: 0; }
.extreme { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 18px 20px; border-radius: var(--r-lg); cursor: pointer; transition: background 0.35s ease; }
.extreme:not(.empty):hover { background: var(--card-strong); }
.extreme.empty { cursor: default; }
.extreme.empty .hint { margin: 0; }
.extreme-empty { display: flex; align-items: center; gap: 14px; }
.extreme-empty .mark { width: 48px; height: 48px; }
.extreme-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 800; }
.extreme-head img { flex: none; }
.extreme-main { display: grid; grid-template-columns: 84px minmax(0, 1fr) 20px; gap: 16px; align-items: center; }
.extreme .poster { border-radius: 12px; box-shadow: 0 10px 22px rgb(0 0 0 / 0.22); }
.extreme-body { display: grid; gap: 8px; min-width: 0; }
.extreme .title { font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.extreme-score { display: inline-flex; align-items: center; gap: 8px; }
.extreme-score .mark { width: 44px; height: 44px; }
.extreme-score strong { font-size: 30px; font-weight: 800; line-height: 1; }
.chevron { display: grid; place-items: center; color: var(--faint); transition: color 0.3s ease; }
.chevron .icon { width: 20px; height: 20px; }
.extreme:hover .chevron, .row:hover .chevron { color: var(--text); }

/* izlicezler */
.pool { margin: 24px var(--side) 64px; }
.pool-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.pool-head h2 { font-size: 26px; font-weight: 800; margin: 0; }
.pool-head .spacer { flex: 1; }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.pool-item { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-md); transition: box-shadow 0.25s ease, background 0.35s ease; }
.pool-item.lit { box-shadow: 0 0 0 3px var(--b); }
.pool-item.chosen { box-shadow: 0 0 0 3px var(--text); background: var(--card-strong); }
/* always two lines tall, so the name and buttons below line up across cards */
.pool-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pool-by { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pool-by .avatar { width: 22px; height: 22px; font-size: 10px; }
.pool-actions { display: flex; gap: 4px; margin-top: auto; }
.pool-actions .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.pool-actions .btn:first-child { flex: 1; }

/* the log: one frosted panel, the films as lighter strips inside it */
.log { padding: 0 var(--side) 64px; }
.log-panel {
  position: relative;
  padding: 10px 18px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--card-line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.sort-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.3s ease;
}
.sort-btn:hover { color: var(--text); }
.sort-btn .icon { width: 16px; height: 16px; }
.year { font-size: 22px; font-weight: 800; margin: 14px 4px 12px; }
.row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 64px auto 76px 20px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 8px 14px 8px 8px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: rgb(255 255 255 / 0.04);
  text-align: left;
  cursor: pointer;
  transition: background 0.35s ease;
}
.row:hover { background: rgb(255 255 255 / 0.1); }
.row .poster { border-radius: 10px; }
.row .main { display: grid; gap: 2px; min-width: 0; }
.row .title { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
/* the block padding keeps the avatar's ring from being clipped by the ellipsis overflow */
.row .sub { padding: 3px; margin: -3px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* hover only brightens the card; nothing grows, lifts or glows */
.row .mdate { display: none; color: var(--muted); }
.row .date { color: var(--muted); font-size: 14px; }
.row .rating { display: grid; gap: 8px; }
.rline { display: inline-flex; align-items: center; gap: 18px; }
.rline .icons { gap: 3px; }
.rline .avatar { width: 22px; height: 22px; font-size: 10px; }
.rline .mark { width: 15px; height: 15px; }

.empty-state { padding: 60px 0; max-width: 40ch; }
.empty-state h2 { font-size: 28px; line-height: 1.1; margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }

/* dialogs */
.sheet {
  width: min(820px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border-radius: var(--r-lg);
  background: var(--card-strong);
  color: var(--text);
  overflow: hidden;
}
/* must match the dim passed to the dialog rim in app.js */
.sheet::backdrop { background: rgb(0 0 0 / 0.45); }
.sheet .close { position: absolute; top: 14px; right: 14px; z-index: 3; }
/* the body scrolls, not the dialog, so the rounded corners stay clean */
.sheet-body {
  position: relative;
  z-index: 2;
  max-height: calc(100dvh - 26px);
  overflow-y: auto;
  padding: 28px;
  /* a thin, quiet scrollbar instead of the browser's thick grey one against the rounded edge */
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.2) transparent;
}
.sheet-body::-webkit-scrollbar { width: 6px; }
.sheet-body::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.sheet-body::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 0.2); border-radius: 999px; }

.film { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
.film > .poster { box-shadow: 0 14px 30px rgb(0 0 0 / 0.25); }
.film h2 { font-size: 30px; line-height: 1.15; margin: 0; padding-right: 52px; }
.film .meta { color: var(--muted); margin: 4px 0 0; }
.film .film-avg { margin-bottom: 16px; }
.film .facts { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.film .facts .field { min-width: 150px; }

.takes { display: grid; gap: 12px; }
.take { padding: 18px; border-radius: var(--r-md); background: rgb(255 255 255 / 0.05); border: 1px solid var(--card-line); }
.take header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.take .name, .verdict .name { display: inline-flex; align-items: center; gap: 8px; }
.take .name { font-size: 15px; font-weight: 800; }
.take .marks { font-size: 15px; }
.take .note-box { margin-top: 10px; }
.take .none { color: var(--faint); margin: 10px 0 0; }
.take form { display: grid; gap: 12px; margin-top: 14px; }
.take .actions, .sheet .actions { display: flex; gap: 8px; align-items: center; }
.actions .spacer { flex: 1; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pill input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.pill .avatar { width: 30px; height: 30px; }
.pill.a:has(input:checked) { background: var(--note-a); border-color: var(--a); color: var(--text); }
.pill.b:has(input:checked) { background: var(--note-b); border-color: var(--b); color: var(--text); }
.pill:has(input:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.scale-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.scale-label { display: inline-flex; align-items: center; gap: 6px; min-width: 100px; font-size: 14px; font-weight: 700; color: var(--muted); }
.scale-label .mark { width: 16px; height: 16px; }
.hit { display: flex; }
.hit button { display: grid; place-items: center; width: 30px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; }

.hit .mark { width: 24px; height: 24px; }
.mark-text { min-width: 2.5em; font-size: 14px; font-weight: 800; }

/* a plain tick on the right, no ring */
/* just the tick, no shape around it */
.save-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  cursor: pointer;
  transition: color 0.3s ease;
}
.save-btn .icon { width: 28px; height: 28px; stroke-width: 2.6; }
.save-btn:hover { color: var(--text); }
.take .error:empty { display: none; }

.danger-zone { margin-top: 20px; display: flex; justify-content: flex-end; }

.sheet.crop { width: min(420px, calc(100% - 24px)); }
/* the profile drops down under the name in the bar; app.js sets its top and right from the name's position */
/* nothing dims the page behind it, so it is a dark glass of its own to stay readable over a bright still */
.sheet.profile { position: fixed; inset: auto; margin: 0; width: min(280px, calc(100% - 24px)); background: rgb(0 0 0 / 0.55); }
.sheet.profile::backdrop { background: transparent; }
.profile-body, .crop-body { display: grid; gap: 16px; }
.profile-body { gap: 12px; padding: 16px; }
.profile-body .error:empty { display: none; }
.profile-body .field > span { font-size: 12px; }
.profile-body .input { height: 38px; font-size: 14px; }
.profile-photo { display: flex; align-items: center; gap: 10px; }
.profile-photo .btn:not(.icon-btn) { height: 34px; padding: 0 12px; font-size: 13px; }
.profile-avatar .avatar { width: 46px; height: 46px; font-size: 19px; }
/* the save tick sits inside the mahlas box, like the arrow on the login */
.alias-row { position: relative; display: block; }
.alias-row .input { width: 100%; padding-right: 40px; }
.alias-row .save-btn { position: absolute; top: 0; right: 0; width: 38px; height: 38px; }
.alias-row .save-btn .icon { width: 20px; height: 20px; }
.profile-logout {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 2px -16px -16px;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}
.profile-logout:hover { color: var(--text); }
.crop-stage { justify-self: center; width: min(280px, 100%); aspect-ratio: 1; border-radius: 50%; background: #3a2b21; cursor: grab; touch-action: none; }
.crop-stage:active { cursor: grabbing; }

.add h2 { font-size: 24px; line-height: 1.2; margin: 0 0 18px; }
.add .search { display: flex; gap: 8px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px; margin-top: 20px; }
.result {
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  animation: rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
}
.result .t { font-size: 13px; font-weight: 700; margin-top: 6px; line-height: 1.3; }
.result .y { font-size: 12px; color: var(--muted); }
.result:hover .poster { outline: 3px solid var(--accent); outline-offset: 2px; }
.picked { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: start; }
.picked .info h3 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; }
.picked .info p { color: var(--muted); margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }

@media (max-width: 1100px) {
  /* not enough room for a side column: the two extreme cards go side by side under the latest film */
  .home { grid-template-columns: 1fr; }
  .extremes { grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .row { grid-template-columns: 56px minmax(0, 1fr) auto 64px; }
  .row .date, .row .chevron { display: none; }
  .row .mdate { display: inline; }
}

@media (max-width: 720px) {
  .top { padding: 10px 12px 0; }
  .top-content { gap: 2px; padding: 5px 5px 5px 10px; }
  .top-content .btn { height: 34px; padding: 0 10px; font-size: 13px; }
  .wordmark span, .top-content .nav span { display: none; }
  .wordmark img { width: 28px; height: 28px; }
  .who > span:last-child { display: none; }
  .who { padding: 3px; }

  .home { margin: 14px 12px 12px; gap: 12px; }
  .latest {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "poster head"
      "poster avg"
      "verdicts verdicts"
      "action action";
    gap: 10px 14px;
    padding: 14px;
  }
  .latest-title { font-size: 22px; }
  .latest > .avg-block { padding-left: 0; border-left: 0; }
  .latest > .avg-block strong { font-size: 24px; }
  .verdicts { gap: 10px; }
  .verdict { padding: 10px; }
  .verdict-head .avatar { width: 30px; height: 30px; }
  .verdict-head .name { font-size: 14px; }
  .note-box { font-size: 16px; }

  .extremes { grid-template-columns: 1fr; gap: 12px; }
  .extreme { padding: 14px 16px; }
  .extreme-main { grid-template-columns: 64px minmax(0, 1fr) 20px; }
  .extreme-score .mark { width: 32px; height: 32px; }
  .extreme-score strong { font-size: 26px; }

  .pool { margin-left: 12px; margin-right: 12px; }
  .log { padding: 0 12px 48px; }
  .log-panel { padding: 8px 10px 12px; }
  .sort-btn { top: 12px; right: 10px; }
  .row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "poster main   avg"
      "poster rating rating";
    gap: 8px 12px;
    padding: 8px;
  }
  .row .poster { grid-area: poster; align-self: start; }
  .row .main { grid-area: main; }
  .row .rating { grid-area: rating; }
  .row .avg-block { grid-area: avg; justify-items: end; }
  .rline { gap: 6px; }
  .rline .mark { width: 11px; height: 11px; }
  .rline .count { min-width: 0; font-size: 11px; }

  .film { grid-template-columns: 1fr; }
  .film > .poster { width: 120px; }
  .film h2 { font-size: 26px; }
  .sheet-body { padding: 20px 16px; }
  .hit button { width: 26px; }
  .hit .mark { width: 21px; height: 21px; }
  .scale-label { min-width: 0; width: 100%; }
  .picked { grid-template-columns: 90px minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
