:root {
  --ink: #17251f;
  --muted: #718078;
  --cream: #f7f3ea;
  --paper: #fbfaf6;
  --pine: #10231d;
  --pine-soft: #18382d;
  --gold: #d8ad58;
  --red: #b74d43;
  --line: #dfe4dc;
  --shadow: 0 22px 60px rgba(14, 35, 29, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.section-wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { position: relative; z-index: 2; width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(223,228,220,.6); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.02; letter-spacing: .04em; text-transform: uppercase; }
.brand strong { color: var(--red); font-size: 13px; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(183,77,67,.45); border-radius: 50%; color: var(--red); font-size: 16px; }
.header-nav { display: flex; gap: 34px; color: #5d6b64; font-size: 14px; font-weight: 600; }
.header-nav a:hover { color: var(--red); }
.ghost-button, .text-button { background: none; border: 0; color: #6b786f; font-size: 13px; font-weight: 700; padding: 8px 0; }
.ghost-button:hover, .text-button:hover { color: var(--red); }

.hero { min-height: 430px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 40px; position: relative; overflow: hidden; }
.hero-copy { padding: 48px 0 54px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 14px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; background: var(--red); border-radius: 50%; }
h1, h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-weight: 700; letter-spacing: -.045em; line-height: .98; }
h1 { max-width: 700px; font-size: clamp(48px, 7vw, 86px); }
h1 em, h2 em { color: var(--red); font-style: normal; }
.hero-lede { max-width: 500px; margin: 24px 0 30px; color: #637169; font-size: 17px; }
.hero-meta { display: flex; gap: 16px; align-items: center; color: #79857f; font-size: 13px; }
.hero-meta strong { color: var(--ink); font-size: 16px; }
.meta-divider { width: 1px; height: 18px; background: var(--line); }
.hero-art { min-height: 350px; position: relative; display: grid; place-items: center; overflow: hidden; }
.hero-art::before { content: ""; position: absolute; width: 310px; height: 310px; border-radius: 50%; background: #f2e7cf; opacity: .85; }
.hero-orbit { position: absolute; border: 1px solid rgba(183,77,67,.32); border-radius: 50%; transform: rotate(-28deg); }
.orbit-one { width: 330px; height: 130px; }
.orbit-two { width: 430px; height: 160px; transform: rotate(22deg); border-color: rgba(16,35,29,.2); }
.hero-tree { position: relative; z-index: 1; color: var(--pine); font-size: 135px; line-height: 1; text-shadow: 0 10px 0 #315f4e, 0 20px 0 #204433; transform: translateY(-8px); }
.hero-snowflake { position: absolute; color: var(--red); font-size: 24px; }
.snowflake-one { top: 58px; right: 16%; }
.snowflake-two { bottom: 50px; left: 15%; color: var(--pine-soft); }
.hero-caption { position: absolute; right: 11%; bottom: 24px; color: var(--pine); font-family: "Playfair Display", serif; font-size: 19px; line-height: 1.05; text-align: right; }
.hero-caption strong { color: var(--red); }

.how-it-works { display: flex; align-items: center; gap: 24px; padding: 22px 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { display: flex; gap: 12px; align-items: center; flex: 1; }
.step > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pine); color: #fff; font-size: 11px; font-weight: 800; }
.step strong { display: block; font-size: 13px; }
.step small { display: block; color: var(--muted); font-size: 12px; }
.step-line { height: 1px; flex: .65; background: var(--line); }

.tier-section { padding: 94px 0 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 34px; }
h2 { font-size: clamp(38px, 5vw, 60px); }
.heading-actions { display: flex; align-items: center; gap: 20px; padding-bottom: 4px; }
.selection-hint { color: var(--muted); font-size: 12px; }
.selection-hint.is-active { color: var(--red); font-weight: 700; }
.board { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.tier-row { min-height: 108px; display: grid; grid-template-columns: 118px 1fr; border-bottom: 1px solid rgba(255,255,255,.5); }
.tier-row:last-child { border-bottom: 0; }
.tier-label { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; color: #fff; }
.tier-label b { font-family: "Playfair Display", serif; font-size: 43px; line-height: 1; }
.tier-label span { font-size: 10px; font-weight: 700; letter-spacing: .08em; opacity: .8; text-transform: uppercase; }
.tier-s .tier-label { background: var(--red); }
.tier-a .tier-label { background: #c98b65; }
.tier-b .tier-label { background: #c1a85d; }
.tier-c .tier-label { background: #728e7a; }
.tier-d .tier-label { background: #71808a; }
.tier-dropzone { display: flex; align-content: center; align-items: center; flex-wrap: wrap; gap: 12px; padding: 15px 18px; min-height: 108px; background: rgba(247,243,234,.45); transition: background .2s, box-shadow .2s; }
.tier-dropzone.is-over { background: #f3e5d9; box-shadow: inset 0 0 0 3px rgba(183,77,67,.3); }
.tier-dropzone:empty::after { content: "pretiahni sem"; color: #a9b1aa; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.film-card { position: relative; width: 86px; min-height: 119px; border: 0; padding: 0; background: #e6e9e3; border-radius: 7px; overflow: hidden; box-shadow: 0 6px 14px rgba(16,35,29,.13); transition: transform .18s, box-shadow .18s, outline .18s; cursor: grab; }
.film-card:hover { transform: translateY(-4px); box-shadow: 0 12px 18px rgba(16,35,29,.17); }
.film-card:active { cursor: grabbing; }
.film-card.is-selected { outline: 3px solid var(--gold); outline-offset: 3px; transform: translateY(-3px); }
.film-card img { display: block; width: 100%; height: 88px; object-fit: cover; background: linear-gradient(135deg, var(--pine), #d4ac62); }
.film-card .card-meta { display: block; padding: 6px 6px 7px; background: #fff; text-align: left; }
.film-card strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 10px; line-height: 1.12; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.film-card small { display: block; margin-top: 3px; color: #8a948d; font-size: 9px; }
.tier-dropzone .film-card { width: 77px; min-height: 105px; }
.tier-dropzone .film-card img { height: 74px; }
.tier-dropzone .film-card .card-meta { padding: 5px; }

.library-head { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-top: 56px; margin-bottom: 18px; }
h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.search-box { width: 220px; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ink); color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.film-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 18px; padding: 20px 0 32px; }
.empty-library { color: var(--muted); padding: 20px 0 35px; }

.submit-panel { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 26px 30px; background: var(--pine); color: #fff; }
.submit-kicker { color: #d5b167; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.submit-panel h3 { margin-top: 4px; font-family: "Playfair Display", serif; font-size: 25px; }
.submit-panel p { margin: 6px 0 0; color: #a4b5ac; font-size: 13px; }
.primary-button { border: 0; border-radius: 2px; padding: 13px 18px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; transition: transform .18s, background .18s; }
.primary-button:hover { background: #a33f37; transform: translateY(-2px); }
.primary-button span { margin-left: 14px; font-size: 17px; }

.community-section { padding: 76px 0 100px; border-top: 1px solid var(--line); }
.community-note { margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: right; }
.community-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.community-card { padding: 20px; border: 1px solid var(--line); background: #fff; }
.community-card.is-top { border-color: rgba(183,77,67,.5); box-shadow: 0 8px 22px rgba(183,77,67,.08); }
.community-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.rank-number { color: #b0b9b1; font-family: "Playfair Display", serif; font-size: 30px; line-height: 1; }
.community-card.is-top .rank-number { color: var(--red); }
.community-card h4 { margin: 0; font-size: 15px; line-height: 1.15; }
.community-card .film-year { color: var(--muted); font-size: 11px; }
.score { display: flex; gap: 10px; align-items: baseline; margin-top: 22px; }
.score strong { font-family: "Playfair Display", serif; font-size: 38px; line-height: 1; }
.score span { color: var(--muted); font-size: 11px; }
.score-bar { height: 4px; margin-top: 14px; background: #edf0ea; }
.score-bar i { display: block; height: 100%; background: var(--red); }
.vote-breakdown { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 11px; }
.vote-breakdown b { color: var(--ink); }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 36px; border-top: 1px solid var(--line); color: #89958d; font-size: 12px; }
.name-dialog { width: min(460px, calc(100% - 30px)); border: 0; padding: 0; color: var(--ink); box-shadow: 0 24px 100px rgba(16,35,29,.24); }
.name-dialog::backdrop { background: rgba(16,35,29,.54); backdrop-filter: blur(5px); }
.name-dialog form { position: relative; padding: 42px; }
.name-dialog h2 { font-size: 42px; }
.dialog-copy { margin: 18px 0 26px; color: var(--muted); font-size: 14px; }
.dialog-close { position: absolute; top: 15px; right: 18px; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; }
.name-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.name-dialog input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); outline: 0; border-radius: 0; color: var(--ink); }
.name-dialog input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(183,77,67,.1); }
.dialog-submit { width: 100%; margin-top: 18px; }
.dialog-status { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 12px; }
.toast { position: fixed; z-index: 5; right: 22px; bottom: 22px; max-width: 320px; padding: 13px 16px; border-radius: 3px; background: var(--pine); color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(16,35,29,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.snow { position: fixed; z-index: -1; inset: 0; pointer-events: none; opacity: .28; background-image: radial-gradient(#c5d0c6 1px, transparent 1px), radial-gradient(#d9c6b7 1px, transparent 1px); background-size: 44px 44px, 67px 67px; background-position: 0 0, 22px 31px; }

@media (max-width: 760px) {
  .section-wrap, .site-header { width: min(100% - 30px, 560px); }
  .site-header { padding: 20px 0; }
  .header-nav { display: none; }
  .ghost-button { font-size: 12px; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  .hero-copy { padding: 12px 0 10px; }
  h1 { font-size: clamp(45px, 14vw, 72px); }
  .hero-lede { font-size: 15px; }
  .hero-art { min-height: 220px; margin-top: -4px; }
  .hero-art::before { width: 205px; height: 205px; }
  .hero-tree { font-size: 90px; }
  .orbit-one { width: 240px; height: 100px; }
  .orbit-two { width: 320px; height: 120px; }
  .hero-caption { right: 4%; bottom: 8px; font-size: 16px; }
  .how-it-works { gap: 9px; padding: 16px 0 20px; }
  .step { gap: 7px; }
  .step > span { flex: 0 0 25px; width: 25px; height: 25px; font-size: 9px; }
  .step strong { font-size: 11px; }
  .step small { font-size: 10px; }
  .step-line { flex: .2; }
  .tier-section { padding: 65px 0 70px; }
  .section-heading, .library-head, .submit-panel { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; justify-content: space-between; }
  .tier-row { grid-template-columns: 62px 1fr; min-height: 95px; }
  .tier-label b { font-size: 31px; }
  .tier-label span { max-width: 58px; font-size: 8px; text-align: center; }
  .tier-dropzone { min-height: 95px; padding: 11px 10px; gap: 8px; }
  .film-card { width: 72px; min-height: 105px; }
  .film-card img { height: 76px; }
  .tier-dropzone .film-card { width: 63px; min-height: 92px; }
  .tier-dropzone .film-card img { height: 63px; }
  .film-library { grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
  .search-box { width: 100%; }
  .submit-panel { padding: 24px 20px; }
  .submit-panel .primary-button { width: 100%; }
  .community-grid { grid-template-columns: 1fr 1fr; }
  .community-note { text-align: left; }
  .site-footer { flex-direction: column; gap: 5px; }
  .name-dialog form { padding: 33px 23px 25px; }
  .name-dialog h2 { font-size: 35px; }
}
