/* =================================================================
   Bidara Members — login + dashboard + companion world
   ================================================================= */

:root {
  --cream-page: #F7EFDE;
  --cream-card: #FBF5E6;
  --cream-soft: #FFF7E6;
  --purple-1:   #6B4DA0;
  --purple-2:   #4A327C;
  --purple-text:#3A2D5C;
  --body:       #5A5470;
  --body-soft:  #6F6A85;
  --gold:       #D4A847;
  --gold-soft:  #FFE9A8;
  --rose:       #D14B5C;
  --sky:        #C5DBEC;
  --shadow-sm:  0 4px 14px rgba(58, 45, 92, 0.08);
  --shadow-md:  0 10px 30px rgba(58, 45, 92, 0.10);
  --shadow-lg:  0 24px 60px rgba(58, 45, 92, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--cream-page);
  font-family: 'Quicksand', system-ui, sans-serif;
  color: var(--purple-text);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* Without these, the `display: flex/block` rules below override the
   `hidden` attribute and both views stay on screen at once. */
.member-login[hidden],
.member-app[hidden],
.member-toast[hidden],
.wizard-step[hidden] { display: none !important; }

body.bootstrap-pending #loginView,
body.bootstrap-pending #memberApp { display: none !important; }

.bootstrap-splash[hidden] { display: none !important; }

.bootstrap-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--cream-page);
  z-index: 200;
}

.bootstrap-splash svg {
  animation: splash-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(74, 50, 124, 0.18));
}

.bootstrap-splash p {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--body-soft);
  letter-spacing: 0.6px;
  margin: 0;
}

@keyframes splash-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* =================================================================
   LOGIN
   ================================================================= */

.member-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(ellipse at top, #F5E5C5 0%, var(--cream-page) 60%),
    var(--cream-page);
}

.login-card {
  background: var(--cream-card);
  background-image:
    radial-gradient(ellipse at top left, rgba(255, 233, 168, 0.4) 0%, rgba(255, 233, 168, 0) 60%),
    radial-gradient(ellipse at bottom right, rgba(212, 168, 71, 0.15) 0%, rgba(212, 168, 71, 0) 55%);
  border-radius: 24px;
  padding: 44px 36px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(212, 168, 71, 0.35) inset;
}

.login-mark { margin: 0 auto 10px; display: block; }

.login-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.login-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple-2);
  margin: 0 0 6px;
  line-height: 1.15;
}

.login-sub {
  margin: 0 0 24px;
  color: var(--body);
  font-size: 0.95rem;
  line-height: 1.5;
}

.login-card label {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--purple-2);
}

.login-card label span { margin-bottom: 6px; }

.login-card input {
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid rgba(107, 77, 160, 0.18);
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--purple-text);
}

.login-card input:focus {
  outline: none;
  border-color: var(--purple-1);
  box-shadow: 0 0 0 3px rgba(107, 77, 160, 0.15);
}

.login-error {
  color: var(--rose);
  font-size: 0.86rem;
  margin: 4px 0 12px;
}

.login-tip {
  margin: 16px 0 0;
  font-size: 0.84rem;
  color: var(--body-soft);
}

.login-tip a {
  color: var(--purple-1);
  text-decoration: none;
  font-weight: 600;
}

.login-soft-note {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--body-soft);
  font-style: italic;
}

/* =================================================================
   SHARED BUTTONS
   ================================================================= */

.btn-primary {
  background: linear-gradient(135deg, var(--purple-1) 0%, var(--purple-2) 100%);
  color: #FFF7E6;
  border: 0;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(74, 50, 124, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition: transform 0.18s ease;
}

.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-soft {
  background: rgba(107, 77, 160, 0.08);
  color: var(--purple-2);
  border: 0;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition: background 0.18s ease;
}

.btn-soft:hover:not(:disabled) { background: rgba(107, 77, 160, 0.16); }
.btn-soft:disabled { opacity: 0.55; cursor: not-allowed; }

/* =================================================================
   MEMBER APP HEADER
   ================================================================= */

.member-app { display: flex; flex-direction: column; min-height: 100vh; }

.member-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--cream-card);
  border-bottom: 1px solid rgba(212, 168, 71, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.member-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--purple-2);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.member-brand em { color: var(--gold); font-style: italic; }

.member-logout {
  background: rgba(107, 77, 160, 0.08);
  color: var(--purple-2);
  border: 0;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.member-logout:hover { background: rgba(107, 77, 160, 0.16); }

/* =================================================================
   COMPANION CREATURE PETS
   ================================================================= */

.creature-pet {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.creature-pet svg { width: 100%; height: 100%; display: block; }

/* Idle animation: gentle bobbing float */
.creature-pet.companion-active { animation: pet-float 3.2s ease-in-out infinite; }
@keyframes pet-float {
  0%, 100% { transform: translateY(0)    rotate(-1deg); }
  50%      { transform: translateY(-8px) rotate(1deg);  }
}

/* Quick "Play" wiggle */
.creature-pet.is-playing { animation: pet-wiggle 0.6s ease; }
@keyframes pet-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20%      { transform: rotate(-8deg) scale(1.05); }
  40%      { transform: rotate(8deg)  scale(1.05); }
  60%      { transform: rotate(-6deg) scale(1.02); }
  80%      { transform: rotate(6deg)  scale(1.02); }
}

/* "Feed" little heart */
.creature-pet.is-feeding::before {
  content: '♥';
  position: absolute;
  top: -8px;
  right: 8px;
  font-size: 20px;
  color: var(--rose);
  animation: heart-float 1.4s ease-out forwards;
}
@keyframes heart-float {
  from { transform: translateY(0)    scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  to   { transform: translateY(-46px) scale(1.2); opacity: 0; }
}

/* =================================================================
   COMPANION WIZARD
   ================================================================= */

.member-wizard {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
  text-align: center;
}

.wizard-step { animation: wizard-fade 0.3s ease; }
@keyframes wizard-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.wizard-progress span {
  width: 32px;
  height: 4px;
  border-radius: 4px;
  background: rgba(107, 77, 160, 0.18);
}

.wizard-progress span.is-active { background: var(--purple-1); }

.wizard-illustration {
  position: relative;
  height: 140px;
  margin-bottom: 12px;
}

.wizard-confetti { position: absolute; inset: 0; }
.wizard-confetti span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--c);
  transform: rotate(20deg);
  animation: confetti-bob 3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.4s);
}
.wizard-confetti span:nth-child(2) { animation-delay: -0.8s; }
.wizard-confetti span:nth-child(3) { animation-delay: -1.6s; }
.wizard-confetti span:nth-child(4) { animation-delay: -2.4s; }
.wizard-confetti span:nth-child(5) { animation-delay: -3.2s; }

@keyframes confetti-bob {
  0%, 100% { transform: translateY(0)    rotate(20deg); }
  50%      { transform: translateY(-10px) rotate(-15deg); }
}

.wizard-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.member-wizard h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple-2);
  margin: 0 0 10px;
  line-height: 1.15;
}

.wizard-body {
  margin: 0 0 24px;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.6;
}

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

/* Creature grid in step 2 */

.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
  text-align: left;
}

.creature-card {
  background: #FFFFFF;
  border: 2px solid rgba(107, 77, 160, 0.10);
  border-radius: 16px;
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.creature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(107, 77, 160, 0.35);
  box-shadow: 0 10px 24px rgba(58, 45, 92, 0.08);
}

.creature-card.is-selected {
  border-color: var(--purple-1);
  background: linear-gradient(180deg, #FBF5E6 0%, #FFFFFF 100%);
  box-shadow: 0 0 0 3px rgba(107, 77, 160, 0.18);
}

.creature-card .creature-pet {
  width: 80px;
  height: 80px;
  animation: pet-float 3.2s ease-in-out infinite;
}

.creature-card h4 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 1rem;
}

.creature-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--body-soft);
  line-height: 1.4;
}

/* Step 3 name preview */

.wizard-name-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--cream-card);
  border: 1px dashed rgba(212, 168, 71, 0.5);
  border-radius: 16px;
  padding: 18px;
  margin: 18px 0;
}

.wizard-name-meta { text-align: left; }
.wizard-name-default {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--body-soft);
  margin: 0;
}
.wizard-name-default-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--purple-2);
  margin: 2px 0 0;
}

.wizard-name-field {
  display: flex;
  flex-direction: column;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--purple-2);
}

.wizard-name-field span { margin-bottom: 6px; }

.wizard-name-field input {
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid rgba(107, 77, 160, 0.18);
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--purple-text);
}

.wizard-name-field input:focus {
  outline: none;
  border-color: var(--purple-1);
  box-shadow: 0 0 0 3px rgba(107, 77, 160, 0.15);
}

/* =================================================================
   DASHBOARD
   ================================================================= */

.member-dashboard {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero row */

.member-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.member-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--purple-2);
  margin: 0;
  line-height: 1.15;
}

.hero-sub {
  margin: 6px 0 0;
  color: var(--body-soft);
  font-size: 1rem;
}

.member-points-card {
  background: linear-gradient(135deg, var(--purple-1) 0%, var(--purple-2) 100%);
  color: #FFF7E6;
  padding: 20px 26px;
  border-radius: 18px;
  text-align: right;
  box-shadow: 0 14px 30px rgba(74, 50, 124, 0.25);
  position: relative;
  min-width: 220px;
}

.member-points-card::after {
  content: '✦';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: var(--gold);
}

.points-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 247, 230, 0.75);
}

.points-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  margin: 2px 0;
  transition: transform 0.4s cubic-bezier(.2, .9, .3, 1.2);
}

.points-value.is-bumped { transform: scale(1.18); }

.points-sub {
  display: block;
  font-size: 0.74rem;
  color: rgba(255, 247, 230, 0.75);
  max-width: 220px;
}

/* =================================================================
   COMPANION CARD — habitat + stats + food tray + actions
   ================================================================= */

.member-companion-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.10);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* The little world */

.companion-stage {
  position: relative;
  background: linear-gradient(180deg, #D9EBC9 0%, #9BC489 56%, #6FA858 100%);
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

/* A soft warm sun radiates from the top-right */
.stage-sun {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 233, 168, 0.85) 0%, rgba(255, 233, 168, 0) 70%);
  pointer-events: none;
}

/* The river runs along the back of the habitat */
.stage-river {
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: 38%;
  height: 36px;
  background: linear-gradient(180deg, #C5DBEC 0%, #8FBADB 100%);
  border-radius: 50%;
  opacity: 0.7;
  filter: blur(0.5px);
  pointer-events: none;
}

.stage-river::before {
  content: '';
  position: absolute;
  inset: 6px 20px;
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0.45) 0 16px,
    transparent 16px 36px);
  border-radius: 999px;
  animation: river-flow 6s linear infinite;
}

@keyframes river-flow {
  from { transform: translateX(0); }
  to   { transform: translateX(-36px); }
}

.companion-clouds span {
  position: absolute;
  width: 70px;
  height: 24px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  animation: cloud-drift var(--d, 18s) linear infinite;
  pointer-events: none;
}

.companion-clouds span::before,
.companion-clouds span::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.companion-clouds span::before { width: 22px; height: 22px; left: 8px;  top: -10px; }
.companion-clouds span::after  { width: 28px; height: 28px; right: 12px; top: -14px; }

@keyframes cloud-drift {
  from { transform: translateX(-90px); }
  to   { transform: translateX(calc(100% + 90px)); }
}

/* Tufts of flowers + bushes on the foreground grass */

.stage-flowers span {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, var(--gold) 0 4px, #FFE9A8 4px 7px, transparent 7px);
  pointer-events: none;
}

.stage-bushes span {
  position: absolute;
  background: #6FA858;
  border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
  pointer-events: none;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}

/* Stat HUD across the top */

.pet-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(255, 247, 230, 0.85);
  backdrop-filter: blur(4px);
  padding: 8px 10px;
  border-radius: 14px;
  z-index: 3;
  box-shadow: 0 4px 14px rgba(42, 26, 74, 0.10);
}

.hud-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}

.hud-icon {
  grid-row: 1 / span 2;
  font-size: 18px;
  width: 26px;
  text-align: center;
}

.hud-bar {
  background: rgba(107, 77, 160, 0.14);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.hud-bar > span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7BB35E, #5A8C46);
  border-radius: 999px;
  transition: width 0.4s ease, background 0.4s ease;
}

.hud-stat.is-warn  .hud-bar > span { background: linear-gradient(90deg, #E8C162, #D4A847); }
.hud-stat.is-crit  .hud-bar > span { background: linear-gradient(90deg, #E26677, #C24356); }

.hud-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--body-soft);
}

/* World layer holds the companion, poops, bubble */

.pet-world {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.creature-pet.companion-active {
  position: absolute;
  /* Margin-based centering keeps the `transform` channel free
     for the bobbing/wiggle keyframes without conflicting with
     translateX. Width must match the offset. */
  left: calc(50% - 80px);
  bottom: 18%;
  width: 160px;
  height: 160px;
  z-index: 2;
  pointer-events: auto;
  cursor: grab;
  filter: drop-shadow(0 8px 12px rgba(42, 26, 74, 0.18));
  transition: filter 0.2s ease;
}

.creature-pet.companion-active.is-target {
  filter: drop-shadow(0 10px 16px rgba(212, 168, 71, 0.55));
}

.creature-pet.companion-active.is-sad   { animation: pet-sag 4s ease-in-out infinite; }
.creature-pet.companion-active.is-sleep { animation: pet-sleep 5s ease-in-out infinite; }
.creature-pet.companion-active.is-eat   { animation: pet-eat 0.4s ease; }

@keyframes pet-sag {
  0%, 100% { transform: translateY(2px) rotate(-2deg); }
  50%      { transform: translateY(6px) rotate(0deg);  }
}

@keyframes pet-sleep {
  0%, 100% { transform: translateY(0)    scale(1);    }
  50%      { transform: translateY(-3px) scale(1.02); }
}

@keyframes pet-eat {
  0%, 100% { transform: scale(1); }
  50%      { transform: translateY(2px) scale(1.06); }
}

/* Speech bubble above the companion */

.speech-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(18% + 160px);
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1.5px solid rgba(107, 77, 160, 0.20);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--purple-2);
  box-shadow: 0 6px 16px rgba(42, 26, 74, 0.15);
  white-space: nowrap;
  z-index: 4;
  animation: bubble-pop 0.25s ease;
  pointer-events: none;
}

.speech-bubble[hidden] { display: none !important; }

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 1.5px solid rgba(107, 77, 160, 0.20);
  border-bottom: 1.5px solid rgba(107, 77, 160, 0.20);
  transform: translateX(-50%) rotate(45deg);
}

@keyframes bubble-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.85); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);    }
}

/* Sleep Zzz floating up */

.sleep-z {
  position: absolute;
  left: 50%;
  bottom: calc(18% + 130px);
  transform: translateX(-30px);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--purple-1);
  letter-spacing: 4px;
  z-index: 4;
  pointer-events: none;
}

.sleep-z[hidden] { display: none !important; }
.sleep-z span { display: inline-block; animation: zzz-float 2s ease-in-out infinite; }
.sleep-z span:nth-child(2) { animation-delay: -0.6s; opacity: 0.8; }
.sleep-z span:nth-child(3) { animation-delay: -1.2s; opacity: 0.6; }

@keyframes zzz-float {
  0%   { transform: translate(0, 0)     scale(1);   opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(20px, -40px) scale(1.4); opacity: 0; }
}

/* Poops */

.poop-layer { position: absolute; inset: 0; pointer-events: none; }

.poop {
  position: absolute;
  width: 38px;
  height: 38px;
  pointer-events: auto;
  cursor: pointer;
  animation: poop-drop 0.5s cubic-bezier(.4,1.6,.5,1) backwards;
  filter: drop-shadow(0 2px 3px rgba(42, 26, 74, 0.18));
}

.poop:hover { transform: scale(1.1); }
.poop.is-cleaning { animation: poop-clean 0.45s ease forwards; }

@keyframes poop-drop {
  from { transform: translateY(-30px) scale(0.6) rotate(-10deg); opacity: 0; }
  to   { transform: translateY(0)     scale(1)   rotate(0deg);    opacity: 1; }
}

@keyframes poop-clean {
  to { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Bath splash overlay */

.bath-splash {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(197, 219, 236, 0) 30%, rgba(143, 186, 219, 0.6) 100%);
  animation: bath-rain 1.2s ease forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes bath-rain {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Drop-target overlay when dragging food */

.drop-hint {
  position: absolute;
  inset: 14px;
  border: 3px dashed rgba(74, 50, 124, 0.5);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--purple-2);
  background: rgba(255, 233, 168, 0.35);
  z-index: 4;
  pointer-events: none;
  animation: drop-pulse 1s ease-in-out infinite;
}

.drop-hint[hidden] { display: none !important; }

@keyframes drop-pulse {
  0%, 100% { transform: scale(1);   }
  50%      { transform: scale(1.02); }
}

/* Companion info column */

.companion-info {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.companion-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

.companion-info h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  color: var(--purple-2);
  margin: 0;
}

.companion-desc {
  color: var(--body);
  font-size: 0.94rem;
  line-height: 1.55;
  margin: 0;
}

.companion-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.companion-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.companion-meta span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--body-soft);
}

.companion-meta strong {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 0.94rem;
}

/* Food tray */

.food-tray {
  background: var(--cream-soft);
  border: 1px dashed rgba(212, 168, 71, 0.55);
  border-radius: 14px;
  padding: 12px 14px 14px;
}

.food-tray-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.food-tray-head h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  margin: 0;
  color: var(--purple-2);
}

.food-tray-hint {
  font-size: 0.74rem;
  color: var(--body-soft);
  font-style: italic;
}

.food-tray-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
}

.food-item {
  background: #FFFFFF;
  border: 1.5px solid rgba(107, 77, 160, 0.14);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.food-item:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 168, 71, 0.65);
  box-shadow: 0 6px 14px rgba(58, 45, 92, 0.08);
}

.food-item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.food-item .food-icon {
  width: 36px;
  height: 36px;
}

.food-item .food-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--purple-2);
  text-align: center;
  line-height: 1.1;
}

/* Drag ghost — follows the pointer */

.food-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  z-index: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 8px 14px rgba(42, 26, 74, 0.25));
}

.companion-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: auto;
}

.pet-action {
  padding: 10px 12px;
  font-size: 0.84rem;
  flex-direction: column;
  gap: 2px;
}

.pet-action .action-emoji { font-size: 18px; }

/* Perks */

.member-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 1.4rem;
  margin: 0 0 16px;
}

.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.perk-card {
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.10);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(58, 45, 92, 0.04);
}

.perk-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.perk-icon-shop   { background: rgba(107, 77, 160, 0.10); color: var(--purple-1); }
.perk-icon-review { background: rgba(212, 168, 71, 0.18); color: var(--gold); }
.perk-icon-card   { background: rgba(79, 125, 63, 0.12);  color: #4F7D3F; }
.perk-icon-friend { background: rgba(209, 75, 92, 0.10);  color: var(--rose); }

.perk-card h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.perk-card p {
  margin: 0;
  color: var(--body);
  font-size: 0.86rem;
  line-height: 1.5;
}

.member-demo-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--cream-soft);
  border: 1px dashed rgba(212, 168, 71, 0.55);
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--body);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.member-demo-note em { color: var(--gold); font-style: italic; font-weight: 700; }

.member-demo-btn {
  margin-left: auto;
  padding: 8px 16px;
  font-size: 0.82rem;
}

/* =================================================================
   TOAST
   ================================================================= */

.member-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--purple-2);
  color: #FFF7E6;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 36px rgba(74, 50, 124, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.member-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.member-toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--purple-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 760px) {
  .member-header { padding: 12px 16px; }
  .member-dashboard { padding: 20px 16px 48px; }
  .member-wizard { padding: 24px 16px 48px; }

  .member-hero { grid-template-columns: 1fr; }
  .member-points-card { text-align: left; }
  .points-sub { max-width: none; }

  .member-companion-card { grid-template-columns: 1fr; }
  .companion-stage      { min-height: 360px; }
  .creature-pet.companion-active { width: 130px; height: 130px; left: calc(50% - 65px); }
  .speech-bubble        { bottom: calc(18% + 130px); }
  .sleep-z              { bottom: calc(18% + 100px); }
  .companion-info       { padding: 20px; }
  .companion-meta       { grid-template-columns: 1fr 1fr; }
  .pet-hud              { grid-template-columns: repeat(4, 1fr); padding: 6px 8px; gap: 6px; }
  .hud-label            { display: none; }
}

@media (max-width: 480px) {
  .login-card { padding: 32px 24px 24px; }
  .login-card h1 { font-size: 1.7rem; }
  .member-wizard h2 { font-size: 1.55rem; }
  .creature-grid { grid-template-columns: 1fr 1fr; }
}

/* =================================================================
   MEMBER TABS
   ================================================================= */

.member-tabs {
  background: var(--cream-card);
  border-bottom: 1px solid rgba(212, 168, 71, 0.25);
  padding: 0 28px;
  position: sticky;
  top: 65px;
  z-index: 9;
  overflow-x: auto;
  scrollbar-width: none;
}
.member-tabs::-webkit-scrollbar { display: none; }
.member-tabs[hidden] { display: none !important; }

.member-tabs-inner {
  display: inline-flex;
  gap: 4px;
  max-width: 1100px;
}

.member-tab {
  background: none;
  border: 0;
  padding: 14px 18px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.member-tab:hover { color: var(--purple-2); }

.member-tab.is-active {
  color: var(--purple-2);
  border-bottom-color: var(--purple-1);
}

.member-tab svg { display: block; }

.member-dashboard[hidden],
.member-friend[hidden],
.member-games[hidden],
.member-journey[hidden]   { display: none !important; }

/* =================================================================
   JOURNEY MAP — Chapter 1 (Garden Forest)
   ================================================================= */

.member-journey {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.journey-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.journey-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.journey-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  color: var(--purple-2);
  margin: 0;
  line-height: 1.15;
}

.journey-sub {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 0.96rem;
  line-height: 1.5;
  max-width: 600px;
}

.journey-progress {
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.15);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 220px;
  box-shadow: var(--shadow-sm);
}

.journey-progress-bar {
  background: rgba(107, 77, 160, 0.10);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.journey-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #E8C162);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.journey-progress-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--body-soft);
}

.journey-progress-label strong {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 1.05rem;
}

/* The stage holds the SVG map + the info panel side-by-side on
   desktop. On mobile the info panel becomes a sheet. */

.journey-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #6FA858;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(74, 50, 124, 0.12);
}

.journey-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
}

/* SVG node + path styling */

.journey-paths path {
  fill: none;
  stroke: rgba(74, 50, 124, 0.35);
  stroke-width: 4;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}

.journey-paths path.is-walked {
  stroke: var(--gold);
  stroke-dasharray: none;
  stroke-width: 5;
}

.journey-node {
  cursor: pointer;
  transition: transform 0.18s ease;
}

.journey-node:hover { transform: scale(1.08); transform-origin: center; transform-box: fill-box; }

.journey-node circle.node-base {
  fill: rgba(255, 247, 230, 0.95);
  stroke: rgba(74, 50, 124, 0.5);
  stroke-width: 3;
  filter: url(#softShadow);
}

.journey-node.is-locked circle.node-base {
  fill: rgba(255, 247, 230, 0.55);
  stroke: rgba(74, 50, 124, 0.3);
}

.journey-node.is-visited circle.node-base {
  fill: var(--gold);
  stroke: #8B6F2A;
}

.journey-node.is-current circle.node-base {
  fill: #FFE9A8;
  stroke: var(--purple-1);
  stroke-width: 4;
}

.journey-node.is-reachable circle.node-base {
  fill: #FFF7E6;
  stroke: var(--gold);
  stroke-width: 4;
  animation: node-pulse 1.8s ease-in-out infinite;
}

@keyframes node-pulse {
  0%, 100% { stroke-opacity: 0.7; }
  50%      { stroke-opacity: 1;   }
}

.journey-node circle.node-halo {
  fill: url(#nodeGlow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.journey-node.is-current circle.node-halo { opacity: 1; }

.journey-node text.node-label {
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: var(--purple-2);
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 247, 230, 0.9);
  stroke-width: 4;
  stroke-linejoin: round;
  pointer-events: none;
}

.journey-node.is-locked text.node-label { fill: rgba(74, 50, 124, 0.55); }

.journey-node .node-icon { pointer-events: none; }

/* Special node types use the icon to hint at what's there */

.journey-node.node-type-start    circle.node-base { fill: #C5DBEC; }
.journey-node.node-type-boss     circle.node-base { fill: #D14B5C; stroke: #8B2C3B; }
.journey-node.node-type-treasure circle.node-base { fill: #FFE9A8; stroke: var(--gold); }
.journey-node.node-type-rest     circle.node-base { fill: #D5C4EF; stroke: var(--purple-1); }

/* Player marker — the companion + a tiny shadow */

.journey-marker {
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(.4,.0,.2,1);
}

.journey-marker .marker-shadow {
  fill: rgba(42, 26, 74, 0.25);
}

.journey-marker .marker-pet {
  animation: marker-bob 2.4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes marker-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Decorations (trees, stones, flowers) sit behind paths */

.journey-decor .decor-tree     { fill: #4F7D3F; }
.journey-decor .decor-tree-dk  { fill: #3B5F30; }
.journey-decor .decor-stone    { fill: #BFB39A; opacity: 0.85; }
.journey-decor .decor-flower   { fill: #FFE9A8; }
.journey-decor .decor-bush     { fill: #6FA858; }
.journey-decor .decor-mushroom { fill: #D14B5C; }

/* Info panel — slides in from the right on desktop, sheet on mobile */

.journey-info {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 320px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-lg);
  transform: translateX(0);
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 5;
}

.journey-info[hidden] { display: none !important; }

.journey-info-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--body-soft);
  cursor: pointer;
  border-radius: 50%;
}

.journey-info-close:hover { background: rgba(107, 77, 160, 0.08); color: var(--purple-2); }

.journey-info-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.journey-info h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  color: var(--purple-2);
  margin: 0 0 8px;
  line-height: 1.2;
}

.journey-info-desc {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--body);
  line-height: 1.55;
}

.journey-info-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(107, 77, 160, 0.10);
  color: var(--purple-2);
  margin-bottom: 12px;
}

.journey-info-status.is-current  { background: var(--purple-1); color: #FFF7E6; }
.journey-info-status.is-visited  { background: var(--gold); color: #FFFFFF; }
.journey-info-status.is-reachable{ background: var(--gold-soft); color: #8B6F2A; }
.journey-info-status.is-locked   { background: rgba(74, 50, 124, 0.10); color: var(--body-soft); }

.journey-info-actions { display: flex; gap: 8px; }
.journey-info-actions .btn-primary { width: 100%; padding: 12px 18px; }

.journey-info-reward {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--body-soft);
}

.journey-footer-note {
  font-size: 0.82rem;
  color: var(--body-soft);
  font-style: italic;
  text-align: center;
  margin: 0;
}

/* Responsive journey */

@media (max-width: 760px) {
  .journey-header { grid-template-columns: 1fr; }
  .journey-progress { min-width: 0; }
  .journey-title { font-size: 1.55rem; }
  .journey-info {
    position: static;
    width: auto;
    margin: 12px 12px 16px;
    transform: none;
  }
  .journey-stage { border-radius: 16px; }
}

/* =================================================================
   LIFE STAGES — eggs, scaling, evolution celebration
   ================================================================= */

/* The active companion has a CSS var for its size scale, so each
   life stage feels physically different without rewriting transforms. */
.creature-pet.companion-active { --pet-scale: 1; }

.creature-pet.companion-active.stage-egg       { --pet-scale: 0.7; }
.creature-pet.companion-active.stage-hatchling { --pet-scale: 0.65; }
.creature-pet.companion-active.stage-child     { --pet-scale: 0.85; }
.creature-pet.companion-active.stage-teen      { --pet-scale: 1;    }
.creature-pet.companion-active.stage-adult     { --pet-scale: 1.15; }
.creature-pet.companion-active.stage-elder     { --pet-scale: 1.15; }

/* Apply the scale via an inner SVG transform so the wrapper keeps
   its absolute positioning + drag hit area. */
.creature-pet.companion-active > svg {
  transform: scale(var(--pet-scale));
  transform-origin: center bottom;
  transition: transform 0.6s cubic-bezier(.2,1.8,.4,1);
}

/* Floating stage badge — a small purple ribbon near the pet */

.stage-badge {
  position: absolute;
  left: 50%;
  bottom: calc(18% - 24px);  /* a touch under the pet's feet */
  transform: translateX(-50%);
  background: var(--purple-2);
  color: #FFF7E6;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(42, 26, 74, 0.25);
  white-space: nowrap;
}

.stage-badge.is-egg    { background: #D4A847; color: #4A327C; }
.stage-badge.is-adult  { background: linear-gradient(135deg, #6B4DA0, #4A327C); }
.stage-badge.is-elder  { background: linear-gradient(135deg, #C9B289, #8A6F4A); }

.stage-badge[hidden] { display: none !important; }

/* Egg state — wobbles softly and sits on the grass instead of
   bobbing in the air. Speech bubble + sleep Zzz hide for the egg. */

.creature-pet.companion-active.stage-egg {
  animation: egg-wobble 2.6s ease-in-out infinite;
}

@keyframes egg-wobble {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg);  }
}

/* Hatching: a quick crack-and-burst sequence */

.creature-pet.companion-active.is-hatching > svg {
  animation: hatch-shake 0.6s ease-out;
}

@keyframes hatch-shake {
  0%, 100% { transform: scale(var(--pet-scale)) translateX(0); }
  20%      { transform: scale(var(--pet-scale)) translateX(-6px) rotate(-6deg); }
  40%      { transform: scale(var(--pet-scale)) translateX(6px) rotate(6deg); }
  60%      { transform: scale(var(--pet-scale)) translateX(-4px) rotate(-3deg); }
  80%      { transform: scale(var(--pet-scale)) translateX(4px) rotate(3deg); }
}

/* Evolution burst: a ring of stars expanding outward */

.evolve-burst {
  position: absolute;
  left: 50%;
  bottom: 28%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, 50%);
  z-index: 4;
  pointer-events: none;
}

.evolve-burst[hidden] { display: none !important; }

.evolve-burst .evolve-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 233, 168, 0.8);
  animation: evolve-ring-grow 1.4s ease-out forwards;
  opacity: 0;
}

.evolve-burst .evolve-ring:nth-child(2) { animation-delay: 0.18s; }
.evolve-burst .evolve-ring:nth-child(3) { animation-delay: 0.36s; border-color: rgba(212, 168, 71, 0.6); }

@keyframes evolve-ring-grow {
  0%   { transform: scale(0.3); opacity: 1; border-width: 5px; }
  100% { transform: scale(1.4); opacity: 0; border-width: 1px; }
}

.evolve-burst .evolve-star {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0;
  animation: evolve-star-fly 1.2s ease-out forwards;
}

@keyframes evolve-star-fly {
  0%   { transform: translate(0,0) scale(0.4); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1); opacity: 0; }
}

/* Growth-progress card sits in the info column under .companion-meta */

.growth-card {
  background: var(--cream-soft);
  border: 1px solid rgba(212, 168, 71, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
}

.growth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.growth-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
}

.growth-next {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.86rem;
  color: var(--purple-2);
}

.growth-bar {
  background: rgba(107, 77, 160, 0.10);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}

.growth-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, #FFD17B 100%);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.growth-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--body-soft);
  font-style: italic;
  line-height: 1.4;
}

.growth-card.is-max { background: linear-gradient(180deg, #FFE9A8 0%, #FFF7E6 100%); }
.growth-card.is-max .growth-hint { color: var(--purple-2); font-style: normal; font-weight: 700; }

/* =================================================================
   AUTH CARD — Sign in vs Create account tabs
   ================================================================= */

.auth-card { padding-top: 32px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 20px;
  background: rgba(107, 77, 160, 0.06);
  border-radius: 999px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--body-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab:hover { color: var(--purple-2); }
.auth-tab.is-active {
  background: #FFFFFF;
  color: var(--purple-2);
  box-shadow: 0 2px 6px rgba(58, 45, 92, 0.10);
}

.auth-form[hidden] { display: none !important; }
.auth-form { display: flex; flex-direction: column; gap: 0; animation: auth-fade 0.25s ease; }

@keyframes auth-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-form h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--purple-2);
  margin: 0 0 6px;
  line-height: 1.2;
}

.auth-form .login-sub { margin-bottom: 18px; }

.auth-form label em {
  color: var(--body-soft);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: none;
  margin-left: 4px;
}

.auth-helper {
  display: block;
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--body-soft);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-switch {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--body-soft);
  text-align: center;
}

.auth-switch-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--purple-1);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(107, 77, 160, 0.4);
  text-underline-offset: 3px;
}

.auth-switch-link:hover { color: var(--purple-2); }

/* =================================================================
   DASHBOARD — orders summary + quick buy grid
   ================================================================= */

.member-orders-card {
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.10);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.orders-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.orders-card-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.orders-card-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--purple-2);
  margin: 0;
}

.orders-card-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-mini {
  background: var(--cream-soft);
  border: 1px solid rgba(212, 168, 71, 0.35);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 86px;
}

.orders-mini-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--body-soft);
}

.orders-mini-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--purple-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orders-empty {
  text-align: center;
  color: var(--body-soft);
  font-style: italic;
  padding: 12px 0;
  margin: 0;
}

.member-order {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--cream-card);
  border: 1px solid rgba(212, 168, 71, 0.22);
  border-radius: 12px;
}

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

.member-order-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.member-order-head strong {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 0.98rem;
}

.member-order-badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.member-order-badge.is-awaiting  { background: rgba(212, 168, 71, 0.18); color: #8B6F2A; }
.member-order-badge.is-review    { background: rgba(107, 77, 160, 0.14); color: var(--purple-2); }
.member-order-badge.is-completed { background: rgba(79, 125, 63, 0.16);  color: #4F7D3F; }

.member-order-items {
  margin: 0;
  font-size: 0.86rem;
  color: var(--body);
  line-height: 1.4;
  /* Truncate long item lists to one line so the row stays calm */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-order-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.member-order-total strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  color: var(--purple-2);
  font-variant-numeric: tabular-nums;
}

.member-order-total span {
  font-size: 0.74rem;
  color: var(--body-soft);
}

/* Quick buy */

.member-quickbuy { display: flex; flex-direction: column; gap: 12px; }

.member-section-sub {
  margin: -6px 0 8px;
  color: var(--body-soft);
  font-size: 0.92rem;
}

.quickbuy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.quickbuy-card {
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.10);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quickbuy-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(58, 45, 92, 0.10);
}

.quickbuy-image {
  position: relative;
  height: 150px;
  background: #FCF5EB;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quickbuy-image img {
  max-width: 90%;
  max-height: 130px;
  object-fit: contain;
}

.quickbuy-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: #2A1A4A;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
}

.quickbuy-body {
  padding: 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.quickbuy-tagline {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--body-soft);
}

.quickbuy-body h4 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  color: var(--purple-2);
  line-height: 1.25;
}

.quickbuy-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.quickbuy-price {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--purple-2);
}

.quickbuy-btn {
  padding: 8px 16px;
  font-size: 0.84rem;
  box-shadow: 0 4px 12px rgba(74, 50, 124, 0.20);
}

.quickbuy-card.is-preorder .quickbuy-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #B8902F 100%);
  box-shadow: 0 4px 12px rgba(212, 168, 71, 0.25);
  color: #2A1A4A;
}

/* My Friend header */

.member-friend {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.friend-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.9rem;
  color: var(--purple-2);
  margin: 0;
  line-height: 1.15;
}

@media (max-width: 760px) {
  .orders-card-head { flex-direction: column; align-items: stretch; }
  .orders-card-summary { gap: 6px; }
  .orders-mini { flex: 1; min-width: 0; padding: 8px 10px; }
  .quickbuy-grid { grid-template-columns: repeat(2, 1fr); }
  .quickbuy-image { height: 130px; }
}

@media (max-width: 480px) {
  .quickbuy-grid { grid-template-columns: 1fr; }
}

/* =================================================================
   WORD SEARCH
   ================================================================= */

.member-games {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.games-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.9rem;
  color: var(--purple-2);
  margin: 0;
  line-height: 1.15;
}

.ws-card {
  background: #FFFFFF;
  border: 1px solid rgba(107, 77, 160, 0.10);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ws-levels {
  display: inline-flex;
  gap: 4px;
  background: rgba(107, 77, 160, 0.08);
  border-radius: 999px;
  padding: 4px;
}

.ws-level {
  background: transparent;
  border: 0;
  padding: 8px 18px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--body-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.ws-level:hover { color: var(--purple-2); }
.ws-level.is-active {
  background: #FFFFFF;
  color: var(--purple-2);
  box-shadow: 0 2px 6px rgba(58, 45, 92, 0.10);
}

.ws-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ws-score {
  background: linear-gradient(135deg, var(--gold) 0%, #E8C162 100%);
  color: #2A1A4A;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 8px 14px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
}

.ws-score.is-bumped { transform: scale(1.15); }

.ws-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
  position: relative;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(var(--ws-cols, 10), 1fr);
  gap: 4px;
  background: var(--cream-soft);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 71, 0.35);
  user-select: none;
  touch-action: none;
}

.ws-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 6px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: clamp(0.78rem, 2.2vw, 1.1rem);
  color: var(--purple-2);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
  box-shadow: 0 1px 0 rgba(58, 45, 92, 0.05);
}

.ws-cell:hover { background: #FFFCEC; }

.ws-cell.is-dragging {
  background: var(--purple-1);
  color: #FFF7E6;
  transform: scale(1.05);
}

.ws-cell.is-found {
  background: rgba(79, 125, 63, 0.18);
  color: var(--purple-2);
}

.ws-cell.is-found.is-secret {
  background: linear-gradient(135deg, var(--gold) 0%, #FFD17B 100%);
  color: #2A1A4A;
}

.ws-overlay { display: none; } /* future-proofing — kept for line drawing later */

.ws-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--cream-card);
  border: 1px solid rgba(212, 168, 71, 0.25);
  border-radius: 14px;
  padding: 16px;
}

.ws-list-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  color: var(--purple-2);
  margin: 0;
}

.ws-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.ws-word {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--purple-text);
  padding: 2px 0;
  position: relative;
}

.ws-word.is-found {
  color: var(--body-soft);
  text-decoration: line-through;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}

.ws-progress { margin-top: 4px; }

.ws-progress-bar {
  background: rgba(107, 77, 160, 0.12);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.ws-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #FFD17B);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ws-progress-label {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--body-soft);
}

.ws-progress-label strong {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-variant-numeric: tabular-nums;
}

.ws-secret {
  background: linear-gradient(180deg, #FFF7E6 0%, #FFFFFF 100%);
  border: 1px dashed rgba(212, 168, 71, 0.55);
  border-radius: 12px;
  padding: 12px 14px;
}

.ws-secret-title {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.ws-secret-hint {
  font-size: 0.76rem;
  color: var(--body-soft);
  margin: 0 0 8px;
  line-height: 1.4;
}

.ws-secret-hint strong { color: var(--gold); }

.ws-secret-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-secret-slot {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--body-soft);
  letter-spacing: 4px;
  text-align: center;
  padding: 4px 0;
  border-radius: 8px;
  background: rgba(212, 168, 71, 0.08);
}

.ws-secret-slot.is-revealed {
  color: #2A1A4A;
  background: linear-gradient(135deg, var(--gold), #FFD17B);
  letter-spacing: 2px;
  animation: ws-secret-pop 0.4s ease;
}

@keyframes ws-secret-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.ws-howto {
  margin: 0;
  font-size: 0.82rem;
  color: var(--body-soft);
  font-style: italic;
}

@media (max-width: 760px) {
  .ws-stage { grid-template-columns: 1fr; }
  .ws-list { grid-template-columns: 1fr 1fr 1fr; }
  .games-header h1 { font-size: 1.45rem; }
  .ws-toolbar { flex-direction: column; align-items: stretch; }
  .ws-toolbar-right { justify-content: space-between; }
}

/* =================================================================
   AUTH STEP TRANSITION + OTP CODE INPUT
   ================================================================= */

.auth-step[hidden] { display: none !important; }

.auth-step-verify h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--purple-2);
  margin: 0 0 6px;
}

/* Big spaced-out OTP-style input for the 6-digit code. */
#verifyCodeInput {
  font-family: 'Courier New', 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.55em;
  text-align: center;
  padding: 14px 14px;
  text-indent: 0.55em; /* pulls the visual centre back into the box */
}

#verifyCodeInput::placeholder { letter-spacing: 0.25em; opacity: 0.35; }

.auth-step-verify .auth-switch button + button { margin-left: 4px; }

.member-adopt-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #FFE9A8 0%, #FFD17B 100%);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.member-adopt-banner[hidden] { display: none !important; }

.adopt-banner-art {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(42, 26, 74, 0.18));
}

.adopt-banner-text { flex: 1; min-width: 0; }

.adopt-banner-eyebrow {
  margin: 0 0 2px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8B6F2A;
}

.member-adopt-banner h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--purple-2);
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.adopt-banner-sub { margin: 0; color: var(--body); font-size: 0.9rem; }

#memberAdoptBtn { flex-shrink: 0; }

@media (max-width: 560px) {
  .member-adopt-banner { flex-direction: column; align-items: stretch; text-align: center; }
  #memberAdoptBtn { width: 100%; }
}
