
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --bg: #101014;
  --surface: #19191f;
  --surface2: #24232b;
  --text: #f7f4f1;
  --muted: #aaa6b2;
  --accent: #e9b872;
  --accentText: #17131a;
  --border: #36323d;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  transition: background .2s, color .2s;
}

/* THEME COLORS */

body[data-theme="dark"] {
  --bg: #101014;
  --surface: #19191f;
  --surface2: #24232b;
  --text: #f7f4f1;
  --muted: #aaa6b2;
  --accent: #e9b872;
  --accentText: #17131a;
  --border: #36323d;
}

body[data-theme="pastel"] {
  --bg: #fff5f7;
  --surface: #fff;
  --surface2: #f8e8ef;
  --text: #442d42;
  --muted: #816c80;
  --accent: #e7a8c7;
  --accentText: #352333;
  --border: #efd5e2;
}

body[data-theme="matcha"] {
  --bg: #eff2e7;
  --surface: #fbfcf6;
  --surface2: #e1e8d5;
  --text: #283a2e;
  --muted: #6f806f;
  --accent: #9cad79;
  --accentText: #203024;
  --border: #d4dfc9;
}

body[data-theme="y2k"] {
  --bg: #f6efff;
  --surface: #fff;
  --surface2: #eadcff;
  --text: #35204f;
  --muted: #806a9d;
  --accent: #ff73c8;
  --accentText: #321038;
  --border: #d9c2fa;
}

body[data-theme="sunset"] {
  --bg: #241725;
  --surface: #352034;
  --surface2: #48283a;
  --text: #fff0df;
  --muted: #d0a7a7;
  --accent: #ff9a6c;
  --accentText: #351a22;
  --border: #63394a;
}

body[data-theme="espresso"] {
  --bg: #19120f;
  --surface: #251b16;
  --surface2: #34251d;
  --text: #f4e7d8;
  --muted: #b8a18d;
  --accent: #c99765;
  --accentText: #24170f;
  --border: #4a3427;
}

body[data-theme="cyber"] {
  --bg: #06110e;
  --surface: #0b1c17;
  --surface2: #102b22;
  --text: #dcffe9;
  --muted: #8bb9a1;
  --accent: #42f59b;
  --accentText: #03130b;
  --border: #1b5940;
}

body[data-theme="cloud"] {
  --bg: #edf5ff;
  --surface: #fff;
  --surface2: #dceaff;
  --text: #203450;
  --muted: #657c9b;
  --accent: #8db9f7;
  --accentText: #142a48;
  --border: #cbdcf4;
}

/* GENERAL ELEMENTS */

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar,
main,
footer {
  max-width: 1120px;
  margin: auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* TOP NAVIGATION */

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
}

.top-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.top-actions select {
  max-width: 170px;
}

.button,
select,
input,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--surface2);
  color: var(--text);
}

.button {
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary {
  background: var(--accent);
  color: var(--accentText);
  border-color: transparent;
}

.quiet {
  background: transparent;
}

/* HERO */

.hero {
  min-height: 350px;
  padding-top: 48px;
  padding-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 12px;
}

h1,
h2 {
  font-family: 'Playfair Display', serif;
}

h1 {
  font-size: clamp(42px, 5vw, 63px);
  line-height: 1.06;
  letter-spacing: -1.5px;
  margin: 0 0 16px;
}

h1 span {
  color: var(--accent);
}

h2 {
  font-size: 28px;
  margin: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
  max-width: 470px;
}

/* DECORATIVE MOVIE POSTERS */

.posters {
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.poster {
  width: 170px;
  height: 230px;
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 20px 50px #0002;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 3px;
  font-size: 10px;
  text-align: center;
}

.poster b {
  font: 700 27px 'Playfair Display', serif;
  letter-spacing: 1px;
}

.poster small {
  font-size: 8px;
}

.back {
  position: absolute;
  transform: rotate(-12deg) translateX(-45px);
  background: var(--surface2);
  color: var(--muted);
}

.front {
  transform: rotate(8deg) translateX(25px);
  background: linear-gradient(
    150deg,
    var(--surface2),
    var(--surface),
    var(--accent)
  );
}

/* COLLECTION HEADER */

.welcome,
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
}

.welcome {
  padding: 25px 0 16px;
  border-top: 1px solid var(--border);
}

.saved {
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 5px;
}

.saved:first-letter {
  color: #60bf88;
}

/* STATISTICS */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 48px;
}

.stats article {
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stats article span,
.stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stats strong {
  display: block;
  font-size: 31px;
  margin: 7px 0;
}

.stats small {
  font-size: 11px;
}

/* MOVIE LISTS */

.list-section {
  margin-bottom: 48px;
  scroll-margin-top: 20px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 small {
  font: 600 12px 'DM Sans';
  padding: 6px 9px;
  background: var(--surface2);
  border-radius: 8px;
  color: var(--muted);
  vertical-align: middle;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.movie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.movie-top {
  display: flex;
  gap: 12px;
}

.movie-poster {
  flex-shrink: 0;
  width: 45px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(
    140deg,
    var(--accent),
    var(--surface2)
  );
  color: var(--accentText);
}

.movie-title {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.meta,
.notes {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.notes {
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rating {
  color: var(--accent);
  font-size: 12px;
}

.movie-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.small {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 7px;
  padding: 8px;
}

.danger {
  color: #d66b75;
}

/* EMPTY LISTS */

.empty {
  padding: 34px 18px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty b {
  font: 600 20px 'Playfair Display';
}

.empty p,
.callout p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.empty[hidden] {
  display: none;
}

/* BOTTOM CALLOUT */

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0 40px;
}

.callout h3 {
  margin: 0;
}

.callout p {
  margin: 5px 0 0;
}

/* FOOTER */

footer {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  padding-bottom: 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

/* DIALOGS AND FORMS */

dialog {
  width: min(470px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  max-height: 90vh;
}

dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(3px);
}

.dialog-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-head h2 {
  font-size: 25px;
}

.x {
  font-size: 23px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 9px;
}

.dialog-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.dialog-card input,
.dialog-card select,
.dialog-card textarea {
  width: 100%;
  font-size: 13px;
  font-weight: 400;
}

.form-row {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.error {
  color: #df6874;
  font-size: 12px;
  margin: 0;
}

.switch {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.switch button {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
}


.privacy {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.full {
  width: 100%;
}

/* TOAST NOTIFICATION */

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 12px;
  transition: .2s;
  z-index: 10;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* WATCH CALENDAR */

.calendar-section {
  margin: 0 0 50px;
  scroll-margin-top: 20px;
}

.calendar-intro {
  margin: 7px 0 0;
}

.calendar-panel,
.calendar-day-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.calendar-panel {
  margin-bottom: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.calendar-toolbar h3 {
  font: 600 19px 'Playfair Display', serif;
  margin: 0 auto 0 0;
}

.calendar-today {
  margin-left: 3px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 7px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  padding: 7px 0;
}

.calendar-cell {
  min-width: 0;
  min-height: 67px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 9px 3px;
  font-size: 12px;
}

.calendar-cell.outside {
  opacity: .42;
}

.calendar-cell.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.calendar-cell.today .calendar-day-number {
  font-weight: 800;
  color: var(--accent);
}

.calendar-cell.has-movies {
  background: color-mix(
    in srgb,
    var(--accent) 13%,
    var(--surface2)
  );
}

.calendar-day-number {
  line-height: 1.2;
}

.calendar-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.calendar-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.calendar-count {
  font-size: 9px;
  color: var(--muted);
  line-height: 1;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  margin-top: 14px;
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-day-head .eyebrow {
  margin-bottom: 5px;
}

.calendar-day-head h3 {
  font: 600 20px 'Playfair Display', serif;
  margin: 0;
}

.day-count {
  background: var(--surface2);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.day-movies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.day-movie {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}

.day-movie strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.day-movie span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}

.day-movie button {
  margin-top: 9px;
}

.day-movies:empty {
  display: none;
}

#calendarDayEmpty {
  margin: 0;
  font-size: 12px;
}

#watchedDateLabel[hidden] {
  display: none;
}

/* TABLET AND MOBILE */

@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .topbar {
    height: 70px;
  }

  .brand {
    font-size: 12px;
  }

  .top-actions select {
    max-width: 125px;
    font-size: 11px;
    padding: 9px 6px;
  }

  .top-actions .button {
    font-size: 11px;
    padding: 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 38px;
  }

  .posters {
    height: 225px;
  }

  .poster {
    width: 140px;
    height: 195px;
  }

  .stats {
    gap: 8px;
  }

  .stats article {
    padding: 12px;
  }

  .stats strong {
    font-size: 25px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .callout {
    align-items: start;
    flex-wrap: wrap;
  }

  footer {
    gap: 10px;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .calendar-panel,
  .calendar-day-panel {
    padding: 12px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-cell {
    min-height: 53px;
    border-radius: 7px;
    padding: 7px 1px;
    font-size: 11px;
  }

  .calendar-count {
    font-size: 8px;
  }

  .calendar-toolbar {
    gap: 6px;
  }

  .calendar-toolbar h3 {
    font-size: 16px;
  }

  .calendar-toolbar .small {
    padding: 7px;
  }

  .day-movies {
    grid-template-columns: 1fr;
  }

  .calendar-day-head h3 {
    font-size: 18px;
  }
}

@media (max-width: 460px) {
  .movie-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stats article:last-child {
    grid-column: span 2;
  }

  .hero h1 {
    font-size: 43px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .section-head h2 {
    font-size: 23px;
  }
}


/* Random Movie Picker */
.picker-card {
  margin: 24px 0;
  padding: 26px;
  border: 1px solid var(--border, #444);
  border-radius: 18px;
  background: var(--card, #8a8585);
}

.picker-content {
  text-align: center;
}

.picker-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent, #ff704d);
}

.picker-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--text, #fff);
}

.picker-card p {
  color: var(--muted, #aaa);
}

.picker-button {
  margin-top: 12px;
  padding: 13px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent, #ff704d);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.picker-button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.picker-result {
  margin: 18px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}



/* ACCESSIBILITY FIX — QUIZ IN EVERY THEME */

/* Give quiz areas a consistent, readable background */
[id*="quiz" i],
[class*="quiz" i] {
  color: #211a2b !important;
  background-color: #f7f5ff;
}

/* Make all quiz writing dark and readable */
[id*="quiz" i] *,
[class*="quiz" i] * {
  color: #211a2b !important;
}

/* Make answer choices stand out clearly */
[id*="quiz" i] button,
[class*="quiz" i] button,
[id*="quiz" i] label,
[class*="quiz" i] label,
[id*="quiz" i] input,
[class*="quiz" i] input,
[id*="quiz" i] select,
[class*="quiz" i] select {
  background-color: #ffffff !important;
  color: #211a2b !important;
  border-color: #76658f;
}

/* Keep keyboard focus visible */
[id*="quiz" i] button:focus-visible,
[class*="quiz" i] button:focus-visible,
[id*="quiz" i] input:focus-visible,
[class*="quiz" i] input:focus-visible,
[id*="quiz" i] select:focus-visible,
[class*="quiz" i] select:focus-visible {
  outline: 3px solid #3b2670 !important;
  outline-offset: 3px;
}

/* Make disabled answers distinguishable */
[id*="quiz" i] button:disabled,
[class*="quiz" i] button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}


/* Make the random picker heading match surrounding text */
.picker-card h2 {
  color: var(--text, inherit) !important;
}

/* Keep emphasized words in the heading the same color */
.picker-card h2 em,
.picker-card h2 strong,
.picker-card h2 span {
  color: inherit !important;
}
/* BRAND LOGO — keeps it small beside the title */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 100px;
  height: 1000px;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  flex: 0 0 50px;
  display: block;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-title small {
  display: block;
  margin-top: 3px;
}