/* ==========================================================================
   Web Architect Guide — Shared Design System
   DNA: Teko / Roboto Condensed / Noto Sans JP
   Palette: Indigo #5c6bc0, Deep #3949ab, bg #f0f4f8, dots #dfe9f3
   ========================================================================== */

:root {
  --bg-body: #f0f4f8;
  --bg-card: #ffffff;
  --text-main: #2d3436;
  --text-sub: #636e72;
  --accent: #5c6bc0;
  --accent-dark: #3949ab;
  --accent-light: #9fa8da;
  --accent-bg: #f0f4ff;
  --danger: #e53935;
  --danger-bg: #ffebee;
  --success: #43a047;
  --success-bg: #e8f5e9;
  --warning: #ff9800;
  --warning-bg: #fff3e0;
  --gold: #c5a059;
  --shadow: 0 8px 30px rgba(92, 107, 192, 0.15);
  --shadow: 0 8px 30px rgba(92, 107, 192, 0.15);
  --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
}

/* ===== 3D PAGE FLIP TRANSITION ===== */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-body);
  z-index: 10000;
  pointer-events: none;
  transform-style: preserve-3d;
  perspective: 2000px;
  visibility: hidden;
}

.page-transition-page {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50vw;
  height: 100vh;
  background: #fff;
  transform-origin: left center;
  box-shadow: inset 20px 0 50px rgba(0, 0, 0, 0.05), -10px 0 30px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  transform: rotateY(0deg);
}

.page-transition-overlay.is-active-next {
  visibility: visible;
}

.page-transition-overlay.is-active-next .page-transition-page {
  animation: flipNextOut 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

.page-transition-overlay.is-active-prev {
  visibility: visible;
}

.page-transition-overlay.is-active-prev .page-transition-page {
  left: 0;
  transform-origin: right center;
  transform: rotateY(-180deg);
  animation: flipPrevOut 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

body.entering-next .page-transition-overlay {
  visibility: visible;
}

body.entering-next .page-transition-page {
  left: 50%;
  transform-origin: left center;
  transform: rotateY(180deg);
  animation: flipNextIn 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

body.entering-prev .page-transition-overlay {
  visibility: visible;
}

body.entering-prev .page-transition-page {
  left: 0;
  transform-origin: right center;
  transform: rotateY(0deg);
  animation: flipPrevIn 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

@keyframes flipNextOut {
  0% {
    transform: rotateY(0deg);
  }

  100% {
    transform: rotateY(-180deg);
  }
}

@keyframes flipNextIn {
  0% {
    transform: rotateY(180deg);
    opacity: 1;
  }

  99% {
    transform: rotateY(0deg);
    opacity: 1;
  }

  100% {
    transform: rotateY(0deg);
    opacity: 0;
  }
}

@keyframes flipPrevOut {
  0% {
    transform: rotateY(-180deg);
  }

  100% {
    transform: rotateY(0deg);
  }
}

@keyframes flipPrevIn {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }

  99% {
    transform: rotateY(-180deg);
    opacity: 1;
  }

  100% {
    transform: rotateY(-180deg);
    opacity: 0;
  }
}

/* ===== SMOOTH SCROLL WRAPPER ===== */
.smooth-scroll-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  will-change: transform;
}

/* ===== SOUND TOGGLE BUTTON ===== */
#soundToggleBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-light);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10000;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

#soundToggleBtn:hover {
  transform: scale(1.1);
  background: var(--accent-bg);
  color: var(--accent-dark);
}

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

/* ===== ULTIMATE MAGICAL BOOK LOADER ===== */
.ultimate-book-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  perspective: 2500px;
  background: var(--bg-body);
  pointer-events: none;
  animation: fadeLoader 0.5s 2.0s forwards;
}

.ub-left-half {
  width: 50%;
  height: 100%;
  background: #fff;
  border-right: 1px solid #ddd;
  box-shadow: inset -20px 0 50px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

.ub-right-half {
  width: 50%;
  height: 100%;
  position: relative;
  transform-origin: left center;
  transform-style: preserve-3d;
  animation: openThickBook 1.8s cubic-bezier(0.85, 0, 0.15, 1) 0.2s forwards;
  z-index: 2;
}

.ub-cover-front,
.ub-page-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.ub-cover-front {
  background: linear-gradient(135deg, #1a1e29, #2c3245);
  border-left: 20px solid #11141c;
  /* Spine thickness */
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5), inset 5px 0 15px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ub-cover-texture {
  position: absolute;
  inset: 15px;
  border: 4px solid var(--gold);
  border-radius: 4px;
  opacity: 0.8;
}

.ub-cover-title {
  color: var(--gold);
  font-family: "Teko", sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
}

.ub-page-inner {
  background: #fff;
  transform: rotateY(180deg);
  box-shadow: inset 30px 0 50px rgba(0, 0, 0, 0.08);
}

@keyframes openThickBook {
  0% {
    transform: rotateY(0deg) translateZ(0);
  }

  100% {
    transform: rotateY(-180deg) translateZ(0);
  }
}

@keyframes fadeLoader {
  0% {
    opacity: 1;
    pointer-events: auto;
  }

  100% {
    opacity: 0;
    pointer-events: none;
    display: none;
  }
}

body {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 2.0;
  margin: 0;
  padding: 40px 20px;
  background-image: radial-gradient(#dfe9f3 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-family: "Teko", sans-serif;
  font-size: clamp(3rem, 8vw, 5rem);
  margin: 0;
  line-height: 1.25;
  padding: 0.1em 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h2 {
  font-size: 2.5rem;
  margin: 80px 0 40px;
  font-family: "Teko", sans-serif;
  color: #000;
  border-bottom: 3px solid #eee;
  padding-bottom: 10px;
  line-height: 1;
}

h2 span {
  color: var(--accent);
  margin-right: 15px;
  font-size: 3rem;
}

h3 {
  font-size: 1.4rem;
  margin: 40px 0 20px;
  border-left: 6px solid var(--accent);
  padding-left: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

p {
  font-size: 1.05rem;
  margin-bottom: 2em;
  text-align: justify;
  color: #455a64;
}

strong {
  background: linear-gradient(transparent 60%, #fff9c4 60%);
  padding: 0 4px;
  font-weight: 900;
  color: var(--text-main);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.content {
  padding: 60px 40px;
}

/* ===== HERO (Black Gradient) ===== */
.hero {
  background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
  color: #fff;
  padding: 100px 40px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.tag-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 5px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "Teko", sans-serif;
  display: inline-block;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.2rem;
  margin-top: 20px;
  font-weight: bold;
  color: #b2bec3;
}

/* ===== LEARNING OBJECTIVES ===== */
.learning-objectives {
  background: #e3f2fd;
  border-left: 5px solid #4285f4;
  padding: 20px 25px;
  margin-bottom: 40px;
  border-radius: 8px;
}

.learning-objectives h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #1565c0;
  font-size: 1.1rem;
}

.learning-objectives ul {
  margin: 0;
  padding-left: 20px;
  color: #455a64;
  line-height: 2.2;
}

/* ===== SPECIAL BOXES ===== */
.box {
  padding: 30px;
  border-radius: var(--radius);
  margin: 40px 0;
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.story-box {
  background-color: #fff;
  border-left: 4px solid var(--gold);
  font-style: italic;
  position: relative;
  padding: 30px;
  border-radius: 8px;
  margin: 40px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.story-box::before {
  content: "STORY";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--gold);
  color: #fff;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 4px;
}

.metaphor-box {
  background-color: #e0f7fa;
  border: 1px solid #b2ebf2;
  padding: 25px;
  border-radius: 8px;
  margin: 30px 0;
  position: relative;
}

.metaphor-box::after {
  content: "MECHANISM";
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: #fff;
  padding: 5px 15px;
  font-size: 0.8rem;
  border-bottom-left-radius: 8px;
}

.danger-box {
  background-color: var(--danger-bg);
  border: 2px solid #ef9a9a;
  color: #c62828;
  padding: 30px;
  border-radius: 8px;
  margin: 40px 0;
}

.danger-box h3 {
  color: #b71c1c;
  border: none;
  padding-left: 0;
}

.success-box {
  background-color: var(--success-bg);
  border: 2px solid #a5d6a7;
  color: #2e7d32;
  padding: 30px;
  border-radius: 8px;
  margin: 40px 0;
}

.tip-box {
  background: var(--accent-bg);
  border-left: 5px solid var(--accent);
  padding: 25px;
  border-radius: 8px;
  margin: 30px 0;
}

/* ===== GRID LAYOUTS ===== */
.col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

.col-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

/* ===== ROLE CARDS (Personas) ===== */
.role-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  border: 1px solid #eee;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.role-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
}

.role-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.role-card h4 {
  font-family: "Teko", sans-serif;
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--text-main);
}

.role-card p {
  font-size: 0.95rem;
  text-align: center;
}

/* ===== COMPARISON (Before/After) ===== */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

.compare-panel {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 300px;
}

.compare-header {
  padding: 15px 20px;
  font-family: "Teko", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.compare-body {
  padding: 25px;
}

.panel-before {
  background: #fff;
  border: 2px solid #ef9a9a;
}

.panel-before .compare-header {
  background: #ffcdd2;
  color: #b71c1c;
}

.panel-after {
  background: #0f172a;
  color: #e2e8f0;
  border: 2px solid #1e293b;
}

.panel-after .compare-header {
  background: #1e293b;
  color: #38bdf8;
}

.error-line {
  background: #fff;
  border-left: 4px solid var(--danger);
  padding: 10px 15px;
  margin-bottom: 10px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both infinite;
  border-radius: 4px;
}

.error-line:nth-child(2) {
  animation-delay: 0.2s;
  animation-duration: 0.7s;
}

.error-line:nth-child(3) {
  animation-delay: 0.4s;
  animation-duration: 0.6s;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}

.terminal-line {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(10px);
  animation: termFade 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-line:nth-child(1) {
  animation-delay: 0.5s;
}

.terminal-line:nth-child(2) {
  animation-delay: 1.2s;
  color: #34d399;
}

.terminal-line:nth-child(3) {
  animation-delay: 1.8s;
  color: #34d399;
}

.terminal-line:nth-child(4) {
  animation-delay: 2.4s;
  color: #34d399;
}

.terminal-line:nth-child(5) {
  animation-delay: 3.0s;
  color: #34d399;
}

.terminal-line:nth-child(6) {
  animation-delay: 3.8s;
  color: #38bdf8;
  font-weight: bold;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #38bdf8;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes termFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ===== CODE BOX & COPY ===== */
.code-box {
  background: #2d3436;
  color: #dfe6e9;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  margin: 20px 0;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.code-box::before {
  content: "PROMPT";
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  font-size: 0.7rem;
  border-radius: 4px;
  font-weight: bold;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  font-family: "Roboto Condensed", sans-serif;
}

.copy-btn:hover {
  background: var(--accent);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(92, 107, 192, 0.2);
  border: none;
  cursor: pointer;
  font-family: "Noto Sans JP", sans-serif;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
  box-shadow: 0 6px 12px rgba(57, 73, 171, 0.3);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-lg {
  padding: 20px 40px;
  font-size: 1.2rem;
  border-radius: 14px;
}

/* ===== STEP LIST ===== */
.step-list {
  list-style: none;
  padding: 0;
}

.step-list li {
  background: #fff;
  margin-bottom: 15px;
  padding: 20px 25px;
  border-left: 5px solid var(--accent);
  display: flex;
  align-items: flex-start;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-radius: 0 8px 8px 0;
  gap: 15px;
}

.step-num {
  font-family: "Teko", sans-serif;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  min-width: 40px;
  line-height: 1;
}

.step-text {
  flex: 1;
}

.step-text h4 {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.step-text p {
  margin: 0;
  font-size: 0.95rem;
}

/* ===== QUEST CARDS (Portal) ===== */
.quest-list-container {
  position: relative;
  display: flex;
  flex-direction: column;
}

.quest-list-track {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 55px;
  width: 4px;
  background: #eceff1;
  z-index: 0;
}

.quest-list-progress {
  position: absolute;
  top: 30px;
  left: 55px;
  width: 4px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
  z-index: 1;
  transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  height: 0%;
}

.quest-card {
  display: flex;
  gap: 20px;
  padding: 25px;
  border: 2px solid #eee;
  border-radius: var(--radius);
  margin-bottom: 20px;
  transition: all 0.2s;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  position: relative;
  z-index: 2;
}

.quest-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transform: translateX(5px);
}

.quest-num {
  background: var(--accent-bg);
  color: var(--accent);
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: "Teko", sans-serif;
  line-height: 1;
}

.quest-num .qn-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.quest-num .qn-val {
  font-size: 2rem;
  font-weight: 700;
}

.quest-info {
  flex: 1;
}

.quest-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.quest-info h4 {
  margin: 0;
  font-size: 1.1rem;
}

.quest-info p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.quest-badge {
  font-family: "Teko", sans-serif;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-clear {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-active {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-locked {
  background: #eceff1;
  color: #90a4ae;
  border: 1px solid #cfd8dc;
}

/* ===== EXP DASHBOARD ===== */
.status-dashboard {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(92, 107, 192, 0.1);
  border: 2px solid var(--accent-light);
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.status-dashboard::after {
  content: "";
  position: absolute;
  top: 0;
  right: -50px;
  width: 150px;
  height: 150px;
  background: var(--accent-bg);
  border-radius: 50%;
  z-index: 0;
  opacity: 0.5;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
}

.player-level {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-level span {
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 700;
  background: #e3f2fd;
  padding: 4px 12px;
  border-radius: 20px;
}

.exp-text {
  font-family: "Teko", sans-serif;
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
}

.exp-track {
  width: 100%;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #64b5f6, var(--accent));
  width: 0%;
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.exp-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ===== REWARD BOX (Gamification) ===== */
.reward-box {
  background: radial-gradient(circle at center, #fffde7 0%, #fff8e1 100%);
  border: 3px dashed var(--gold);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  margin-top: 50px;
  box-shadow: 0 10px 30px rgba(255, 193, 7, 0.15);
  animation: float 4s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reward-icon {
  font-size: 4rem;
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
}

.reward-exp {
  display: inline-block;
  background: linear-gradient(45deg, var(--gold), #ffb300);
  color: #fff;
  padding: 5px 25px;
  border-radius: 30px;
  font-weight: bold;
  font-family: "Teko", sans-serif;
  font-size: 1.8rem;
  margin: 15px 0 25px;
  letter-spacing: 2px;
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* ===== INTERACTIVE FLOW DIAGRAMS ===== */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  overflow-x: auto;
  padding: 20px 0;
}

.flow-node {
  background: #fff;
  border: 3px solid;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  font-weight: 700;
  min-width: 140px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.flow-node:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.flow-node i {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.flow-arrow {
  font-size: 2rem;
  color: var(--accent-light);
  animation: pulseArrow 1.5s infinite;
}

@keyframes pulseArrow {

  0%,
  100% {
    transform: translateX(0);
    opacity: 0.7;
  }

  50% {
    transform: translateX(5px);
    opacity: 1;
    color: var(--accent);
  }
}

/* ===== SHAKE ANIMATION FOR LOCKED QUESTS ===== */
.quest-card.shaking {
  animation: lockedShake 0.5s;
  border-color: var(--danger) !important;
  box-shadow: 0 0 15px rgba(229, 57, 53, 0.2);
}

.quest-card.shaking .quest-badge {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

@keyframes lockedShake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-6px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(6px);
  }
}

/* ===== ACCORDION (FAQ) ===== */
.accordion-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  padding: 20px 25px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--accent-bg);
}

.accordion-header::after {
  content: "+";
  font-family: "Teko", sans-serif;
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.3s;
}

.accordion-item.open .accordion-header::after {
  content: "−";
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 25px;
}

.accordion-body-inner {
  padding: 0 0 20px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3436;
  color: #fff;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 500;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-size: 0.95rem;
}

.toast.show {
  bottom: 40px;
}

/* ===== SUPPORT ENGINE ===== */
.support-area {
  background: var(--accent-bg);
  padding: 40px;
  border-radius: var(--radius);
  margin-top: 60px;
}

.support-textarea {
  width: 100%;
  height: 140px;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s;
  background: #fff;
}

.support-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
}

/* ===== FLOW DIAGRAM (SVG Based) ===== */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.flow-node {
  background: #fff;
  border: 2px solid var(--accent-light);
  border-radius: 12px;
  padding: 15px 25px;
  text-align: center;
  font-weight: 700;
  min-width: 120px;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--accent);
}

/* ===== NAV BAR (back link) ===== */
.nav-bar {
  max-width: 960px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-back:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

/* ===== FOOTER ===== */
.page-footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  font-size: 0.85rem;
  color: #90a4ae;
}

/* ===== MAGIC SPARKLES (Copy Success) ===== */
.magic-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFly 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  z-index: 10000;
  box-shadow: 0 0 10px var(--gold), 0 0 20px #fff;
}

@keyframes sparkleFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ===== PROMPT SIMULATOR (Drag & Drop) ===== */
.prompt-simulator {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  margin: 40px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.simulator-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.ingredient-pill {
  background: var(--bg-body);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: grab;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  border: 1px solid #ddd;
}

.ingredient-pill:active {
  cursor: grabbing;
}

.ingredient-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.ingredient-pill.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.simulator-cauldron {
  min-height: 150px;
  background: #1a1e29;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 4px dashed #3a4259;
  transition: all 0.3s;
  position: relative;
}

.simulator-cauldron.drag-over {
  background: #232836;
  border-color: var(--gold);
}

.cauldron-placeholder {
  color: #5c6bc0;
  text-align: center;
  margin: auto;
  font-family: "Teko", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 2px;
  pointer-events: none;
}

.simulator-cauldron .ingredient-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  cursor: default;
  transform: none;
}

.simulator-result {
  margin-top: 20px;
  display: none;
  animation: fadeIn 0.5s forwards;
}

.simulator-result.show {
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    padding: 60px 20px;
  }

  h1 {
    font-size: 3rem;
  }

  .content {
    padding: 30px 20px;
  }

  .col-2,
  .col-3,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .quest-card {
    flex-direction: column;
    text-align: center;
  }

  .quest-list-track,
  .quest-list-progress {
    display: none;
  }
}

/* ===== GAMIFICATION: CONFETTI ===== */
.confetti {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg) translateZ(0);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(720deg) translateZ(0);
    opacity: 0;
  }
}