/* ============================
   Explorastory — Custom Styles
   Parchment & Storytelling Theme
   ============================ */

/* ============================
   DESIGN TOKENS
   ============================ */
:root {
  /* Parchment palette */
  --color-parchment:       #f5e6c8;
  --color-parchment-mid:   #eddebb;
  --color-parchment-dark:  #c9a86c;   /* borders, dividers, accent */
  --color-parchment-deep:  #b8945a;   /* deeper accent */

  /* Ink palette */
  --color-ink:             #2c1a0e;   /* main text */
  --color-ink-muted:       #5a3a22;   /* secondary / muted text */

  /* Forest green — primary CTA */
  --color-primary:         #3d6b4f;
  --color-primary-dark:    #2d5039;
  --color-primary-soft:    #e0ede5;

  /* Warm amber accent */
  --color-warning:         #c17f24;
  --color-warning-soft:    #fdf0d5;

  /* Teal info */
  --color-info:            #4a7c8a;
  --color-info-soft:       #e0f0f3;

  /* Dark (ink, footer) */
  --color-dark:            #2c1a0e;

  /* Parchment texture — white wash overlay to lighten */
  --parchment-wash: rgba(255, 255, 255, 0.3);
  --parchment-img: linear-gradient(var(--parchment-wash), var(--parchment-wash)),
                   url("../images/thematic_images/parchment.040e5ce9359b.webp");
}

/* ============================
   GLOBAL BASE
   ============================ */
body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  color: var(--color-ink);
  background-color: var(--color-parchment);
  background-image: var(--parchment-img);
  background-repeat: repeat;
  background-size: 400px 400px;
}

h1, h2, h3, h4, h5 {
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
  color: var(--color-ink);
}

/* Restore white headings on dark/green backgrounds */
.htp-hero h1, .htp-hero h2, .htp-hero h3, .htp-hero h4, .htp-hero h5,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5 {
  color: #fff;
}

/* ============================
   BOOTSTRAP COLOR OVERRIDES
   ============================ */
.text-muted   { color: var(--color-ink-muted) !important; }
.text-dark    { color: var(--color-ink) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-primary) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info    { color: var(--color-info) !important; }
.text-purple  { color: #6f42c1 !important; }
.text-green   { color: #1e7e34 !important; }

/* ---- Background utilities ---- */
.bg-white {
  background-color: #fffef9 !important;
  background-image: none !important;
}

.bg-light {
  background-color: var(--color-parchment-mid) !important;
  background-image: var(--parchment-img);
  background-repeat: repeat;
  background-size: 400px 400px;
}

.bg-primary,
.btn-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

.bg-primary-soft { background-color: var(--color-primary-soft) !important; }
.bg-warning-soft { background-color: var(--color-warning-soft) !important; }
.bg-info-soft    { background-color: var(--color-info-soft) !important; }
.bg-purple-soft  { background-color: rgba(111, 66, 193, 0.12) !important; }
.bg-green-soft   { background-color: rgba(40, 167, 69, 0.12) !important; }

/* ---- Badge pill colors ---- */
.badge.bg-primary-soft { color: var(--color-primary); }
.badge.bg-warning-soft { color: #7c5a00; }
.badge.bg-info-soft    { color: #0b7285; }
.badge.bg-purple-soft  { color: #6f42c1; }
.badge.bg-green-soft   { color: #1e7e34; }

/* ---- Borders ---- */
.border-top    { border-top-color: var(--color-parchment-dark) !important; }
.border-bottom { border-bottom-color: var(--color-parchment-dark) !important; }
hr             { border-color: var(--color-parchment-dark) !important; opacity: 0.5; }

/* ---- Outline button ---- */
.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---- Form controls ---- */
.form-control {
  background-color: rgba(255, 248, 230, 0.85);
  border-color: var(--color-parchment-dark);
  color: var(--color-ink);
}
.form-control::placeholder {
  color: var(--color-ink-muted);
  opacity: 0.75;
}
.form-control:focus {
  background-color: #fffaed;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(61, 107, 79, 0.2);
  color: var(--color-ink);
}

/* ============================
   NAVBAR
   ============================ */
.navbar {
  background-color: var(--color-parchment) !important;
  background-image: var(--parchment-img);
  background-repeat: repeat;
  background-size: 400px 400px;
  border-bottom: 1px solid var(--color-parchment-dark);
  box-shadow: 0 1px 8px rgba(44, 26, 14, 0.12) !important;
}

.navbar-brand span {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--color-ink) !important;
  letter-spacing: 0.03em;
}

.navbar-light .navbar-nav .nav-link {
  color: var(--color-ink);
  font-weight: 600;
}
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
  color: var(--color-primary);
}

.logo-placeholder {
  width: 40px;
  height: 40px;
  background-color: var(--color-primary);
}
.logo-placeholder-sm {
  width: 28px;
  height: 28px;
  background-color: var(--color-primary);
}

/* ============================
   HERO SECTION
   ============================ */
.hero-section {
  background-color: var(--color-parchment);
  background-image: var(--parchment-img);
  background-repeat: repeat;
  background-size: 400px 400px;
  padding: 2.5rem 0 3rem;
}

/* ============================
   HERO CARD FAN
   ============================ */
.hero-title-group {
  max-width: 900px;
  height: 310px;
  position: relative;
  margin-bottom: 0.25rem;
}

.hero-fan {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 280px;
  pointer-events: none;
}

.fan-card {
  position: absolute;
  width: 155px;
  bottom: 0;
  left: 50%;
  margin-left: -77px;
  transform-origin: bottom center;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(44, 26, 14, 0.32);
}

.fan-card-1 { transform: rotate(-30deg); z-index: 1; }
.fan-card-2 { transform: rotate(-15deg); z-index: 2; }
.fan-card-3 { transform: rotate(0deg);   z-index: 3; }
.fan-card-4 { transform: rotate(15deg);  z-index: 2; }
.fan-card-5 { transform: rotate(30deg);  z-index: 1; }

.hero-game-title {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  font-size: clamp(3.2rem, 8.5vw, 6.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  z-index: 10;
  color: var(--color-ink);
  font-family: 'Cinzel', Georgia, serif;
  text-shadow:
    0 0 32px rgba(245, 230, 200, 1),
    0 0 64px rgba(245, 230, 200, 0.95),
    0 2px 8px rgba(245, 230, 200, 0.9);
}

.hero-tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
  font-family: 'Cinzel', Georgia, serif;
  text-shadow:
    0 0 24px rgba(245, 230, 200, 1),
    0 0 48px rgba(245, 230, 200, 0.95),
    0 0 72px rgba(245, 230, 200, 0.85);
}

/* ============================
   STAT PILLS BANNER
   ============================ */
.stat-pill-col {
  padding: 1rem 0.5rem;
}

.stat-pill-col-mid {
  border-left: 1px solid var(--color-parchment-dark);
  border-right: 1px solid var(--color-parchment-dark);
}

.stat-pill-icon {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.stat-pill-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.2;
  font-family: 'Cinzel', Georgia, serif;
}

.stat-pill-label {
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  margin-top: 0.15rem;
}

/* ============================
   SECTION SPACING
   ============================ */
.py-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* ============================
   HOW IT WORKS — STEP NUMBERS
   ============================ */
.step-number {
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2rem;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle       { width: 72px; height: 72px; }
.feature-icon      { width: 48px; height: 48px; flex-shrink: 0; }
.avatar-placeholder { width: 44px; height: 44px; flex-shrink: 0; font-size: 0.8rem; }

/* ============================
   HERO FORM — INPUT FOCUS
   ============================ */
.hero-form .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(61, 107, 79, 0.2);
}

/* ============================
   TILE MOSAIC
   ============================ */
.tile-mosaic {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-row {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.tile-img {
  width: calc(33.333% - 2px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 5px !important;
}

.tile-showcase-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ============================
   CHARACTER CARDS
   ============================ */
.character-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(44, 26, 14, 0.15) !important;
}

.character-deck-img {
  width: 100%;
  aspect-ratio: 62 / 107;
  object-fit: cover;
  display: block;
}

/* ============================
   CHARACTER CARD ROW (Play Together)
   ============================ */
.char-card-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: visible;
}

.char-card-item {
  flex-shrink: 0;
  text-align: center;
  position: relative;
  transition: transform 0.25s ease;
  z-index: 1;
  cursor: pointer;
}

.char-card-item + .char-card-item {
  margin-left: -22px;
}

.char-card-item:hover {
  transform: translateY(-8px) scale(1.6);
  z-index: 20;
}

.char-card-item:hover .char-portrait {
  box-shadow: 0 16px 40px rgba(44, 26, 14, 0.4);
}

.char-portrait {
  width: 105px;
  aspect-ratio: 62 / 107;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(44, 26, 14, 0.22);
  border: 3px solid var(--color-parchment);
  display: block;
}

.char-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-ink-muted);
  margin-top: 0.4rem;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.04em;
}

/* ============================
   STORY COMBO BOARD
   ============================ */
.story-combo-board {
  background: #1a0f07;
}

.story-card-overlay {
  position: absolute;
  top: 0;
  transition: transform 0.25s ease;
  cursor: pointer;
  z-index: 5;
}

.story-card-overlay:hover {
  transform: scale(1.5) translateY(-10%);
  z-index: 30;
}

.story-card-label {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--color-parchment);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  font-family: 'Cinzel', Georgia, serif;
}

.story-card-label-win {
  color: #ffd43b;
}

.story-step-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 0.9rem;
}

/* ============================
   TOKEN IMAGES
   ============================ */
.token-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* ============================
   ADVENTURE CARD IMAGES
   ============================ */
.adv-card-img {
  width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ============================
   SETUP STEP BADGES
   ============================ */
.setup-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ============================
   HOW-TO-PLAY HERO
   ============================ */
.htp-hero {
  background: linear-gradient(135deg, #3d6b4f 0%, #2b4f3a 100%);
}

.btn-white {
  background-color: var(--color-parchment);
  border-color: var(--color-parchment-dark);
  color: var(--color-ink);
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.04em;
}
.btn-white:hover {
  background-color: var(--color-parchment-mid);
  border-color: var(--color-parchment-dark);
  color: var(--color-ink);
}

/* ============================
   SUBNAV SCROLLBAR HIDE
   ============================ */
.htp-subnav { scrollbar-width: none; }
.htp-subnav::-webkit-scrollbar { display: none; }

/* ============================
   OBJECTIVE ARC (How-to-Play Goal section)
   ============================ */
.objective-arc {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.objective-step {
  flex: 0 0 200px;
  text-align: center;
  position: relative;
}

.objective-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin: 0 auto 0.75rem;
  font-family: 'Cinzel', Georgia, serif;
}

.objective-card-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.25s ease;
  cursor: pointer;
}

.objective-card-img:hover {
  transform: scale(1.06) translateY(-5px);
}

.objective-label {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  font-family: 'Cinzel', Georgia, serif;
}

.objective-label-win {
  color: var(--color-warning);
}

.objective-desc {
  font-size: 0.82rem;
  color: var(--color-ink-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
}

.turn-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  font-family: 'Cinzel', Georgia, serif;
}

.objective-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 2rem;
  color: var(--color-parchment-dark);
  opacity: 0.7;
  padding-bottom: 3rem;
}

@media (max-width: 767.98px) {
  .objective-arc {
    flex-direction: column;
    align-items: center;
  }
  .objective-arrow {
    transform: rotate(90deg);
    padding-bottom: 0;
  }
}

/* ============================
   STORY ARC FLOW (How-to-Play)
   ============================ */
.story-arc-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.story-arc-card {
  flex: 0 0 220px;
  text-align: center;
}

.story-arc-card img {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.25s ease;
  cursor: pointer;
}

.story-arc-card img:hover {
  transform: scale(1.08) translateY(-6px);
}

.story-arc-label {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  font-family: 'Cinzel', Georgia, serif;
}

.story-arc-label-win {
  color: var(--color-warning);
}

.story-arc-desc {
  font-size: 0.82rem;
  color: var(--color-ink-muted);
  margin-top: 0.3rem;
}

.story-arc-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 2rem;
  color: var(--color-parchment-dark);
  opacity: 0.7;
  padding-bottom: 2.5rem;
}

@media (max-width: 767.98px) {
  .story-arc-flow {
    flex-direction: column;
    align-items: center;
  }
  .story-arc-arrow {
    transform: rotate(90deg);
    padding-bottom: 0;
  }
}

/* ============================
   FOOTER
   ============================ */
footer.bg-dark {
  background-color: #1a0f07 !important;
  background-image: none !important;
}

footer .border-secondary {
  border-color: rgba(201, 168, 110, 0.25) !important;
}

/* ============================
   RESPONSIVE TWEAKS
   ============================ */
@media (max-width: 767.98px) {
  .hero-section {
    padding: 2rem 0 2.5rem;
  }

  .hero-title-group {
    height: 220px;
  }

  .hero-fan {
    width: 380px;
    height: 190px;
  }

  .fan-card {
    width: 95px;
    margin-left: -47px;
  }

  .fan-card-1 { transform: rotate(-28deg); z-index: 1; }
  .fan-card-2 { transform: rotate(-14deg); z-index: 2; }
  .fan-card-3 { transform: rotate(0deg);   z-index: 3; }
  .fan-card-4 { transform: rotate(14deg);  z-index: 2; }
  .fan-card-5 { transform: rotate(28deg);  z-index: 1; }

  .hero-stats {
    gap: 1.1rem;
  }
}
