:root {
  --bg: #120d0b;
  --surface: #1d1512;
  --surface-raised: #2a1e19;
  --text: #f4ebe1;
  --text-muted: #a89a8c;
  --accent: #e8a33d;
  --accent-strong: #f5b957;
  --accent-contrast: #1a1006;
  --danger: #c0392b;
  --success: #6fbf73;
  --border: #3a2b24;
  --radius: 14px;
  --gutter: 16px;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; overflow-x: hidden; }

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at top, #2a1710 0%, var(--bg) 60%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 12px var(--gutter);
  background: rgba(18, 13, 11, 0.92);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.topbar strong { color: var(--accent); font-weight: 400; }

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
}

.screen { display: flex; flex-direction: column; gap: 20px; }

.home { align-items: center; text-align: center; padding-top: 12vh; }
.home h1 { font-size: clamp(3rem, 14vw, 5.5rem); color: var(--accent); }
.home p { margin: 0; color: var(--text-muted); max-width: 36ch; }
.category {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.9rem;
}
.best { color: var(--text-muted); font-size: 0.9rem; }

.btn {
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.btn:hover { background: var(--accent-strong); }
.btn-block { width: 100%; }

.poster-frame {
  align-self: center;
  width: min(62vw, 260px);
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.poster-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.4rem;
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--surface-raised) 10px, var(--surface-raised) 20px);
}

.film-title { text-align: center; }
.film-title h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); overflow-wrap: anywhere; }
.film-title .original { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

.year-picker { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.year-value {
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--accent);
}
.year-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.year-row input[type="range"] { flex: 1; min-width: 0; height: 44px; accent-color: var(--accent); }
.step {
  flex: none;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}
.step:hover { border-color: var(--accent); }

.result {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.result .truth { font-family: var(--font-display); font-size: 3rem; line-height: 1; }
.result .gap { margin: 4px 0 0; color: var(--text-muted); }
.result .points {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent);
  animation: pop 0.5s ease-out;
}
.result.perfect .truth { color: var(--success); }

@keyframes pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  100% { opacity: 1; transform: none; }
}

.final-score { text-align: center; }
.final-score .total { font-family: var(--font-display); font-size: 5rem; color: var(--accent); line-height: 1; }
.final-score .total span { font-size: 2rem; color: var(--text-muted); }

.recap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recap li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.recap .thumb { width: 48px; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--surface-raised); }
.recap .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recap .thumb .poster-placeholder { font-size: 0.7rem; padding: 2px; }
.recap .name { font-weight: 600; overflow-wrap: anywhere; }
.recap .detail { color: var(--text-muted); font-size: 0.85rem; }
.recap .pts { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .result .points { animation: none; }
}

@media (min-width: 720px) {
  .app { padding-top: 40px; }
  .home { padding-top: 8vh; }
}
