:root {
  --curtain: #4a0f1a;
  --curtain-deep: #2c070e;
  --paper: #f3e4c3;
  --ink: #23121a;
  --bulb: #ffc53d;
  --bulb-bright: #ffd46a;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --velvet: #8e1b2c;
}

* { box-sizing: border-box; }

::selection { color: var(--ink); background: var(--bulb); }
input { caret-color: var(--velvet); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Figtree', system-ui, sans-serif;
  color: var(--paper);
  /* Stage curtain: soft vertical folds under a spotlight */
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(255, 197, 61, 0.16), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 14px, transparent 14px 46px, rgba(255, 255, 255, 0.035) 46px 60px, transparent 60px 92px),
    linear-gradient(var(--curtain), var(--curtain-deep));
  background-attachment: fixed;
}

.page {
  flex: 1;
  width: min(1280px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  text-align: center;
}

.wordmark {
  margin: 0 0 2.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--bulb);
}

h1 {
  margin: 0;
  font-family: 'Limelight', 'Figtree', sans-serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.05;
  color: var(--paper);
  text-shadow: 0 0 28px rgba(255, 197, 61, 0.35);
}

.lede {
  max-width: 34rem;
  margin: 1.1rem auto 2.4rem;
  font-size: 1.1rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* The form is an admission ticket with a tear-off stub */
.ticket {
  --stub: 13.5rem;
  --notch: 11px;
  display: grid;
  grid-template-columns: 1fr var(--stub);
  max-width: 38rem;
  margin: 0 auto;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border-radius: 12px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45));
  -webkit-mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 97%, #000) intersect,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 97%, #000);
  mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 97%, #000) intersect,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 97%, #000);
}

.ticket-main { padding: 1.2rem 1.5rem 1.3rem; }

.ticket-main label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.7;
}

.ticket-main input {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.15rem 0;
  font: 800 1.7rem 'Figtree', sans-serif;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(35, 18, 26, 0.25);
  border-radius: 0;
  outline: none;
}

.ticket-main input::placeholder { color: rgba(35, 18, 26, 0.52); } /* large bold text: 3:1 on the paper */
.ticket-main input:focus-visible { border-bottom-color: var(--velvet); }

.ticket-stub {
  display: grid;
  place-items: center;
  padding: 1rem;
  border-left: 2px dashed rgba(35, 18, 26, 0.35);
}

button {
  font: 800 1rem 'Figtree', sans-serif;
  cursor: pointer;
}

.ticket-stub button,
.download {
  padding: 0.8rem 1.1rem;
  color: var(--ink);
  background: var(--bulb);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.ticket-stub button:hover:not(:disabled),
.download:hover:not(:disabled) { background: var(--bulb-bright); }

.ticket-stub button:active,
.download:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: 0.55; cursor: progress; }

:focus-visible { outline: 3px solid var(--bulb); outline-offset: 3px; }
.ticket :focus-visible { outline-color: var(--velvet); }
.ticket-main input:focus-visible { outline: none; }

/* Import: one quiet line under the form, for months the RSS feed no longer holds */
.import {
  max-width: 38rem;
  margin: 1.1rem auto 0;
  font-size: 0.92rem;
  line-height: 1.6;
  opacity: 0.9;
}
.import-button {
  display: inline-block;
  font-weight: 700;
  color: var(--bulb);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.import-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.import-button:focus-within { outline: 3px solid var(--bulb); outline-offset: 3px; border-radius: 4px; }
.import-hint { display: block; font-size: 0.82rem; opacity: 0.7; }
.import-hint a { color: inherit; }

.status {
  min-height: 1.5rem;
  margin: 1.4rem auto 0;
  max-width: 34rem;
  font-weight: 600;
}
.status.error { color: var(--bulb); }

/* [hidden] must win over the grid display below */
.result[hidden] { display: none; }

/* Result: a settings panel beside the preview on wide screens, stacked on narrow ones */
.result {
  display: grid;
  grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.controls {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: rgba(20, 4, 8, 0.55);
  border: 1px solid rgba(243, 228, 195, 0.14);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 228, 195, 0.22) transparent;
}

.group {
  margin: 0;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 0;
  border-bottom: 1px solid rgba(243, 228, 195, 0.12);
  min-width: 0;
}

.group-setup { display: grid; gap: 0.9rem; }

/* Section titles lead; field labels sit quieter under them */
.styles legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bulb);
}
.styles legend + * { clear: both; }

.picker > span,
.toggle > span:first-child,
.sublabel {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
}

.picker select,
.style-options label,
.toggle-control {
  font: 600 0.92rem 'Figtree', sans-serif;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(243, 228, 195, 0.22);
}

.picker select { width: 100%; padding: 0.6rem 0.7rem; border-radius: 10px; }
.picker select option { color: #000; }

/* The ratings row reads as label on the left, switch on the right */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.toggle > span:first-child { margin: 0; font-size: 0.92rem; opacity: 0.85; }

/* Ratings switch */
.toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem 0.55rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.toggle-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.toggle-track {
  position: relative;
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(243, 228, 195, 0.25);
  transition: background 0.15s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.15s;
}
.toggle-control input:checked + .toggle-track { background: var(--bulb); }
.toggle-control input:checked + .toggle-track::after { transform: translateX(1.1rem); background: var(--ink); }
.toggle-control input:focus-visible + .toggle-track { outline: 3px solid var(--bulb); outline-offset: 3px; }
.toggle-state { min-width: 3.4rem; }

.style-options { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.style-options input { position: absolute; opacity: 0; pointer-events: none; }
.style-options label { padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: border-color 0.12s, background 0.12s; }
.style-options label:hover { border-color: rgba(243, 228, 195, 0.6); }
.style-options input:checked + label { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.style-options input:focus-visible + label { outline: 3px solid var(--bulb); outline-offset: 3px; }

/* Filter tiles: a small preview of a poster under each filter, name below */
.tile-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem 0.45rem; }
.style-options.tile-options label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  background: none;
  border: 0;
  opacity: 0.8;
}
.tile-options .thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(243, 228, 195, 0.16), rgba(243, 228, 195, 0.04));
  box-shadow: 0 0 0 1.5px rgba(243, 228, 195, 0.18);
  transition: box-shadow 0.12s, transform 0.12s;
}
.tile-options .thumb:not(.ready) { animation: thumb-wait 1.2s ease-in-out infinite alternate; }
@keyframes thumb-wait { to { opacity: 0.5; } }
.style-options.tile-options label:hover { opacity: 1; }
.style-options.tile-options label:active .thumb { transform: scale(0.95); }
.style-options.tile-options label:hover .thumb { box-shadow: 0 0 0 1.5px rgba(243, 228, 195, 0.6); }
.style-options.tile-options input:checked + label { color: var(--paper); background: none; opacity: 1; font-weight: 800; }
/* Month-only styles while a whole year is picked */
.style-options.tile-options input:disabled + label { opacity: 0.35; cursor: not-allowed; }
.tile-options input:checked + label .thumb { box-shadow: 0 0 0 2.5px var(--paper), 0 6px 14px rgba(0, 0, 0, 0.4); transform: translateY(-1px); }
.style-options.tile-options input:focus-visible + label { outline: none; }
.tile-options input:focus-visible + label .thumb { outline: 3px solid var(--bulb); outline-offset: 3px; }

/* Duotone colour pairs: nested under the filter chips, a split swatch before each name */
.tones { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed rgba(243, 228, 195, 0.18); }
.tones[hidden] { display: none; }
.tones .style-options label { display: inline-flex; align-items: center; gap: 0.5rem; }
.tones .style-options label::before {
  content: '';
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tone-dark) 50%, var(--tone-light) 50%);
  box-shadow: 0 0 0 1.5px rgba(243, 228, 195, 0.5);
}

/* The one primary action stays pinned to the bottom of the panel */
.download-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 1rem 1.2rem 1.2rem;
  background: linear-gradient(rgba(20, 4, 8, 0), rgba(20, 4, 8, 0.92) 30%);
}
.download-bar { display: flex; gap: 0.6rem; }
.download { flex: 1; font-size: 1.05rem; }
/* Share sits beside Download as the quieter of the two */
.share {
  padding: 0.8rem 1.1rem;
  font: 700 1.05rem 'Figtree', sans-serif;
  color: var(--paper);
  background: transparent;
  border: 2px solid rgba(243, 228, 195, 0.55);
  border-radius: 999px;
  cursor: pointer;
}
.share { transition: border-color 0.15s, transform 0.08s; }
.share:hover { border-color: var(--paper); }
.share:active { transform: translateY(2px); }
/* Download and Share confirm on the button itself: the label swaps and the button gives one small nod */
.download.done, .share.done, .dock-button.done { animation: nod 0.4s var(--ease-out); }
@keyframes nod { 40% { transform: scale(1.05); } }

/* The preview sits like a film on a screen */
.screen {
  padding: clamp(0.5rem, 2vw, 1rem);
  background: #000;
  border-radius: 6px;
  box-shadow: 0 0 80px rgba(255, 197, 61, 0.14), 0 30px 60px rgba(0, 0, 0, 0.5);
}

canvas { display: block; width: 100%; height: auto; transition: opacity 0.3s var(--ease-out); }

/* Loading: the house lights dim and a row of marquee bulbs chases while posters are found and hung.
   Both wait 150 ms, so a quick redraw (a filter or a style from cached posters) never flickers. */
.screen { position: relative; }
.screen.loading canvas { opacity: 0.3; transition: opacity 0.35s 0.15s; }
.projector {
  position: absolute;
  inset: 0;
  padding: clamp(2rem, 18%, 12rem) 1.25rem 2rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, visibility 0s 0.18s;
}
.screen.loading .projector { opacity: 1; visibility: visible; transition: opacity 0.3s 0.15s; }
.projector-card {
  position: sticky;
  top: 38vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: fit-content;
  max-width: 22rem;
  margin: 0 auto;
  padding: 1rem 1.4rem 1.05rem;
  text-align: center;
  background: rgba(20, 4, 8, 0.82);
  border: 1px solid rgba(243, 228, 195, 0.16);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.projector-text { font-size: 0.92rem; font-weight: 600; line-height: 1.4; color: var(--paper); }
.bulbs { display: flex; gap: 0.55rem; }
.bulbs i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--bulb);
  opacity: 0.22;
}
.screen.loading .bulbs i { animation: chase 1.1s ease-in-out infinite; }
.bulbs i:nth-child(2) { animation-delay: 0.12s !important; }
.bulbs i:nth-child(3) { animation-delay: 0.24s !important; }
.bulbs i:nth-child(4) { animation-delay: 0.36s !important; }
.bulbs i:nth-child(5) { animation-delay: 0.48s !important; }
@keyframes chase {
  0%, 55%, 100% { opacity: 0.22; box-shadow: none; }
  18% { opacity: 1; box-shadow: 0 0 12px 3px rgba(255, 197, 61, 0.6); }
}

/* The first poster comes up like a projector lamp warming: overexposed and soft, settling into focus */
.screen.lit canvas { animation: lamp 1s var(--ease-out); }
.screen.lit { animation: screen-glow 1.4s var(--ease-out); }
@keyframes lamp {
  from { opacity: 0; filter: brightness(2.4) contrast(0.55) blur(8px); }
  35% { opacity: 1; }
  to { filter: none; }
}
@keyframes screen-glow {
  from { box-shadow: 0 0 0 rgba(255, 197, 61, 0), 0 30px 60px rgba(0, 0, 0, 0.5); }
  40% { box-shadow: 0 0 140px rgba(255, 197, 61, 0.3), 0 30px 60px rgba(0, 0, 0, 0.5); }
}

.billing {
  padding: 1.5rem 1.25rem 2rem;
  font-family: 'Six Caps', 'Figtree', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.7; /* keeps the small credit line above 4.5:1 on the curtain */
}

/* The TMDB credit is a sentence people should be able to read, so it skips the billing-block caps */
.billing .credits {
  display: block;
  margin-top: 0.6rem;
  font: 400 0.8rem/1.4 'Figtree', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 560px) {
  .ticket { grid-template-columns: 1fr; -webkit-mask: none; mask: none; }
  .ticket-stub { border-left: 0; border-top: 2px dashed rgba(35, 18, 26, 0.35); }
  .ticket-stub button { width: 100%; }
}

/* Phone-only pieces stay out of the desktop layout */
.sheet-head, .dock, .sheet-backdrop { display: none; }

/* Phones: the poster fills the page; controls float over it as a dock that opens one group at a time */
@media (max-width: 860px) {
  .result { display: block; margin: 1.5rem -1.25rem 0; }
  .result[hidden] { display: none; }

  .screen {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: 0 0 calc(6rem + env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: none;
  }

  .dock {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem;
    background: rgba(28, 6, 11, 0.82);
    border: 1px solid rgba(243, 228, 195, 0.16);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transform: translate(-50%, 0);
    transition: transform 0.25s ease, opacity 0.2s;
  }
  /* Hidden while the preview is off screen, so it never covers the username form */
  .dock.away { opacity: 0; pointer-events: none; transform: translate(-50%, 140%); }

  .dock-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 3.6rem;
    padding: 0.5rem 0.5rem 0.45rem;
    font: 700 0.7rem 'Figtree', sans-serif;
    white-space: nowrap;
    color: var(--paper);
    background: none;
    border: 0;
    border-radius: 999px;
  }
  .dock-button svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .dock-button { transition: background 0.15s, color 0.15s, transform 0.1s; }
  .dock-button:active { transform: scale(0.93); }
  .dock-button[aria-expanded='true'] { color: var(--ink); background: var(--paper); }
  .dock-download { color: var(--ink); background: var(--bulb); }
  .dock-download:disabled, .dock-button:disabled { opacity: 0.5; }

  /* The panel becomes a bottom sheet showing only the group its dock button asked for */
  .controls {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    max-height: 72svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
    background: #1c060b;
    border: 0;
    border-top: 1px solid rgba(243, 228, 195, 0.16);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: none;
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.28s;
  }
  .controls[data-sheet] { transform: none; visibility: visible; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .controls .group { display: none; border-bottom: 0; }
  .controls[data-sheet='setup'] [data-group='setup'] { display: grid; }
  .controls[data-sheet='style'] [data-group='style'],
  .controls[data-sheet='filter'] [data-group='filter'] { display: block; }
  .controls .styles legend { display: none; } /* the sheet title names the group */
  .download-bar { display: none; }

  .sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem 0.3rem;
    background: #1c060b;
  }
  .sheet-head::before {
    content: '';
    position: absolute;
    top: 0.45rem;
    left: 50%;
    width: 2.4rem;
    height: 0.25rem;
    border-radius: 999px;
    background: rgba(243, 228, 195, 0.25);
    transform: translateX(-50%);
  }
  .sheet-title { margin: 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bulb); }
  .sheet-done { padding: 0.4rem 0.9rem; font-size: 0.9rem; color: var(--ink); background: var(--paper); border: 0; border-radius: 999px; }

  .sheet-backdrop { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(0, 0, 0, 0.25); border: 0; cursor: default; transition: opacity 0.25s; }
  @starting-style { .sheet-backdrop { opacity: 0; } }
  .sheet-backdrop[hidden] { display: none; }

  /* Sheets stay short so the poster above stays in view: options scroll sideways in one row */
  .controls .style-options { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1.2rem; padding: 0.3rem 1.2rem 0.5rem; scrollbar-width: none; scroll-snap-type: x proximity; }
  .controls .style-options::-webkit-scrollbar { display: none; }
  .controls .style-options label { padding: 0.55rem 0.9rem; scroll-snap-align: start; }
  .controls .tile-options { display: flex; gap: 0.6rem; }
  .controls .style-options.tile-options label { flex: 0 0 4.6rem; padding: 0; }
}

@media (max-width: 380px) {
  .dock-button { min-width: 3.5rem; padding-inline: 0.4rem; }
}

/* Reduced motion: nothing slides, nods or chases; the screen still dims and the loading card still fades,
   so "working" and "done" stay legible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .screen canvas, .projector { transition-duration: 0.2s !important; }
  .screen.loading .bulbs i { opacity: 0.85; }
}

/* ---------- premium ---------- */
/* Premium tiles carry a small gold lock until the viewer unlocks */
.tile-options label { position: relative; }
.tile-options label.premium::after {
  content: '';
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--bulb) center / 0.7rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323121a' stroke-width='3' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.premium-tag,
.premium-open {
  font: 700 0.78rem 'Figtree', sans-serif;
  color: var(--ink);
  background: var(--bulb);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.premium-tag { margin-left: 0.3rem; padding: 0.1rem 0.5rem; vertical-align: 0.1em; }
.premium-open {
  margin: 0.4rem 1.2rem 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  color: var(--bulb);
  background: rgba(255, 197, 61, 0.1);
  box-shadow: inset 0 0 0 1.5px rgba(255, 197, 61, 0.55);
}
.premium-open:hover { background: rgba(255, 197, 61, 0.18); }
.premium-open[hidden], .premium-tag[hidden] { display: none; }

.paywall {
  width: min(30rem, 100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 1.6rem 1.5rem 1.3rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  text-align: left;
}
.paywall::backdrop { background: rgba(20, 4, 8, 0.72); backdrop-filter: blur(3px); }
.paywall[open] { animation: paywall-in 0.32s var(--ease-out); }
@keyframes paywall-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.paywall-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.paywall-kicker { margin: 0; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--velvet); }
.paywall h2 { margin: 0.3rem 2rem 0.6rem 0; font: 400 2rem/1.05 'Limelight', serif; }
.paywall-reason { margin: 0 0 0.6rem; font-weight: 600; color: var(--velvet); }
.paywall-list { margin: 0 0 1.1rem; padding-left: 1.2rem; line-height: 1.45; }
.paywall-list li + li { margin-top: 0.3rem; }
.paywall-buy { width: 100%; font: 800 1.1rem 'Figtree', sans-serif; cursor: pointer; }
.paywall-fine { margin: 0.6rem 0 1rem; font-size: 0.8rem; opacity: 0.75; text-align: center; }
.paywall-restore { padding-top: 0.9rem; border-top: 2px dashed rgba(35, 18, 26, 0.25); }
.paywall-restore label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 700; }
.paywall-row { display: flex; gap: 0.5rem; }
.paywall-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  font: 400 0.95rem 'Space Mono', monospace;
  color: var(--ink);
  background: #fff8e6;
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.paywall-row .share { color: var(--ink); border-color: var(--ink); font-size: 0.95rem; }
.paywall-error { min-height: 1.2rem; margin: 0.6rem 0 0; font-size: 0.85rem; font-weight: 700; color: var(--velvet); }
.billing a { color: inherit; }
.paywall-for { margin: -0.3rem 0 0.6rem; font: 700 1rem 'Space Mono', monospace; }
.paywall-other { margin: 0 0 0.6rem; font-size: 0.88rem; }
.paywall-other[hidden] { display: none; }
