:root {
  --gryffindor: #7f0909;
  --slytherin: #1a472a;
  --ravenclaw: #0e1a40;
  --hufflepuff: #ecb939;
  --magic: rgba(180,140,255,0.9);
  --gold: #e6c97b;
  --parchment: #f5e9c8;
}



body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255,220,150,0.08), transparent 60%),
    radial-gradient(circle at bottom, rgba(120,80,200,0.1), transparent 70%),
    #0a0a0f;
  color: var(--parchment);
  font-family: 'Cinzel', serif;
  background: radial-gradient(circle at top, #0b0b0f, #000);
  color: #f5f5f5;
  overflow-x: hidden;
}


/* ================= HOGWARTS INTRO ================= */
#hogwarts-intro {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;

  /* night sky + subtle magic */
  background:
    radial-gradient(circle at top, rgba(80,60,140,0.25), transparent 60%),
    radial-gradient(circle at bottom, rgba(20,20,40,0.6), #000 70%),
    linear-gradient(to bottom, #05050a, #000);

  transition: opacity 1.5s ease, transform 1.5s ease;
}

/* fade away spell */
#hogwarts-intro.hide {
  opacity: 0;
  transform: scale(1.05) translateY(-40px);
  pointer-events: none;
}

/* ================= CONTENT ================= */
.intro-content {
  text-align: center;
  max-width: 720px;
  padding: 2.5rem;
  position: relative;
  color: #fff;
  z-index: 2;
}

.intro-content h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  letter-spacing: 4px;
  line-height: 1.2;
  text-shadow:
    0 0 12px rgba(255,255,255,0.2),
    0 0 30px rgba(160,120,255,0.6);
  animation: glow 4s ease-in-out infinite alternate;
}

.intro-content p {
  margin-top: 1.2rem;
  font-size: 1.05rem;
  letter-spacing: 1px;
  opacity: 0.9;
  text-shadow: 0 0 14px rgba(0,0,0,0.8);
}

/* ================= BUTTON ================= */
#enter-hogwarts {
  margin-top: 3.2rem;
  padding: 1rem 3rem;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  letter-spacing: 4px;
  color: #fff;

  background: linear-gradient(
    to right,
    rgba(180,140,255,0.12),
    rgba(255,255,255,0.05)
  );

  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50px;
  cursor: pointer;

  box-shadow:
    0 0 20px rgba(160,120,255,0.25),
    inset 0 0 15px rgba(255,255,255,0.05);

  transition: all 0.45s ease;
}

#enter-hogwarts:hover {
  background: rgba(180,140,255,0.2);
  box-shadow:
    0 0 50px rgba(180,140,255,0.7),
    inset 0 0 25px rgba(255,255,255,0.1);
  transform: translateY(-3px);
}

/* ================= TRAIN & FOG ================= */
.intro-images {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

.train {
  width: 170px;
  position: relative;
  bottom: 0;
  filter:
    drop-shadow(0 0 18px rgba(255,255,255,0.35))
    drop-shadow(0 0 40px rgba(180,140,255,0.25));
  animation: trainFloat 4s ease-in-out infinite;
  transition: transform 2s ease, bottom 2s ease;
}

.train.enter {
  bottom: 55px;
  transform: scale(1.2);
}

/* ================= FOG ================= */
.fog {
  position: absolute;
  width: 340px;
  height: 170px;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.05) 30%,
    transparent 70%
  );
  border-radius: 50%;
  animation: fogMove 8s ease-in-out infinite;
  filter: blur(28px);
  z-index: -1;
}

/* ambient fog layers */
#hogwarts-intro::before,
#hogwarts-intro::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 60%);
  opacity: 0.4;
  pointer-events: none;
  animation: fogDrift 60s linear infinite;
}

#hogwarts-intro::after {
  animation-duration: 90s;
  opacity: 0.25;
}

/* ================= ANIMATIONS ================= */
@keyframes fogMove {
  0%   { transform: translateX(-52%) translateY(0); opacity: 0.35; }
  50%  { transform: translateX(-48%) translateY(-12px); opacity: 0.6; }
  100% { transform: translateX(-52%) translateY(0); opacity: 0.35; }
}

@keyframes fogDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(-200px); }
}

@keyframes glow {
  from {
    text-shadow:
      0 0 10px rgba(255,255,255,0.25),
      0 0 20px rgba(160,120,255,0.4);
  }
  to {
    text-shadow:
      0 0 20px rgba(255,255,255,0.5),
      0 0 45px rgba(180,140,255,0.9);
  }
}

@keyframes trainFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ================= SITE CONTENT ================= */




/* Dobby */
#dobby-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  cursor: pointer;
  z-index: 9999;
}
#dobby-text {
  display: none;
  position: absolute;
  bottom: 60px;
  color: var(--magic);
  font-weight: bold;
}
#dobby-text.visible { display: block; }

#sorting-hat {
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
}

#sorting-hat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,200,120,0.12), transparent 65%);
  filter: blur(40px);
  z-index: -1;
}

#sorting-hat h2 {
  font-size: 2.6rem;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 25px rgba(255,200,120,0.6);
}

#sorting-hat p {
  opacity: 0.8;
  font-style: italic;
}

#student-name {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 40px;
  margin-top: 2rem;
  font-size: 1rem;
  width: 260px;
  backdrop-filter: blur(6px);
}

#student-name::placeholder {
  color: rgba(255,255,255,0.4);
}

#sort-button {
  margin-left: 1rem;
  padding: 1rem 2.5rem;
  border-radius: 40px;
  background: radial-gradient(circle, #e6c97b, #9a6f2f);
  border: none;
  color: #2b1a00;
  font-weight: bold;
  cursor: pointer;
  box-shadow:
    0 0 20px rgba(230,201,123,0.6),
    inset 0 0 10px rgba(255,255,255,0.3);
  transition: transform 0.3s ease;
}

#sort-button:hover {
  transform: translateY(-2px) scale(1.03);
}
#sorting-result {
  margin-top: 3rem;
  opacity: 0;
  transform: scale(0.9);
  transition: all 1s ease;
}

#sorting-result.reveal {
  opacity: 1;
  transform: scale(1);
}

#house-name {
  font-size: 2.2rem;
  margin-top: 1rem;
  text-shadow: 0 0 30px var(--magic);
}

#house-crest {
  width: 160px;
  margin: 1.5rem auto;
  filter: drop-shadow(0 0 25px rgba(255,255,255,0.4));
}

#house-desc {
  font-style: italic;
  opacity: 0.9;
}

/* SWEETS */
.sweets {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.9));
  border-top: 1px solid rgba(255,255,255,0.1);
}

.bean-container img {
  width: 80px;
  cursor: pointer;
  transition: transform 0.4s ease;
}

.bean-container img:hover {
  transform: rotate(360deg) scale(1.1);
}

.frog-container {
  position: relative;
  display: inline-block;
}

#frog {
  width: 100px;
  cursor: pointer;
  position: relative;
  transition: transform 0.4s ease;
}

.frog-jump {
  animation: frogJump 0.5s ease forwards;
}

@keyframes frogJump {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-40px) rotate(-10deg); }
  50% { transform: translateY(-50px) rotate(10deg); }
  75% { transform: translateY(-40px) rotate(-5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.frog-card {
    display: none; /* Hidden at first */
  backdrop-filter: blur(6px) brightness(1.2);
  border: 2px solid rgba(255,255,255,0.2);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(180,140,255,0.5);
  color: #fff;
  background: rgba(10,10,15,0.6);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(180,140,255,0.4);
  text-align: center;
  z-index: 999;
  opacity: 0; /* For smooth fade */
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.6s ease;
}





/* Site content initially hidden */
/* ================= SITE CONTENT ================= */
#site-content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

#site-content.visible {
  opacity: 1;
  transform: translateY(0);
}
#character-quiz {
  padding: 6rem 2rem;
  text-align: center;
  background: radial-gradient(circle at top, #111 0%, #050505 70%);
  color: #f5f5f5;
}

#character-quiz h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(180,140,255,0.4);
}

.quiz-subtitle {
  opacity: 0.8;
  margin-bottom: 3rem;
  font-style: italic;
}

.question {
  max-width: 600px;
  margin: 0 auto 3rem;
  animation: fadeIn 1.2s ease;
}

.question p {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.question button {
  display: block;
  width: 100%;
  margin: 0.6rem 0;
  padding: 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.question button:hover {
  background: rgba(180,140,255,0.15);
  box-shadow: 0 0 15px rgba(180,140,255,0.3);
}

.hidden {
  display: none;
}

#character-result {
  margin-top: 4rem;
  animation: glowReveal 2s ease forwards;
}

#character-name {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 25px rgba(180,140,255,0.6);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}



#forest {
   margin: 0;
  font-family: "Georgia", serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #0b1a12, #020504);
  color: #e6e6e6;
}

.scene {
  display: none;
  text-align: center;
  max-width: 600px;
  padding: 2rem;
  animation: fadeIn 2s ease forwards;
}

.scene.active {
  display: block;
}

h1, h2 {
  letter-spacing: 2px;
  font-weight: normal;
}

.whisper {
  font-style: italic;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.question {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #e6e6e6;
  padding: 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s ease;
}

button:hover {
  background: rgba(255,255,255,0.1);
  letter-spacing: 1px;
}

/* Fog animation */
.fog {
  position: absolute;
  inset: 0;
  background: url("https://www.transparenttextures.com/patterns/fog.png");
  opacity: 0.15;
  animation: fogMove 60s linear infinite;
  pointer-events: none;
}

@keyframes fogMove {
  from { background-position: 0 0; }
  to { background-position: 1000px 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= HOGWARTS INFO ================= */
.hogwarts-info {
  background:
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.9)),
    url("hogwarts-bg.jpg") center/cover no-repeat;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ================= WAND CURSOR ================= */
.wand {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  background: white;
  box-shadow:
    0 0 10px #b48cff,
    0 0 25px #b48cff,
    0 0 40px #b48cff;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* ================= MAGICAL DUST ================= */
.dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.dust span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: radial-gradient(circle, rgba(255,255,255,0.9), transparent);
  border-radius: 50%;
  opacity: 0.7;
  animation: floatDust linear infinite;
}

@keyframes floatDust {
  0% {
    transform: translateY(110vh) translateX(0) scale(0.5);
  }
  100% {
    transform: translateY(-10vh) translateX(40px) scale(1);
  }
}

/* ================= HEADER ================= */
header {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 10rem 8rem;
  background: linear-gradient(to bottom, #0c0c0c, #1a1a1a);
  position: relative;
  overflow: hidden;
}

/* Intro text */
header .intro {
  max-width: 400px;
}

header .intro h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 3vw, 3.5rem);
  color: #f6f6f6;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(180,140,255,0.5);
}

header .intro p {
  font-size: 1rem;
  color: #dcdcdc;
  line-height: 1.5;
  max-width: 320px;
}

/* ================= DOBBY ================= */
header .dobby img {
  width: 200px;
  filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
  transition: 0.6s ease;
}

header .dobby img:hover {
  transform: translateY(-10px) scale(1.05);
  filter: drop-shadow(0 0 25px rgba(255,255,255,0.5));
}

/* ================= OWL ================= */
header .owl img {
  width: 150px;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.25));
  transition: 0.5s ease;
}

header .owl img:hover {
  transform: translateY(-8px) rotate(-5deg);
}

/* ================= HOUSE CREST ================= */
header .house-crest img {
  width: 200px;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.4));
  transition: transform 0.5s ease;
}

header .house-crest img:hover {
  transform: scale(1.05);
}

/* ================= HOGWARTS INFO SECTION ================= */
.hogwarts-info {
  padding: 8rem 8vw;
  text-align: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(10,0,20,0.95));
  position: relative;
  z-index: 2;
}

.hogwarts-info h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--magic);
  margin-bottom: 3rem;
  text-shadow: 0 0 12px var(--magic), 0 0 25px rgba(180,140,255,0.3);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

/* Individual Cards */
.info-card {
  background: rgba(20, 10, 30, 0.85);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards;
}

.info-card:nth-child(1) { animation-delay: 0.2s; }
.info-card:nth-child(2) { animation-delay: 0.4s; }
.info-card:nth-child(3) { animation-delay: 0.6s; }
.info-card:nth-child(4) { animation-delay: 0.8s; }

.info-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 1rem;
  filter: brightness(0.85) saturate(1.1);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.info-card h3 {
  font-family: 'Cinzel', serif;
  margin-bottom: 0.5rem;
  color: var(--magic);
  text-shadow: 0 0 8px rgba(180,140,255,0.6);
}

.info-card p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.5;
  color: #f0f0f0;
  text-shadow: 0 0 4px rgba(0,0,0,0.4);
}

/* Hover Magic Effect */
.info-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(180,140,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transform: rotate(45deg);
  transition: opacity 0.5s, transform 0.5s;
}

.info-card:hover::before {
  opacity: 1;
  transform: rotate(0deg);
}

.info-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(180,140,255,0.6);
}

.info-card:hover img {
  transform: scale(1.03);
  filter: brightness(1) saturate(1.2);
}

/* Fade-in animation for cards */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sparkle effect inside cards */
.info-card .sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, white, transparent);
  pointer-events: none;
  animation: sparkleFloat 1.5s ease-in-out infinite;
}

@keyframes sparkleFloat {
  0% { transform: translate(0,0) scale(1); opacity:1; }
  50% { transform: translate(10px,-15px) scale(0.5); opacity:0.5; }
  100% { transform: translate(-5px, -30px) scale(0); opacity:0; }
}


/* ===== ROOM OF REFLECTION ===== */
.hidden {
  display: none;
}

/* FULL ROOM — NOT A CARD */
#room-of-reflection {
  min-height: 100vh;
  padding: 6rem 2rem;

  background: radial-gradient(
    circle at center,
    rgba(20,20,30,0.95),
    rgba(0,0,0,0.95)
  );

  opacity: 0;
  transform: translateY(60px);
  transition: opacity 2s ease, transform 2s ease;
}

/* Visible state */
#room-of-reflection.visible {
  opacity: 1;
  transform: translateY(0);
}

/* MIRROR CARD */
.mirror-frame {
  max-width: 720px;
  margin: 0 auto;

  padding: 3rem 2rem;
  border-radius: 22px;

  background: rgba(30,30,50,0.85);
  border: 2px solid rgba(200,200,255,0.35);

  box-shadow:
    0 0 60px rgba(180,140,255,0.45),
    inset 0 0 40px rgba(180,140,255,0.2);

  backdrop-filter: blur(6px);
  text-align: center;
}

.mirror-frame h2 {
  font-family: 'Cinzel', serif;
  color: #e8e8ff;
  text-shadow: 0 0 20px rgba(180,140,255,0.6);
}

.mirror-text {
  margin: 1.5rem 0 2.5rem;
  color: #ccc;
  text-shadow: 0 0 15px rgba(120,120,255,0.4);
}

.question {
  margin-bottom: 2rem;
}

.question p {
  margin-bottom: 1rem;
}

.question button {
  margin: 0.4rem;
  padding: 0.7rem 1.6rem;
  border-radius: 20px;

  background: rgba(100,100,200,0.3);
  border: 1px solid rgba(180,140,255,0.5);
  color: #fff;

  cursor: pointer;
  transition: all 0.4s ease;
}

.question button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 30px rgba(180,140,255,0.6);
}

/* RESULT */
#reflection-result {
  margin-top: 2rem;
}

.result-text {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* SHIMMER */
@keyframes shimmer {
  0% { box-shadow: 0 0 40px rgba(180,140,255,0.3); }
  100% { box-shadow: 0 0 70px rgba(180,140,255,0.6); }
}

/* ================= POTION BREWING ================= */
#potion-brewing {
  text-align: center;
  color: #f5f3ff;
  font-family: 'Cinzel', serif;
  background: linear-gradient(to bottom, #0a0a0d, #1b1b2f);
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}

#potion-brewing h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 15px rgba(180,140,255,0.6);
}

.ingredients {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.ingredient {
  background: linear-gradient(135deg, #2c1a36, #442266);
  padding: 1rem 2rem;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.ingredient:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(180,140,255,0.7);
}

.ingredient.selected {
  border: 2px solid #b48cff;
}

.cauldron-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.cauldron {
  position: relative;
  width: 200px;
}

.cauldron img {
  width: 100%;
  z-index: 2;
  position: relative;
}

.potion {
  position: absolute;
  bottom: 20px;
  left: 10%;
  width: 80%;
  height: 60px;
  background: #555;
  border-radius: 50%;
  z-index: 1;
  transition: background 0.6s ease;
}

.bubbles {
  position: absolute;
  bottom: 50px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  animation: bubble 1.5s infinite ease-in;
  opacity: 0;
}

@keyframes bubble {
  0% { transform: translateX(0) translateY(0) scale(0); opacity: 1; }
  50% { transform: translateX(-10px) translateY(-50px) scale(1); opacity: 0.7; }
  100% { transform: translateX(10px) translateY(-100px) scale(0.5); opacity: 0; }
}

#brew-btn {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #6a00ff, #d388ff);
  color: #fff;
  box-shadow: 0 0 20px rgba(180,140,255,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}

#brew-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(180,140,255,0.8);
}

#potion-result {
  margin-top: 2rem;
  font-size: 1.2rem;
  animation: fadeIn 2s ease forwards;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from {opacity:0;}
  to {opacity:1;}
}

/* House Cards */
/* Section Title Glow */
section h1 {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  color: #f6f6f6;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(180,140,255,0.5);
  margin-bottom: 2rem;
  animation: glow 3s infinite alternate;
}

/* Houses Grid */
.houses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 8rem;
  padding: 9rem 8vw;
  background: linear-gradient(to top, #0b0b0f, #1a1a2b);
  position: relative;
  overflow: hidden;
  cursor: url('wand-cursor.png'), auto; /* magical wand cursor */
}

/* Floating sparkles */
.houses::before {
  content:'';
  position:absolute;
  inset:0;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 2px) repeat;
  background-size: 50px 50px;
  pointer-events: none;
  animation: stars 20s linear infinite;
}

/* Sparkle animation */
@keyframes stars {
  from {background-position: 0 0;}
  to {background-position: 100px 100px;}
}

/* House Cards */
.house-card {
  padding: 3.5rem;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transition: transform 0.5s ease, box-shadow 0.5s ease, text-shadow 0.5s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: #fff;
}

/* Card Hover Magic */
.house-card:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 30px 60px rgba(180,140,255,0.7), 0 0 20px rgba(255,255,255,0.2) inset;
}

.house-card h3 {
  font-family: 'Cinzel', serif;
  margin-bottom:0.5rem;
  letter-spacing:2px;
  transition: text-shadow 0.5s ease;
}

/* Glow text on hover */
.house-card:hover h3 {
  text-shadow: 0 0 15px rgba(255,255,255,0.7), 0 0 30px rgba(180,140,255,0.5);
}

/* Description & span */
.house-card span {
  font-size:0.8rem;
  opacity:0.8;
  letter-spacing:1px;
}
.house-card p {
  margin-top:1.2rem;
  line-height:1.6;
}

/* House gradients */
.gryffindor { background: linear-gradient(135deg, #2b0000, var(--gryffindor)); }
.slytherin  { background: linear-gradient(135deg, #02150b, var(--slytherin)); }
.ravenclaw  { background: linear-gradient(135deg, #020a25, var(--ravenclaw)); }
.hufflepuff { background: linear-gradient(135deg, #2a2400, var(--hufflepuff)); }

/* Optional sparkle overlay on each card */
.house-card::after {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 2px) repeat;
  background-size: 20px 20px;
  pointer-events: none;
  animation: floatDust 8s linear infinite;
}

@keyframes floatDust {
  0% { transform: translate(0,0);}
  50% { transform: translate(5px,-5px);}
  100% { transform: translate(-5px,5px);}
}

/* Glow animation for title */
@keyframes glow {
  from { text-shadow: 0 0 10px rgba(180,140,255,0.4); }
  to { text-shadow: 0 0 25px rgba(180,140,255,0.7); }
}


/* =================== Hogwarts Guardians =================== */
#hogwarts-guardians {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: #f0f0ff;
  font-family: 'Cinzel', serif;
  text-align: center;
  background: linear-gradient(to top, #0b0b0f, #1a1a2b);
  cursor: pointer;
}

/* Full magical overlay */
.guardian-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.05), transparent),
    radial-gradient(circle at 80% 70%, rgba(200,180,255,0.05), transparent);
  z-index: 0;
  pointer-events: auto;
}

/* Floating magical dust particles */
.magic-dust {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9), transparent);
  animation: floatDust 12s linear infinite;
  z-index: 2;
}
/* For the dust, allow pointer but keep visual magic */
.magic-dust {
  pointer-events: auto; /* now cursor works */
  cursor:pointer;
}

@keyframes floatDust {
  0%   { transform: translateY(100vh) translateX(0) scale(0.4); opacity:0.5; }
  50%  { transform: translateY(50vh) translateX(20px) scale(0.6); opacity:1; }
  100% { transform: translateY(-10vh) translateX(0) scale(0.4); opacity:0.5; }
}

/* Guardian content */
.guardian-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 4rem 2rem;
  animation: fadeInSlow 3s ease forwards;
  cursor: pointer;
}

/* Slow fade in of content */
@keyframes fadeInSlow {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Intro line glow effect */
.intro-line, .closing-line {
  font-size: 1.25rem;
  font-style: italic;
  color: #dcdcff;
  text-shadow: 0 0 8px rgba(200,180,255,0.5), 0 0 20px rgba(180,140,255,0.2);
  margin-bottom: 0.5rem;
  animation: pulseGlow 4s ease-in-out infinite;
  cursor: pointer;
}

/* Guardians list */
.guardians-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  cursor: pointer;
}

.guardian {
  flex: 1 1 300px;
  background: rgba(0,0,20,0.4);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(180,140,255,0.3);
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  backdrop-filter: blur(4px);
}

.guardian:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 0 35px rgba(180,140,255,0.6);
}

/* Guardian headings */
.guardian h2 {
  font-size: 1.5rem;
  color: #f5f5ff;
  margin-bottom: 1rem;
  text-shadow: 0 0 15px rgba(180,140,255,0.4);
  animation: pulseGlow 4s ease-in-out infinite;
  
}

/* Guardian paragraph */
.guardian p {
  font-size: 1rem;
  line-height: 1.6;
  color: #e0e0ff;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}

/* Pulsating glow animation for headings */
@keyframes pulseGlow {
  0%,100% { text-shadow: 0 0 10px rgba(180,140,255,0.3); }
  50% { text-shadow: 0 0 25px rgba(180,140,255,0.7); }
}

/* Small responsive tweaks */
@media (max-width: 768px) {
  .guardians-list {
    flex-direction: column;
    align-items: center;
  }
}


/* Container and filter */
.house-filter {
  text-align: center;
  margin-bottom: 2rem;
  font-family: 'Cinzel', serif;
  color: #f5f3ff;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(180,140,255,0.6);
}

/* Grid */
.characters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 2.5rem;
  padding: 6rem 8vw;
  background: linear-gradient(to bottom, #0a0a0d, #1b1b2f);
}

/* Character card magic */
.character-card {
  opacity: 0;
  transform: translateY(50px) rotateX(15deg);
  transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.5s ease;
  background: rgba(20,10,30,0.85);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  padding: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Fade in on scroll */
.character-card.visible {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* Magical image hover */
.character-card img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 18px;
  filter: brightness(0.7) saturate(0.9);
  transition: transform 0.5s ease, filter 0.5s ease, box-shadow 0.5s ease;
}

/* Glow hover effect */
.character-card:hover img {
  transform: scale(1.05) rotateZ(1deg);
  filter: brightness(1.1) saturate(1.2);
  box-shadow: 0 0 30px rgba(180,140,255,0.8), 0 0 60px rgba(100,255,255,0.2) inset;
}

/* Card text */
.character-card h4 {
  margin-top: 1rem;
  font-family:'Cinzel', serif;
  letter-spacing: 1px;
  text-align: center;
  color: #f5f3ff;
  text-shadow: 0 0 5px rgba(180,140,255,0.5);
}

.character-card span {
  font-size: 0.85rem;
  opacity: 0.7;
  display: block;
  text-align: center;
  margin-top: 0.3rem;
}

/* Sparkles effect inside card */
.character-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.character-card:hover::before {
  opacity: 0.4;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}


/* Modal */
.modal {
  position: fixed; inset:0;
  background: rgba(0,0,0,0.85);
  display:flex;
  justify-content:center;
  align-items:center;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.6s;
  z-index:10000;
}
.modal.show { opacity:1; pointer-events:auto; }
.modal-content {
  background: linear-gradient(#2a1f14, #1b140c);
  padding:3rem;
  max-width:500px;
  border-radius:18px;
  animation: pageOpen 0.8s ease;
  position: relative;
}
@keyframes pageOpen { from {transform:scale(0.9); opacity:0;} to{transform:scale(1); opacity:1;} }
.close {
  position:absolute; top:20px; right:30px; font-size:2rem; cursor:pointer;
}
/* ================= DOBBY SECTION ================= */
#dobby-section {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.85), rgba(0,0,0,1)),
    url("hogwarts-bg.jpg") center/cover no-repeat;
  padding: 6rem 2rem;
}

/* Container */
#dobby-container {
  position: relative;
  text-align: center;
}

/* Dobby Image */
#dobby {
  width: 220px;
  cursor: pointer;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.25));
  transition: transform 1.2s ease, filter 1.2s ease;
}

/* Freed animation */
#dobby.freed {
  transform: translateY(-25px);
  filter: drop-shadow(0 0 40px rgba(255,255,255,0.7));
}

/* Text */
#dobby-text {
  margin-top: 2rem;
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  letter-spacing: 3px;
  opacity: 0;
  transform: translateY(10px);
  color: #f6f6f6;
  text-shadow: 0 0 18px rgba(255,255,255,0.7);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

#dobby-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sparkles */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, white, transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFloat 2s ease forwards;
}

@keyframes sparkleFloat {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-60px) scale(0);
  }
}
/*logout footer*/
/* Logout Button */
#logout-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  background: rgba(180,140,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  z-index: 50;
}

#logout-btn:hover {
  box-shadow: 0 0 25px rgba(180,140,255,0.6);
}

/* Overlay */
#logout-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #0b0b15, #000);
  z-index: 999;
  display: none;
  overflow: hidden;
}

/* Gates */
.gate {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    #111,
    #000
  );
}

.gate.left {
  left: -50%;
  animation: closeLeft 2s forwards ease-in-out;
}

.gate.right {
  right: -50%;
  animation: closeRight 2s forwards ease-in-out;
}

/* Farewell Text */
.farewell {
  position: absolute;
  bottom: 15%;
  width: 100%;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  opacity: 0;
  animation: fadeText 2s forwards ease 1.2s;
  letter-spacing: 3px;
}

/* Animations */
@keyframes closeLeft {
  to { left: 0; }
}

@keyframes closeRight {
  to { right: 0; }
}

@keyframes fadeText {
  to { opacity: 1; }
}



/* Footer */
footer { text-align:center; padding:3rem; opacity:0.6; }
footer a { color: var(--magic); text-decoration:none; }
