/* ============================================================
   Тайный Санта — яркий flat-дизайн:
   насыщенный фон, цветные подарки с параллаксом, жирные шрифты
   ============================================================ */

:root {
  --bg: #443c71;           /* спокойный приглушённый индиго */
  --bg-deep: #362d5e;
  --ink: #1f1633;          /* тёмный текст */
  --ink-soft: rgba(31, 22, 51, 0.6);
  --paper: #ffffff;
  --pink: #ff5c8a;
  --yellow: #ffc93c;
  --teal: #2ed8c3;
  --blue: #4d96ff;
  --white-soft: rgba(255, 255, 255, 0.75);
  --white-line: rgba(255, 255, 255, 0.35);
  --hard: 8px 8px 0 rgba(31, 22, 51, 0.35);
  --hard-sm: 4px 4px 0 rgba(31, 22, 51, 0.3);
  --radius: 24px;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* атрибут hidden всегда сильнее любых display */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

/* ---------- фон: подарки и снежинки с параллаксом ---------- */

.bg-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.px { position: absolute; will-change: transform; }

.gift {
  position: relative;
  width: var(--s, 90px);
  height: calc(var(--s, 90px) * 0.78);
  background: var(--c, var(--pink));
  border-radius: 12px;
  animation: float 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* вертикальная лента */
.gift::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 20%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}

/* крышка */
.gift::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  top: 16%;
  height: 26%;
  background: var(--c, var(--pink));
  filter: brightness(0.82);
  border-radius: 10px;
  box-shadow: inset 0 -4px 0 rgba(31, 22, 51, 0.12);
}

.gift .bow {
  position: absolute;
  top: calc(-0.34 * var(--s, 90px));
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--s, 90px) * 0.34);
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-16px) rotate(var(--r, 0deg)); }
}

.flake-decor {
  color: rgba(255, 255, 255, 0.12);
  font-size: var(--fs, 64px);
  animation: spin 26s linear infinite;
  animation-delay: var(--d, 0s);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- каркас и отступы ---------- */

.shell {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

main.shell {
  padding-top: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(48px, 8vw, 96px);
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 7vw, 72px);
}

.topbar {
  position: relative;
  z-index: 4;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: clamp(20px, 4vw, 32px) clamp(20px, 5vw, 48px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 19px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
}

.logo-hat { font-size: clamp(24px, 3vw, 30px); display: inline-block; }

.tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 30px);
  padding-top: clamp(16px, 3vw, 40px);
}

.badge {
  font-size: clamp(11px, 1.6vw, 14px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
  padding: 12px 24px;
  box-shadow: var(--hard-sm);
  max-width: 100%;
}

h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 7.5vw, 88px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: #fff;
  text-wrap: balance;
}

h1 .hl { color: var(--yellow); }

.subtitle {
  max-width: 640px;
  color: var(--white-soft);
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 500;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
  width: min(600px, 100%);
}

.stat, .stat-card {
  background: var(--paper);
  border-radius: 18px;
  padding: clamp(16px, 2.4vw, 22px) clamp(12px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  box-shadow: var(--hard);
}

.stat span, .stat-card span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 2.4vw, 20px);
  line-height: 1.25;
  color: var(--violet, var(--pink));
}

/* дата длинная — ей отдельный кегль, чтобы не распирало карточку */
.stat span[data-event-date] { font-size: clamp(12.5px, 1.7vw, 16px); }

.stat:nth-child(1) { --violet: var(--pink); }
.stat:nth-child(2) { --violet: var(--bg-deep); }
.stat:nth-child(3) { --violet: #0da58f; }
.stat-card span { --violet: var(--bg-deep); }

.stat label, .stat-card label {
  font-size: clamp(9px, 1.6vw, 11px);
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- разделитель ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--yellow);
  font-size: 18px;
  padding: 0 clamp(8px, 4vw, 40px);
}

.divider::before, .divider::after {
  content: "";
  height: 3px;
  border-radius: 2px;
  flex: 1;
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- кнопки: flat + жёсткая тень ---------- */

.btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(13px, 1.8vw, 15px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 16px;
  padding: 16px 30px;
  min-height: 52px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: #fff;
  background: var(--bg-deep);
  border: none;
}

.btn:hover { transform: translate(-2px, -2px); }
.btn:active { transform: translate(3px, 3px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--pink);
  box-shadow: var(--hard);
}
.btn-primary:hover { box-shadow: 10px 10px 0 rgba(31, 22, 51, 0.35); }
.btn-primary:active { box-shadow: 2px 2px 0 rgba(31, 22, 51, 0.35); }

.btn-secondary {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--hard);
}
.btn-secondary:hover { box-shadow: 10px 10px 0 rgba(31, 22, 51, 0.35); }
.btn-secondary:active { box-shadow: 2px 2px 0 rgba(31, 22, 51, 0.35); }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--white-line);
  color: #fff;
}
.btn-ghost:hover { border-color: #fff; }

.btn-danger {
  background: var(--paper);
  color: #d61f4c;
  border: 2px solid #d61f4c;
}

.btn-lg { padding: 19px 42px; font-size: clamp(14px, 2vw, 16px); border-radius: 18px; }
.btn-block { width: 100%; }

/* ---------- карточки: белые, плотные, flat ---------- */

.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: clamp(30px, 5.5vw, 56px);
  box-shadow: var(--hard);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card h2, .card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 3.4vw, 30px);
  line-height: 1.2;
  color: var(--ink);
}

.card h3 { font-size: clamp(18px, 2.6vw, 22px); }

.card-note { color: var(--ink-soft); font-size: clamp(13px, 1.9vw, 15px); font-weight: 600; line-height: 1.6; margin-top: -6px; }

/* ---------- формы: непрозрачные, просторные ---------- */

#reg-form, .card form {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vw, 26px);
}

.field { display: flex; flex-direction: column; gap: 10px; }

.field label {
  font-size: clamp(11px, 1.6vw, 12.5px);
  font-weight: 800;
  color: var(--bg-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.optional { text-transform: none; letter-spacing: 0.02em; color: var(--ink-soft); font-weight: 600; }

.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 16px; /* iOS не зумит при фокусе */
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 2px solid rgba(31, 22, 51, 0.18);
  border-radius: 14px;
  padding: 17px 20px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.field input::placeholder, .field textarea::placeholder { color: rgba(31, 22, 51, 0.35); font-weight: 500; }

.field input:focus, .field textarea:focus {
  border-color: var(--bg-deep);
  box-shadow: 0 0 0 4px rgba(68, 60, 113, 0.2);
}

/* ---------- сообщения ---------- */

.message {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: clamp(13px, 1.9vw, 14.5px);
  font-weight: 700;
  line-height: 1.55;
}

.message.ok { background: #d9f7ea; color: #0b8a5c; }
.message.err { background: #ffe1e8; color: #c81e4e; }
.message.info { background: #fff3d1; color: #8a6410; }

/* ---------- как это работает ---------- */

.how { text-align: center; }

.how-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 5vw, 48px);
  color: #fff;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 22px);
  text-align: left;
}

.step {
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 30px) clamp(20px, 2.5vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--hard);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step:hover { transform: translate(-3px, -3px); box-shadow: 12px 12px 0 rgba(31, 22, 51, 0.35); }

.step:nth-child(1) { background: var(--pink); color: #fff; }
.step:nth-child(2) { background: var(--yellow); color: var(--ink); }
.step:nth-child(3) { background: var(--teal); color: var(--ink); }
.step:nth-child(4) { background: var(--blue); color: #fff; }

.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.step-icon { font-size: clamp(30px, 4vw, 40px); }

.step h3 {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 700;
  color: inherit;
}

.step p { font-size: clamp(13px, 1.9vw, 14px); font-weight: 600; line-height: 1.6; opacity: 0.92; }

/* ---------- админка ---------- */

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 36px); color: #fff; }
.panel-head .card-note { color: var(--white-soft); margin-top: 6px; font-size: 14px; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 40px);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 16px);
}

.actions-row { display: flex; gap: 12px; flex-wrap: wrap; }
.actions-row .btn { flex: 1 1 auto; min-width: 200px; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 2px solid rgba(31, 22, 51, 0.12);
}

table { width: 100%; border-collapse: collapse; font-size: clamp(13px, 1.9vw, 14.5px); min-width: 640px; }

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bg-deep);
  padding: 13px 16px;
  background: #f1ecff;
  border-bottom: 2px solid rgba(31, 22, 51, 0.12);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(31, 22, 51, 0.08);
  vertical-align: top;
  color: var(--ink);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf8ff; }

.status-ok { color: #0b8a5c; font-weight: 800; }
.status-err { color: #c81e4e; font-weight: 800; }

.empty { color: var(--ink-soft); text-align: center; padding: 24px; font-size: 14px; font-weight: 600; }

/* ---------- футер ---------- */

footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(24px, 4vw, 40px) 20px clamp(36px, 6vw, 56px);
  color: var(--white-soft);
  font-size: 13.5px;
  font-weight: 600;
}

footer a { color: var(--yellow); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- доступность ---------- */

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 8px;
}

.card :focus-visible { outline-color: var(--bg-deep); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- мобильные ---------- */

@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .hero-stats { gap: 10px; }
  .stat label, .stat-card label { font-size: 9px; letter-spacing: 0.1em; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .actions-row .btn { min-width: 100%; }
  .topbar { padding-top: 18px; }
  .bg-decor .hide-m { display: none; }
  .badge { padding: 10px 16px; letter-spacing: 0.05em; }
  /* на мобильном розовый подарок прячем в угол, чтобы не мешал логотипу */
  .corner-tl { left: -95px !important; top: 0 !important; }
}

/* на тач-устройствах — без «отъезда» карточек по ховеру */
@media (hover: none), (pointer: coarse) {
  .card:hover, .step:hover { transform: none; }
}

/* ---------- личный результат (santa.html) ---------- */

.code-input {
  text-transform: uppercase;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 26px;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
}

.my-code {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(32px, 8vw, 44px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 14px 0 10px;
}

.share-box {
  border: 2px dashed rgba(31, 22, 51, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 14px 0;
}

.share-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 8px;
}

.share-row {
  display: flex;
  gap: 8px;
}

.share-row input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 10px 12px;
  border: 2px solid rgba(31, 22, 51, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.pending-box {
  margin: 14px 0;
}

.result-target {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 rgba(31, 22, 51, 0.25);
  padding: 20px 22px;
  margin: 18px 0;
}

.result-name {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  margin-bottom: 14px;
}

.result-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 2px dashed rgba(31, 22, 51, 0.2);
  font-weight: 600;
  word-break: break-word;
}

.result-row span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ---------- личные ссылки в админке ---------- */

.links-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid rgba(31, 22, 51, 0.15);
  border-radius: 14px;
  background: #fff;
}

.link-info { min-width: 0; flex: 1; }
.link-name { font-weight: 800; }
.link-code {
  font-size: 13px;
  color: var(--ink-soft);
}
.link-code strong {
  color: var(--ink);
  letter-spacing: 0.15em;
}
.link-url {
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
}

.link-copy { flex: none; }

/* ---------- модальное окно результата ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 22, 51, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-card {
  position: relative;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.28);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 26px 24px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(31, 22, 51, 0.25);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.modal-close:hover {
  background: var(--ink);
  color: #fff;
}

