/* Restyle 1UPMovies.com here. Components use these names only. */

:root {
  --bg: #0c0b09;
  --bg-raised: #16140f;
  --bg-sunken: #090807;
  --ink: #f3eee6;
  --ink-soft: #cfc6b8;
  --muted: #8f8476;
  --gold: #c6a36a;
  --gold-ink: #1a140c;
  --line: rgba(198, 163, 106, 0.22);
  --danger: #c46a5c;
  --ok: #8aa584;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --hero-ink: #f6f1e8;
  --hero-scrim: linear-gradient(to top, #0c0b09 0%, rgba(12, 11, 9, 0.78) 38%, rgba(12, 11, 9, 0.28) 100%);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 2px;
  --page: 1120px;
  --pad: clamp(16px, 4vw, 40px);
  --top: 72px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4efe6;
  --bg-raised: #fffaf3;
  --bg-sunken: #e7e0d2;
  --ink: #1c1712;
  --ink-soft: #3c342c;
  --muted: #6e6256;
  --gold: #8a6430;
  --gold-ink: #1c1712;
  --line: rgba(80, 60, 30, 0.18);
  --danger: #8d3a32;
  --ok: #3d6a48;
  --shadow: 0 18px 40px rgba(70, 50, 20, 0.08);
  --hero-ink: #1c1712;
  --hero-scrim: linear-gradient(to top, #f4efe6 0%, rgba(244, 239, 230, 0.88) 42%, rgba(244, 239, 230, 0.28) 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--gold-ink); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 8px 12px;
  z-index: 50;
}
.skip:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar-inner, .page, .colophon {
  width: min(var(--page), calc(100% - (var(--pad) * 2)));
  margin-inline: auto;
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark-quiet { font-size: 18px; }
.desk-nav { display: flex; gap: 22px; }
.desk-nav a { text-decoration: none; color: var(--ink-soft); }
.desk-nav a[aria-current="page"] { color: var(--gold); }
.account { margin-left: auto; position: relative; }
.menu > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.menu-panel a, .menu-panel button.text-btn { text-align: left; }

.page { padding-bottom: 72px; }
.brand-mark {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.kicker {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
h1 { font-size: clamp(40px, 6vw, 76px); margin: 0 0 12px; }
h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 8px; }
h3 { font-size: 22px; margin: 0; }
.lede, .dek { color: var(--ink-soft); max-width: 42rem; }
.quiet, .year, .score-line { color: var(--muted); }
.score-line { font-size: 14px; margin: 6px 0 0; }

.btn, .text-btn, button {
  border-radius: var(--radius);
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold);
  color: var(--gold-ink);
  border: 1px solid var(--gold);
  text-decoration: none;
  padding: 12px 18px;
}
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.text-btn, .text-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
}
.hero-actions, .list-actions, .row-actions, .inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.hero {
  position: relative;
  min-height: clamp(520px, 78vh, 760px);
  display: grid;
  align-items: end;
  margin-inline: calc(var(--pad) * -1);
  overflow: hidden;
  color: var(--hero-ink);
}
.hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.hero-scrim { position: absolute; inset: 0; background: var(--hero-scrim); }
.hero-copy { position: relative; padding: 48px var(--pad) 56px; max-width: 760px; }
.section { padding: 72px 0; }
.section-head, .page-head { margin-bottom: 28px; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; }

.topfive { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.topfive li {
  display: grid;
  grid-template-columns: auto 72px 1fr auto;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.rank { font-family: var(--serif); font-size: 28px; color: var(--gold); }
.top-poster img, .poster-missing, .list-card img, .row-poster img {
  width: 72px;
  height: 108px;
  object-fit: cover;
  background: var(--bg-sunken);
}
.gross { font-family: var(--serif); font-size: 28px; margin: 0; }

.snap-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scroll-padding-inline: 4px;
  padding-bottom: 12px;
  scrollbar-color: var(--line) transparent;
}
.snap-row > * { scroll-snap-align: start; flex: 0 0 auto; }
.trailer-card { width: min(78vw, 320px); text-decoration: none; color: inherit; }
.poster-frame { position: relative; display: block; }
.trailer-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; background: var(--bg-sunken); }
.trailer-flag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 6px;
}
.trailer-meta { display: grid; gap: 2px; padding-top: 8px; }
.trailer-title { font-family: var(--serif); }
.trailer-date { color: var(--muted); font-size: 14px; }
.trailer-card.is-on img { outline: 1px solid var(--gold); outline-offset: 3px; }

.activity, .comments, .letters, .admin-list, .threads, .bubbles, .shop, .codes, .keys { list-style: none; margin: 0; padding: 0; }
.activity li, .comments li, .letters li, .admin-list li {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.activity time, .comments time, .bubbles time { color: var(--muted); font-size: 13px; }

.panel, .auth-card, .empty-state {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 22px;
  margin: 22px 0;
}
.auth-card { max-width: 460px; }
.empty-state h2 { font-size: 32px; }
.stack { display: grid; gap: 12px; }
.slim { max-width: 560px; }
label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 14px; }
.check { grid-template-columns: auto 1fr; align-items: center; }
input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}
.search-line, .add-form { display: flex; gap: 8px; align-items: center; }
.search-line input, .add-form input { flex: 1; }
.search-results { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.search-results li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.search-results img { width: 48px; height: 72px; object-fit: cover; }

.watchlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.film-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.film-row:has(.handle) { grid-template-columns: auto 64px 1fr; }
.film-row:has(.nudge) { grid-template-columns: auto auto 64px 1fr; }
.handle {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: grab;
  padding: 8px 4px;
}
.nudge { display: grid; gap: 4px; }
.nudge button { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 4px 8px; }
.row-poster img { width: 64px; height: 96px; object-fit: cover; }
.note-form { display: flex; gap: 8px; align-items: center; }
.note-input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  color: var(--muted);
}
.note-input:focus { border-bottom-color: var(--gold); }
.poster-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.list-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  text-decoration: none;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.list-card-title { display: block; font-family: var(--serif); font-size: 22px; }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 2px 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pill-gold { color: var(--gold); border-color: var(--gold); }

.player { margin: 12px 0 28px; }
.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
}
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
}
.film-page .film-hero { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: end; }
.film-hero img { width: 280px; height: auto; }

.profile { --accent: var(--gold); }
.profile[data-accent="gold"] { --accent: #c6a36a; }
.profile[data-accent="crimson"] { --accent: #9d3530; }
.profile[data-accent="teal"] { --accent: #2f6f6a; }
.profile[data-accent="ivory"] { --accent: #e4dccf; }
html[data-theme="light"] .profile[data-accent="gold"] { --accent: #8a6430; }
html[data-theme="light"] .profile[data-accent="crimson"] { --accent: #8d2e2a; }
html[data-theme="light"] .profile[data-accent="teal"] { --accent: #1f5c58; }
html[data-theme="light"] .profile[data-accent="ivory"] { --accent: #6e655b; }
.profile-head { display: flex; gap: 18px; align-items: end; }
.avatar {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.rank-badge { color: var(--accent); font-family: var(--serif); font-size: 28px; margin: 8px 0 0; }
.points-num { font-family: var(--serif); font-size: 56px; color: var(--ink); }
.stats { display: flex; gap: 28px; }
.stats div { display: grid; }
.stats dt { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.stats dd { margin: 0; font-family: var(--serif); font-size: 32px; }
.board-scroll, .shop-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.board-scroll { max-height: 16rem; }
.shop-scroll { max-height: min(32rem, 70vh); }
.board li, .shop-card, .threads a, .keys li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.shop { display: grid; gap: 0; }
.shop-card { grid-template-columns: auto 1fr; }
.shop-card .quiet, .shop-card form, .shop-card .pill { grid-column: 2; }
.shop-card.is-worn { outline: 1px solid var(--accent); outline-offset: 4px; }
.shop-card.is-locked { opacity: 0.72; }
.swatch { width: 28px; height: 28px; border: 1px solid var(--line); }
.swatch-gold { background: #c6a36a; }
.swatch-crimson { background: #9d3530; }
.swatch-teal { background: #2f6f6a; }
.swatch-ivory { background: #e4dccf; }
.who { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.who .ico, .board .ico, .avatar .ico { color: var(--accent, var(--gold)); }

.flash { padding: 12px 14px; border: 1px solid var(--line); background: var(--bg-raised); }
.flash-error { color: var(--danger); }
.state-empty, .state-idle, .state-error, .state-loading { margin: 12px 0; }
.state-error { color: var(--danger); }
#film-results[data-state="loading"] { color: var(--muted); }
.code, .codes code {
  font-family: ui-monospace, "Source Code Pro", monospace;
  letter-spacing: 0.06em;
  background: var(--bg-sunken);
  padding: 8px 10px;
}
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-pad { display: inline-block; background: #f4efe6; padding: 12px; }
.gross-edit { border: 1px solid var(--line); margin: 0; display: grid; gap: 8px; }
.admin-list li { grid-template-columns: 1fr auto; align-items: center; }
.split { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.threads a { grid-template-columns: 1fr; text-decoration: none; }
.threads a[aria-current="page"] { color: var(--gold); }
.bubbles { display: grid; gap: 12px; }
.bubbles li { max-width: 36rem; }
.bubbles .mine { margin-left: auto; text-align: right; }
.colophon { padding: 48px 0 24px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.colophon a { color: var(--gold); }
.save-status[hidden] { display: none; }
.save-status {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--gold-ink);
  padding: 6px 10px;
  z-index: 60;
}
.tabbar { display: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 760px) {
  .desk-nav { display: none; }
  .topfive li { grid-template-columns: auto 56px 1fr; }
  .topfive .gross { grid-column: 3; font-size: 22px; }
  .film-page .film-hero, .split, .profile-head { grid-template-columns: 1fr; }
  .film-hero img { width: min(100%, 220px); }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    text-decoration: none;
    color: var(--muted);
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 0 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  .tabbar a[aria-current="page"] { color: var(--gold); }
  .tab-ico { width: 22px; height: 22px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .page { padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .snap-row, .board-scroll, .shop-scroll {
    scroll-behavior: auto !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
