:root {
  --bg: #0d0d0f;
  --panel: #161618;
  --panel-line: #2a2a30;
  --lime: #c4f135;
  --lime-d: #a9d800;
  --purple: #7c4dff;
  --purple-d: #6a2bd9;
  --card: #ffffff;
  --ink: #121212;
  --muted: #7c8190;
  --muted-d: #9a9aa3;
  --line: #e7e6e2;
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: #fff;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.heavy, h1, h2, .block-head, .hero-title, .section-title, .cd-number {
  font-weight: 900;
  letter-spacing: -0.5px;
}

.topbar {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #6f6f78;
  padding: 20px 16px 6px;
}

.container { max-width: 880px; margin: 0 auto; padding: 28px 16px 64px; }

/* ---------- HERO ---------- */
.hero-card {
  position: relative;
  background: var(--card);
  border-radius: 30px;
  padding: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.hero-img {
  display: block;
  width: 100%;
  height: clamp(220px, 42vw, 360px);
  object-fit: cover;
  border-radius: 20px;
}
.hero-tag {
  position: absolute;
  top: 34px;
  right: 34px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
  font-size: clamp(14px, 2.6vw, 22px);
  padding: 8px 16px;
  border-radius: 12px;
}
.hero-title {
  position: absolute;
  left: 30px;
  bottom: 30px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(34px, 9vw, 66px);
  line-height: 0.95;
  padding: 12px 22px 14px;
  border-radius: 18px;
  text-transform: uppercase;
}

/* ---------- Blocks (generic) ---------- */
.block {
  border-radius: var(--radius);
  padding: 22px;
}
.block-white { background: var(--card); color: var(--ink); }
.block-green { background: var(--lime); color: var(--ink); }
.block-head {
  margin: 0 0 12px;
  font-size: clamp(22px, 4.5vw, 32px);
  text-transform: uppercase;
  line-height: 1;
}
.hl { color: var(--purple); }
.hl-dark { color: var(--purple-d); }
.block-p { margin: 12px 0 0; font-size: 14px; color: #4a4f5c; }
.block-p.dark { color: #2c3a00; }
.meme-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  margin: 12px auto 0;
  border-radius: 14px;
}

/* ---------- COUNTDOWN ---------- */
.countdown {
  text-align: center;
  margin-bottom: 16px;
  padding: 22px 24px 24px;
  border-radius: var(--radius);
}
.cd-head {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
  color: #2c3a00;
  margin-bottom: 12px;
}
.cd-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: rgba(13, 13, 15, 0.12);
  border-radius: 999px;
}
.cd-tab {
  border: none;
  background: transparent;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #3a4a00;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cd-tab.active { background: var(--ink); color: var(--lime); }
.cd-main { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.cd-number {
  font-size: clamp(56px, 16vw, 104px);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cd-unit { font-size: clamp(20px, 4vw, 28px); font-weight: 900; color: var(--ink); text-transform: uppercase; }
.cd-sub { margin-top: 10px; font-size: 15px; font-weight: 700; color: #3a4a00; font-variant-numeric: tabular-nums; letter-spacing: 1px; }

/* ---------- MEME GRID ---------- */
.meme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
.span-2 { grid-column: 1 / -1; }
.meme-wide { display: flex; align-items: center; gap: 22px; }
.meme-wide .block-text { flex: 1; }
.meme-wide .meme-img { width: auto; max-width: 40%; max-height: 190px; margin: 0; }
.final-block {
  text-align: center;
  font-size: clamp(20px, 4.4vw, 30px);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 30px 24px;
}
.final-memes { display: flex; gap: 14px; margin-top: 22px; justify-content: center; }
.final-memes .meme-img { width: auto; max-width: 46%; max-height: 200px; margin: 0; }

/* ---------- Emoji legend ---------- */
.emoji-legend { display: flex; justify-content: space-around; gap: 10px; text-align: center; margin-top: 6px; }
.emoji-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.emoji { font-size: clamp(40px, 10vw, 60px); line-height: 1; }
.emoji-cap { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: var(--ink); }

/* ---------- Section title ---------- */
.section-title {
  font-size: clamp(28px, 7vw, 46px);
  text-transform: uppercase;
  margin: 8px 0 18px;
  color: #fff;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-d); font-weight: 700; }
/* Кастомный дропдаун */
.dropdown { position: relative; min-width: 200px; }
.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #1f1f24;
  color: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.dropdown-trigger:hover { border-color: var(--purple); }
.dropdown.open .dropdown-trigger { border-color: var(--purple); }
.dropdown-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-arrow { width: 14px; height: 9px; flex-shrink: 0; transition: transform 0.2s ease; }
.dropdown-arrow path { stroke: var(--lime); }
.dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #16161a;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  z-index: 50;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: #e7e7ea;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.dropdown-option:hover { background: #25252c; }
.dropdown-option.is-selected { background: var(--lime); color: #0d0d0f; font-weight: 700; }

/* Кастомный чекбокс */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 14px;
  color: var(--muted-d);
  cursor: pointer;
  user-select: none;
}
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-box {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 2px solid var(--panel-line);
  background: #1f1f24;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.checkbox-box svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: opacity 0.15s ease, transform 0.15s ease; }
.checkbox-box svg path { stroke: #0d0d0f; }
.checkbox:hover .checkbox-box { border-color: var(--purple); }
.checkbox input:checked ~ .checkbox-box { background: var(--lime); border-color: var(--lime); }
.checkbox input:checked ~ .checkbox-box svg { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible ~ .checkbox-box { box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.4); border-color: var(--purple); }
.checkbox input:checked ~ .checkbox-label { color: #fff; }

/* ---------- Gift grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-4px); }
.card.reserved { opacity: 0.55; }
.card-img { width: 100%; height: 180px; object-fit: cover; background: #f0eff0; display: block; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px; }
.imp-3 { background: var(--lime); color: #2c3a00; }
.imp-2 { background: var(--purple); color: #fff; }
.imp-1 { background: #ececef; color: #5b6170; }
.badge-store { background: var(--ink); color: #fff; }
.card-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.price { font-size: 17px; font-weight: 900; color: var(--ink); }
.comment { margin: 0; color: var(--muted); font-size: 14px; }
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--purple); }
.btn-block { width: 100%; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #0d0d0f; font-weight: 900; }
.btn-primary:hover { filter: brightness(0.95); border-color: var(--lime-d); }
.btn-ghost { background: transparent; }
.btn-link { background: #f1ecff; border-color: #e2d8ff; color: var(--purple-d); }
.btn-reserve { background: var(--lime); border-color: var(--lime); color: #0d0d0f; font-weight: 900; text-transform: uppercase; letter-spacing: 0.3px; }
.btn-reserve:hover { filter: brightness(0.95); }
.btn-reserved { background: #f2f2f2; color: var(--muted); cursor: default; border-style: dashed; }
.btn-unreserve { background: #fff; border-color: #18a558; color: #18a558; }

.empty { text-align: center; color: var(--muted-d); padding: 50px 0; font-size: 16px; }
.footer { text-align: center; color: #5a5a63; padding: 28px 16px; font-size: 13px; }

/* ---------- Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.card-enter { animation: cardEnter 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card-enter { animation: none; }
  .card:hover { transform: none; }
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #1c1c20;
  color: #fff;
  border: 1px solid var(--panel-line);
  border-left: 4px solid var(--lime);
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { border-left-color: var(--lime); }
.toast-error { border-left-color: #ff5470; }
.toast-info { border-left-color: var(--purple); }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.01s linear; transform: none; }
}

/* ====================== ADMIN ====================== */
.admin-body { background: var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1 { margin: 0; font-size: 22px; text-transform: uppercase; }
.hero-emoji { font-size: 52px; line-height: 1; }

.admin-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.admin-header h1 { margin: 0; font-size: 28px; color: #fff; text-transform: uppercase; }
.admin-header-actions { display: flex; gap: 8px; }
.admin-header .btn { background: #1d1d22; color: #fff; border-color: var(--panel-line); }
.admin-header .btn:hover { border-color: var(--purple); }

.hint { background: var(--lime); border: none; color: #2c3a00; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin: 14px 0 22px; }

.item-form {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea, input[type="password"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fafafa;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
}
.current-image { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.remove-img { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; }
.error { color: #c81e57; font-size: 14px; margin: 0; }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-item {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.admin-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); background: #f4f4f4; }
.admin-item-meta { flex: 1; min-width: 0; }
.admin-item-title { font-weight: 800; font-size: 16px; }
.admin-item-sub { color: var(--muted); font-size: 13px; }
.admin-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-danger { color: #c81e57; border-color: #f3c6d4; }
.btn-danger:hover { background: #fff0f4; border-color: #c81e57; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .meme-grid { grid-template-columns: 1fr; }
  .meme-wide { flex-direction: column; align-items: stretch; }
  .meme-wide .meme-img { max-width: 100%; max-height: 220px; margin: 12px auto 0; }
  .field-row { grid-template-columns: 1fr; }
  .toggle { margin-left: 0; }
  .hero-title { left: 18px; bottom: 18px; }
  .hero-tag { top: 24px; right: 24px; }
}
