:root {
  --accent: #d98c7a;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, white);
  --ink: #3b3330;
  --muted: #8a7f7a;
  --line: #eee4df;
  --bg: #fdfaf7;
  --card: #fff;
  --ok: #6aa27f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 40, 30, .05), 0 6px 20px rgba(60, 40, 30, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* buttons & inputs */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .6em 1.1em; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4em; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: #b5483b; }
.btn.sm { padding: .35em .8em; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: .65em .85em;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-weight: 700; font-size: .85rem; margin: .8em 0 .3em; }
label .muted { font-weight: 400; }
.check { display: flex; align-items: center; gap: .5em; font-weight: 600; margin: .8em 0; }
.check input { width: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

/* hero */
.hero { position: relative; text-align: center; padding: 64px 20px 48px; overflow: hidden;
  background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.hero.has-cover { color: #fff; background: #333 center/cover no-repeat; }
.hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero .sub { font-size: 1.1rem; opacity: .9; }
.countdown { display: inline-block; margin-top: 14px; padding: .4em 1em; border-radius: 999px;
  background: rgba(255,255,255,.75); color: var(--ink); font-weight: 700; }
.hero-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* info cards */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: -24px 0 28px; position: relative; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h3 { font-size: 1.15rem; }
.welcome { white-space: pre-line; }
.pay-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* toolbar */
.toolbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.toolbar .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 200px; }
.toolbar select { width: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chip { flex: none; padding: .35em .9em; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-weight: 700; font-size: .85rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* items */
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 60px; }
.item { display: flex; flex-direction: column; overflow: hidden; padding: 0; position: relative; }
.item .img { aspect-ratio: 1; padding: 14px; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.item .img img { width: 100%; height: 100%; object-fit: contain; }
.item .img.placeholder { display: grid; place-items: center; font-size: 3rem; background: var(--accent-soft); }
.item .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item .store { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.item .title { font-weight: 800; line-height: 1.3; }
.item .price { font-weight: 800; color: var(--accent); }
.item .notes { font-size: .85rem; color: var(--muted); font-style: italic; }
.item .actions { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.item .actions .btn { flex: 1; justify-content: center; }
.item.done { opacity: .6; }
.item.done .img { filter: grayscale(.7); }
.badge { position: absolute; top: 10px; left: 10px; padding: .2em .7em; border-radius: 999px; font-size: .72rem; font-weight: 800; background: #fff; border: 1px solid var(--line); }
.badge.must { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge.dream { background: #f5edff; color: #7a5aa6; border-color: #e6d8fb; }
.badge.got { left: auto; right: 10px; background: var(--ok); color: #fff; border-color: var(--ok); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(40,30,25,.45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 20px; max-width: 480px; width: 100%; max-height: 92vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 640px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: .7em 1.2em; border-radius: 999px; font-weight: 700; z-index: 60; box-shadow: var(--shadow); animation: fade .2s; }

footer { text-align: center; padding: 30px 20px 50px; color: var(--muted); font-size: .85rem; }

/* lock screen */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.lock .card { max-width: 380px; width: 100%; text-align: center; }

/* admin */
.admin-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: .7em 1em; border: none; background: none; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: var(--ink); border-color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.li { display: flex; gap: 14px; align-items: center; padding: 12px 14px; }
.li .thumb { width: 56px; height: 56px; border-radius: 10px; flex: none; background: #fff center/contain no-repeat; border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.5rem; }
.li .grow { flex: 1; min-width: 0; }
.li .grow .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.li.is-hidden { opacity: .55; }
.surprise .reveal { filter: blur(6px); user-select: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi .n { font-size: 1.8rem; font-weight: 800; font-family: "Fraunces", Georgia, serif; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.essentials { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
#qr { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 12px; }
#qr img, #qr canvas { width: 220px; height: 220px; image-rendering: pixelated; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .item .body { padding: 10px 12px 12px; }
  .item .actions .btn { font-size: .8rem; padding: .5em .6em; }
  .li { flex-wrap: wrap; }
  .li .btns { width: 100%; justify-content: flex-start; }
}
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-group > * { flex: none; }
