/* ==============================
   LANDING PAGE
============================== */

#landing {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  z-index: 10000;
  transition: opacity 1s ease;
}

.landing-astro-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.landing-astro-logo img {
  height: 55px;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.4));
}

@media(max-width: 768px) {
  .landing-astro-logo img {
    height: 45px;
  }
}

.landing-bg {
  position: absolute;
  inset: 0;
  background: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/background1.png') center/cover no-repeat;
  z-index: -2;
  animation: zoomBg 25s ease-in-out forwards;
}

#landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

/* Landing content */
.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rainbow-box {
  width: 320px;
  height: 72px;
  background: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/sabah_text.png') center/contain no-repeat;
  animation: fadeInDown 1.2s ease forwards;
}

.rainbow-box .rainbow-text {
  display: none;
}

/* Title */
.main-title {
  width: 720px;
  height: 220px;
  margin: 2rem 0 1rem;
  background: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/rise_of_the_votes_high_quality.png') center/contain no-repeat;
  text-indent: -9999px;
  animation: fadeInUp 1.8s ease forwards;
}

.subtitle {
  font-family: "Merriweather", serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #F4B87A;
  margin-bottom: 2.5rem;
  animation: fadeInUp 2s ease forwards;
}

.start-btn {
  border: none;
  background: #F4B87A;
  color: black;
  padding: .6rem 1.8rem;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: all .2s ease;
  animation: fadeInUp 2.2s ease forwards;
}

.start-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background-color: #eaa968;
}

.copyright {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  animation: fadeInUp 2.5s ease forwards;
}

@media(max-width:768px) {
  .rainbow-box {
    width: clamp(150px, 50vw, 320px);
    height: clamp(35px, 12vw, 72px);
  }

  .main-title {
    width: clamp(400px, 90vw, 720px);
    height: clamp(130px, 28vw, 220px);
  }
}

/* ================================
   GLOBAL BASE
================================ */
/* ===============================
   GLOBAL BASE
=============================== */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Merriweather", sans-serif;
}

.main-body {
  background: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/background2.png') center/cover no-repeat;
}

/* Quiz logos */
.quiz-logos-container {
  position: fixed;
  top: 15px;
  left: 20px;
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 1000;
}

.quiz-logo {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* SABAH logo */
.quiz-logo-sabah {
  width: 95px;         /* bump size back to normal */
  height: 50px;
  background-image: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/sabah_text.png');
}

/* ROTV logo */
.quiz-logo-rotv {
  width: 140px;        /* bump size back to normal */
  height: 50px;
  background-image: url('https://assets.astroawani.com/data/assets-prn-sabah-2025/rise_of_the_votes_high_quality.png');
}


/* Game container */
.game-container {
  position: fixed;
  bottom: 5%;
  right: 8%;
  width: 30vw;
  max-width: 500px;
  min-width: 280px;
}

/* Character sprite */
.character {
  position: fixed;
  bottom: 0;
  right: 15%;
  max-height: 90vh;
  object-fit: contain;
  transition: .35s ease;
  z-index: 20;
}

.character.change { transform: scale(1.02) translateY(-8px); }

/* Dialogue box */
.dialogue-box {
  position: fixed;
  top: 80px;
  right: calc(23% + 200px);
  max-width: 280px;
  padding: 1.2rem;
  backdrop-filter: blur(6px);
  border-radius: 16px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity .5s ease;
  z-index: 25;
}

/* Answer buttons */
.answer-buttons {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 160px;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity .5s ease;
}

.answer-buttons.visible {
  opacity: 1;
  pointer-events: auto;
}

.answer-buttons .btn {
  font-weight: 600;
  border-radius: .75rem;
  background: rgba(255,255,255,0.9);
  color: black;
  border: 1px solid rgba(255,255,255,1);
  backdrop-filter: blur(4px);
  transition: .2s ease;
}

.answer-buttons .btn:hover {
  background: rgba(255,255,255,1);
  transform: scale(1.05);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
}


/* ================================
   PROGRESS BAR
================================ */
.progress-container {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  text-align: center;
  z-index: 9999;
}

#question-counter {
  color: #000 !important;
  /* force black text */
  text-shadow: none !important;
  /* remove white glow if any */
  font-weight: 700;
}

.progress-bar {
  height: 8px;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffcc00, #ff6600);
  transition: width .4s ease;
}

.left-logo {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 80px;
  z-index: 1000;
}

/* ================================
   RESPONSIVE — DESKTOP
================================ */
@media (min-width: 577px) {
  .answer-buttons {
    left: 20%;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    gap: 1rem;
  }

  .answer-buttons .btn {
    padding: .8rem 1.2rem;
    font-size: 1.1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
  }
}

/* ================================
   RESPONSIVE — MOBILE
================================ */
@media (max-width: 576px) {

  /* =============================
       SAFE AREA FOR LOGOS
       ============================= */
  .quiz-logos-container {
    top: 10px !important;
    left: 20px !important;
    gap: 1rem !important;
  }

  .quiz-logo-sabah {
    width: 65px !important;
    height: 32px !important;
  }

  .quiz-logo-rotv {
    width: 100px !important;
    height: 32px !important;
  }

  /* =============================
       PROGRESS BAR LOWERED
       ============================= */
  .progress-container {
    top: 50px !important;
    /* moved down from 30px */
  }

  /* =============================
       CHARACTER ANIMATION
       ============================= */
  @keyframes popInMobile {
    0% {
      opacity: 0;
      transform: translateX(50%) scale(0.8);
    }

    60% {
      opacity: 1;
      transform: translateX(50%) scale(1.05);
    }

    100% {
      opacity: 1;
      transform: translateX(50%) scale(1);
    }
  }

  .character {
    right: 50%;
    animation: popInMobile 1.2s forwards;
    max-height: 60vh;
    /* optional: prevents overlap with progress bar */
  }

  /* =============================
       DIALOGUE BOX MOVED BELOW PROGRESS BAR
       ============================= */
  .dialogue-box {
    top: 150px !important;
    /* previously bottom:75vh which caused overlap */
    left: 50% !important;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 500px;
    padding: 1rem 1.2rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
  }

  .dialogue-box::before {
    display: none;
  }

  .dialogue-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.75);
  }

  /* =============================
       ANSWERS STAY AT BOTTOM
       ============================= */
  .answer-buttons {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    margin-bottom: 1.5rem;
  }

  /* OPTIONAL – Reduce width of other logos using left-logo class */
  .left-logo {
    width: 50px;
  }
}


/* ============================================================== 
   CHARACTER CARD REVEAL - Simplified, Elegant Version
   ============================================================== */

.summon-container {
  display: none;

  /* FULLSCREEN FIX — but cleanly */
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  width: 100vw;
  height: 100vh;

  background: #000 !important;
  overflow-y: auto !important;

  /* Center the content */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* start at top */
  align-items: center;

  padding: 80px 20px 120px;
  z-index: 11000 !important;
}



/* When reveal is active also force the page root to be black to cover any stray backgrounds */
body.reveal-active {
  background: #000 !important;
  color: #f0e9d8 !important; /* clean warm white */
}

body.reveal-active .main-body {
  background-image: none !important;
  background: #000 !important;
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Layout container */
.main-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 50px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}



/* --- Character Card --- */
/* --- Character Card --- */
.card-section {
  flex: 0 1 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible !important;
}

.card-container {
  position: relative;
  width: 100%;
  max-width: 350px;
  perspective: 1000px;
}

.card {
  width: 100%;
  aspect-ratio: 9/16;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid #d4af37;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  animation: popCard 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  background-color: #000;
}

/* Fix - ensure image fills card properly */
.card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 18px;
  z-index: 1;
}

/* Optional: glowing border effect */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  z-index: 2;
  pointer-events: none;
}


@keyframes popCard {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }

  60% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

.card-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 18px;
}

/* --- Info Panel --- */
.details-section {
  flex: 1;
  max-width: 600px;
  min-width: 320px;
}

.details-panel {
  margin-top: 15px;
  background: rgba(34, 70, 34, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 34px;
  animation: slideIn 1s ease 0.5s both;
  backdrop-filter: blur(6px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header inside panel */
.details-header {
  text-align: center;
  margin-bottom: 20px;
}

.character-name {
  font-size: 2.5rem;
  color: #d4af37;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.character-role {
  display: inline-block;
  margin-top: 8px;
  background: linear-gradient(to right, #3b523b, #1a3c1a);
  color: #f5f2e7;
  padding: 5px 15px;
  border-radius: 15px;
  border: 1px solid #d4af37;
  font-size: 1rem;
  text-transform: uppercase;
}

.quote {
  font-style: italic;
  text-align: center;
  margin: 20px 0 30px 0;
  padding: 15px;
  border-left: 3px solid #d4af37;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.6;
  font-size: 1.1rem;
}

/* Strengths list only */
.attribute-section {
  margin-top: 10px;
}

.attribute-title {
  color: #d4af37;
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 600;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 5px;
}

.attribute-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attribute-list li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
  font-size: 1rem;
}

.attribute-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: #d4af37;
}

/* --- Footer / Share Section --- */
footer {
  margin-top: 50px;
  text-align: center;
  color: #d4af37;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* --- Responsive Layout --- */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    align-items: center;
  }

  .card-section,
  .details-section {
    width: 100%;
    max-width: 400px;
  }

  .character-name {
    font-size: 2rem;
  }

  .quote {
    font-size: 1rem;
  }
}


@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .logo {
    font-size: 1.8rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .details-panel {
    padding: 20px;
  }

  .character-name {
    font-size: 1.6rem;
  }

  .quote {
    font-size: 1rem;
    padding: 10px;
  }

  .attribute-title {
    font-size: 1.1rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .attribute-list li {
    font-size: 0.9rem;
  }

  .details-content {
    grid-template-columns: 1fr;
  }

  /* Single column on mobile */
}

/* Share Section Styles */
.share-section {
  margin-top: 3rem;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #f5f2e7;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.share-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.share-btn.instagram {
  background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
  color: white;
}

.share-btn.facebook {
  background: #1877F2;
  color: white;
}

.share-btn.twitter {
  background: #000000;
  color: white;
}

.share-btn.threads {
  background: #000000;
  color: white;
}

.share-btn.whatsapp {
  background: #25D366;
  color: white;
}

.share-btn.telegram {
  background: #0088CC;
  color: white;
}

.share-btn.download {
  background: #6c757d;
  color: white;
}

/* Tooltip styles for better UX */
.share-btn {
  position: relative;
}

.share-btn::after {
  content: attr(title);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.share-btn:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: -35px;
}

.fight-section {
  margin-bottom: 1.5rem;
  background: rgba(42, 92, 42, 0.4);
  padding: 1rem;
  border-radius: 10px;
  border-left: 3px solid var(--gold);
}

.fight-section .attribute-title {
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.fight-text {
  color: var(--light-gold);
  font-size: 1rem;
  line-height: 1.5;
}

/* === FINAL MOBILE FIX: Adjust question position above the character === */
@media (max-width: 576px) {

  /* Character (girl) */
  .character {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    transform-origin: bottom center !important;
    max-height: 60vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    z-index: 10 !important;
  }

  /* Dialogue box (lifted higher to avoid overlap) */
  .dialogue-box {
    position: fixed !important;
    bottom: 72% !important;
    /* â¬† lift it higher above the girl */
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    width: 88vw !important;
    max-width: 92vw !important;
    padding: 1rem !important;
    text-align: center !important;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    z-index: 20 !important;
  }

  #question {
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  /* Answer buttons */
  .answer-buttons {
    position: fixed !important;
    bottom: 1% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 88vw !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.6rem !important;
    z-index: 30 !important;
  }

  .answer-buttons .btn {
    font-weight: 600;
    border-radius: .75rem;
    background: rgba(255, 255, 255, 0.75);
    /* semi-transparent white */
    color: #000;
    /* readable black text */
    border: 1px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    /* soft frosted effect */
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }



  .game-container {
    width: 100%;
    padding: 0;
    margin: 0;
  }
}

/* ============================
   RESULT PAGE BANNERS (FIXED)
   ============================ */

.result-banners {
  width: 100%;
  text-align: center;
  margin: 40px auto 20px;
}

.banner-desktop,
.banner-mobile {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
  border-radius: 10px;
}

/* Desktop default */
.banner-desktop {
  display: block;
}

.banner-mobile {
  display: none;
}

/* Mobile switch */
@media (max-width: 600px) {
  .banner-desktop {
    display: none;
  }
  .banner-mobile {
    display: block;
  }
}

/* Optional: Blend banners into dark theme */
.result-banners img {
  filter: brightness(0.92) contrast(1.05);
}

.restart-btn {
  margin-top: 10px;
  padding: 12px 28px;
  background: #ffcc00;
  color: #000;
  font-weight: 700;
  border-radius: 30px;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.25s ease;
}

.restart-btn:hover {
  background: #e6b800;
  transform: translateY(-3px);
}
