/* ===== Палитра «сумерки на двоих» ===== */
:root {
  --plum-1: #160b1f;
  --plum-2: #2a1330;
  --berry:  #5a1f3d;
  --rose:   #ff7a9c;
  --rose-soft: #ffb3c6;
  --peach:  #ffc9a3;
  --gold:   #ffe0a8;
  --cream:  #fff2f4;
  --cream-dim: rgba(255, 242, 244, 0.62);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.16);
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--cream);
  background:
    radial-gradient(120% 80% at 50% 120%, var(--berry) 0%, transparent 60%),
    radial-gradient(90% 60% at 50% -10%, #3a1840 0%, transparent 55%),
    linear-gradient(180deg, var(--plum-1) 0%, var(--plum-2) 55%, #3d1730 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Контейнер ===== */
.app {
  position: relative;
  z-index: 2;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 20px) 22px
           calc(env(safe-area-inset-bottom) + 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Верхняя плашка статуса ===== */
.status {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 15px;
  font-weight: 600;
  color: var(--cream-dim);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose-soft);
  box-shadow: 0 0 10px var(--rose);
}
.status b { color: var(--cream); font-weight: 700; }

/* ===== Главная зона ===== */
.hero {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* ===== Карточки действий (поцелуй / обнимашка) ===== */
.actions { width: 100%; display: flex; flex-direction: column; gap: 16px; }

.action-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.orb {
  position: relative;
  flex-shrink: 0;
  width: clamp(84px, 24vw, 104px);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
  -webkit-tap-highlight-color: transparent;
}
.orb .emoji { font-size: clamp(40px, 11vw, 52px); line-height: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25)); }
.orb:active { transform: scale(0.9); }
.orb.pop { animation: pop 0.35s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(0.88); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Поцелуй — розово-сливовый */
.orb-kiss {
  background: radial-gradient(circle at 32% 28%, var(--rose-soft) 0%, var(--rose) 40%, var(--berry) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset,
              0 14px 36px -14px rgba(255,122,156,0.65),
              0 0 50px -14px rgba(255,122,156,0.55);
}
/* Обнимашка — тёплый сиренево-лавандовый, чтобы отличалась */
.orb-hug {
  background: radial-gradient(circle at 32% 28%, #e6c9ff 0%, #b07fe0 42%, #5e3a82 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset,
              0 14px 36px -14px rgba(176,127,224,0.65),
              0 0 50px -14px rgba(176,127,224,0.5);
}

/* Пульсирующее кольцо вокруг каждой кнопки */
.orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  animation: ring 2.8s ease-out infinite;
}
.orb-hug::after { border-color: rgba(224,201,255,0.4); }
@keyframes ring { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.45); opacity: 0; } }

/* Направленные счётчики справа от кнопки */
.action-info { flex: 1; min-width: 0; }
.action-title { font-size: 15px; font-weight: 800; color: var(--cream); margin-bottom: 8px; }
.dir-line {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--cream-dim);
  padding: 2px 0;
}
.dir-line b {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  background: linear-gradient(135deg, var(--rose-soft), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.dir-line b.bump { animation: bump 0.4s cubic-bezier(.34,1.56,.64,1); display: inline-block; }
@keyframes bump { 0%,100% { transform: scale(1); } 45% { transform: scale(1.25); } }

.totals { font-size: 14px; font-weight: 700; color: var(--cream-dim); text-align: center; }
.totals b { color: var(--cream); }

/* ===== Нижние ссылки ===== */
.footer-links { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; }
.footer-links button {
  background: none; border: none; color: var(--cream-dim);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}
.footer-links button.danger { color: rgba(255,179,198,0.7); font-size: 13px; font-weight: 600; }

/* ===== Блок кода / приёма по коду на экране приглашения ===== */
.code-hint { font-size: 13px; color: var(--cream-dim); text-align: center; margin-top: 4px; }
.code-hint b { color: var(--cream); font-family: var(--font-display); letter-spacing: 0.5px; user-select: all; }

.join { margin-top: 20px; }
.join-divider { display: flex; align-items: center; gap: 12px; color: var(--cream-dim); font-size: 13px; margin-bottom: 14px; }
.join-divider::before, .join-divider::after { content: ''; flex: 1; height: 1px; background: var(--glass-border); }
.join-q { font-size: 14px; color: var(--cream-dim); margin-bottom: 10px; }

/* ===== Карточка приглашения (когда пары ещё нет) ===== */
.invite {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 30px 24px;
  text-align: center;
}
.invite .big-emoji { font-size: 56px; }
.invite h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  margin: 14px 0 8px;
}
.invite p { color: var(--cream-dim); font-size: 15px; line-height: 1.5; margin-bottom: 22px; }

.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  color: #3a0f1f;
  background: linear-gradient(135deg, var(--rose-soft), var(--peach));
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(255, 179, 198, 0.7);
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(0.97); }

.invite-link {
  margin-top: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.invite-link.show { display: flex; }
.invite-link .field {
  display: flex; gap: 8px; align-items: center;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
}
.invite-link input {
  flex: 1; background: none; border: none; color: var(--cream);
  font-family: inherit; font-size: 13px; outline: none;
}
.btn-ghost {
  padding: 11px 16px; border-radius: 100px;
  border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--cream);
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Нижняя строка «поделиться» ===== */
.share-row { margin-top: 6px; }
.share-row button {
  background: none; border: none; color: var(--cream-dim);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ===== Летящие сердечки при поцелуе ===== */
.particle {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  font-size: 26px;
  will-change: transform, opacity;
  animation: fly 1.05s ease-out forwards;
}
@keyframes fly {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(var(--rot)); opacity: 0; }
}

/* ===== Фоновые сердечки (амбиент) ===== */
.bg-hearts { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bg-hearts span {
  position: absolute;
  bottom: -40px;
  font-size: 20px;
  opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) scale(0.7); opacity: 0; }
  12%  { opacity: 0.5; }
  88%  { opacity: 0.45; }
  100% { transform: translateY(-112dvh) scale(1.1); opacity: 0; }
}

/* ===== Состояния загрузки / экраны ===== */
.screen { display: none; width: 100%; flex: 1; flex-direction: column; align-items: center; justify-content: center; }
.screen.active { display: flex; }

.loader { width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--glass-border); border-top-color: var(--rose);
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.6); color: var(--cream);
  padding: 12px 20px; border-radius: 100px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--glass-border); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.25s, transform 0.25s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Доступность ===== */
.orb:focus-visible, .btn-primary:focus-visible, .btn-ghost:focus-visible,
.footer-links button:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .orb::after, .bg-hearts span { animation: none; }
  .particle { animation-duration: 0.5s; }
}
