@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English+SC&display=swap');
/* === Base & Globals === */
body {
  background-color: #1f1a17;
  background-image: url('/static/books.png');
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  color: #f0e6d2;
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 2rem;
}


body.light-mode input[type="submit"] {
  background-color: #e0c28b !important;
  color: #3a2a1a !important;
  border: 1px solid #a07642;
  box-shadow: 1px 1px 3px rgba(100, 80, 50, 0.4);
}

body.light-mode input[type="submit"]:hover {
  background-color: #f0d8a5 !important;
}



body.light-mode {
  background-image: url('/static/books-light.png');
  background-color: #f9f5e5;
  color: #1f1a17;
}



body.light-mode textarea,
body.light-mode select,
body.light-mode input[type="submit"] {
  background-color: #fff;
  color: #1f1a17;
  border: 1px solid #800000;
}

body.light-mode input[type="submit"] {
  background-color: #aa0000;
  color: white;
}

body.light-mode .answer-box {
  background-color: #fffbe6;
  background-image: none;
  color: #2e2e2e;
}

body.light-mode .snippet {
  background-color: #eee;
  border-left-color: #aa0000;
}

body.light-mode .snippet pre {
  background-color: #f2efe7;
  color: #1f1a17;
}
body.light-mode .selector-group {
  color: #2b1e15;
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 3px rgba(150, 120, 90, 0.4);
}

body.light-mode .selector-group select {
  background-color: #fffdf8;
  color: #2b1e15;
  border-color: #a84c00;
}

body.light-mode #conversation-container {
  background: #fdfaf3;
  border: 2px solid #a88b5a;
  color: #2b1e15;
}

body.light-mode #conversation-log {
  color: #2b1e15;
}


body.light-mode #spell-box {
  background-color: #fdfaf3;
  color: #2b1e15;
  border: 1px solid #a88b5a;
}

body.light-mode #cast-spell-btn {
  background-color: #e0c28b;
  color: #3a2a1a;
  border: 1px solid #a07642;
}

body.light-mode #cast-spell-btn:hover {
  background-color: #f0d8a5;
}
/* === Typography === */
h1 {
  text-align: center;
  font-family: 'IM Fell English SC', serif;
  font-size: 3.5rem;
  background: linear-gradient(to right, #fceabb, #f8b500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
  1px 1px 0 #3b240b,
  2px 2px 4px #000,
  0 0 10px #f8b500,
  0 0 20px #ffcc33;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  animation: flicker 3s infinite alternate;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
}
h2 {
  font-family: 'IM Fell English SC', serif;
}

/* Crest image (optional tweak) */
.crest {
  height: 100px;
  filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.5));
}
/* Magical flicker effect */
h1 img {
  height: 48px;
}
h1 {
  font-size: 2.2rem;
  flex-direction: column;
}

.crest {
  height: 70px;
}

/* === Layout === */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem auto;
  max-width: 850px;
  gap: 0.75rem;
}

/* === Forms & Selectors === */
textarea, select, input[type="submit"] {
  padding: 0.75rem;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid #5c1a00;
  background-color: #3a2a20;
  color: #f0e6d2;
  width: 100%;
}
.selector-group {
  display: inline-flex;
  align-items: center;
  margin: 0.5rem 0.25rem 1rem 0;
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  color: #f4e8c1;
  background-color: rgba(80, 50, 30, 0.6);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.selector-group label {
  display: inline-block;
  width: 100px; /* adjust as needed */
  margin-right: 0.65rem;
  white-space: nowrap;
  font-weight: 500;
}

.selector-group select {
  font-size: 1.05rem;
  font-family: 'EB Garamond', serif;
  padding: 0.35rem 0.75rem;
  border: 1px solid #993300;
  border-radius: 5px;
  background-color: #2e1f14;
  color: #f4e8c1;
  font-weight: 500;
  min-width: 140px;
}

textarea, select, input[type="submit"], .reveal-button {
  font-size: 1.3rem;
  padding: 1rem;
}


/* === Buttons === */
input[type="submit"] {
  background-color: #800000;
  color: white;
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
  background-color: #aa0000;
}

.reveal-button {
  background-color: transparent;
  border: 1px solid #f0e6d2;
  color: #f0e6d2;
  padding: 0.4rem 1rem;
  font-family: 'Roboto', serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.reveal-button:hover {
  background-color: #f0e6d2;
  color: #1f1a17;
  box-shadow: 0 0 10px #f0e6d2aa;
}
.reveal-button {
  font-size: 1.2rem;
  padding: 0.6rem 1.2rem;
}


/* === UI Components === */
.answer-box {
  background-image: url('/static/parchment-texture.jpg');
  background-size: cover; /* stretch to fit */
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fdf6e3; /* fallback color */

  border: 2px solid #aa0000;
  border-radius: 10px;
  padding: 20px;
  margin: 20px auto;
  font-family: "Garamond", "Georgia", serif;
  box-shadow: 0 0 15px rgba(170, 0, 0, 0.3);
  max-width: 850px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.answer-pre {
  white-space: pre-wrap;
  font-family: inherit;
}

.answer-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #7b1e1e;
  margin-bottom: 10px;
}
.answer-content {
  font-size: 1.1em;
  line-height: 1.6;
  color: #2e2e2e;
}

#snippets-wrapper {
  background: url('/static/parchment-dark.jpg') repeat;
  font-family: 'Cormorant Garamond', 'EB Garamond', serif;
  background-size: auto;
  border: 3px double #6a4c2b;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 850px;
  box-shadow: 0 0 15px rgba(50, 30, 10, 0.6);
  font-family: 'EB Garamond', serif;
  color: #e8dbc4;
}

#snippets-wrapper h2 {
  text-align: center;
  font-family: 'IM Fell English SC', serif;
  font-size: 1.8rem;
  color: #d2b48c;
  text-shadow: 1px 1px 2px #1c120a;
  margin-bottom: 1.5rem;
}

#snippets-wrapper .snippet {
  background: transparent;
  font-family: 'Cormorant Garamond', 'EB Garamond', serif;
  border: none;
  padding: 0.5rem 0;
  margin: 1rem 0;
  box-shadow: none;
  color: inherit;
}

#snippets-wrapper .snippet a {
  text-decoration: none;
  color: inherit;
}

#snippets-wrapper .snippet a:hover {
  text-decoration: none;
  color: #6a4b2b; /* Optional: darken slightly on hover */
}


#snippets-wrapper .snippet a strong {
  color: #5a3a1a; /* dark ink tone */
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}



#snippets-wrapper h2.snippets-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 2.2rem;
  text-align: center;
  color: #2f1f14;
  font-style: italic;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  text-shadow: none;
}

#snippets-wrapper h2.snippets-title::after {
  content: "";
  display: block;
  width: 180px;
  height: 2px;
  margin: 0.8rem auto 0;
  background: linear-gradient(to right, #4b3522, #2f1f14, #4b3522);
  opacity: 0.6;
}






.snippet {
  padding: 0.5rem 0;
  margin: 1rem 0;
  border: none;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  color: #e0d6c0;
  line-height: 1.6;
  position: relative;
}

.snippet a strong {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1em;
  color: #cfa36a;
  text-decoration: none;
}

.snippet a strong::after {
  content: ".";
}
#snippets-wrapper .snippet pre {
  font-family: 'Cormorant Garamond', 'EB Garamond', serif;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 1.2s ease-in-out,
    opacity 0.8s ease-in-out,
    margin-top 0.8s ease-in-out,
    padding-left 0.6s ease-in;
  opacity: 0;
  display: block;
  background: none;
  border: none;
  padding: 0 0 0 1.2rem;
  margin: 0;
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  color: #2f1f14;
  white-space: pre-wrap;
  line-height: 1.6;
}

#snippets-wrapper .snippet a strong {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.1em;
  color: #2f1f14;
  letter-spacing: 0.02em;
  text-decoration: none;
}


#snippets-wrapper .snippet pre.revealed {
  max-height: 1000px;
  opacity: 1;
  margin-top: 0.3rem;
  padding-left: 1.6rem;
}


.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-right: 1rem;
}

.snippet-header a {
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.snippet-header a,
.snippet-header a strong,
.snippet-header .revelio-spell {
  text-decoration: none;
  border: none;
}


.revelio-spell {
  white-space: nowrap;
  font-family: 'IM Fell English SC', serif;
  font-size: 1.1rem;
  color: #f8e3a0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: right;
}



.revelio-spell:hover {
  color: #fff4c2;
  text-shadow: 0 0 8px #f6da89, 0 0 12px #ffd;
}

.revelio-spell:hover::after {
  opacity: 1;
}


.portrait-icon {
  width: 150px;
  height: 209px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 4px;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
  float: left; /* only include this if you're not using flex */
}

/* === Animated Student Portraits (scaled correctly) === */
.portrait-animated-wrapper {
  position: relative;
  width: 160px;
  height: 175px;
  flex-shrink: 0;
  margin-top: 4px;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.portrait-animated-video {
  position: absolute;
  top: 13px;     /* scaled from 53px */
  left: 13px;    /* scaled from 57px */
  width: 131px;  /* scaled from 512px */
  height: 131px;
  border-radius: 8px;
  object-fit: cover;
}

.portrait-animated-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 175px;
  pointer-events: none;
}




/* Make sure .answer-box still works with your layout */
.answer-box {
  display: flex; /* or grid, if you're using that elsewhere */
  align-items: flex-start;
  min-height: 210px;
  gap: 1rem;
}

/* === Conversation Box === */
#conversation-container {
display: none;
max-height: 300px;
overflow-y: auto;
border: 2px solid #aa0000;
background: #2b1c16;
border-radius: 6px;
padding: 1rem;
margin-bottom: 1.5rem;
color: #f0e6d2;
font-family: 'Garamond', 'Georgia', serif;
}

#conversation-log {
white-space: pre-wrap;
}

#conversation-container {
  padding-left: 0.5rem;
  padding: 0.5rem 1rem;
  transition: all 0.4s ease;
}


/* Light mode overrides */

/* === Spell Box === */
#spell-box-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  max-width: 850px;
  padding: 0 1rem;
}


#spell-box {
font-family: 'EB Garamond', serif;
font-size: 1.05rem;
padding: 0.4rem 0.6rem;
border: 1px solid #993300;
border-radius: 5px;
background-color: #2e1f14;
color: #f4e8c1;
width: 160px;
}

#cast-spell-btn {
font-family: 'EB Garamond', serif;
font-size: 1.05rem;
padding: 0.4rem 0.9rem;
background-color: #800000;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.3s ease;
}

#cast-spell-btn:hover {
background-color: #aa0000;
}

#spell-feedback {
  font-size: 0.9rem;
  font-style: italic;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

/* Fading out (disappear) */
.fade-out {
  opacity: 0;
  pointer-events: none; /* Prevent interaction while faded out */
  transition: opacity 0.25s ease-out;
}

/* Fading in (reappear) */
.fade-in {
  opacity: 1;
  transition: opacity 2s ease-in;
}


/* Rune Styling: Larger, Brighter Glow, and Yellow-White Base */
.rune {
  width: 100px;
  height: 100px;
  animation: glow 1.5s infinite alternate;
  opacity: 0.9;
}

/* Glow animation for the runes */
@keyframes glow {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1); /* Slight scale-up effect */
  }
}

/* Runes container */
#runes-container {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: block;
}

/* Crucio Effect: Page shake as if in pain */
.crucio-shake {
  animation: shake 5s ease-in-out forwards;  /* Ensure the animation lasts 5 seconds and doesn't loop */
}

@keyframes shake {
  0% {
    transform: translate(0, 0); /* Initial state */
  }
  10% {
    transform: translate(-10px, -5px); /* Shake left and up */
  }
  20% {
    transform: translate(8px, 6px); /* Shake right and down */
  }
  30% {
    transform: translate(-8px, 10px); /* Shake left and down */
  }
  40% {
    transform: translate(7px, -10px); /* Shake right and up */
  }
  50% {
    transform: translate(-5px, 5px); /* Shake left and down */
  }
  60% {
    transform: translate(6px, -4px); /* Shake right and up */
  }
  70% {
    transform: translate(-7px, 8px); /* Shake left and up */
  }
  80% {
    transform: translate(8px, -5px); /* Shake right and down */
  }
  90% {
    transform: translate(-6px, 6px); /* Shake left and up */
  }
  100% {
    transform: translate(0, 0); /* End at the default position */
  }
}


/* Avada Kedavra Effect */
#avada-effect {
  position: fixed; /* Cover the whole screen */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent; /* Start with no background */
  z-index: 9999; /* Ensure it stays on top of all elements */
  display: none; /* Hidden by default */
}

.avada-flash {
  animation: flash-effect 3s ease-out forwards; /* Slower, more noticeable flash */
}

@keyframes flash-effect {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: #4caf50; /* A softer green (darker) */
  }
  100% {
    background-color: transparent;
  }
}

.avada-blackout {
  background-color: black !important; /* Full black background */
  animation: blackout-effect 1s ease-in-out forwards; /* Smooth transition to blackout */
}

@keyframes blackout-effect {
  0% {
    background-color: transparent;
  }
  100% {
    background-color: black;
  }
}



#timeline-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  background-color: #1f1a17;
  color: #f0e6d2;
  overflow-y: auto;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  padding: 1em;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

#timeline-sidebar.visible {
  transform: translateX(0);
}

#toggle-timeline {
  position: fixed;
  top: 10px;
  right: 17px;
  z-index: 1100;
  background: #eee0d0;
  border: none;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
}
#expand-timeline {
  position: fixed;
  top: 10px;
  right: 120px;
  z-index: 1100;
  background: #eee0d0;
  border: none;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
}

#timeline-sidebar.wide {
  width: 600px;
}
@media (max-width: 768px) {
  #timeline-sidebar.wide {
    width: 100%;
  }
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#expand-timeline {
  background: none;
  border: none;
  font-size: 20px;
  color: #f0e6d2;
  cursor: pointer;
}


#timeline-sidebar {
  font-family: 'Georgia', serif;
  background-size: cover;
  padding: 1.5em;
  line-height: 1.4;
}

.timeline-entry {
  margin-bottom: 1.5em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1em;
}

.timeline-entry h4 {
  margin: 0;
  font-size: 1.1em;
  color: #e6d2b5;
}

.timeline-entry p {
  font-weight: bold;
  color: #fdf5e6;
}

.timeline-entry ul {
  padding-left: 1.2em;
  list-style-type: disc;
}
.timeline-entry a {
  color: #d8c9a3;
  text-decoration: none;
  font-weight: bold;
}

.timeline-entry a:hover {
  text-decoration: underline;
  color: #fdf6da;
}

#timeline-controls {
  margin-bottom: 1em;
}

#timeline-controls input {
  width: 100%;
  padding: 6px;
  margin-bottom: 0.5em;
  font-size: 14px;
}

@media (max-width: 768px) {
  #timeline-sidebar {
    width: 100%;
  }
}







body.light-mode #spell-feedback {
  color: #2b1e15;
}

body:not(.light-mode) #spell-feedback {
  color: #f0e6d2;
}


body.mischief-mode.light-mode {
  background-image: url('/static/marauders-map-light.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
}

body.mischief-mode:not(.light-mode) {
  background-image: url('/static/marauders-map-dark.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
}

#spell-feedback {
  font-size: 0.9rem;
  font-style: italic;
  min-height: 1.2em;
  color: var(--spell-feedback-color, #f0e6d2);
  white-space: normal;
  overflow-wrap: anywhere;
  position: relative;
  opacity: 1;
  transition: opacity 0.3s ease;
}

body.light-mode #spell-feedback {
  --spell-feedback-color: #2b1e15;
  --spell-glow-color: #ffebb1;
}

.spell-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  text-shadow:
    0 0 4px var(--spell-glow-color, #f0e6d2),
    0 0 8px var(--spell-glow-color, #f0e6d2),
    0 0 12px var(--spell-glow-color, #f0e6d2);
  transition: opacity 0.6s ease, transform 0.6s ease;
  min-width: 0.5ch;
}

.spell-letter.visible {
  opacity: 1;
  transform: translateY(0);
}

.spell-letter.fading {
  opacity: 0;
  transform: translateX(0.5em);
}




/* === Animations === */
@keyframes flicker {
0% {
  text-shadow:
  1px 1px 0 #3b240b,
  2px 2px 4px #000,
  0 0 8px #f8b500,
  0 0 12px #ffcc33;
}
100% {
  text-shadow:
  1px 1px 0 #3b240b,
  2px 2px 4px #000,
  0 0 12px #f8b500,
  0 0 24px #ffd700;
}
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeOverlay 1s ease-out forwards;
}

@keyframes fadeOverlay {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.overlay-lumos {
  background: radial-gradient(circle, rgba(255,255,200,0.4) 0%, rgba(255,255,200,0.1) 60%, transparent 100%);
}

.overlay-nox {
  background: radial-gradient(circle, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
}

.overlay-fizzle {
  background: repeating-radial-gradient(circle, rgba(255,0,0,0.2), rgba(255,255,0,0.2) 5px);
}

body:not(.light-mode) #conversation-container {
  background: #2b1c16;
  border: 2px solid #aa0000;
  color: #f0e6d2;
}

.overlay.overlay-patronus {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(173, 216, 230, 0.4), rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.0) 100%);
  animation: patronus-flare 4s ease-out forwards;
  z-index: 9999;
}

.overlay.overlay-patronus::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(200, 230, 255, 0.15) 0%, rgba(200, 230, 255, 0.05) 40%, transparent 100%);
  animation: aura-pulse 2s infinite alternate, aura-fadeout 4s forwards;
  filter: blur(8px);
}


@keyframes aura-pulse {
  0% { opacity: 0.2; }
  100% { opacity: 0.4; }
}

@keyframes aura-fadeout {
  0%   { opacity: 1; }
  50%  { opacity: 0.6; }
  100% { opacity: 0; transform: scale(1.05); }
}

.patronus-summon path {
  fill: #c8f0ff;
  filter: blur(1px) brightness(1.2);
}

.patronus-summon {
  background: none !important;
  border: none !important;
  outline: none !important;
  pointer-events: none;
}

.patronus-summon svg {
  display: block;
  background: none !important;
  fill: none !important;
}

@keyframes patronus-flare {
  0% {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(6px);
  }
  30% {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(2px);
  }
  80% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
    filter: blur(8px);
  }
}

.overlay.overlay-shield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(135, 206, 250, 0.6), rgba(30, 144, 255, 0.45), transparent 70%);
  border: 2px solid rgba(173, 216, 230, 0.7);
  box-shadow: 0 0 30px 15px rgba(30, 144, 255, 0.5); /* Stronger glow effect */
  animation: shield-pulse 4s ease-out forwards; /* Faster, continuous animation */
  z-index: 9999;
}

@keyframes shield-pulse {
  0% {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(6px);
  }
  40% {
    opacity: 1;
    transform: scale(1.05);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
    filter: blur(10px);
  }
}



.overlay.overlay-flame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 120, 0, 0.5), rgba(255, 69, 0, 0.3), rgba(139, 0, 0, 0.1));
  animation: flame-burst 4s ease-out forwards;
  z-index: 9999;
}

@keyframes flame-burst {
  0% {
    opacity: 0;
    transform: scale(0.7) rotate(0deg);
    filter: brightness(1.5) blur(4px);
  }
  30% {
    opacity: 0.9;
    transform: scale(1.05) rotate(2deg);
    filter: brightness(1.2) blur(1px);
  }
  60% {
    opacity: 0.6;
    transform: scale(1) rotate(-1deg);
    filter: brightness(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.1) rotate(1deg);
    filter: brightness(0.8) blur(6px);
  }
}

.conversation-toggle {
  font-family: 'IM Fell English SC', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #c9b890;
  text-align: center;
  margin: 1.5rem auto 1rem;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.conversation-toggle:hover {
  color: #f0e6d2;
  text-shadow: 0 0 6px rgba(250, 240, 200, 0.5);
}


/* === Media Queries === */
@media (max-width: 768px) {
  .portrait-video-wrapper {
    transform: scale(0.66); /* or whatever fits */
    transform-origin: top left;
  }
}

@media (max-width: 600px) {
  #spell-box-container {
    display: none !important;
  }
    textarea, select, input[type="submit"], .reveal-button {
        font-size: 1.3rem;
        padding: 1rem;
    }

    .reveal-button {
        font-size: 1.2rem;
        padding: 0.6rem 1.2rem;
    }

    h1 {
        font-size: 2.2rem;
        flex-direction: column;
    }

    .crest {
        height: 70px;
    }

    .answer-box {
        display: block !important; /* no flex at all */
    }

.portrait-icon {
  height: 100px;
  width: auto;
  position: relative;
  overflow: hidden;
}


}

