/* ==========================================================================
   HOCUS POCUS GRIMOIRE - GLYTCH MASCOT CARTOON STYLE
   Bold ink outlines, vibrant Halloween palette, cel-shaded textures,
   and 3D animated living eye with real interactive functions.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Fredoka:wght@400;600;700&family=Pirata+One&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Witch & Mascot Color Palette */
  --bg-deep: #11081f;
  --bg-purple: #1e0f33;
  --bg-card: #281442;
  --ink-black: #140d1c;
  --winnie-orange: #f3781e;
  --winnie-orange-dark: #c85707;
  --sanderson-green: #18d34d;
  --sanderson-green-dark: #0b8c2e;
  --potion-cyan: #22e6cf;
  --leather-base: #a67948;
  --leather-dark: #7a532b;
  --leather-light: #c4965f;
  --snake-silver: #96a5b8;
  --snake-dark: #505c6c;
  --eye-amber: #d8892b;
  --eye-amber-bright: #fab23c;
  --magic-violet: #bd34fe;
  --magic-glow: rgba(189, 52, 254, 0.6);
  --parchment-bg: #f4ecd8;
  --parchment-border: #d2be97;
  --parchment-ink: #2b1f14;

  /* Comic UI Tokens */
  --comic-border: 3.5px solid var(--ink-black);
  --comic-shadow: 5px 5px 0px rgba(15, 8, 24, 0.95);
  --comic-shadow-sm: 3px 3px 0px rgba(15, 8, 24, 0.95);
  --comic-shadow-glow: 0 0 25px var(--magic-glow), 5px 5px 0px var(--ink-black);
  --radius-comic: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--bg-deep);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 18%, rgba(138, 43, 226, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 15% 85%, rgba(24, 211, 77, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(243, 120, 30, 0.14) 0%, transparent 50%);
}

/* Common Utility */
.hidden {
  display: none !important;
}

/* Atmospheric Spooky Vignette & Fog */
.spooky-stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(2px 2px at 40px 60px, #ffffff99, transparent),
                    radial-gradient(2.5px 2.5px at 180px 140px, #fab23c88, transparent),
                    radial-gradient(1.5px 1.5px at 320px 220px, #ffffff77, transparent),
                    radial-gradient(2px 2px at 640px 90px, #bd34fe88, transparent),
                    radial-gradient(2.5px 2.5px at 850px 300px, #ffffffaa, transparent),
                    radial-gradient(2px 2px at 1100px 120px, #18d34d77, transparent),
                    radial-gradient(2px 2px at 1350px 250px, #ffffff88, transparent);
  background-repeat: repeat;
  background-size: 800px 500px;
  opacity: 0.7;
}

/* Header & Mascot Banner */
.site-header {
  position: relative;
  z-index: 10;
  padding: 24px 20px 10px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mascot-avatar-pill {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--winnie-orange), var(--sanderson-green));
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mascot-avatar-pill:hover {
  transform: scale(1.08) rotate(-4deg);
}

.mascot-avatar-pill img {
  width: 110%;
  height: 110%;
  object-fit: cover;
  object-position: center 20%;
}

.brand-text h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 2px 2px 0px var(--ink-black), 0 0 12px var(--magic-glow);
  line-height: 1.1;
}

.brand-text p {
  font-size: 0.88rem;
  color: #c9b4e3;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text .badge-pill {
  background: var(--winnie-orange);
  color: var(--ink-black);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1.5px solid var(--ink-black);
}

/* Action Controls in Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comic-btn {
  background: var(--bg-card);
  color: #fff;
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-sm);
  border-radius: 14px;
  padding: 10px 18px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.comic-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0px var(--ink-black);
  background: #391c5c;
}

.comic-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--ink-black);
}

.comic-btn.btn-winnie {
  background: var(--winnie-orange);
  color: var(--ink-black);
}
.comic-btn.btn-winnie:hover {
  background: #ffa033;
}

.comic-btn.btn-green {
  background: var(--sanderson-green);
  color: var(--ink-black);
}
.comic-btn.btn-green:hover {
  background: #25f460;
}



/* ==========================================================================
   MAIN STAGE: THE WITCH'S ALTAR & SPELLBOOK
   ========================================================================== */

.main-stage {
  position: relative;
  z-index: 5;
  max-width: 1240px;
  margin: 15px auto 40px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-stage {
    grid-template-columns: 1fr;
  }
}

/* Altar Centerpiece Card */
.altar-viewport {
  background: linear-gradient(180deg, rgba(38, 20, 64, 0.75) 0%, rgba(20, 11, 36, 0.95) 100%);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow);
  border-radius: 28px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 590px;
  backdrop-filter: blur(12px);
}

/* Ambient glow & decorative cobwebs */
.altar-viewport::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(189, 52, 254, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

/* Mascot Dialogue Bubble */
.mascot-speech-bubble {
  background: #fff;
  color: var(--ink-black);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-sm);
  border-radius: 18px;
  padding: 12px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  max-width: 580px;
  animation: floatUpDown 4s ease-in-out infinite;
}

/* Direct Hero Audit Bar */
.audit-hero-bar {
  width: 100%;
  max-width: 580px;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

.hero-audit-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-sm);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  gap: 10px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hero-audit-input-wrap:focus-within {
  box-shadow: var(--comic-shadow-glow), 0 0 16px rgba(189, 52, 254, 0.5);
  border-color: var(--sanderson-purple);
}

.hero-input-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.hero-url-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-black);
  min-width: 0;
}

.hero-url-input::placeholder {
  color: #7b7185;
  font-weight: 500;
}

.hero-audit-submit-btn {
  border-radius: 999px !important;
  padding: 9px 18px !important;
  font-size: 0.95rem !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-btn-text-full {
  display: inline;
}
.hero-btn-text-mobile {
  display: none;
}

@media (max-width: 520px) {
  .hero-btn-text-full {
    display: none;
  }
  .hero-btn-text-mobile {
    display: inline;
  }
}

.input-error {
  border-color: #ff3344 !important;
  box-shadow: 0 0 0 3px rgba(255, 51, 68, 0.4) !important;
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.pulse-focus {
  border-color: var(--winnie-orange) !important;
  box-shadow: 0 0 0 4px var(--winnie-orange), 0 0 24px rgba(255, 122, 0, 0.7) !important;
  animation: pulseGlow 1.2s ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 48px;
  border-width: 14px 14px 0 0;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  display: block;
  width: 0;
}
.mascot-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 46px;
  border-width: 17px 17px 0 0;
  border-style: solid;
  border-color: var(--ink-black) transparent transparent transparent;
  display: block;
  width: 0;
}

.bubble-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink-black);
  flex-shrink: 0;
  overflow: hidden;
}
.bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.bubble-text strong {
  color: var(--winnie-orange-dark);
}

/* ==========================================================================
   THE 3D GRIMOIRE (THE BOOK WITH THE EYE)
   ========================================================================== */

.book-3d-scene {
  perspective: 1400px;
  width: 390px;
  height: 510px;
  position: relative;
  margin: 10px auto 25px;
  user-select: none;
}

@media (max-width: 600px) {
  .main-stage {
    padding: 0 10px;
  }
  .altar-viewport {
    padding: 14px 10px;
    overflow: visible !important;
  }
  .book-3d-scene {
    width: min(300px, calc(100vw - 64px));
    height: clamp(450px, 62vh, 500px);
    margin: 6px auto 16px;
  }
  .serpent-clasp-wrapper {
    top: 24px !important;
    right: -16px !important;
    width: 76px !important;
    height: 90px !important;
    z-index: 20;
  }
  .hp-book-pages-edge {
    right: -14px !important;
    width: 22px !important;
    top: 12px !important;
    bottom: 12px !important;
  }
  .hp-book-pages-edge-left {
    left: -14px !important;
    width: 22px !important;
    top: 12px !important;
    bottom: 12px !important;
  }
  .hero-audit-input-wrap {
    padding: 4px 6px 4px 12px;
    gap: 6px;
  }
  .hero-url-input {
    font-size: 0.86rem;
  }
  .hero-audit-submit-btn {
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
  }
  .brand-text h1 {
    font-size: 1.25rem;
  }
  .brand-text p {
    font-size: 0.74rem;
    flex-wrap: wrap;
  }
  .book-stage-controls {
    gap: 6px;
  }
  .book-stage-controls .comic-btn {
    padding: 7px 11px;
    font-size: 0.8rem;
    min-height: 40px;
  }
  .hint-pill {
    font-size: 0.74rem;
    padding: 6px 12px;
  }
}

@media (max-width: 360px) {
  .book-3d-scene {
    width: min(270px, calc(100vw - 48px));
    height: 440px;
  }
  .serpent-clasp-wrapper {
    right: -10px !important;
    width: 64px !important;
    height: 76px !important;
  }
}

.hp-book {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.35, 1);
  cursor: pointer;
}

/* Shift book right when open so left-turning cover doesn't clip off screen on desktop */
.hp-book.is-open {
  transform: translateX(110px);
}

/* Back Cover & Pages Spine (Base) - Authentic Distressed Leather Tome */
.hp-book-base {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #432717 0%, #2a160d 100%);
  border-radius: 18px;
  border: var(--comic-border);
  box-shadow: 
    16px 20px 0px rgba(10, 5, 18, 0.85),
    0 0 35px rgba(189, 52, 254, 0.22);
  transform: translateZ(-25px);
  overflow: visible;
}

/* Gilded Ancient Page Edges - Right */
.hp-book-pages-edge {
  position: absolute;
  top: 14px;
  right: -16px;
  bottom: 14px;
  width: 26px;
  background: repeating-linear-gradient(
    90deg,
    #cfb684 0px,
    #e9dbb8 2px,
    #b49864 4px,
    #e9dbb8 6px
  );
  border: 3px solid var(--ink-black);
  border-left: none;
  border-radius: 0 10px 10px 0;
  box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* Gilded Ancient Page Edges - Left (Visible when open) */
.hp-book-pages-edge-left {
  position: absolute;
  top: 14px;
  left: -16px;
  bottom: 14px;
  width: 26px;
  background: repeating-linear-gradient(
    90deg,
    #e9dbb8 0px,
    #cfb684 2px,
    #e9dbb8 4px,
    #b49864 6px
  );
  border: 3px solid var(--ink-black);
  border-right: none;
  border-radius: 10px 0 0 10px;
  box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.hp-book.is-open .hp-book-pages-edge-left {
  opacity: 1;
}

/* Outer Antique Leather Corner Brackets */
.open-book-bracket {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink-black);
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(135deg, #7c8896 0%, #46505c 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.open-book-bracket::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  background: #181d22;
  border-radius: 50%;
}

.bracket-tl {
  top: 4px;
  left: 4px;
  border-radius: 8px 0 12px 0;
  border-right: none;
  border-bottom: none;
}
.bracket-tl::after {
  top: 3px;
  left: 3px;
}

.bracket-tr {
  top: 4px;
  right: 4px;
  border-radius: 0 8px 0 12px;
  border-left: none;
  border-bottom: none;
}
.bracket-tr::after {
  top: 3px;
  right: 3px;
}

.bracket-bl {
  bottom: 4px;
  left: 4px;
  border-radius: 0 12px 0 8px;
  border-right: none;
  border-top: none;
}
.bracket-bl::after {
  bottom: 3px;
  left: 3px;
}

.bracket-br {
  bottom: 4px;
  right: 4px;
  border-radius: 12px 0 8px 0;
  border-left: none;
  border-top: none;
}
.bracket-br::after {
  bottom: 3px;
  right: 3px;
}

.hp-book.is-open .open-book-bracket {
  opacity: 1;
}

/* Interior Pages Content (Visible when opened) - Smooth Parchment (No Center Line) */
.hp-book-interior {
  position: absolute;
  inset: 8px;
  background-color: var(--parchment-bg);
  background-image: radial-gradient(circle at 50% 50%, #fcf8ee 0%, #f3ebd6 100%);
  border-radius: 14px;
  border: 3px solid #8e6c43;
  padding: 14px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow-y: auto;
  overflow-x: hidden !important;
  color: var(--parchment-ink);
  z-index: 2;
  box-shadow: 
    inset 0 0 20px rgba(119, 87, 43, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

/* Guard against all side-scrolling inside book */
.hp-book-interior,
.hp-book-interior * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Completely remove the line down the middle */
.book-spine-crease {
  display: none !important;
}

/* Crimson Silk Ribbon Bookmark (Draped elegantly across right page) */
.book-silk-ribbon {
  position: absolute;
  top: -2px;
  right: 20px;
  width: 16px;
  height: 44px;
  background: linear-gradient(135deg, #a8182a 0%, #db2a40 50%, #83101e 100%);
  border: 1.5px solid #4a0a12;
  border-top: none;
  border-radius: 0 0 3px 3px;
  box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.4);
  z-index: 9;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
}
.ribbon-charm {
  font-size: 0.6rem;
  color: #ffd700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Open Book Header with Sentient Watcher Eye Crest */
.open-book-crest {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(67, 39, 23, 0.1) 0%, rgba(67, 39, 23, 0.03) 100%);
  border: 1.5px solid rgba(142, 108, 67, 0.35);
  border-radius: 9px;
  padding: 4px 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 5;
}

.crest-eye-frame {
  width: 58px;
  height: 38px;
  flex-shrink: 0;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.45);
  background: #25160d;
}

#hpOpenEyeRoot {
  width: 100%;
  height: 100%;
  position: relative;
}

.crest-eye-frame .hp-eye-flesh {
  width: 100%;
  height: 100%;
  border-width: 2px;
}
.crest-eye-frame .hp-eye-socket {
  width: 50px;
  height: 32px;
  border-width: 2px;
}
.crest-eye-frame .hp-eyeball {
  width: 64px;
  height: 52px;
  top: -10px;
  left: -7px;
}
.crest-eye-frame .hp-iris {
  width: 26px;
  height: 26px;
  border-width: 2px;
}
.crest-eye-frame .hp-pupil {
  width: 12px;
  height: 12px;
}
.crest-eye-frame .hp-highlight {
  width: 5px;
  height: 5px;
  top: 5px;
  left: 6px;
}
.crest-eye-frame .hp-highlight-secondary {
  width: 2.5px;
  height: 2.5px;
  bottom: 6px;
  right: 7px;
}
.crest-eye-frame .hp-eyelid {
  border-width: 2px;
}
.crest-eye-frame .hp-eye-stitches {
  display: none; /* Keep mini eye clean inside crest frame */
}

.crest-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.crest-rune-title {
  font-family: 'Fredoka', 'Cinzel Decorative', Georgia, serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #3b220b;
  letter-spacing: 0.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crest-subtitle {
  font-size: 0.68rem;
  color: #705232;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slim antique scrollbar for vertical navigation only */
.hp-book-interior::-webkit-scrollbar {
  width: 5px;
}
.hp-book-interior::-webkit-scrollbar-track {
  background: rgba(180, 150, 110, 0.12);
  border-radius: 4px;
}
.hp-book-interior::-webkit-scrollbar-thumb {
  background: #cbb493;
  border-radius: 4px;
}
.hp-book-interior::-webkit-scrollbar-thumb:hover {
  background: #a98d64;
}

.hp-book.is-open .hp-book-interior {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   FRONT COVER (CEL-SHADED LEATHER, SNAKES, STITCHES, & EYE)
   ========================================================================== */

.hp-book-cover {
  position: absolute;
  inset: 0;
  background-color: var(--leather-base);
  border-radius: 20px;
  border: var(--comic-border);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: inset 0 0 20px rgba(60, 36, 17, 0.45);
  overflow: visible;
}

.hp-book.is-open .hp-book-cover {
  transform: rotateY(-125deg);
}

/* Stitched Leather Patchwork (Like Glytch Mascot & Movie Book) */
.leather-patchwork {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: none;
}

.patch-seam-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Heavy Silver Serpent Clasp */
.serpent-clasp-wrapper {
  position: absolute;
  top: 36px;
  right: -24px;
  width: 95px;
  height: 110px;
  z-index: 10;
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.serpent-clasp-wrapper:hover {
  transform: scale(1.08) rotate(3deg);
}

.serpent-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(4px 4px 0px var(--ink-black));
}

/* Bottom Corner Ornate Metal Bracket */
.corner-bracket {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 65px;
  height: 65px;
  pointer-events: none;
  filter: drop-shadow(3px 3px 0px var(--ink-black));
}

.spine-ribs {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(90deg, #613e1f, #8b5b2e, #4b2e15);
  border-right: 3px solid var(--ink-black);
  border-radius: 18px 0 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 40px 0;
}

.spine-ridge {
  height: 8px;
  background: #30190a;
  border-top: 2px solid #a67948;
  border-bottom: 2px solid var(--ink-black);
}

/* The Purple Mystic Beacon Beam (Shoots out when book opens) */
.magic-beacon-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(208, 72, 255, 0.85) 0%, rgba(138, 43, 226, 0.45) 45%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
  opacity: 0;
  mix-blend-mode: screen;
}

.hp-book.is-open .magic-beacon-beam {
  transform: translate(-50%, -50%) scale(2.2);
  opacity: 0.9;
}

/* ==========================================================================
   THE LIVING EYE (CARTOON / CEL-SHADED SENTIENT EYE)
   ========================================================================== */

#hpSentientEyeRoot {
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  width: 175px;
  height: 125px;
  pointer-events: auto;
  z-index: 5;
}

.hp-eye-flesh {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #875c31 0%, #68421c 70%, #43270e 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 4px solid var(--ink-black);
  box-shadow: 
    inset 0 0 15px rgba(0, 0, 0, 0.7),
    0 6px 0px rgba(20, 10, 5, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.1s ease;
}

.hp-eye-flesh.hp-eye-wincing {
  animation: eyeLocalJitter 0.35s ease-in-out;
}

@keyframes eyeLocalJitter {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(0.96) translate(-3px, 2px) rotate(-3deg); }
  50% { transform: scale(0.96) translate(3px, -2px) rotate(3deg); }
  75% { transform: scale(0.98) translate(-1px, -1px) rotate(-1deg); }
}

.hp-eye-socket {
  position: relative;
  width: 135px;
  height: 85px;
  background: #25160d;
  border-radius: 50%;
  border: 3.5px solid var(--ink-black);
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.9);
}

/* Sclera & Capillaries */
.hp-eyeball {
  position: absolute;
  top: -25px;
  left: -12px;
  width: 160px;
  height: 135px;
  background: radial-gradient(circle at 50% 50%, #fffef8 0%, #f6edd7 65%, #dec5a1 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.hp-veins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Amber/Hazel Cel-Shaded Iris */
.hp-iris {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--eye-amber-bright) 0%, var(--eye-amber) 60%, #613b0c 100%);
  border: 3.5px solid var(--ink-black);
  box-shadow: 
    inset 0 0 8px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(250, 178, 60, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-iris-ring {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 230, 150, 0.5);
  pointer-events: none;
}

/* Black Dynamic Pupil */
.hp-pupil {
  width: 32px;
  height: 32px;
  background-color: var(--ink-black);
  border-radius: 50%;
  position: relative;
  transition: transform 0.08s ease-out;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* Specular Cornea Glint (3D shine) */
.hp-highlight {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 13px;
  height: 13px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px #ffffff;
}
.hp-highlight-secondary {
  position: absolute;
  bottom: 16px;
  right: 18px;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
}

/* Cel-Shaded Eyelids */
.hp-eyelid {
  position: absolute;
  left: -2px;
  right: -2px;
  background: #7a4f25;
  border: 3.5px solid var(--ink-black);
  pointer-events: none;
  z-index: 6;
  transition: transform 0.12s ease-out;
}

.hp-eyelid-upper {
  top: -3.5px;
  height: 50%;
  border-radius: 0 0 50% 50% / 0 0 40% 40%;
  border-top: none;
  transform: translateY(-92%);
}

.hp-eyelid-lower {
  bottom: -3.5px;
  height: 46%;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  border-bottom: none;
  transform: translateY(92%);
}

.hp-lid-crease {
  position: absolute;
  top: 8px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: #4a2d13;
  border-radius: 2px;
}

/* Stitches surrounding the Eye */
.hp-eye-stitches {
  position: absolute;
  inset: -25px;
  width: calc(100% + 50px);
  height: calc(100% + 50px);
  pointer-events: none;
  z-index: 7;
}



/* Quick Interactive Stage Controls */
.book-stage-controls {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.hint-pill {
  font-size: 0.82rem;
  color: #cbb4e3;
  margin-top: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   SIDEBAR & MODULAR SPOOKY PANELS (THE ACTUAL FUNCTIONS)
   ========================================================================== */

.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comic-card {
  background: var(--bg-card);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow);
  border-radius: var(--radius-comic);
  padding: 22px;
  position: relative;
}

.comic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.comic-card-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tabs Inside Grimoire or Panel */
.grimoire-tabs {
  display: flex;
  background: rgba(18, 9, 31, 0.65);
  border-radius: 12px;
  padding: 4px;
  gap: 5px;
  border: 2px solid var(--ink-black);
  margin-bottom: 12px;
  width: 100%;
}

.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: #cbb4e3;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.tab-label-full {
  display: inline;
}
.tab-label-short {
  display: none;
}

@media (max-width: 540px) {
  .tab-label-full {
    display: none;
  }
  .tab-label-short {
    display: inline;
  }
  .tab-btn {
    padding: 7px 4px;
    font-size: 0.8rem;
  }
}

.tab-btn.active {
  background: var(--winnie-orange);
  color: var(--ink-black);
  box-shadow: var(--comic-shadow-sm);
}

/* 1. CURSE TOGGLES */
.curses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.curse-toggle-btn {
  background: rgba(30, 16, 48, 0.8);
  border: 2.5px solid var(--ink-black);
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.curse-toggle-btn:hover {
  background: #3a1e5c;
  transform: translate(-2px, -2px);
  box-shadow: var(--comic-shadow-sm);
}

.curse-toggle-btn.active {
  border-color: var(--sanderson-green);
  background: rgba(24, 211, 77, 0.18);
}

.curse-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.curse-icon {
  font-size: 1.4rem;
}

.curse-text-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}
.curse-text-box p {
  font-size: 0.78rem;
  color: #bfabdc;
}

.curse-pill-status {
  background: var(--ink-black);
  color: #a491bf;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
}
.curse-toggle-btn.active .curse-pill-status {
  background: var(--sanderson-green);
  color: var(--ink-black);
}

/* 2. THE MARKETING & WEBSITE AUDIT ENGINE (Inside Book) */
.audit-wrapper {
  color: var(--parchment-ink);
}

.spell-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: #522c0c;
  margin-bottom: 4px;
}
.spell-desc {
  font-size: 0.8rem;
  color: #79522b;
  margin-bottom: 12px;
}

.audit-input-with-btn {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.audit-input-with-btn .audit-text-input {
  flex: 1;
}

.audit-live-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  text-align: left;
  background: #fbf5e6;
  border: 1.5px solid #dfcfb2;
  border-radius: 10px;
  padding: 10px 14px;
}
.live-step {
  font-size: 0.78rem;
  color: #6d4b26;
  font-weight: 500;
  transition: color 0.2s ease;
}
.live-step.done {
  color: #0b7e28;
  font-weight: 700;
}

/* Initial Atmospheric Ready State inside Grimoire */
.audit-ready-card {
  text-align: center;
  padding: 14px 10px;
  background: rgba(253, 248, 237, 0.75);
  border: 1.5px dashed #cbb493;
  border-radius: 12px;
  margin-top: 8px;
}
.ancient-seal-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}
.spell-subtitle {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.95rem;
  color: #432208;
  margin-bottom: 6px;
}
.audit-feature-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin: 10px 0;
  background: #fff8eb;
  border: 1px solid #e2d2ba;
  border-radius: 8px;
  padding: 8px 10px;
}
.check-item {
  font-size: 0.76rem;
  color: #5c3c1e;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chk-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}

/* Dossier Header */
.dossier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 2px dashed #d5be94;
  padding-bottom: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.domain-badge-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.dossier-domain-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.live-verified-pill {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #86efac;
  white-space: nowrap;
}
.dossier-page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #3b220b;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Spacious, non-overflowing Health Score Card */
.health-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  border: 2px solid var(--ink-black);
  box-shadow: 2px 2px 0px var(--ink-black);
  min-width: 86px;
  flex-shrink: 0;
}
.health-score-card.score-healthy {
  background: #d4fedb;
  border-color: #0a5f22;
}
.health-score-card.score-warning {
  background: #fff0d1;
  border-color: #92580c;
}
.health-score-card.score-critical {
  background: #ffe2e6;
  border-color: #9f1239;
}

.score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.score-number {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink-black);
}
.score-denominator {
  font-size: 0.74rem;
  font-weight: 700;
  color: #604020;
}
.score-status-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
}

/* Real Metrics Grid */
.real-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}
.metric-chip {
  background: #fdfaf3;
  border: 1.5px solid #d9c5a3;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.metric-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.metric-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}
.metric-val {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2b1706;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-name {
  font-size: 0.65rem;
  color: #79522b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossier-section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #5a2e0a;
  margin: 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dossier-insights-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-card {
  background: #fbf8f0;
  border: 1.5px solid #dfcfb2;
  border-radius: 10px;
  padding: 10px 12px;
}

.insight-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.insight-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: #924510;
  text-transform: uppercase;
  font-family: 'Fredoka', sans-serif;
}

.insight-priority-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}
.insight-priority-badge.priority-high {
  background: #fee2e2;
  color: #b91c1c;
}
.insight-priority-badge.priority-medium {
  background: #fef3c7;
  color: #b45309;
}
.insight-priority-badge.priority-good {
  background: #dcfce7;
  color: #15803d;
}

.insight-tag {
  background: #eee3cf;
  color: #523a22;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
}

.insight-finding {
  font-size: 0.78rem;
  color: #3b220b;
  margin-bottom: 4px;
  line-height: 1.3;
}

.insight-action {
  font-size: 0.76rem;
  color: #573e27;
  line-height: 1.35;
}

.dossier-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* 3. GROWTH SPELLS ACCORDION */
.growth-spells-wrapper {
  color: var(--parchment-ink);
}

.spells-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.spell-card {
  background: #fff;
  border: 2px solid var(--parchment-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.spell-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  background: #fcf9f2;
}
.spell-card-top:hover {
  background: #f7f1e4;
}

.spell-badge-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spell-icon {
  font-size: 1.25rem;
}

.spell-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #3b220b;
}

.spell-cat {
  font-size: 0.7rem;
  color: #7e5934;
  display: block;
}

.spell-impact {
  background: var(--sanderson-green);
  color: var(--ink-black);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--ink-black);
}

.spell-card-body {
  display: none;
  padding: 12px;
  border-top: 1px solid #ebd9b8;
  background: #ffffff;
}

.spell-card.expanded .spell-card-body {
  display: block;
}

.spell-detail-item {
  margin-bottom: 8px;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #8c4710;
  text-transform: uppercase;
}

.detail-text,
.detail-example {
  font-size: 0.76rem;
  color: #4f361f;
  margin-top: 2px;
}

.formula-box {
  background: #f5ede0;
  border: 1px dashed #ad8755;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 3px;
  font-family: monospace;
  font-size: 0.78rem;
  color: #7b1fa2;
}

.copy-spell-btn {
  background: var(--winnie-orange);
  color: var(--ink-black);
  border: 1.5px solid var(--ink-black);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

/* 3. ALL-SEEING EYE ORACLE */
.oracle-input-area {
  margin: 14px 0;
}

.quill-input-box {
  display: flex;
  gap: 6px;
  width: 100%;
}

.oracle-input {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2.5px solid var(--parchment-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--ink-black);
  outline: none;
}
.oracle-input:focus {
  border-color: var(--winnie-orange-dark);
}

.oracle-btn {
  background: var(--winnie-orange);
  color: var(--ink-black);
  border: 2px solid var(--ink-black);
  border-radius: 10px;
  padding: 0 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--ink-black);
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.prompt-tag {
  font-size: 0.72rem;
  color: #785a3a;
  font-weight: 600;
}

.quick-btn {
  background: rgba(220, 195, 155, 0.4);
  border: 1.5px solid #c2a77b;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.74rem;
  color: #4b341f;
  cursor: pointer;
}
.quick-btn:hover {
  background: #e8d7bb;
}

.oracle-scroll-result {
  background: #fff;
  border: 2px solid var(--parchment-border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  min-height: 80px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.quill-feather {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.oracle-response-text {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.95rem;
  color: #3f220c;
  line-height: 1.4;
}

/* ==========================================================================
   SITE CURSES OVERLAYS
   ========================================================================== */

/* 1. Black Flame Candle Spotlight */
.curse-candle-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.curse-candle-overlay.active {
  opacity: 1;
}

/* 2. Salem Mist Canvas */
.curse-fog-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 990;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.curse-fog-canvas.active {
  opacity: 1;
}

/* 3. Floating Ghosts */
.curse-ghost-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 992;
  overflow: hidden;
}

.curse-ghost {
  position: absolute;
  width: 75px;
  height: 95px;
  animation: ghostAscend linear forwards;
  filter: drop-shadow(0 0 15px rgba(189, 52, 254, 0.6));
}

@keyframes ghostAscend {
  0% { transform: translateY(0) scale(0.6) rotate(-8deg); opacity: 0; }
  15% { opacity: 0.85; }
  50% { transform: translateY(-50vh) scale(1) rotate(8deg); }
  85% { opacity: 0.85; }
  100% { transform: translateY(-110vh) scale(1.2) rotate(-6deg); opacity: 0; }
}

/* 4. Bats Swarm */
.curse-bats-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 995;
  overflow: hidden;
}

.curse-bat {
  position: absolute;
  width: 50px;
  height: 30px;
  animation: batFlap linear forwards;
}

@keyframes batFlap {
  0% { transform: translate(0, 0) scale(var(--scale)); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(calc(var(--scale) * 1.3)); opacity: 0; }
}

/* ==========================================================================
   MODAL: CODE SNIPPET / EMBED DRAWER
   ========================================================================== */

.comic-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 7, 24, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.comic-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.comic-modal-window {
  background: var(--bg-card);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-glow);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  padding: 28px;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.comic-modal-backdrop.open .comic-modal-window {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #391c5c;
  color: #fff;
  border: 2px solid var(--ink-black);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0px var(--ink-black);
}

.modal-close-btn:hover {
  background: var(--winnie-orange);
  color: var(--ink-black);
}

.code-preview-block {
  background: #140b20;
  border: 2px solid var(--ink-black);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #8affc1;
  overflow-x: auto;
  line-height: 1.4;
}

/* Mascot Easter Egg Companion in Corner - Fixed to Bottom-Right & Mobile Optimized */
.mascot-companion-corner {
  position: fixed;
  bottom: 18px;
  right: 20px;
  left: auto;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.companion-img-wrapper {
  width: 76px;
  height: 98px;
  cursor: pointer;
  filter: drop-shadow(4px 4px 0px var(--ink-black));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  flex-shrink: 0;
}

.companion-img-wrapper:hover {
  transform: scale(1.08) rotate(-4deg);
}

.companion-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.companion-dismiss-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-black);
  color: #fff;
  border: 1.5px solid var(--winnie-orange);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  padding: 0;
  z-index: 2;
}

.companion-img-wrapper:hover .companion-dismiss-btn {
  opacity: 1;
}

.companion-dismiss-btn:hover {
  transform: scale(1.15);
  background: #ff3344;
  border-color: #fff;
}

.companion-bubble {
  background: #fff;
  color: var(--ink-black);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow-sm);
  border-radius: 14px;
  padding: 8px 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 190px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  position: relative;
}

/* Arrow points to the right towards Winnie */
.companion-bubble::before {
  content: '';
  position: absolute;
  bottom: 14px;
  right: -9px;
  border-width: 6px 0 6px 9px;
  border-style: solid;
  border-color: transparent transparent transparent var(--ink-black);
}

.companion-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hp-book.is-open {
    transform: translateX(0);
  }
  .hp-book.is-open .hp-book-cover {
    transform: rotateY(-180deg) translateZ(-20px);
    opacity: 0;
    pointer-events: none;
  }
}

/* Remove hover-only candle curse on mobile and touch devices */
@media (max-width: 768px), (hover: none) {
  #curseCandleBtn {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .main-stage {
    padding-bottom: 80px;
  }
  .book-stage-controls {
    margin-bottom: 12px;
  }
  .hint-pill {
    cursor: pointer;
    touch-action: manipulation;
    padding: 7px 14px;
    border-radius: 999px;
    transition: transform 0.15s ease, background 0.2s ease;
    margin: 0 auto 10px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(33, 14, 57, 0.9);
    border: 1.5px solid rgba(255, 122, 0, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  .hint-pill:active {
    transform: scale(0.96);
    background: rgba(55, 25, 95, 1);
  }
  .mascot-companion-corner {
    bottom: 12px;
    right: 12px;
    gap: 8px;
    z-index: 999;
  }
  .companion-img-wrapper {
    width: 50px;
    height: 66px;
  }
  .companion-dismiss-btn {
    opacity: 0.85;
    width: 20px;
    height: 20px;
    font-size: 13px;
  }
  .companion-bubble {
    max-width: 150px;
    font-size: 0.74rem;
    padding: 6px 9px;
  }
}

@media (max-width: 480px) {
  .mascot-companion-corner {
    bottom: 10px;
    right: 10px;
  }
  .companion-img-wrapper {
    width: 44px;
    height: 58px;
  }
}

/* ==========================================================================
   CUP O CODE SERVICE CTA COMPONENTS
   ========================================================================== */



/* 2. Grimoire Audit Dossier CTA */
.dossier-cupocode-cta {
  background: linear-gradient(135deg, #27123d 0%, #3e1963 100%);
  border: 2px solid var(--ink-black);
  box-shadow: 4px 4px 0px rgba(20, 13, 28, 0.45);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.dossier-cupocode-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  bottom: 0;
  background: var(--sanderson-green);
}

.cta-inner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 211, 77, 0.16);
  border: 1.5px solid var(--sanderson-green);
  border-radius: 999px;
  padding: 2px 10px;
  width: fit-content;
  margin-bottom: 4px;
}

.cta-coffee-icon {
  font-size: 0.9rem;
}

.cta-badge-text {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--sanderson-green);
  text-transform: uppercase;
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.5px;
}

.cta-dossier-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  color: #fff;
  margin: 4px 0;
  line-height: 1.25;
}

.cta-dossier-copy {
  font-size: 0.8rem;
  color: #ebdffc;
  line-height: 1.45;
  margin-bottom: 10px;
}

.cta-dossier-copy strong {
  color: #fff;
  font-weight: 700;
}

.cta-dossier-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-dossier-btn {
  text-decoration: none;
  font-size: 0.88rem;
  padding: 8px 16px;
  box-shadow: 3px 3px 0px var(--ink-black);
}

.cta-domain-hint {
  font-size: 0.78rem;
  color: #cfbfeb;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}

/* 3. Audit Ready State Callout */
.audit-ready-cupocode-cta {
  margin-top: 14px;
  padding: 10px 14px;
  background: #ece3cf;
  border: 1.5px dashed #bba47f;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: #3b220b;
  flex-wrap: wrap;
}

.ready-cta-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ready-cta-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

.ready-cta-text strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
  color: #2b1f14;
}

.ready-cta-text span {
  font-size: 0.75rem;
  color: #5c4530;
}

.ready-cta-link {
  color: #b45309;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  transition: color 0.15s ease;
}

.ready-cta-link:hover {
  color: #853703;
}

/* 3. Site Footer with CTA Across the Bottom */
.site-footer {
  margin-top: 60px;
  position: relative;
  z-index: 10;
  border-top: var(--comic-border);
  background: rgba(18, 9, 31, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  transition: padding-right 0.2s ease;
}

@media (min-width: 900px) {
  .footer-inner {
    padding-right: 110px;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding-bottom: 95px;
    margin-top: 35px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 14px;
    padding-right: 0;
  }
  .footer-brand-lockup {
    justify-content: center;
    text-align: center;
  }
  .footer-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-icon {
  font-size: 1.8rem;
  filter: drop-shadow(2px 2px 0px var(--ink-black));
}

.footer-copy {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.3px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: #d1bfe8;
}

.footer-cta-btn {
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 20px;
  font-weight: 700;
}


