/* ============================================================
   BrainTrail · Design Tokens
   ============================================================ */
:root {
  --teal-900: #0a4a42;
  --teal-700: #0f8f7e;
  --teal-500: #1eb29c;
  --teal-300: #7cd6c4;
  --teal-100: #d3efe8;
  --teal-50:  #eaf7f3;

  --orange-700: #d96a2c;
  --orange-500: #f08a4b;
  --orange-300: #f5b487;
  --orange-100: #fde3cf;

  --plum-700: #5d40b8;
  --plum-500: #7c5cd3;
  --plum-300: #b8a4ed;
  --plum-100: #ece5fb;

  --amber-500: #f4a261;
  --amber-100: #fdebd6;

  --cream:   #fbf5e9;
  --cream-2: #f4ecd8;
  --paper:   #ffffff;
  --ink:     #143a33;
  --ink-soft:#3d5b54;
  --ink-mute:#6e857f;

  --shadow-sm: 0 2px 0 rgba(20, 58, 51, 0.08);
  --shadow-md: 0 4px 0 rgba(20, 58, 51, 0.10), 0 10px 20px -10px rgba(20, 58, 51, 0.18);
  --shadow-lg: 0 6px 0 rgba(20, 58, 51, 0.10), 0 18px 36px -18px rgba(20, 58, 51, 0.30);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 36px;
}

/* ============================================================
   Tablet artboard frame (460x880)
   ============================================================ */
.bt-app {
  width: 460px;
  height: 880px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.bt-app * { box-sizing: border-box; }
.bt-app h1, .bt-app h2, .bt-app h3, .bt-app h4 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

/* Topographic contour background ---------------------------------- */
.bt-topo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

/* Status bar ------------------------------------------------------- */
.bt-status {
  height: 28px;
  padding: 6px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}
.bt-status-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bt-status-right svg { display: block; }

/* Scrollable inner ------------------------------------------------- */
.bt-scroll {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
}
.bt-scroll::-webkit-scrollbar { display: none; }

/* Buttons ---------------------------------------------------------- */
.bt-btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.01em;
}
.bt-btn:active { transform: translateY(2px); }
.bt-btn-primary {
  background: var(--teal-700);
  color: white;
  box-shadow: 0 4px 0 var(--teal-900);
}
.bt-btn-primary:hover { background: var(--teal-500); }
.bt-btn-secondary {
  background: var(--orange-500);
  color: white;
  box-shadow: 0 4px 0 var(--orange-700);
}
.bt-btn-ghost {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--cream-2) inset, 0 4px 0 rgba(20,58,51,0.08);
}
.bt-btn-plum {
  background: var(--plum-500);
  color: white;
  box-shadow: 0 4px 0 var(--plum-700);
}

/* Chips, tags ----------------------------------------------------- */
.bt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 13px;
  background: var(--cream-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.bt-chip.easy    { background: var(--teal-100);   color: var(--teal-900); }
.bt-chip.medium  { background: var(--orange-100); color: var(--orange-700); }
.bt-chip.hard    { background: var(--plum-100);   color: var(--plum-700); }
.bt-chip.challenge{ background: #fde0a4;          color: #8a5a10; }

/* Cards ----------------------------------------------------------- */
.bt-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  border: 1.5px solid #eee5d0;
}

/* Generic helpers -------------------------------------------------- */
.bt-flex { display: flex; }
.bt-stack { display: flex; flex-direction: column; }
.bt-center { display: flex; align-items: center; justify-content: center; }

/* Bottom nav -------------------------------------------------------- */
.bt-nav {
  height: 72px;
  background: var(--paper);
  border-top: 1.5px solid #ede2c8;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  flex-shrink: 0;
  z-index: 5;
  position: relative;
}
.bt-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: 'Fredoka', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 16px;
  transition: background 0.15s;
}
.bt-nav-item.active { color: var(--teal-700); background: var(--teal-50); }
.bt-nav-item.active svg { stroke: var(--teal-700); }
.bt-nav-item svg { width: 24px; height: 24px; stroke: var(--ink-mute); stroke-width: 2; fill: none; }

/* Avatar swatches -------------------------------------------------- */
.bt-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}

/* Animations ------------------------------------------------------- */
@keyframes bt-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes bt-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes bt-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes bt-confetti {
  0%   { transform: translateY(-30px) rotate(0deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(600px) rotate(720deg); opacity: 0; }
}
@keyframes bt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 143, 126, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(15, 143, 126, 0); }
}

.bt-pop     { animation: bt-pop 0.5s ease-out backwards; }
.bt-float   { animation: bt-float 3s ease-in-out infinite; }
.bt-pulse   { animation: bt-pulse 1.8s ease-in-out infinite; }

/* Trail climb animations ------------------------------------------ */
@keyframes bt-hike {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  25%      { transform: translateY(-4px) rotate(2deg); }
  50%      { transform: translateY(0) rotate(3deg); }
  75%      { transform: translateY(-4px) rotate(-2deg); }
}
@keyframes bt-shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.22; }
  25%, 75% { transform: scaleX(0.7); opacity: 0.10; }
  50%      { transform: scaleX(1); opacity: 0.22; }
}
@keyframes bt-flag-wave {
  0%, 100% { transform: scaleX(1); }
  50%      { transform: scaleX(0.7) translateX(2px); }
}
@keyframes bt-sparkle-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
@keyframes bt-trail-dash {
  to { stroke-dashoffset: -16; }
}
@keyframes bt-puff {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  40%  { opacity: 0.6; }
  100% { transform: translate(-14px, -2px) scale(1.4); opacity: 0; }
}

.bt-hiker-bob   { animation: bt-hike 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
.bt-hiker-shade { animation: bt-shadow-pulse 1.1s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes btj-spin { to { transform: rotate(360deg); } }
.btj-spin { animation: btj-spin 0.8s linear infinite; }
.bt-flag-wave   { animation: bt-flag-wave 1.6s ease-in-out infinite; transform-origin: left center; }
.bt-twinkle     { animation: bt-sparkle-twinkle 1.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.bt-trail-anim  { animation: bt-trail-dash 1.4s linear infinite; }
.bt-puff        { animation: bt-puff 1.1s ease-out infinite; }

/* Progress bars --------------------------------------------------- */
.bt-progress {
  height: 12px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
  border-radius: 999px;
  position: relative;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inputs ---------------------------------------------------------- */
.bt-input {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  padding: 14px 20px;
  border: 2.5px solid var(--cream-2);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.bt-input:focus { border-color: var(--teal-500); }

/* Date picker day hover ------------------------------------------- */
.dp-day:not(:disabled):hover { background: var(--teal-50); }
.dp-day:not(:disabled):active { transform: translateY(1px); }
