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

body {
  margin: 0;
  padding: 0px;
  font-family: 'League Spartan', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, #ff9a9e 0%, #fad0c4 50%, #fbc2eb 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin-bottom: 20px;
  color: white;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 0 10px;
}

#modeToggle {
  margin-bottom: 10px;
  padding: 8px 16px;
  font-size: 1rem;
  background-color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#flipHint {
  margin-top: -10px;
  margin-bottom: 30px;
  font-size: 0.95rem;
  color: white;
  opacity: 0.85;
  text-align: center;
  padding: 0 10px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.decks-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 60px;
  justify-content: center;
  padding: 20px;
}

.deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.deck-label {
  margin-bottom: 12px;
  font-weight: bold;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90vw;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.card-stack {
  position: relative;
  width: 320px;
  height: 500px;
}

.card {
  width: 100%;
  height: 100%;
  perspective: 1000px;
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(calc(var(--i, 0) * 4px)) scale(calc(1 - var(--i, 0) * 0.02));
  z-index: calc(10 - var(--i, 0));
  opacity: calc(1 - var(--i, 0) * 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

/* Boost top card's z-index just in case */
.card:nth-child(1) {
  z-index: 100;
}

.card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  will-change: transform;
  pointer-events: auto;
}

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

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  font-size: 1rem;
  overflow-y: auto;
  backface-visibility: hidden;
  pointer-events: auto;
}

.card-front {
  transform: rotateY(0deg);
  z-index: 2;
}

.card-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.card-title {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: #222;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-size: 1.5rem;
  line-height: 1.5;
  white-space: pre-wrap;
  text-align: center;
}

/*.card:hover .card-inner {
  transform: rotateY(180deg);
}*/


@media (max-width: 768px) {
  .decks-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 10px;
  }

  .card-stack {
    width: 90vw;
    height: 140vw;
    position: relative;
    z-index: 1;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-content {
    font-size: 0.9rem;
  }

  .deck-label {
    font-size: 1rem;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
}

.study-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.study-layout img {
  height: 120px !important;
  width: auto !important;
  max-width: 100%;
  object-fit: contain;
}

@keyframes float {
  0%   { transform: translateY(calc(var(--i, 0) * 4px)) scale(calc(1 - var(--i, 0) * 0.02)); }
  50%  { transform: translateY(calc(var(--i, 0) * 2px + -6px)) scale(calc(1 - var(--i, 0) * 0.02)); }
  100% { transform: translateY(calc(var(--i, 0) * 4px)) scale(calc(1 - var(--i, 0) * 0.02)); }
}

.card.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes quizWiggle {
  0%   { transform: rotateZ(0deg); }
  25%  { transform: rotateZ(0.5deg); }
  75%  { transform: rotateZ(-0.5deg); }
  100% { transform: rotateZ(0deg); }
}

.card.quiz-wiggle {
  animation: quizWiggle 3s ease-in-out infinite;
  will-change: transform;
}

.card.no-hover .inner {
  pointer-events: none;
}

/*
.dropdown-container {
  margin-top: 8px;
  margin-bottom: 0px;
  text-align: center;
  width: 100%;
}

.dropdown-container select {
  font-size: 0.95rem;
  padding: 8px 12px;
  border: 2px solid #f5c6a5;
  border-radius: 10px;
  background: linear-gradient(to right, #fff5f0, #ffe9d6);
  color: #5a3e36;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);

  width: 100%;
  max-width: 260px; 
  min-width: 200px;
  display: inline-block;
  white-space: nowrap;
}

.dropdown-container select:hover,
.dropdown-container select:focus {
  background: linear-gradient(to right, #ffe9d6, #fff0e1);
  outline: none;
  transform: scale(1.015);
}
*/

.background-float-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float-orb {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  filter: blur(8px);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Base Animation */
@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) scale(1.2);
    opacity: 0;
  }
}

/* Orb Variations (shorter durations, staggered delays) */
.orb-a {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,1), transparent);
  left: 10%;
  bottom: -15%;
  animation-duration: 18s;
  animation-delay: 0s;
}

.orb-b {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(255,255,255,0.5), transparent);
  left: 30%;
  bottom: -10%;
  animation-duration: 14s;
  animation-delay: 2s;
}

.orb-c {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255,255,255,0.35), transparent);
  left: 55%;
  bottom: -20%;
  animation-duration: 20s;
  animation-delay: 4s;
}

.orb-d {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(255,255,255,0.9), transparent);
  left: 75%;
  bottom: -18%;
  animation-duration: 17s;
  animation-delay: 6s;
}

.orb-e {
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, rgba(255,255,255,0.5), transparent);
  left: 20%;
  bottom: -10%;
  animation-duration: 12s;
  animation-delay: 1s;
}

.orb-f {
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent);
  left: 40%;
  bottom: -5%;
  animation-duration: 19s;
  animation-delay: 3s;
}

.orb-g {
  width: 45px;
  height: 45px;
  background: radial-gradient(circle, rgba(255,255,255,0.6), transparent);
  left: 65%;
  bottom: -12%;
  animation-duration: 15s;
  animation-delay: 5s;
}

.orb-h {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(255,255,255,0.4), transparent);
  left: 82%;
  bottom: -14%;
  animation-duration: 20s;
  animation-delay: 7s;
}

.orb-i {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,0.6), transparent);
  left: 5%;
  bottom: -8%;
  animation-duration: 17s;
  animation-delay: 0.5s;
}

.orb-j {
  width: 35px;
  height: 35px;
  background: radial-gradient(circle, rgba(255,255,255,0.45), transparent);
  left: 50%;
  bottom: -18%;
  animation-duration: 13s;
  animation-delay: 2.5s;
}

.orb-k {
  width: 75px;
  height: 75px;
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent);
  left: 35%;
  bottom: -22%;
  animation-duration: 22s;
  animation-delay: 4.5s;
}

.orb-l {
  width: 55px;
  height: 55px;
  background: radial-gradient(circle, rgba(255,255,255,0.5), transparent);
  left: 90%;
  bottom: -25%;
  animation-duration: 18s;
  animation-delay: 6.5s;
}

/*
@keyframes doorFade {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.animate-doorFade {
  animation: doorFade 1.5s ease-out forwards;
}
  */

  
  @keyframes cardZoomSpin {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  40% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

.intro-card {
  width: 200px;
  height: 340px;
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cardZoomSpin 2.5s ease forwards;
}


.icon-transform-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.magic-icon {
  font-size: 80px;
  color: black;
  position: absolute;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.trail-icon {
  z-index: 2;
}

.revealed-icon {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(255, 153, 170, 0.5));

}


/* Animation keyframes */
@keyframes shakeStart {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

@keyframes floatTrail {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 165, 79, 0.55));
  }
  50% {
    transform: translate(-30px, -60px) rotate(15deg);
    filter: drop-shadow(0 0 6px rgba(255, 165, 79, 0.55))
  }
  100% {
    transform: translate(50px, 80px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes fadeInNew {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Triggered animations */
.icon-transform-container.revealed .trail-icon {
  animation: shakeStart 0.3s ease, floatTrail 2s ease-in-out forwards;
  opacity: 0;
}

.icon-transform-container.revealed .revealed-icon {
  animation: fadeInNew 1s ease-in-out 2s forwards;
  visibility: visible;
  pointer-events: auto;
}



.activity-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 300px;
  overflow: hidden;
}

.activity-heading {
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

.suggestion-list {
  font-size: 0.85rem;
  line-height: 1.4;
  max-height: 250px;
  overflow-y: auto;
  padding-left: 1.2em;
  margin: 0 auto;
  text-align: left;
  list-style: none;
  width: 100%;
  max-width: 250px;
}

.suggestion-list li {
  margin-bottom: 6px;
}

/* Optional: prettier scroll bar for WebKit browsers */
.suggestion-list::-webkit-scrollbar {
  width: 6px;
}
.suggestion-list::-webkit-scrollbar-thumb {
  background-color: rgba(200, 200, 200, 0.6);
  border-radius: 4px;
}


.card.emotion-glow.card-visible {
  animation: glow-purple 1.4s ease-out forwards;
}
.card.distress-glow.card-visible {
  animation: glow-blue 1.4s ease-out forwards;
}
.card.interpersonal-glow.card-visible {
  animation: glow-green 1.4s ease-out forwards;
}
.card.mindfulness-glow.card-visible {
  animation: glow-yellow 1.4s ease-out forwards;
}

@keyframes glow-purple {
  0%, 100% { box-shadow: 0 0 0 rgba(206, 147, 216, 0); }
  50% { box-shadow: 0 0 80px rgba(206, 147, 216, 0.85); }
}

@keyframes glow-blue {
  0%, 100% { box-shadow: 0 0 0 rgba(144, 202, 249, 0); }
  50% { box-shadow: 0 0 80px rgba(144, 202, 249, 0.85); }
}

@keyframes glow-green {
  0%, 100% { box-shadow: 0 0 0 rgba(129, 199, 132, 0); }
  50% { box-shadow: 0 0 80px rgba(129, 199, 132, 0.85); }
}

@keyframes glow-yellow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 224, 130, 0); }
  50% { box-shadow: 0 0 80px rgba(255, 224, 130, 0.85); }
}

a {
  color: #3366cc; /* or any standout color */
  text-decoration: underline;
  font-weight: 500; /* optional, to make it stand out more */
}

a:hover {
  color: #003399; /* darker on hover */
  text-decoration: underline;
}

a.emphasized-link {
  color: #3366cc;
  text-decoration: underline;
  font-weight: 500;
}


