/* Amigo Secreto — Design System */
:root {
  --red:        #B91C1C;
  --red-dark:   #991B1B;
  --red-hover:  #7F1D1D;
  --red-light:  #FEE2E2;
  --red-bg:     #FFF5F5;
  --green:      #166534;
  --green-bg:   #DCFCE7;
  --gold:       #92400E;
  --gold-bg:    #FEF3C7;
  --bg:         #FDFAF7;
  --surface:    #FFFFFF;
  --text:       #1C1917;
  --text-muted: #78716C;
  --border:     #E7E5E4;
  --border-hover: #D6D3D1;
  --r:          14px;
  --r-sm:       8px;
  --r-lg:       20px;
  --shadow:     0 1px 4px rgba(0,0,0,0.07), 0 2px 12px rgba(0,0,0,0.04);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--red);
  color: #fff;
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 8px rgba(185,28,28,.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: .01em;
}

.brand svg { flex-shrink: 0; }

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: background .15s;
  margin-right: 4px;
  flex-shrink: 0;
}
.btn-back:hover { background: rgba(255,255,255,.18); }

/* ── Avatar / User menu ───────────────────────────────── */
.user-menu { position: relative; }

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.avatar-btn:hover { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.8); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 200;
}

.dropdown-info {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.dropdown-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.dropdown-email { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .65rem 1rem;
  font-size: .9rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--red); }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: default; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg); }

.btn-danger {
  background: none;
  color: var(--red);
  border: 1.5px solid var(--red-light);
  border-radius: var(--r);
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: var(--red-bg); }

.btn-sm {
  padding: .45rem 1rem;
  font-size: .82rem;
  border-radius: var(--r-sm);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

.btn-link {
  background: none;
  border: none;
  color: var(--red);
  font-size: .88rem;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--red-dark); }

/* ── Forms ────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .6rem .9rem;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(185,28,28,.12);
}

.form-group small {
  font-size: .78rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  color: var(--red);
  font-size: .85rem;
  padding: .5rem .75rem;
  background: var(--red-light);
  border-radius: var(--r-sm);
  margin-bottom: .5rem;
}

.form-success {
  color: var(--green);
  font-size: .85rem;
  padding: .5rem .75rem;
  background: var(--green-bg);
  border-radius: var(--r-sm);
  margin-bottom: .5rem;
}

/* ── Auth page ────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #7F1D1D 0%, #B91C1C 50%, #991B1B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--red);
  border-radius: 18px;
  margin-bottom: .75rem;
  box-shadow: 0 4px 16px rgba(185,28,28,.4);
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.auth-brand p {
  margin: .3rem 0 0;
  font-size: .88rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: .55rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all .15s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.btn-auth {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: .8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s;
  letter-spacing: .01em;
}
.btn-auth:hover { background: var(--red-dark); }
.btn-auth:disabled { opacity: .6; cursor: default; }

.auth-or {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: .82rem;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

#google-signin-container {
  display: flex;
  justify-content: center;
  margin-bottom: .25rem;
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.forgot-link:hover { color: var(--red); }

/* ── Main layout ──────────────────────────────────────── */
.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Action bar (index page) ──────────────────────────── */
.action-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-bar .btn-primary,
.action-bar .btn-secondary {
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

/* ── Section ──────────────────────────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .75rem;
}

/* ── Group Cards ──────────────────────────────────────── */
.groups-grid {
  display: grid;
  gap: .75rem;
}

.group-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-left-color .15s;
  position: relative;
  overflow: hidden;
}

.group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.group-card.drawn { border-left-color: var(--green); }

.group-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}

.group-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.group-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

.group-card-meta span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* ── Status badge ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-waiting {
  background: var(--gold-bg);
  color: var(--gold);
}

.badge-drawn {
  background: var(--green-bg);
  color: var(--green);
}

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: .75rem;
  opacity: .6;
}

.empty-state h3 {
  margin: 0 0 .4rem;
  font-size: 1.1rem;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 1.25rem;
  font-size: .9rem;
}

/* ── Loading ──────────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2.5rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card (generic) ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  margin-bottom: .75rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .4rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.card-title .count {
  background: var(--bg);
  color: var(--text-muted);
  font-size: .78rem;
  padding: .1rem .45rem;
  border-radius: 999px;
}

.card-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0 0 .9rem;
}

/* ── Group header (group page) ────────────────────────── */
.group-hero {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  padding: 1.5rem 1.25rem 1.25rem;
}

.group-hero-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 .5rem;
  line-height: 1.2;
}

.group-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .85rem;
  font-size: .85rem;
  opacity: .88;
  margin-top: .35rem;
}

.group-hero-meta span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.badge-hero-waiting {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.badge-hero-drawn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #15803D;
  color: #fff;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

/* ── Invite box ───────────────────────────────────────── */
.invite-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.invite-link-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .55rem .9rem;
  font-size: .82rem;
  color: var(--text-muted);
  background: var(--bg);
  outline: none;
  font-family: 'SF Mono', 'Fira Code', monospace;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .55rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.btn-copy:hover { background: var(--border); color: var(--text); }
.btn-copy.copied { background: var(--green-bg); color: var(--green); border-color: var(--green-bg); }

/* ── Members list ─────────────────────────────────────── */
.members-list { display: flex; flex-direction: column; gap: .5rem; }

.member-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.member-item:hover { background: var(--bg); }

.member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .88rem;
  color: #fff;
  flex-shrink: 0;
  background: var(--red);
}

.member-info { flex: 1; min-width: 0; }

.member-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.member-email {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-you {
  background: var(--red-light);
  color: var(--red);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
  letter-spacing: .03em;
}

.badge-owner {
  background: var(--gold-bg);
  color: var(--gold);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
}

.hint-status {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
}
.hint-status.has-hint { color: var(--green); }

/* ── Gift hint textarea ───────────────────────────────── */
.hint-textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .6rem .9rem;
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--surface);
}
.hint-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(185,28,28,.1);
}

.hint-saved {
  font-size: .82rem;
  color: var(--green);
  font-weight: 600;
  margin-left: .5rem;
}

/* ── Action section ───────────────────────────────────── */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding-top: .25rem;
}

.btn-draw {
  width: 100%;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .01em;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 16px rgba(185,28,28,.35);
}
.btn-draw:hover { opacity: .9; }
.btn-draw:active { transform: scale(.99); }
.btn-draw:disabled { opacity: .5; cursor: default; }

.btn-reveal {
  width: 100%;
  background: linear-gradient(135deg, #166534, #15803D);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .01em;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 16px rgba(22,101,52,.35);
}
.btn-reveal:hover { opacity: .9; }
.btn-reveal:active { transform: scale(.99); }

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Reveal overlay ───────────────────────────────────── */
.reveal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,5,3,.92);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn .2s ease;
}

.reveal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 340px;
  width: 100%;
}

.reveal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: rgba(255,255,255,.12);
  border: none;
  color: rgba(255,255,255,.8);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.reveal-close:hover { background: rgba(255,255,255,.22); }

/* 3D Card flip */
.reveal-card {
  width: 300px;
  height: 380px;
  perspective: 1200px;
  cursor: pointer;
  flex-shrink: 0;
}

.reveal-inner {
  width: 100%;
  height: 100%;
  transition: transform .9s cubic-bezier(.175,.885,.32,1.1);
  transform-style: preserve-3d;
  position: relative;
}

.reveal-inner.flipped { transform: rotateY(180deg); }

.reveal-front,
.reveal-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.reveal-front {
  background: linear-gradient(145deg, #B91C1C, #7F1D1D);
  color: #fff;
  box-shadow: 0 8px 40px rgba(185,28,28,.5);
}

.reveal-back {
  background: linear-gradient(145deg, #15803D, #166534);
  color: #fff;
  transform: rotateY(180deg);
  box-shadow: 0 8px 40px rgba(22,101,52,.5);
}

.reveal-gift-icon {
  font-size: 4rem;
  line-height: 1;
  animation: bounce 1.2s ease infinite;
}

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

.reveal-tap-hint {
  font-size: .88rem;
  opacity: .75;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.reveal-label {
  font-size: .8rem;
  opacity: .78;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.reveal-name {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  animation: popIn .4s ease .1s both;
}

@keyframes popIn {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.reveal-value-box {
  background: rgba(255,255,255,.18);
  border-radius: var(--r-sm);
  padding: .6rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  letter-spacing: .02em;
}

.reveal-value-label {
  font-size: .72rem;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
  font-weight: 400;
}

.reveal-hint-box {
  background: rgba(255,255,255,.12);
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  font-size: .88rem;
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
}

.reveal-hint-label {
  font-size: .72rem;
  opacity: .72;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}

/* ── Confetti ─────────────────────────────────────────── */
@keyframes confetti-fall {
  0%   { transform: translateY(-10vh) rotate(0deg) scale(1);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--rot, 540deg)) scale(.8); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
  animation: confetti-fall var(--dur, 2s) var(--delay, 0s) ease-in forwards;
}

/* ── Toasts ───────────────────────────────────────────── */
#toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: .88rem;
  font-weight: 500;
  max-width: 300px;
  opacity: 0;
  transform: translateX(110%);
  transition: all .28s cubic-bezier(.175,.885,.32,1.2);
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
  .topbar { padding: 0 1rem; }
  .main-content { padding: 1rem .75rem 3.5rem; }
  .auth-card { padding: 2rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal { border-radius: var(--r); }
  .reveal-card { width: 270px; height: 340px; }
  .reveal-name { font-size: 1.5rem; }
}

/* ── Scheduled draw info ──────────────────────────────── */
.scheduled-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold-bg);
  color: var(--gold);
  border-radius: var(--r-sm);
  padding: .6rem .85rem;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .75rem;
}

/* ── Reset password page ──────────────────────────────── */
.reset-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #7F1D1D, #B91C1C);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ── Landing Page ──────────────────────────────────────────── */
.landing-page {
  min-height: 100vh;
  background: #fff;
  color: #1c1917;
}

.landing-nav {
  background: #B91C1C;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
}

.landing-login-link {
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px;
  padding: .35rem .9rem;
}
.landing-login-link:hover { background: rgba(255,255,255,.12); }

.landing-hero {
  background: linear-gradient(160deg, #B91C1C 0%, #7f1d1d 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
}

.landing-gift {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: bounce-gift .6s ease infinite alternate;
}
@keyframes bounce-gift {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.landing-hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.landing-hero h1 span { color: #FCD34D; }

.landing-lead {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.landing-cta-btn {
  display: inline-block;
  background: #FCD34D;
  color: #7f1d1d;
  font-weight: 800;
  font-size: 1.1rem;
  padding: .9rem 2.2rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.landing-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}

.landing-badges {
  margin-top: 1.2rem;
  font-size: .82rem;
  opacity: .8;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.landing-feature {
  background: #fdf8f7;
  border: 1px solid #fde8e0;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.lf-icon { font-size: 2.2rem; margin-bottom: .75rem; }

.landing-feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: #7f1d1d;
}
.landing-feature p {
  font-size: .88rem;
  color: #57534e;
  line-height: 1.55;
  margin: 0;
}

.landing-how {
  background: #fdf4f4;
  padding: 3rem 1.5rem;
  text-align: center;
}
.landing-how h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #B91C1C;
  margin: 0 0 2rem;
}

.landing-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  max-width: 820px;
  margin: 0 auto;
}

.landing-step {
  background: #fff;
  border: 1px solid #fde8e0;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  flex: 1;
  min-width: 200px;
  max-width: 240px;
  text-align: center;
}

.ls-num {
  width: 40px;
  height: 40px;
  background: #B91C1C;
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.landing-step h4 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: #1c1917;
}
.landing-step p {
  font-size: .84rem;
  color: #57534e;
  line-height: 1.5;
  margin: 0;
}

.landing-step-arrow {
  font-size: 1.5rem;
  color: #B91C1C;
  opacity: .4;
  align-self: center;
  display: none;
}
@media (min-width: 700px) { .landing-step-arrow { display: block; } }

.landing-cta-section {
  text-align: center;
  padding: 3.5rem 1.5rem;
}
.landing-cta-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1c1917;
  margin: 0 0 .75rem;
}
.landing-cta-section p {
  color: #57534e;
  margin: 0 0 1.75rem;
  font-size: .95rem;
}

.landing-footer {
  background: #1c1917;
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.25rem;
  font-size: .8rem;
}
.landing-footer a { color: rgba(255,255,255,.65); }
