:root {
  --bg1: #ffe66d;
  --bg2: #ff8fab;
  --bg3: #8ec5ff;
  --ink: #2b2140;
  --muted: #6b5f80;
  --card: #ffffff;
  --primary: #ff4f81;
  --primary-dark: #e63a6c;
  --green: #2fbf71;
  --yellow: #ffb703;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(43, 33, 64, 0.15);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%) fixed;
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; }
input, select, button { font: inherit; color: inherit; }

/* ---------- Buttons ---------- */
.btn { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 600; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; width: 100%; padding: 14px; font-size: 1.1rem; box-shadow: 0 6px 0 var(--primary-dark); }
.btn-add { background: var(--green); color: #fff; box-shadow: 0 4px 0 #23965a; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font-weight: 600; text-decoration: underline; }

input, select {
  border: 3px solid #f0e6ff; border-radius: 14px; padding: 10px 14px; background: #fff; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--primary); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--card); width: 100%; max-width: 380px; padding: 36px 28px; border-radius: 28px; box-shadow: var(--shadow); text-align: center; }
.logo { font-size: 64px; animation: bounce 2s ease-in-out infinite; }
.auth-card h1 { font-size: 2.4rem; color: var(--primary); }
.tagline { color: var(--muted); margin: 6px 0 22px; }
.auth-card form { display: grid; gap: 14px; text-align: left; }
.auth-card label { display: grid; gap: 6px; font-weight: 500; }
.auth-card .link { margin-top: 16px; }
.error { color: #d6336c; min-height: 1.2em; margin: 0; font-weight: 500; }

/* ---------- Topbar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; flex-wrap: wrap; gap: 8px; }
.brand { font-size: 1.6rem; font-weight: 700; }
.brand span { color: #fff; text-shadow: 2px 2px 0 var(--primary); }
.user { background: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 999px; }

/* ---------- Secties ---------- */
section { max-width: 1100px; margin: 0 auto 24px; padding: 0 16px; }
.hero { text-align: center; }
.hero h2 { font-size: 2.2rem; color: #fff; text-shadow: 3px 3px 0 var(--ink); margin-top: 12px; }
.sub { margin: 6px 0 18px; font-weight: 500; }
.searchbar input { width: 100%; max-width: 640px; font-size: 1.25rem; padding: 18px 24px; border-radius: 999px; border: 4px solid #fff; box-shadow: var(--shadow); }

.verdict { max-width: 640px; margin: 16px auto 0; padding: 14px 18px; border-radius: 16px; font-size: 1.1rem; animation: pop .3s; }
.verdict.good { background: #d3f9d8; color: #1b6e3c; }
.verdict.warn { background: #fff3bf; color: #8a5a00; border: 3px dashed var(--yellow); }

.results { margin-top: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; text-align: left; }
.result { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); animation: pop .3s; }
.result.seen { opacity: .65; }
.result .poster { width: 72px; height: 108px; flex: none; }
.r-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-title { font-weight: 600; font-size: 1.05rem; }
.year { color: var(--muted); font-weight: 400; }
.orig { color: var(--muted); font-size: .85rem; font-style: italic; }
.overview { margin: 2px 0 6px; font-size: .85rem; color: var(--muted); }
.r-body .btn { align-self: flex-start; margin-top: auto; padding: 6px 14px; }
.badge { align-self: flex-start; margin-top: auto; background: #e7f5ff; color: #1864ab; padding: 4px 12px; border-radius: 999px; font-weight: 600; }

.manual { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 18px auto 0; background: rgba(255,255,255,.75); padding: 12px; border-radius: 999px; max-width: 640px; }
.manual input[name=title] { flex: 1; min-width: 140px; }
.manual input[name=year] { width: 90px; }
.manual span { font-weight: 600; }

/* ---------- Collectie ---------- */
.collection { background: rgba(255,255,255,.55); backdrop-filter: blur(6px); border-radius: 28px; padding: 22px; }
.collection-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.collection-head h2 { font-size: 1.7rem; }
.pill { background: var(--primary); color: #fff; padding: 2px 12px; border-radius: 999px; font-size: 1rem; vertical-align: middle; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.controls input { min-width: 0; flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.card { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; animation: pop .3s; }
.card:hover { transform: translateY(-4px) rotate(-.5deg); }
.card .poster { width: 100%; aspect-ratio: 2/3; }
.c-body { padding: 10px 12px 12px; }
.card h3 { font-size: 1rem; line-height: 1.2; }
.meta { color: var(--muted); font-size: .8rem; margin: 2px 0 6px; }

.poster { display: block; object-fit: cover; border-radius: 12px; background: #eee; }
.card .poster { border-radius: 0; }
.poster.ph { display: grid; place-items: center; color: #fff; font-size: 2.6rem; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,.15); }

.stars { display: flex; gap: 2px; }
.stars button { background: none; border: 0; padding: 0; font-size: 1.35rem; cursor: pointer; color: #dee2e6; transition: transform .1s, color .1s; }
.stars button.on { color: var(--yellow); }
.stars button:hover { transform: scale(1.3); }
.stars:hover button { color: var(--yellow); }
.stars button:hover ~ button { color: #dee2e6; }

.del { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); cursor: pointer; opacity: 0; transition: opacity .15s; font-weight: 700; }
.card:hover .del, .del:focus { opacity: 1; }
@media (hover: none) { .del { opacity: 1; } }

.empty { text-align: center; font-size: 1.15rem; padding: 30px 0; }

/* ---------- Toast & confetti ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 500; transition: transform .3s; z-index: 10; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.toast.warn { background: #e8590c; }

.confetti { position: fixed; top: -10px; width: 10px; height: 14px; border-radius: 3px; z-index: 9; pointer-events: none; animation: fall 1.6s ease-in forwards; }

@keyframes fall { to { top: 105vh; transform: rotate(720deg); } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 560px) {
  .hero h2 { font-size: 1.7rem; }
  .manual { border-radius: 20px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .collection { padding: 14px; }
}
