/* ==================================================================
   Тайный Санта — новогодние стили
   ================================================================== */

:root {
  --bg-0: #060a18;
  --bg-1: #0a1128;
  --bg-2: #111c3f;
  --panel: rgba(17, 28, 63, 0.72);
  --line: rgba(150, 177, 255, 0.14);
  --line-strong: rgba(195, 214, 255, 0.24);
  --text: #eef3ff;
  --muted: #9aa9cd;
  --gold: #f3d381;
  --gold-2: #d9ad4e;
  --red: #e05a5a;
  --green: #48d99b;
  --blue: #7fb0ff;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 55px rgba(2, 6, 22, 0.55);
  --font-ui: 'Montserrat', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Marck Script', 'Segoe Script', 'Comic Sans MS', cursive;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(41, 74, 160, 0.55), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(120, 60, 160, 0.35), transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, #04060f 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.92em;
  color: var(--gold);
  background: rgba(243, 211, 129, 0.1);
  padding: 1px 6px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

.hint {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- сцена: звёзды, северное сияние, снег ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.stars span {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  border-radius: 50%;
  background: #dce7ff;
  box-shadow: 0 0 6px rgba(220, 231, 255, 0.8);
  animation: twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.aurora {
  position: absolute;
  width: 70vw;
  height: 70vh;
  filter: blur(90px);
  opacity: 0.5;
  border-radius: 50%;
}

.aurora-one {
  top: -25vh;
  left: -15vw;
  background: radial-gradient(circle, rgba(52, 120, 220, 0.55), transparent 65%);
  animation: drift 26s ease-in-out infinite;
}

.aurora-two {
  top: -20vh;
  right: -20vw;
  background: radial-gradient(circle, rgba(150, 70, 200, 0.45), transparent 65%);
  animation: drift 32s ease-in-out infinite reverse;
}

#snow {
  position: absolute;
  inset: 0;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

/* ---------- каркас ---------- */

.app {
  position: relative;
  z-index: 1;
  flex: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 26px;
  background: rgba(8, 13, 30, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
}

.brand-mark {
  font-size: 22px;
  filter: drop-shadow(0 0 10px rgba(243, 211, 129, 0.6));
}

.brand-text em {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 24px;
  color: var(--gold);
}

.nav {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: 0.18s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #20180a;
  background: linear-gradient(135deg, #f7e0a0, #d9ad4e);
  box-shadow: 0 8px 22px rgba(217, 173, 78, 0.28);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.admin-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(243, 211, 129, 0.12);
  border: 1px solid rgba(243, 211, 129, 0.3);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #0b1026;
  background: linear-gradient(135deg, hsl(var(--avatar-hue, 45) 72% 74%), hsl(calc(var(--avatar-hue, 45) + 40) 68% 60%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 26px 20px 32px;
  font-size: 13px;
  color: rgba(154, 169, 205, 0.65);
}

.footer-dot {
  opacity: 0.5;
}

.noscript {
  position: relative;
  z-index: 1;
  margin: 40px auto;
  padding: 20px 26px;
  max-width: 520px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(224, 90, 90, 0.12);
  border: 1px solid rgba(224, 90, 90, 0.35);
}

/* ---------- общие элементы ---------- */

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(24, 38, 80, 0.86), rgba(11, 19, 44, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  animation: fade-up 0.4s ease both;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: clamp(28px, 3.6vw, 40px);
}

.page-head .muted {
  margin-top: 8px;
  font-size: 15px;
  max-width: 560px;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 18px;
}

.section-head h2 {
  font-size: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
  transition: 0.18s;
}

.back-link:hover {
  color: var(--gold);
  transform: translateX(-3px);
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
  position: relative;
}

.btn-primary {
  background: linear-gradient(135deg, #f9e6b4, #e0b352 55%, #c9963a);
  color: #20180a;
  box-shadow: 0 10px 28px rgba(224, 179, 82, 0.26);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(224, 179, 82, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(195, 214, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef8080, #c23f3e);
  color: #fff;
  box-shadow: 0 10px 26px rgba(194, 63, 62, 0.28);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(194, 63, 62, 0.42);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13.5px;
}

.btn-wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.is-busy {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-busy::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: 0.18s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn-danger:hover {
  color: #fff;
  background: rgba(224, 90, 90, 0.25);
  border-color: rgba(224, 90, 90, 0.5);
}

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- бейджи, чипы, прогресс ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-collecting {
  background: rgba(127, 176, 255, 0.14);
  color: #bcd4ff;
  border-color: rgba(127, 176, 255, 0.3);
}

.badge-drawn {
  background: rgba(72, 217, 155, 0.14);
  color: #9ff0cd;
  border-color: rgba(72, 217, 155, 0.32);
}

.badge-confirmed {
  background: rgba(72, 217, 155, 0.16);
  color: #a6f2d0;
  border-color: rgba(72, 217, 155, 0.34);
}

.badge-waiting {
  background: rgba(243, 211, 129, 0.13);
  color: #f5dfa6;
  border-color: rgba(243, 211, 129, 0.3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 13px;
  color: #cfd9f2;
}

.chip-admin {
  background: rgba(243, 211, 129, 0.12);
  color: var(--gold);
  border-color: rgba(243, 211, 129, 0.3);
}

.chip-slim {
  padding: 3px 10px;
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9ad4e, #f7e0a0);
  box-shadow: 0 0 14px rgba(243, 211, 129, 0.45);
  transition: width 0.5s ease;
}

.progress-sm {
  height: 6px;
}

/* ---------- форма ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  color: var(--muted);
}

.field span {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.65;
}

.field input,
.field textarea,
.wish-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(6, 11, 26, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: 0.18s;
}

.field input::placeholder,
.wish-input::placeholder {
  color: rgba(154, 169, 205, 0.55);
}

.field input:focus,
.field textarea:focus,
.wish-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 211, 129, 0.16);
  background: rgba(6, 11, 26, 0.85);
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 600;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch {
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: 0.2s;
  margin-top: 2px;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c7d2ea;
  transition: 0.2s;
}

.switch-row input:checked + .switch {
  background: linear-gradient(135deg, #f3d381, #d9ad4e);
  border-color: transparent;
}

.switch-row input:checked + .switch::after {
  left: 22px;
  background: #20180a;
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.switch-row input:disabled + .switch {
  opacity: 0.5;
}

.switch-text strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.switch-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.switch-compact {
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------- экран входа ---------- */

.auth {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.auth-hero {
  animation: fade-up 0.5s ease both;
}

.garland {
  position: relative;
  height: 76px;
  margin-bottom: 22px;
}

.garland::before {
  content: '';
  position: absolute;
  left: 2%;
  right: 2%;
  top: 4px;
  height: 58px;
  border-bottom: 2px solid rgba(243, 211, 129, 0.3);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.garland span {
  position: absolute;
  left: calc(4% + var(--i) * 9.2%);
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 45% 45%;
  background: currentColor;
  box-shadow: 0 0 12px 3px currentColor;
  animation: bulb 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}

.garland span:nth-child(1) { top: 10px; color: #f3d381; }
.garland span:nth-child(2) { top: 22px; color: #e05a5a; }
.garland span:nth-child(3) { top: 34px; color: #48d99b; }
.garland span:nth-child(4) { top: 44px; color: #7fb0ff; }
.garland span:nth-child(5) { top: 52px; color: #f3d381; }
.garland span:nth-child(6) { top: 56px; color: #e05a5a; }
.garland span:nth-child(7) { top: 52px; color: #48d99b; }
.garland span:nth-child(8) { top: 44px; color: #7fb0ff; }
.garland span:nth-child(9) { top: 34px; color: #f3d381; }
.garland span:nth-child(10) { top: 22px; color: #e05a5a; }
.garland span:nth-child(11) { top: 10px; color: #48d99b; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(58px, 8vw, 108px);
  line-height: 0.88;
  margin: 0 0 20px;
  background: linear-gradient(180deg, #fff7e2, #f3d381 48%, #c9963a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 26px rgba(243, 211, 129, 0.28));
}

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: #c3cfeb;
  max-width: 520px;
  margin-bottom: 26px;
}

.hero-points {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hero-points li > span {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.hero-points strong {
  display: block;
  font-size: 15px;
}

.hero-points small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.hero-note {
  font-size: 14px;
  color: var(--muted);
}

.auth-card {
  padding: 30px 30px 26px;
  animation: fade-up 0.5s 0.08s ease both;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(6, 11, 26, 0.55);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.tab {
  padding: 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.tab.active {
  background: linear-gradient(135deg, #f7e0a0, #d9ad4e);
  color: #20180a;
  box-shadow: 0 8px 20px rgba(217, 173, 78, 0.25);
}

.auth-card-head {
  margin-bottom: 20px;
}

.auth-card-head h2 {
  font-size: 23px;
  margin-bottom: 8px;
}

.auth-card-head p {
  font-size: 14px;
}

.auth-switch {
  margin-top: 18px;
  font-size: 13.5px;
  text-align: center;
}

.auth-hint {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(154, 169, 205, 0.7);
  text-align: center;
}

/* ---------- статистика ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 14px;
  background: rgba(243, 211, 129, 0.1);
  border: 1px solid rgba(243, 211, 129, 0.22);
}

.stat-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.stat-card small {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- карточки коробок ---------- */

.boxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.box-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.box-card:hover {
  transform: translateY(-4px);
  border-color: rgba(243, 211, 129, 0.35);
  box-shadow: 0 26px 60px rgba(2, 6, 22, 0.65);
}

.card-link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  z-index: 1;
}

.box-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.box-card-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 12px rgba(243, 211, 129, 0.45));
}

.box-card h3 {
  font-size: 19px;
}

.box-card-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 40px;
}

.box-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #c3cfeb;
}

.box-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

.role-note {
  font-size: 12.5px;
  color: var(--muted);
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-strong);
  color: var(--gold);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 1.6px;
  cursor: pointer;
  transition: 0.18s;
}

.code-pill:hover {
  background: rgba(243, 211, 129, 0.12);
  border-color: var(--gold);
}

.code-pill-label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-pill-lg {
  font-size: 19px;
  padding: 12px 22px;
}

.copy-icon {
  font-size: 13px;
  opacity: 0.7;
}

/* ---------- пустые состояния ---------- */

.empty-state {
  padding: 52px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 54px;
  filter: drop-shadow(0 0 18px rgba(243, 211, 129, 0.35));
}

.empty-state h1,
.empty-state h2 {
  font-size: 24px;
}

.empty-state p {
  max-width: 480px;
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- страница коробки ---------- */

.box-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 28px;
  margin-bottom: 24px;
}

.box-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.box-hero-icon {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  font-size: 32px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(243, 211, 129, 0.18), rgba(243, 211, 129, 0.04));
  border: 1px solid rgba(243, 211, 129, 0.28);
  box-shadow: 0 0 30px rgba(243, 211, 129, 0.18) inset;
}

.box-hero h1 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 8px;
}

.box-desc {
  font-size: 14px;
  margin-bottom: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.code-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.box-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 24px;
  align-items: start;
}

.box-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.box-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 18px;
}

.panel-head .small {
  margin-top: 4px;
}

.members {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #0b1026;
  background: linear-gradient(135deg, hsl(var(--avatar-hue, 45) 72% 74%), hsl(calc(var(--avatar-hue, 45) + 40) 68% 60%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.member-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.member-name {
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.you {
  font-style: normal;
  font-size: 11px;
  color: var(--gold);
  border: 1px solid rgba(243, 211, 129, 0.35);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}

.member-status {
  font-size: 12px;
}

.status-ok {
  color: #8ce9c3;
}

.status-ready {
  color: #f5dfa6;
}

.status-wait {
  color: var(--muted);
}

.member-side {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crown {
  font-size: 16px;
}

/* ---------- желание ---------- */

.wish-card {
  padding: 26px 28px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.card-head h2 {
  font-size: 22px;
}

.wish-card > .muted {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.wish-input {
  resize: vertical;
  min-height: 132px;
  line-height: 1.6;
}

.wish-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.wish-note {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: #d5defa;
  background: rgba(127, 176, 255, 0.08);
  border: 1px solid rgba(127, 176, 255, 0.18);
}

.wish-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.notice-card {
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.notice-icon {
  font-size: 40px;
}

/* ---------- распаковка подарка ---------- */

.reveal-card {
  padding: 36px 30px;
  text-align: center;
  overflow: hidden;
}

.gift-big {
  font-size: 76px;
  line-height: 1;
  margin-bottom: 14px;
  animation: float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 14px 30px rgba(243, 211, 129, 0.4));
}

.reveal-closed h2 {
  font-size: 26px;
  margin: 6px 0 10px;
}

.reveal-closed .muted {
  max-width: 420px;
  margin: 0 auto 22px;
  font-size: 14px;
  line-height: 1.6;
}

.reveal-open {
  display: none;
}

.reveal-card.is-revealed .reveal-closed {
  display: none;
}

.reveal-card.is-revealed .reveal-open {
  display: block;
  animation: reveal-in 0.55s ease both;
}

.ward-name {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  color: #8c1d2c;
  margin: 4px 0 20px;
}

.reveal-open {
  background: linear-gradient(160deg, #fdf8ea, #f5ead0);
  color: #2b2418;
  border-radius: 18px;
  padding: 28px 26px;
  border: 1px solid rgba(201, 150, 58, 0.45);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.55);
}

.reveal-open .eyebrow {
  color: #a8762a;
}

.ward-wish {
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(168, 118, 42, 0.45);
  border-radius: 14px;
  padding: 16px 18px;
}

.ward-wish-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8762a;
  margin-bottom: 8px;
}

.ward-wish p {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ward-budget {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #6d5620;
}

.ward-note {
  margin-top: 14px;
  font-size: 13px;
  color: #7a6a48;
}

.details-card {
  padding: 18px 24px;
}

.details-card summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--gold);
}

.details-card p {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #d5defa;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- карта назначений ---------- */

.assignments-card {
  padding: 24px 26px;
}

.assignments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.assignment {
  display: grid;
  grid-template-columns: minmax(90px, auto) 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.assignment-santa {
  font-weight: 600;
  font-size: 14px;
}

.assignment-arrow {
  text-align: center;
  color: var(--gold);
}

.assignment-ward strong {
  display: block;
  font-size: 14px;
}

.assignment-ward small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

/* ---------- управление ---------- */

.manage-panel .panel-head {
  margin-bottom: 18px;
}

.crown-badge {
  font-size: 12px;
  color: var(--gold);
  background: rgba(243, 211, 129, 0.12);
  border: 1px solid rgba(243, 211, 129, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.draw-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.draw-row strong {
  color: var(--text);
  font-size: 15px;
}

.draw-block .btn-wide {
  margin-top: 16px;
}

.manage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.danger-zone {
  padding: 20px 22px;
}

.danger-zone h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.danger-zone .btn {
  margin-top: 12px;
}

/* ---------- админ-панель ---------- */

.admin-seal {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(243, 211, 129, 0.1);
  border: 1px dashed rgba(243, 211, 129, 0.4);
  line-height: 1.4;
}

.admin-seal span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

.admin-row-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.admin-row-icon {
  font-size: 24px;
}

.admin-row-main h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.admin-row-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- чат ---------- */

.badge-chat {
  background: rgba(127, 176, 255, 0.16);
  color: #cfe0ff;
  border-color: rgba(127, 176, 255, 0.35);
}

.box-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-card {
  padding: 24px 26px;
}

.chat-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.chat-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.chat-tab.active {
  color: #20180a;
  background: linear-gradient(135deg, #f7e0a0, #d9ad4e);
  border-color: transparent;
}

.chat-unread {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e05a5a;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.chat-single {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}

.chat-subtitle {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  min-height: 120px;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(6, 11, 26, 0.5);
  border: 1px solid var(--line);
  scroll-behavior: smooth;
}

.chat-empty {
  margin: auto;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble p {
  white-space: pre-wrap;
}

.chat-bubble time {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  opacity: 0.65;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(243, 211, 129, 0.22), rgba(217, 173, 78, 0.16));
  border: 1px solid rgba(243, 211, 129, 0.3);
  border-bottom-right-radius: 6px;
}

.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.chat-form input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 11, 26, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: 0.18s;
}

.chat-form input::placeholder {
  color: rgba(154, 169, 205, 0.55);
}

.chat-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 211, 129, 0.16);
}

/* ---------- модальные окна ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 8, 20, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
  overflow-y: auto;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  width: min(520px, 100%);
  padding: 28px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.2s ease;
  margin: auto;
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-backdrop.is-open .modal {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: 0.18s;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.modal-head {
  margin-bottom: 20px;
  padding-right: 36px;
}

.modal-head h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.modal-head p {
  font-size: 14px;
  line-height: 1.5;
}

.modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #d5defa;
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- уведомления ---------- */

.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(370px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(14, 22, 48, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(2, 6, 22, 0.6);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.24s ease;
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.toast-success .toast-icon {
  background: rgba(72, 217, 155, 0.18);
  color: #8ce9c3;
}

.toast-error .toast-icon {
  background: rgba(224, 90, 90, 0.2);
  color: #ffb0b0;
}

.toast-info .toast-icon {
  background: rgba(127, 176, 255, 0.18);
  color: #bcd4ff;
}

/* ---------- анимации ---------- */

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

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(4vw, 3vh) scale(1.08);
  }
}

@keyframes bulb {
  0%,
  100% {
    opacity: 0.55;
    filter: brightness(0.85);
  }
  50% {
    opacity: 1;
    filter: brightness(1.4);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- адаптив ---------- */

@media (max-width: 1080px) {
  .auth {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: 0;
    padding-top: 24px;
  }

  .garland {
    display: none;
  }

  .box-layout {
    grid-template-columns: 1fr;
  }

  .box-side {
    order: 2;
  }

  .admin-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .user-name {
    display: none;
  }

  .page {
    padding: 26px 16px 50px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    flex-direction: column;
  }

  .box-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .box-hero-main {
    flex-direction: column;
    gap: 14px;
  }

  .code-box {
    align-items: stretch;
  }

  .code-pill-lg {
    justify-content: center;
  }

  .wish-actions {
    flex-direction: column;
  }

  .wish-actions .btn {
    width: 100%;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .assignment {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .assignment-arrow {
    text-align: left;
  }

  .chat-form {
    flex-direction: column;
  }

  .chat-form .btn {
    width: 100%;
  }

  .chat-bubble {
    max-width: 90%;
  }

  .toasts {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
