/* System fallbacks keep the entire app usable offline. */
:root {
  color-scheme: dark;
  --bg: #151714;
  --panel: #20231e;
  --ink: #f0f1e8;
  --muted: #a4aa99;
  --line: #353b2e;
  --lime: #d8f36a;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 32px;
}
.brand {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.4px;
}
.brand span {
  color: var(--lime);
  font-size: 12px;
  vertical-align: top;
  margin: 5px;
}
.icon-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 23px;
}
#app {
  max-width: 800px;
  margin: auto;
  padding: env(safe-area-inset-top) 24px 120px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2.3px;
  color: var(--muted);
  font-weight: 600;
}
h1 {
  font:
    500 clamp(42px, 8vw, 64px)/1.1 "Playfair Display",
    Georgia,
    serif;
  letter-spacing: -1.5px;
  margin: 12px 0;
}
h2 {
  font:
    500 30px/1.25 "Playfair Display",
    Georgia,
    serif;
}
p {
  line-height: 1.6;
}
.accent {
  color: var(--lime);
}
.muted {
  color: var(--muted);
}
.empty {
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 35px 0;
}
.empty-number {
  font:
    500 78px/1 "Playfair Display",
    Georgia,
    serif;
  color: var(--lime);
  opacity: 0.75;
}
.empty p {
  color: var(--muted);
}
.primary {
  background: var(--lime);
  color: #191d10;
  border: 0;
  border-radius: 12px;
  padding: 16px 22px;
  min-height: 52px;
  font-weight: 700;
}
.primary span {
  margin-left: 20px;
  font-size: 20px;
}
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1d18f5;
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  z-index: 5;
}
nav a {
  color: var(--muted);
  text-align: center;
  padding: 14px 10px;
  flex: 1;
  max-width: 200px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
nav a.active {
  background: #d8f36a12;
  color: var(--lime);
}
@media (min-width: 700px) {
  #app {
    padding-left: 40px;
    padding-right: 40px;
  }
  header {
    padding-top: 36px;
  }
  .empty {
    padding: 40px;
  }
}
.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.stats {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
  margin: 20px 0 28px;
}
.stats span + span {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.compact {
  padding: 12px 15px;
  min-height: 46px;
}
.compare-banner {
  border: 1px solid #d8f36a42;
  background: #d8f36a0b;
  color: var(--ink);
  border-radius: 15px;
  width: 100%;
  padding: 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  margin: 12px 0 30px;
}
.compare-banner > span:first-child {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 13px;
  row-gap: 5px;
}
.compare-banner svg {
  color: var(--lime);
  grid-row: span 2;
  align-self: center;
}
.compare-banner strong {
  font-size: 17px;
}
.compare-banner small {
  color: var(--muted);
  font-size: 14px;
}
.round-plus {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--lime);
  border-radius: 50%;
  color: var(--bg);
  font-size: 23px;
  margin-left: 8px;
  flex-shrink: 0;
}
.section-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.8px;
  margin: 28px 0 12px;
}
.movie-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
}
.movie-row:hover {
  background: #ffffff04;
}
.rank {
  font:
    500 28px Georgia,
    serif;
  min-width: 32px;
}
.poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 9px;
  background: #2a2f23;
  position: relative;
  display: grid;
  place-items: center;
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.no-poster {
  padding: 15px;
  color: #c9d4b6;
  font:
    500 20px/1.3 Georgia,
    serif;
  text-align: center;
  overflow-wrap: anywhere;
}
.movie-row .poster {
  width: 56px;
  flex-shrink: 0;
  border-radius: 5px;
}
.movie-row .no-poster {
  font: 10px system-ui;
  padding: 5px;
}
.row-copy {
  flex: 1;
  min-width: 0;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}
.uk {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  margin: 5px 0;
}
.year {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}
.footnote {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 25px 0;
}
.pending-strip {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.pending-strip button {
  background: none;
  border: 0;
  color: var(--muted);
  width: 98px;
  flex-shrink: 0;
  padding: 0;
  text-align: left;
}
.pending-strip button > span {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 8px;
}
.pending-strip .no-poster {
  font-size: 16px;
}
.matchup {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 32px;
}
.matchup article {
  min-width: 0;
}
.choice {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: none;
  text-align: left;
  border-radius: 10px;
}
.choice .poster {
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.choice:active .poster {
  transform: scale(0.97);
  box-shadow: 0 0 0 3px var(--lime);
}
.choice-copy {
  padding-top: 16px;
  min-height: 106px;
}
.choice h3 {
  font-size: 18px;
}
.versus {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  pointer-events: none;
}
.detail-button {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  width: 100%;
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
  margin: 8px 0;
}
.compare-actions {
  text-align: center;
  margin: 28px 0 14px;
}
.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  padding: 14px 18px;
  min-height: 48px;
  border-radius: 10px;
}
.undo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  margin: 8px auto;
  min-height: 48px;
  font-size: 14px;
}
.complete-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--lime);
  color: var(--lime);
  width: 70px;
  height: 70px;
  margin: 0 auto;
  border-radius: 50%;
}
.complete-mark svg {
  width: 35px;
  height: 35px;
}
.text-button {
  display: block;
  background: transparent;
  border: 0;
  color: var(--lime);
  font-size: 14px;
  min-height: 44px;
  padding: 10px;
  margin: 8px auto;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 15px;
  margin: 23px 0 16px;
  color: var(--muted);
}
.search-box input {
  border: 0;
  background: transparent;
  min-width: 0;
  flex: 1;
  min-height: 54px;
  color: var(--ink);
  outline-offset: 0;
  padding: 12px 0;
}
.filters {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.filters button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px;
}
.filters button.selected {
  color: var(--lime);
  background: #d8f36a12;
  border-color: #d8f36a55;
}
.badge {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  max-width: 88px;
}
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font-size: 14px;
  min-height: 44px;
}
.small-button.filled {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--bg);
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
dialog {
  width: min(640px, 100%);
  max-height: 90dvh;
  margin: auto auto 0;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  color: var(--ink);
  padding: 0;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(4px);
}
.dialog-inner {
  padding: 30px 24px max(32px, env(safe-area-inset-bottom));
  position: relative;
}
.dialog-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--bg);
  z-index: 2;
  margin: 0 0 10px 10px;
}
.dialog-inner h2 {
  margin: 14px 0 24px;
}
.setting-section {
  border-top: 1px solid var(--line);
  padding: 24px 0 10px;
  margin-top: 24px;
}
.setting-section h3 {
  font-size: 18px;
}
.setting-section p {
  font-size: 15px;
}
.setting-section .footnote {
  font-size: 13px;
}
.setting-section label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 8px;
}
.setting-section input {
  width: 100%;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  margin: 0 0 14px;
}
.button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.button-stack button {
  width: 100%;
  margin: 0;
}
.text-link {
  display: inline-block;
  color: var(--lime);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 15px 0;
}
.notice {
  padding: 16px;
  border: 1px solid #d8f36a45;
  background: #d8f36a0b;
  border-radius: 10px;
  line-height: 1.6;
  font-size: 14px;
  margin: 15px 0;
}
.notice .text-button {
  margin: 10px 0 0;
  padding-left: 0;
}
.error {
  color: #ffc0b6;
  border-color: #a9594544;
  background: #a959450b;
}
.credits {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 12px;
}
.search-submit {
  width: 100%;
}
.search-result {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.search-result .poster {
  align-self: start;
  border-radius: 5px;
}
.search-result .no-poster {
  font-size: 13px;
  padding: 8px;
}
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.added {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--lime);
  min-height: 44px;
}
.search-hint {
  text-align: center;
  margin: 30px 0;
}
.backdrop {
  width: calc(100% + 48px);
  margin: -30px -24px 20px;
  aspect-ratio: 16/9;
  object-fit: cover;
  max-height: 260px;
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  clear: both;
}
.detail-heading > .poster {
  width: 100px;
  flex-shrink: 0;
}
.detail-heading h2 {
  font-size: 27px;
  margin: 10px 0;
}
.detail-heading p {
  margin: 8px 0;
  font-size: 14px;
}
.genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.genres span {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 10px;
  color: var(--muted);
}
.overview {
  font-size: 16px;
  line-height: 1.7;
  color: #cbd0c1;
}
.stills {
  display: flex;
  overflow-x: auto;
  gap: 12px;
}
.stills img {
  width: 85%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 9px;
}
.danger {
  color: #ffc0b6;
}
#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translate(-50%, 12px);
  width: max-content;
  max-width: calc(100% - 32px);
  background: var(--lime);
  color: var(--bg);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 35px #0008;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (min-width: 700px) {
  dialog {
    margin: auto;
    border-radius: 22px;
    max-height: 88dvh;
  }
  .matchup {
    gap: 32px;
  }
  .choice-copy {
    min-height: 90px;
  }
  .movie-row .poster {
    width: 64px;
  }
  .choice h3 {
    font-size: 22px;
  }
  .matchup .poster {
    max-height: 420px;
    width: 100%;
  }
}
@media (max-width: 370px) {
  #app {
    padding-left: 16px;
    padding-right: 16px;
  }
  .matchup {
    gap: 12px;
  }
  .choice h3 {
    font-size: 16px;
  }
  .badge {
    display: none;
  }
  .detail-heading {
    gap: 12px;
  }
  .detail-heading > .poster {
    width: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 699px) {
  body:has([data-view="compare"]) header {
    padding-bottom: 20px;
  }
  [data-view="compare"] h1 {
    font-size: 38px;
  }
  [data-view="compare"] .matchup {
    margin-top: 24px;
  }
  [data-view="compare"] .choice-copy {
    min-height: 90px;
  }
  [data-view="compare"] .compare-actions {
    margin-top: 16px;
  }
}
.dialog-toast {
  position: sticky;
  top: 0;
  z-index: 3;
}

.unseen-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8f36a55;
  border-radius: 8px;
  background: #d8f36a0b;
  color: var(--lime);
  font-size: 14px;
  padding: 8px;
  margin-top: 8px;
}
.filters {
  flex-wrap: wrap;
}
@media (max-width: 699px) {
  [data-view="compare"] h1 {
    font-size: 34px;
  }
  [data-view="compare"] .matchup {
    margin-top: 16px;
  }
  [data-view="compare"] .choice-copy {
    min-height: 75px;
    padding-top: 12px;
  }
  [data-view="compare"] .detail-button {
    margin-top: 4px;
    min-height: 40px;
  }
  [data-view="compare"] .compare-actions {
    margin-top: 10px;
  }
  body:has([data-view="compare"]) header {
    padding-top: 18px;
    padding-bottom: 14px;
  }
}

/* Appearance is independent of the selected VS composition. */
:root {
  --accent-fill: #d8f36a;
  --accent-ink: #191d10;
  --poster-bg: #2a2f23;
  --danger: #ffc0b6;
  --event-paper: #251f1c;
  --event-ink: #f4e5c6;
  --event-red: #ff806b;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ec;
  --panel: #ebece2;
  --ink: #20251b;
  --muted: #626b58;
  --line: #cdd2bf;
  --lime: #526c0c;
  --poster-bg: #dde2d1;
  --danger: #a43022;
  --event-paper: #e9debf;
  --event-ink: #241e19;
  --event-red: #b63728;
}
.primary,
.small-button.filled,
#toast,
.round-plus {
  background: var(--accent-fill);
  color: var(--accent-ink);
}
.poster {
  background: var(--poster-bg);
}
.no-poster,
.overview {
  color: var(--ink);
}
.error,
.danger {
  color: var(--danger);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#app {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
#toast {
  bottom: max(24px, env(safe-area-inset-bottom));
}
.menu-nav {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
}
.menu-nav a {
  padding: 16px 8px;
  border: 1px solid var(--line);
}
.menu-nav a[aria-current] {
  background: var(--panel);
  color: var(--lime);
}
.menu-options {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.menu-options button {
  text-align: left;
}
.menu-options button:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.menu-options button span {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.back-menu {
  margin: 0;
  padding-left: 0;
}
.preference-group {
  border: 0;
  margin: 24px 0 0;
  padding: 0;
  min-width: 0;
}
.preference-group legend {
  font-weight: 700;
  margin-bottom: 14px;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.theme-options label,
.layout-options label {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}
.theme-options label {
  padding: 14px 6px;
  display: flex;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
}
.preference-group input {
  accent-color: var(--lime);
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.preference-group label:has(input:checked) {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px var(--lime);
}
.preference-group label:has(input:focus-visible) {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.layout-options {
  display: grid;
  gap: 10px;
}
.layout-options label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
}
.layout-label {
  min-width: 0;
}
.layout-label strong {
  display: block;
  font-size: 16px;
}
.layout-label small {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 4px;
}
.layout-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 84px;
  height: 90px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  padding: 10px 7px;
  background: var(--bg);
}
.layout-preview i {
  width: 50%;
  height: 60px;
  background: linear-gradient(145deg, #e3b777, #725039);
  transform: rotate(-7deg);
}
.layout-preview i:last-child {
  background: linear-gradient(145deg, #b4d1d1, #344558);
  transform: rotate(7deg);
}
.layout-preview b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  z-index: 1;
  color: var(--accent-fill);
  font-style: italic;
  text-shadow: 1px 1px #151714;
}
.layout-preview.arcade-clash {
  display: block;
  padding: 0;
}
.layout-preview.arcade-clash i {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 65%);
}
.layout-preview.arcade-clash i:last-child {
  clip-path: polygon(0 69%, 100% 39%, 100% 100%, 0 100%);
}
.layout-preview.main-event {
  background: var(--event-paper);
  border-block: 5px solid var(--event-red);
}
.layout-preview.main-event i {
  width: 23px;
  height: 35px;
  align-self: flex-start;
  transform: none;
}
.layout-preview.main-event i:last-child {
  align-self: flex-end;
  margin-left: auto;
}
.layout-preview.main-event b {
  color: var(--event-red);
  text-shadow: none;
}

/* Shared matchup controls and poster-first composition. */
[data-view="compare"] {
  max-width: 640px;
  margin: 0 auto;
}
[data-view="compare"] .matchup {
  margin: 30px 0 0;
  gap: clamp(16px, 4vw, 30px);
  align-items: start;
}
[data-view="compare"] .choice-copy {
  padding-top: 18px;
  min-height: 0;
}
[data-view="compare"] .choice h3 {
  font-size: clamp(16px, 2.6vw, 23px);
}
[data-view="compare"] .choice .uk {
  display: none;
}
[data-view="compare"] .poster {
  border-radius: 5px;
  max-height: none;
}
[data-view="compare"] .versus {
  top: 32%;
  width: auto;
  height: auto;
  background: none;
  border: 0;
  color: var(--lime);
  font:
    italic 900 clamp(40px, 9vw, 68px)/1 system-ui,
    sans-serif;
  letter-spacing: -4px;
  transform: translate(-50%, -50%) rotate(-12deg);
  text-shadow:
    3px 3px var(--bg),
    -2px -2px var(--bg);
  z-index: 2;
}
.film-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 12px;
}
[data-view="compare"] .film-actions button {
  min-height: 44px;
  padding: 7px 0;
  margin: 0;
  width: auto;
  flex: 1 1 auto;
  border: 0;
  background: none;
  font-size: 12px;
}
[data-view="compare"] .film-actions .detail-button {
  color: var(--muted);
}
.duel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 20px;
}
[data-view="compare"] .duel-footer .compare-actions,
.duel-footer .undo {
  margin: 0;
}
.compare-actions .secondary {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
}
.duel-backdrop {
  display: none;
}
[data-vs-layout="fight-night"] .matchup article:first-child .poster {
  transform: rotate(-4deg);
}
[data-vs-layout="fight-night"] .matchup article:last-of-type .poster {
  transform: rotate(4deg);
}
[data-vs-layout="fight-night"] .choice:active .poster {
  transform: rotate(0) scale(0.97);
}

[data-vs-layout="fight-night"] [data-view="compare"]:has(.matchup) {
  min-height: calc(
    100svh - 136px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  display: flex;
  flex-direction: column;
  gap: 30px;
}
[data-vs-layout="fight-night"] [data-view="compare"] .matchup {
  margin-block: auto;
  padding-top: 22px;
  align-items: stretch;
}
[data-vs-layout="fight-night"] .matchup article,
[data-vs-layout="fight-night"] .matchup .choice,
[data-vs-layout="fight-night"] .matchup .choice-copy {
  display: flex;
  flex-direction: column;
}
[data-vs-layout="fight-night"] .matchup .choice,
[data-vs-layout="fight-night"] .matchup .choice-copy {
  flex: 1;
}
[data-vs-layout="fight-night"] .matchup .poster {
  width: 100%;
  flex-shrink: 0;
}
[data-vs-layout="fight-night"] .matchup .choice-copy {
  gap: 8px;
}
[data-vs-layout="fight-night"] .matchup .year {
  margin-top: auto;
}
[data-vs-layout="fight-night"] .duel-footer {
  margin-top: 0;
}
@media (max-width: 699px) {
  [data-vs-layout="fight-night"] [data-view="compare"]:has(.matchup) {
    min-height: calc(
      100svh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
  }
}

/* Full-width cinematic rivals, divided by opposing diagonal edges. */
[data-vs-layout="arcade-clash"] [data-view="compare"] .matchup {
  display: block;
  margin-top: 4px;
}
[data-vs-layout="arcade-clash"] .matchup article {
  position: relative;
}
[data-vs-layout="arcade-clash"] .matchup article + article {
  margin-top: -24px;
}
[data-vs-layout="arcade-clash"] .matchup .choice {
  position: relative;
  min-height: clamp(240px, calc((100svh - 180px) / 2), 360px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: 2px;
  background: var(--poster-bg);
}
[data-vs-layout="arcade-clash"] .matchup .poster,
[data-vs-layout="arcade-clash"] .duel-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 0;
}
[data-vs-layout="arcade-clash"] .duel-backdrop {
  display: block;
}
[data-vs-layout="arcade-clash"] .matchup .choice::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, #080d16d9);
  pointer-events: none;
}
[data-vs-layout="arcade-clash"] .matchup article:first-child .choice {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), 0 100%);
}
[data-vs-layout="arcade-clash"] .matchup article:last-of-type .choice {
  clip-path: polygon(0 30px, 100% 0, 100% 100%, 0 100%);
}
[data-vs-layout="arcade-clash"] .matchup .choice-copy {
  position: relative;
  padding: 48px 20px 86px;
  z-index: 1;
  color: #fff8e9;
}
[data-vs-layout="arcade-clash"] .matchup article:first-child .choice-copy {
  padding-bottom: 110px;
}
[data-vs-layout="arcade-clash"] .matchup .choice h3 {
  font-family: Impact, "Arial Narrow", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(23px, 5.5vw, 38px);
  text-transform: uppercase;
  line-height: 1.05;
}
[data-vs-layout="arcade-clash"] .matchup .year {
  color: #e0e4e7;
}
[data-vs-layout="arcade-clash"] .matchup .versus {
  top: 50%;
  color: var(--accent-fill);
  text-shadow: 3px 3px #151714;
}
[data-vs-layout="arcade-clash"] .film-actions {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 3;
  margin: 0;
  justify-content: space-between;
}
[data-vs-layout="arcade-clash"] .matchup article:first-child .film-actions {
  bottom: 46px;
}
[data-vs-layout="arcade-clash"] [data-view="compare"] .film-actions button {
  flex: 0 1 auto;
  padding-inline: 10px;
  border-radius: 6px;
  background: #10151cce;
  color: #f2f3e9;
}
[data-vs-layout="arcade-clash"] .film-actions .unseen-button {
  color: var(--accent-fill);
}
[data-vs-layout="arcade-clash"] .choice:focus-visible {
  outline-offset: -5px;
}

/* A boxing handbill: warm paper, large title, opposite corners. */
[data-vs-layout="main-event"] [data-view="compare"] .matchup {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  background: var(--event-paper);
  color: var(--event-ink);
  border-block: 7px solid var(--event-red);
  padding: 14px;
  margin-top: 6px;
}
[data-vs-layout="main-event"] .matchup .choice {
  display: grid;
  grid-template-columns: min(40%, 135px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  color: var(--event-ink);
}
[data-vs-layout="main-event"] .matchup article:last-of-type {
  margin-top: 0;
  order: 3;
}
[data-vs-layout="main-event"] .matchup article:last-of-type .choice {
  grid-template-columns: minmax(0, 1fr) min(40%, 135px);
  text-align: right;
}
[data-vs-layout="main-event"] .matchup article:last-of-type .poster {
  grid-column: 2;
  grid-row: 1;
}
[data-vs-layout="main-event"] .matchup article:last-of-type .choice-copy {
  grid-column: 1;
  grid-row: 1;
}
[data-vs-layout="main-event"] .matchup .poster {
  border-radius: 0;
  box-shadow: 3px 3px var(--event-ink);
}
[data-vs-layout="main-event"] .matchup .choice-copy {
  padding: 0;
}
[data-vs-layout="main-event"] .matchup .choice h3 {
  font-family: Impact, "Arial Narrow", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 5vw, 38px);
  line-height: 1.03;
  letter-spacing: -1px;
  text-transform: uppercase;
}
[data-vs-layout="main-event"] .matchup .year,
[data-vs-layout="main-event"] .film-actions .detail-button {
  color: var(--event-ink);
  opacity: 0.75;
}
[data-vs-layout="main-event"] .film-actions .unseen-button {
  color: var(--event-red);
}
[data-vs-layout="main-event"] .matchup .versus {
  position: static;
  align-self: center;
  order: 2;
  border-radius: 0;
  background: var(--event-red);
  color: var(--event-paper);
  text-shadow: none;
  padding: 6px 14px;
  font-size: 29px;
  letter-spacing: 0;
  transform: rotate(-7deg);
}
@media (max-width: 370px) {
  .layout-options label {
    gap: 9px;
    padding: 10px;
  }
  .layout-preview {
    width: 65px;
  }
  .theme-options label {
    gap: 4px;
    font-size: 13px;
  }
}

.language-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 370px) {
  .theme-options:not(.language-options) label {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}
:lang(uk) .menu-options button span {
  margin-left: 0;
}
:lang(uk) .stats {
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Temporary color palettes, independent of light/dark appearance. */
:root[data-color="ocean"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.ocean {
  --bg: #111b24;
  --panel: #1b2b38;
  --ink: #e8f3fa;
  --muted: #a0b6c6;
  --line: #354d60;
  --lime: #85d5f5;
  --accent-fill: #85d5f5;
  --accent-ink: #102631;
  --poster-bg: #263d4e;
}
:root[data-color="ocean"][data-theme="light"],
:root[data-theme="light"] .color-swatch.ocean {
  --bg: #f0f7fa;
  --panel: #e1eef4;
  --ink: #172c3b;
  --muted: #526b7c;
  --line: #bfd3df;
  --lime: #166383;
  --accent-fill: #85d5f5;
  --accent-ink: #102631;
  --poster-bg: #cedee8;
}
:root[data-color="violet"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.violet {
  --bg: #1b1626;
  --panel: #2a2239;
  --ink: #f3edfc;
  --muted: #b5a6ca;
  --line: #493b60;
  --lime: #cbb0ff;
  --accent-fill: #cbb0ff;
  --accent-ink: #28183f;
  --poster-bg: #392e4d;
}
:root[data-color="violet"][data-theme="light"],
:root[data-theme="light"] .color-swatch.violet {
  --bg: #f7f3fc;
  --panel: #ede5f6;
  --ink: #30213f;
  --muted: #726080;
  --line: #d7c9e5;
  --lime: #70449d;
  --accent-fill: #cbb0ff;
  --accent-ink: #28183f;
  --poster-bg: #e0d3ee;
}
:root[data-color="sunset"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.sunset {
  --bg: #241815;
  --panel: #35241e;
  --ink: #fff0e4;
  --muted: #c9aa98;
  --line: #594034;
  --lime: #ffb38b;
  --accent-fill: #ffb38b;
  --accent-ink: #3b2013;
  --poster-bg: #493024;
}
:root[data-color="sunset"][data-theme="light"],
:root[data-theme="light"] .color-swatch.sunset {
  --bg: #fff5ed;
  --panel: #f6e7da;
  --ink: #3c281c;
  --muted: #80634f;
  --line: #e3cdbb;
  --lime: #9c4823;
  --accent-fill: #ffb38b;
  --accent-ink: #3b2013;
  --poster-bg: #ecd5c2;
}

.color-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.color-options label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
}
.appearance-control {
  margin-top: 20px;
}
.appearance-control:first-of-type {
  margin-top: 0;
}
.appearance-control legend {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}
.color-swatch {
  display: flex;
}
.color-swatch i {
  width: 12px;
  height: 22px;
  background: var(--panel);
}
.color-swatch i:first-child {
  border-radius: 6px 0 0 6px;
  background: var(--accent-fill);
}
.color-swatch i:last-child {
  border-radius: 0 6px 6px 0;
  background: var(--bg);
}
.color-swatch.lime {
  --panel: #20231e;
  --accent-fill: #d8f36a;
  --bg: #151714;
}
:root[data-theme="light"] .color-swatch.lime {
  --panel: #ebece2;
  --bg: #f6f4ec;
}

.comparison-question {
  text-align: center;
  font-size: 0.85rem;
  margin: 0 0 0.65rem;
  color: var(--muted);
}
