/* =====================
   FONTS & BASE RESET
   ===================== */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');

:root {
  --accent:        #7c6cf2;
  --accent-bright: #a78bfa;
  --accent-glow:   rgba(124, 108, 242, 0.35);
  --green:         #34d399;
  --green-glow:    rgba(52, 211, 153, 0.3);
  --text-primary:  #f1f0ff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted:    rgba(255, 255, 255, 0.3);
  --glass-bg:      rgba(255, 255, 255, 0.055);
  --glass-border:  rgba(255, 255, 255, 0.10);
  --glass-border-subtle: rgba(255, 255, 255, 0.08);
  --hover-accent:  rgba(124, 108, 242, 0.2);

  /* ---- Type scale ---- */
  /* heading:    screen titles, challenge name            */
  --text-heading:    22px;
  --weight-heading:  800;
  /* subheading: card section names, key labels          */
  --text-subheading: 17px;
  --weight-subheading: 700;
  /* body:       buttons, panel text, grid labels        */
  --text-body:       14px;
  --weight-body:     500;
  /* caption:    meta info, sub-labels, captions         */
  --text-caption:    12px;
  --weight-caption:  500;
}

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

/* Inline SVG icon base */
svg[viewBox] {
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  position: relative;
  top: -1px; /* optical alignment with button text */
}

.icon-wave {
  color: #fbbf24;
  display: inline-flex;
  vertical-align: middle;
}

.auth-hero-icon {
  text-align: center;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 24px rgba(124, 108, 242, 0.45));
}

.icon-fire {
  color: #f59e0b;
}

body {
  font-family: 'Geist', sans-serif;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(124, 108, 242, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
    #0d0b1e;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
}

/* =====================
   SVG BACKGROUND BLOBS
   ===================== */
@keyframes blob-drift-1 {
  0%   { transform: translate(0px, 0px) scale(1) rotate(0deg); }
  30%  { transform: translate(18px, -22px) scale(1.04) rotate(3deg); }
  60%  { transform: translate(-12px, 14px) scale(0.97) rotate(-2deg); }
  100% { transform: translate(0px, 0px) scale(1) rotate(0deg); }
}

@keyframes blob-drift-2 {
  0%   { transform: translate(0px, 0px) scale(1) rotate(0deg); }
  25%  { transform: translate(-20px, 16px) scale(1.03) rotate(-3deg); }
  55%  { transform: translate(14px, -10px) scale(0.98) rotate(2deg); }
  100% { transform: translate(0px, 0px) scale(1) rotate(0deg); }
}

@keyframes blob-drift-3 {
  0%   { transform: translate(0px, 0px) scale(1) rotate(0deg); }
  40%  { transform: translate(-10px, -18px) scale(1.05) rotate(4deg); }
  70%  { transform: translate(16px, 8px) scale(0.96) rotate(-2deg); }
  100% { transform: translate(0px, 0px) scale(1) rotate(0deg); }
}

.bg-blob {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
  will-change: transform;
}

#blob-1 {
  width: 620px;
  height: 620px;
  top: -200px;
  left: -180px;
  opacity: 0.95;
  animation: blob-drift-1 18s ease-in-out infinite;
  transform-origin: center center;
}

#blob-2 {
  width: 540px;
  height: 540px;
  bottom: -200px;
  right: -160px;
  opacity: 0.9;
  animation: blob-drift-2 22s ease-in-out infinite;
  transform-origin: center center;
}

#blob-3 {
  width: 360px;
  height: 360px;
  top: 38%;
  right: -100px;
  opacity: 0.55;
  animation: blob-drift-3 15s ease-in-out infinite;
  transform-origin: center center;
}

/* =====================
   SCREENS & LAYOUT
   ===================== */
.glass-card,
#auth-screen,
#start-screen,
#profile-screen {
  background: var(--glass-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  border-top-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 var(--glass-border);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

/* Transparent wrappers for multi-card screens */
#main-screen,
#profile-wrapper,
#start-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 420px;
  padding-bottom: 100px;
  position: relative;
  z-index: 1;
}

.main-card-top {
  padding-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.main-card-grid {
  padding: 24px;
}

.grid-card-title {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin: 0 0 4px;
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .glass-card,
  #auth-screen,
  #start-screen,
  #profile-screen {
    background: rgba(20, 17, 40, 0.97);
  }
}

.hidden {
  display: none !important;
}

/* =====================
   LOADING SCREEN
   ===================== */
#loading-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 0;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(124, 108, 242, 0.6);
  animation: loading-pulse 1s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* =====================
   AUTH SCREEN
   ===================== */
#auth-screen {
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Floating particle effects on auth screen */
.auth-particle {
  position: absolute;
  bottom: -10px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--accent-bright);
  opacity: 0;
  animation: particle-rise 5s ease-in infinite;
  animation-delay: var(--delay);
  pointer-events: none;
}

@keyframes particle-rise {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  8%   { opacity: 0.55; }
  70%  { opacity: 0.15; }
  100% { transform: translateY(-340px) scale(0.25); opacity: 0; }
}

/* Floating particle effects on main top card — reuses particle-rise keyframes */
.card-particle {
  position: absolute;
  bottom: -10px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--accent-bright);
  opacity: 0;
  animation: particle-rise 5s ease-in infinite;
  animation-delay: var(--delay);
  pointer-events: none;
  z-index: 0;
}

.auth-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  text-align: center;
}

.auth-subtitle {
  font-size: var(--text-body);
  color: var(--text-secondary);
  text-align: center;
  margin-top: -8px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: var(--text-body);
  font-weight: var(--weight-subheading);
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: #1f1f1f;
}

.auth-btn:hover {
  background: #fff;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.auth-btn:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* Sign-out on profile picker */
.profile-signout-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.22);
  font-size: var(--text-caption);
  padding: 8px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
}

.profile-signout-btn:hover {
  color: var(--text-secondary);
}

/* =====================
   PROFILE PICKER
   ===================== */
.profile-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  text-align: center;
}

#profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border-subtle);
  cursor: pointer;
  transition: all 0.18s;
}

.profile-card:hover {
  background: rgba(124, 108, 242, 0.12);
  border-color: rgba(124, 108, 242, 0.3);
}

.profile-card.done-today {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.profile-card.done-today:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

.profile-card.pet-struggling {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-card.pet-struggling:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.profile-card:active {
  transform: scale(0.98);
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.profile-card.done-today .profile-avatar::after {
  content: '✓';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

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

.profile-name {
  font-size: var(--text-subheading);
  font-weight: var(--weight-subheading);
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-challenge {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.profile-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.profile-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

#new-profile-btn {
  padding: 14px;
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
}

#new-profile-btn:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: rgba(167, 139, 250, 0.06);
}

/* =====================
   BUDDY CIRCLE BUTTON (shared)
   ===================== */
.buddy-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.25);
  font-size: 14px;
  color: var(--accent-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.buddy-circle-btn:hover {
  background: var(--hover-accent);
  border-color: rgba(167, 139, 250, 0.5);
}

/* =====================
   PROFILE SCREEN HEADER
   ===================== */
.profile-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 44px;
}

.profile-header .buddy-circle-btn {
  position: absolute;
  right: 0;
}

/* =====================
   MAIN SCREEN HEADER
   ===================== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  padding: 0 44px;
}

#main-buddy-btn {
  position: absolute;
  right: 0;
}

#switch-profile-btn {
  position: absolute;
  left: 0;
  font-size: var(--text-caption);
  font-weight: var(--weight-subheading);
}

#switch-profile-btn:hover {
  color: var(--accent-bright);
}

/* =====================
   START SCREEN
   ===================== */
#start-screen h1 {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  text-align: center;
}

#start-screen p {
  color: var(--text-secondary);
  font-size: var(--text-body);
}

/* =====================
   BUTTONS
   ===================== */
button {
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  font-weight: var(--weight-body);
  border: none;
  border-radius: 12px;
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
}

button:active {
  transform: scale(0.97);
}

#start-btn {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: white;
  padding: 14px;
  font-size: var(--text-subheading);
  width: 100%;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(124, 108, 242, 0.4);
}

#start-btn:hover {
  box-shadow: 0 6px 28px rgba(124, 108, 242, 0.55);
  opacity: 0.95;
}

#checkin-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 52px);
  max-width: 388px;
  z-index: 50;
  background: rgba(52, 211, 153, 0.10);
  color: var(--green);
  padding: 18px;
  font-size: var(--text-subheading);
  border-radius: 20px;
  border: 1.5px solid rgba(52, 211, 153, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(52, 211, 153, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#checkin-btn.dismissed {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

#checkin-btn:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.18);
}

#checkin-btn.already-done {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.4);
  cursor: pointer;
}

#checkin-btn.already-done:hover {
  box-shadow: 0 0 32px rgba(52, 211, 153, 0.5);
  opacity: 0.95;
}

#quit-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.22);
  font-size: var(--text-caption);
  padding: 8px;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

#quit-btn:hover {
  color: #ef4444;
}

/* =====================
   MAIN SCREEN CONTENT
   ===================== */
#greeting {
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

#challenge-label {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  margin: -4px 0 -4px;
  text-align: center;
}

/* =====================
   DAY CALENDAR GRID
   ===================== */
#day-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr) 24px;
  gap: 8px 8px;
  align-items: center;
}

.day-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-caption);
  font-weight: var(--weight-subheading);
  background: var(--glass-bg);
  color: rgba(255, 255, 255, 0.25);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.day-cell.done {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.35);
}

.day-cell.missed {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(239, 68, 68, 0.7);
}

.day-cell.today {
  background: transparent;
  border: 2px solid var(--accent-bright);
  color: var(--accent-bright);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.25);
}

.day-cell.today.done {
  background: linear-gradient(135deg, #34d399, #10b981);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

.day-cell.future {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.12);
}

/* =====================
   WEEKLY WINS (STARS)
   ===================== */
.week-star {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.3s, color 0.3s;
}

.week-star.earned {
  opacity: 1;
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.65));
}

.week-star.just-earned {
  animation: star-earn 0.5s ease-out;
}

@keyframes star-earn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#weekly-wins {
  text-align: center;
  font-size: var(--text-caption);
  color: var(--text-secondary);
  font-weight: var(--weight-caption);
  padding: 2px 0;
  transition: opacity 0.4s;
}

#weekly-wins-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.3);
}

#weekly-wins-label {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  display: block;
}

/* =====================
   START SCREEN — POLISH
   ===================== */
#hero-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.2s;
  filter: drop-shadow(0 4px 16px rgba(124, 108, 242, 0.4));
  line-height: 1;
}

.subtitle {
  text-align: center;
}

#challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border-subtle);
  cursor: pointer;
  transition: all 0.18s;
}

.challenge-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

.challenge-card.selected {
  border-color: var(--card-accent, var(--accent));
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 16%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--card-accent, var(--accent)) 28%, transparent);
}

.card-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.card-label {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.challenge-card.selected .card-label {
  color: var(--card-accent, var(--accent-bright));
}

#custom-challenge-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  font-size: 16px;
  font-family: 'Geist', sans-serif;
  outline: none;
  background: var(--glass-bg);
  color: var(--text-primary);
}

#custom-challenge-input::placeholder {
  color: var(--text-muted);
}

/* =====================
   CELEBRATION
   ===================== */
@keyframes confetti-fall {
  0% {
    transform: translate(var(--x), var(--y)) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-end), var(--y-end)) rotate(var(--spin)) scale(0);
    opacity: 0;
  }
}

.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  animation: confetti-fall 1s ease-out forwards;
}

@keyframes btn-celebrate {
  0% { transform: translateX(-50%) scale(1); }
  30% { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); }
}

#checkin-btn.celebrating {
  animation: btn-celebrate 0.3s ease-out;
}

/* =====================
   DONE STATE
   ===================== */
body {
  transition: background 0.4s ease;
}

/* Subtle ring glow pulse on day-done instead of green flash */
@keyframes ring-done-glow {
  0%   { filter: drop-shadow(0 0 0px rgba(52, 211, 153, 0)); }
  40%  { filter: drop-shadow(0 0 18px rgba(52, 211, 153, 0.7)); }
  100% { filter: drop-shadow(0 0 0px rgba(52, 211, 153, 0)); }
}

#progress-ring-wrapper.day-done-ring #progress-ring {
  animation: ring-done-glow 1.2s ease-out forwards;
}

/* =====================
   ONBOARDING SIGN-IN LINK
   ===================== */
#start-signin-link {
  width: 100%;
  max-width: 420px;
  text-align: right;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}
#start-signin-link a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}
#start-signin-link a:hover {
  color: #fff;
  text-decoration: underline;
}

/* =====================
   STEP INDICATOR
   ===================== */
.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
}

.step-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.step-dot.active {
  width: 22px;
  background: var(--accent);
}

/* =====================
   ONBOARDING STEPS
   ===================== */
#start-screen {
  overflow: hidden;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  position: relative;
}

.onboarding-step.active {
  display: flex;
}

.step-heading {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  text-align: center;
}

.step-heading-emoji {
  font-size: 72px;
  text-align: center;
  filter: drop-shadow(0 4px 16px rgba(124, 108, 242, 0.35));
  line-height: 1;
}

.launch-emoji {
  font-size: 80px;
  text-align: center;
  filter: drop-shadow(0 4px 20px rgba(124, 108, 242, 0.4));
  line-height: 1;
}

.step-nav {
  display: flex;
  gap: 10px;
}

.step-next-btn {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: white;
  padding: 14px;
  font-size: var(--text-body);
  width: 100%;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 18px rgba(124, 108, 242, 0.38);
}

.step-next-btn:hover {
  box-shadow: 0 6px 24px rgba(124, 108, 242, 0.52);
  opacity: 0.95;
}

.step-back-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  padding: 14px;
  font-size: var(--text-body);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  min-width: 90px;
}

#auth-back-btn {
  width: 100%;
}

.step-back-btn:hover {
  background: var(--glass-border);
  color: rgba(255, 255, 255, 0.75);
}

/* =====================
   PROGRESS RING
   ===================== */
#progress-ring-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
  background: radial-gradient(circle, rgba(124, 108, 242, 0.07) 0%, transparent 70%);
  border-radius: 50%;
}

#progress-ring {
  width: min(130px, 34vw);
  height: auto;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: var(--glass-border-subtle);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: var(--challenge-color, var(--accent));
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px rgba(124, 108, 242, 0.55));
}

.ring-pct {
  font-family: 'Geist', sans-serif;
  font-size: 24px; /* SVG units — intentionally larger for the ring centrepiece */
  font-weight: var(--weight-heading);
  fill: var(--text-primary);
}

.ring-label-text {
  font-family: 'Geist', sans-serif;
  font-size: 10px; /* SVG units — kept small to fit inside ring */
  font-weight: var(--weight-caption);
  fill: rgba(255, 255, 255, 0.38);
}

/* =====================
   STREAK DISPLAY
   ===================== */
#streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.45);
  transition: opacity 0.4s ease, max-height 0.4s ease;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

#streak-display.visible {
  opacity: 1;
  max-height: 40px;
}

#streak-count {
  font-size: var(--text-subheading);
  font-weight: var(--weight-heading);
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

#streak-flame {
  display: inline-flex;
  align-items: center;
  color: #f59e0b;
}

@keyframes streak-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(-6deg); }
}

.streak-hot #streak-flame {
  animation: streak-pulse 1.5s ease-in-out infinite;
}

/* =====================
   MOTIVATIONAL MESSAGE
   ===================== */
#motivational-msg {
  text-align: center;
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.38);
  min-height: 18px;
  transition: opacity 0.4s;
  margin-top: -14px;
}

/* =====================
   CHARACTER / PET DISPLAY
   ===================== */
#character-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
}

/* Emoji + speech bubble row — position:relative anchors the absolute bubble */
#character-emoji-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;  /* guarantees bubble space without shifting emoji */
  height: 88px;
  cursor: pointer;
}

#character-emoji {
  line-height: 1;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: bottom center;
  animation: char-idle 3.8s ease-in-out infinite;
}

@keyframes char-idle {
  0%   { transform: scaleY(1)     skewX(0deg);    }
  25%  { transform: scaleY(1.025) skewX(-1.5deg); }
  55%  { transform: scaleY(1.015) skewX(0.8deg);  }
  80%  { transform: scaleY(0.995) skewX(-0.5deg); }
  100% { transform: scaleY(1)     skewX(0deg);    }
}

/* First-arrival hatch animation — overrides idle for ~780ms */
#character-emoji.hatching {
  /* JS hides the character via visibility:hidden before this class is added,
     so no pre-animation flash. 'both' = backwards (holds 0% while class applies)
     + forwards (holds 100% after animation ends). No delay needed. */
  animation: char-hatch 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes char-hatch {
  0%   { transform: scale(0.15) translateY(16px); opacity: 0; }
  20%  { opacity: 0.5; }
  65%  { transform: scale(1.12) translateY(-5px); opacity: 1; }
  82%  { transform: scale(0.97) translateY(2px);  opacity: 1; }
  100% { transform: scale(1)    translateY(0);    opacity: 1; }
}

.character-img {
  height: 80px;
  width: auto;
  display: block;
}

/* Hunger state modifiers */
#character-display.starving #character-emoji {
  animation: starving-pulse 1s ease-in-out infinite;
}

#character-display.starving #speech-bubble {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.10);
}

@keyframes starving-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2) rotate(-8deg); }
}

/* =====================
   SPEECH BUBBLE
   ===================== */
#speech-bubble {
  position: absolute;
  left: calc(50% + 42px);  /* just right of character image */
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  transform-origin: left center;  /* scales outward from the emoji edge */

  background: rgba(227, 92, 228, 0.18);
  border: 1.5px solid rgba(227, 92, 228, 0.45);
  border-radius: 12px;
  padding: 5px 10px;
  white-space: nowrap;
  pointer-events: none;

  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  line-height: 1;
  color: rgba(255, 255, 255, 0.90);

  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);  /* spring pop */
}

/* Tail arrow pointing left toward the emoji */
#speech-bubble::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(227, 92, 228, 0.45);
}

#speech-bubble.visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Exit: slightly different direction to feel deliberate */
#speech-bubble.hiding {
  opacity: 0;
  transform: translateY(-50%) scale(0.75) translateX(6px);
  transition:
    opacity 0.18s ease-in,
    transform 0.18s ease-in;
}

/* =====================
   FAILURE OVERLAY
   ===================== */
#failure-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 24px;
}

#failure-overlay.hidden {
  display: none;
}

#failure-panel {
  text-align: center;
  padding: 36px 28px 28px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#failure-emoji {
  display: flex;
  justify-content: center;
  margin: 0 0 4px;
}

#failure-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  margin: 0;
}

#failure-body {
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 8px;
}

#failure-restart-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: var(--text-body);
  font-weight: var(--weight-subheading);
  cursor: pointer;
  transition: opacity 0.2s;
}

#failure-restart-btn:hover {
  opacity: 0.85;
}

#failure-graveyard-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

#failure-graveyard-btn:hover {
  color: rgba(255, 255, 255, 0.65);
}

/* =====================
   VICTORY OVERLAY
   ===================== */
#victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 24px;
}

#victory-overlay.hidden {
  display: none;
}

#victory-panel {
  text-align: center;
  padding: 36px 28px 28px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: panel-rise 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panel-rise {
  0%   { transform: translateY(24px) scale(0.94); opacity: 0; }
  100% { transform: translateY(0)    scale(1);    opacity: 1; }
}

#victory-trophy {
  margin: 0 0 4px;
}

#victory-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  margin: 0;
}

#victory-body {
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 8px;
}

#victory-new-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
  font-size: var(--text-body);
  font-weight: var(--weight-subheading);
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 20px rgba(124, 108, 242, 0.4);
}

#victory-new-btn:hover {
  opacity: 0.88;
}

#victory-review-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

#victory-review-btn:hover {
  color: rgba(255, 255, 255, 0.65);
}

/* =====================
   MICROINTERACTIONS — RIPPLE
   ===================== */
.ripple {
  position: fixed;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
  pointer-events: none;
  transform: scale(0);
  animation: ripple-expand 0.55s linear forwards;
}

@keyframes ripple-expand {
  to {
    transform: scale(5);
    opacity: 0;
  }
}

/* =====================
   EMOJI FLOAT
   ===================== */
.emoji-float {
  position: fixed;
  font-size: 26px;
  pointer-events: none;
  z-index: 100;
  animation: float-up 0.9s ease-out forwards;
}

@keyframes float-up {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translateY(-90px) scale(1.2);
    opacity: 0;
  }
}

/* =====================
   FOOD FLY (feeding animation)
   ===================== */
.food-fly {
  position: fixed;
  font-size: 28px;
  pointer-events: none;
  z-index: 100;
  will-change: transform, opacity, left, top;
}

#character-emoji.eating {
  animation: eat-bounce 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

@keyframes eat-bounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.3) rotate(-7deg); }
  65%  { transform: scale(0.88) rotate(4deg); }
  100% { transform: scale(1); }
}

#character-emoji.jiggle {
  animation: char-jiggle 0.3s ease-out;
  transform-origin: bottom center;
}

@keyframes char-jiggle {
  0%   { transform: scaleX(1) scaleY(1) skewX(0deg); }
  20%  { transform: scaleX(1.08) scaleY(0.94) skewX(-5deg); }
  45%  { transform: scaleX(0.95) scaleY(1.04) skewX(4deg); }
  65%  { transform: scaleX(1.03) scaleY(0.98) skewX(-2deg); }
  85%  { transform: scaleX(0.99) scaleY(1.01) skewX(0.5deg); }
  100% { transform: scaleX(1) scaleY(1) skewX(0deg); }
}

/* Shimmer effect on check-in button when character is tapped */
#checkin-btn.shimmer-glow {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.45), 0 0 40px rgba(52, 211, 153, 0.15);
  transition: box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.shimmer-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  animation: shimmer-rise 0.65s ease-out forwards;
}

@keyframes shimmer-rise {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-end), var(--y-end)) scale(0);
    opacity: 0;
  }
}

/* =====================
   DAY ITEM ENTRANCE
   ===================== */
@keyframes day-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.day-item-enter {
  animation: day-enter 0.3s ease-out both;
}

/* =====================
   COMMITMENT BLOCK (Step 3)
   ===================== */
.commitment-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.commitment-label {
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
}

.commitment-challenge {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  line-height: 1.15;
}

.commitment-duration {
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
}

/* =====================
   BUDDY STATUS CARD (visible on screen)
   ===================== */
.buddy-status-card {
  padding-top: 28px;
  padding-bottom: 28px;
  gap: 10px;
}

.buddy-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* =====================
   BUDDY CARDS (shared)
   ===================== */
.buddy-panel-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.buddy-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border-subtle);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.buddy-card-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(124, 108, 242, 0.15);
}

.buddy-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.buddy-card-name {
  font-size: var(--text-body);
  font-weight: var(--weight-subheading);
  color: var(--text-primary);
}

.buddy-card-challenge {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buddy-card-status {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buddy-card-status.missed {
  color: rgba(239, 68, 68, 0.65);
}

.buddy-card-nudge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: rgb(251, 191, 36);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.18s;
  line-height: 1;
}

.buddy-card-nudge:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.4);
}

.buddy-card-nudge:active {
  transform: scale(0.9);
}

.buddy-card-nudge.sent {
  opacity: 0.35;
  pointer-events: none;
}

@keyframes nudge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px rgba(251, 191, 36, 0.25); }
}

.buddy-card-nudge.suggest {
  animation: nudge-pulse 2s ease-in-out infinite;
}

.buddy-card-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.buddy-card-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* =====================
   BUDDY PANEL (modal overlay)
   ===================== */
#buddy-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlay-in 0.2s ease-out;
  padding: 24px 16px;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#buddy-panel {
  position: relative;
  border-radius: 20px;
  background: rgba(20, 17, 40, 0.95);
  border: 1px solid var(--glass-border);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: panel-in 0.25s ease-out;
}

#buddy-panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border-subtle);
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--text-subheading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.15s;
}

#buddy-panel-close:hover {
  background: var(--glass-border);
  color: rgba(255, 255, 255, 0.7);
}

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

.buddy-panel-title {
  font-size: var(--text-subheading);
  font-weight: var(--weight-subheading);
  color: var(--text-primary);
  text-align: center;
}

.buddy-panel-subtitle {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.buddy-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.buddy-panel-disabled-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.buddy-panel-disabled-row button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.buddy-panel-disabled-row button[disabled]:active {
  transform: none;
}

.buddy-panel-disabled-hint {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-muted);
  text-align: center;
}

.panel-follow-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-follow-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.buddy-panel-section-label {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

.panel-join-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-challenge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: var(--text-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
  width: 100%;
}

.panel-challenge-row:hover {
  background: rgba(124, 108, 242, 0.12);
  border-color: rgba(124, 108, 242, 0.3);
}

.panel-challenge-row:active {
  transform: scale(0.98);
}

.panel-challenge-row.loading {
  opacity: 0.5;
  pointer-events: none;
}

.panel-challenge-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-challenge-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-challenge-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.buddy-panel-btn {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  width: 100%;
  text-align: center;
  transition: all 0.18s;
}

.buddy-panel-btn.primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(124, 108, 242, 0.35);
}

.buddy-panel-btn.primary:hover {
  box-shadow: 0 6px 22px rgba(124, 108, 242, 0.5);
  opacity: 0.95;
}

.buddy-panel-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
}

.buddy-panel-btn.secondary:hover {
  background: var(--glass-border);
  color: rgba(255, 255, 255, 0.75);
}

.buddy-panel-btn.danger {
  background: none;
  color: rgba(255, 255, 255, 0.22);
  border: none;
  font-size: var(--text-caption);
  text-decoration: underline;
}

.buddy-panel-btn.danger:hover {
  color: #ef4444;
}

/* Invite panel layout — extra breathing room between code block and buttons */
#buddy-panel-content .pair-code {
  margin: 4px 0;
}

#buddy-panel-content .pair-code-label {
  margin-bottom: 4px;
}

/* Pair code display */
.pair-code-wrapper {
  position: relative;
}

.pair-code {
  font-family: 'Geist', monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  color: var(--accent-bright);
  padding: 12px 44px 12px 12px;
  background: rgba(124, 108, 242, 0.08);
  border-radius: 12px;
  border: 1.5px dashed rgba(124, 108, 242, 0.25);
  user-select: all;
}

.pair-code-copy-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-bright);
  opacity: 0.5;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}

.pair-code-copy-btn:hover {
  opacity: 1;
  background: rgba(124, 108, 242, 0.15);
}

.pair-code-copy-btn.copied {
  opacity: 1;
  color: #22c55e;
}

.pair-code-label {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-secondary);
  text-align: center;
}

/* Join code input */
.pair-join-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--glass-border);
  border-radius: 12px;
  font-size: 18px;
  font-family: 'Geist', monospace;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--glass-bg);
  color: var(--text-primary);
}

.pair-join-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: var(--text-body);
  font-weight: var(--weight-body);
}

.pair-join-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--hover-accent);
}

/* Pair confirmation */
.pair-confirm {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.pair-confirm-emoji {
  font-size: 48px;
}

.pair-confirm-name {
  font-size: var(--text-subheading);
  font-weight: var(--weight-subheading);
  color: var(--text-primary);
}

.pair-confirm-challenge {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-secondary);
}

.pair-error {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: rgba(239, 68, 68, 0.8);
  text-align: center;
}

.pair-pending-status {
  font-size: var(--text-caption);
  font-weight: var(--weight-caption);
  color: var(--text-secondary);
  text-align: center;
}

/* =====================
   CHARACTER HINT TOAST
   ===================== */
#character-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 235, 120, 0.12);
  border: 1px solid rgba(255, 235, 120, 0.22);
  border-top-color: rgba(255, 235, 120, 0.32);
  border-radius: 14px;
  padding: 11px 18px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  z-index: 55;
  max-width: 320px;
  width: calc(100% - 48px);
  text-align: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer;
  animation: char-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#character-toast.hidden {
  display: none;
}

#character-toast.hiding {
  animation: char-toast-out 0.25s ease-in forwards;
}

@keyframes char-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes char-toast-out {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
  }
}

/* =====================
   NUDGE TOAST
   ===================== */
#nudge-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(251, 191, 36, 0.12);
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: 14px;
  padding: 12px 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fbbf24;
  font-weight: var(--weight-body);
  font-size: var(--text-body);
  z-index: 60;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s ease-out;
  cursor: pointer;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#nudge-toast.hiding {
  animation: toast-out 0.25s ease-in forwards;
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
