/* ===================================================
   AAYAAN'S WORLD QUEST — CREATIVE WONDER STUDIO THEME
   Bright, Kid-Friendly, Consistent with Home Page
   =================================================== */

/* ---- GOOGLE FONTS & ROOT VARIABLES ---- */
:root {
  --yellow:    #FFD93D;
  --orange:    #FF6B35;
  --pink:      #FF6B9D;
  --red:       #FF4757;
  --green:     #2ED573;
  --teal:      #1E90FF;
  --blue:      #5352ED;
  --purple:    #A55EEA;
  --lime:      #7BED9F;
  --coral:     #FF6348;
  --saffron:   #FF9000;
  --cream:     #FFF9F0;
  --dark:      #2D2D2D;
  --mid:       #555555;
  --light:     #F5F5F5;

  --shape-hexagon: #FF6B9D;
  --shape-square:  #2ED573;
  --shape-circle:  #1E90FF;
  --shape-donkey:  #FF6B35;
  --shape-fish:    #5352ED;

  --font-head: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
  --font-hand: 'Caveat', cursive;

  --shadow-fun: 0 8px 25px rgba(0,0,0,0.1);
  --shadow-strong: 0 12px 35px rgba(0,0,0,0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image: linear-gradient(135deg, #FFF0D6 0%, #F0FFF4 50%, #F0F0FF 100%);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- FLOATING DOODLES BACKGROUND ---- */
.doodle {
  position: fixed;
  font-size: 2.2rem;
  pointer-events: none;
  z-index: 0;
  animation: floatDoodle 8s ease-in-out infinite;
  opacity: 0.12;
  user-select: none;
}
.doodle-1 { top: 12%; left: 2%; animation-delay: 0s; }
.doodle-2 { top: 30%; right: 3%; animation-delay: 1.5s; }
.doodle-3 { top: 55%; left: 2%; animation-delay: 3s; }
.doodle-4 { top: 75%; right: 4%; animation-delay: 2s; }
.doodle-5 { top: 20%; right: 10%; animation-delay: 2.5s; }
.doodle-6 { top: 85%; left: 4%; animation-delay: 1s; }

@keyframes floatDoodle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* ---- NAVBAR (MATCHING HOME PAGE) ---- */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-bottom: 4px solid var(--yellow);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--orange);
  text-decoration: none;
}

.brand-emoji { font-size: 1.5rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active-nav-link {
  background: var(--yellow);
  color: var(--dark);
  transform: translateY(-2px);
}

.btn-nav-home {
  background: linear-gradient(135deg, var(--orange), var(--pink)) !important;
  color: white !important;
  font-weight: 800 !important;
  padding: 0.4rem 0.9rem !important;
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--dark);
  border-radius: 3px;
}

/* ---- GAME TOP CONTROL BAR ---- */
.game-top-bar {
  max-width: 1240px;
  width: 95%;
  margin: 1.5rem auto 0;
  background: white;
  border-radius: 24px;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-fun);
  border: 3px solid #FFE0B2;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}

.game-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.game-emoji-badge {
  font-size: 2.2rem;
  background: #E8F4FD;
  padding: 0.4rem;
  border-radius: 16px;
  border: 2px solid var(--teal);
}

.game-heading {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--teal);
  line-height: 1.1;
}

.level-indicator-badge {
  font-size: 1.1rem;
  color: var(--mid);
}

/* 3 Level Selector Pills */
.level-selector-pills {
  display: flex;
  gap: 0.4rem;
  background: #FFF3E0;
  padding: 0.3rem;
  border-radius: 50px;
  border: 2px solid var(--yellow);
}

.btn-level-pill {
  background: transparent;
  border: none;
  color: var(--mid);
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-level-pill.active-easy {
  background: linear-gradient(135deg, #2ED573, #10B981);
  color: white;
  box-shadow: 0 3px 10px rgba(46, 213, 115, 0.4);
}

.btn-level-pill.active-medium {
  background: linear-gradient(135deg, #FFD93D, #FF6B35);
  color: white;
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4);
}

.btn-level-pill.active-hard {
  background: linear-gradient(135deg, #FF4757, #E11D48);
  color: white;
  box-shadow: 0 3px 10px rgba(255, 71, 87, 0.4);
}

/* Stats */
.header-stats {
  display: flex;
  gap: 0.75rem;
}

.stat-badge {
  background: var(--cream);
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.88rem;
  border: 2px solid #E0E0E0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-badge span:nth-child(2) {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--orange);
}

/* Action buttons */
.header-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  border: 2px solid #ddd;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  transform: translateY(-2px);
}

/* Level Progress Bar */
.level-progress-bar-container {
  max-width: 1240px;
  width: 95%;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50px;
  margin: 0.75rem auto 0;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--coral));
  border-radius: 50px;
  transition: width 0.5s ease;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-notification {
  background: white;
  color: var(--dark);
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-strong);
  border: 3px solid var(--green);
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from { transform: translateY(20px) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---- MAIN GAME CONTAINER ---- */
.game-container {
  max-width: 1240px;
  width: 95%;
  margin: 1.5rem auto 3rem;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 1.5rem;
  position: relative;
  z-index: 5;
}

/* ---- LEFT & RIGHT PANELS ---- */
.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.station-card, .inventory-station {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-fun);
  border: 3px solid #FFE0B2;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.station-title {
  font-size: 1.4rem;
  color: var(--orange);
  font-weight: 700;
}

.shape-desc {
  font-size: 0.85rem;
  color: var(--mid);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Deck & Bag Visuals */
.deck-visual, .bag-visual {
  background: #FFF8E1;
  border-radius: 18px;
  border: 3px dashed var(--orange);
  padding: 1.25rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s;
}

.deck-visual:hover, .bag-visual:hover {
  transform: translateY(-4px) scale(1.02);
  background: #FFF3E0;
}

.deck-icon, .bag-icon { font-size: 2.4rem; }
.deck-label, .bag-prompt { font-size: 1.1rem; font-weight: 700; color: var(--orange); }

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-mystery-bag {
  background: linear-gradient(135deg, var(--teal), var(--blue)) !important;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3) !important;
}

/* ---- CENTER STAGE ---- */
.center-stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 3D Dice Arena */
.dice-arena {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-fun);
  border: 3px solid #E0F7FA;
  display: grid;
  grid-template-columns: 180px 100px 1fr;
  gap: 1.25rem;
  align-items: center;
}

.dice-title { font-size: 1.4rem; color: var(--teal); }
.dice-sub { font-size: 0.82rem; color: var(--mid); margin-top: 0.25rem; }

.btn-roll-dice {
  background: linear-gradient(135deg, var(--coral), var(--pink));
  color: white;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-roll-dice:hover { transform: translateY(-2px); }

/* 3D Dice */
.scene-3d {
  width: 70px;
  height: 70px;
  perspective: 350px;
  margin: auto;
  cursor: pointer;
}

.cube-dice {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: translateZ(-35px);
  transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cube-face {
  position: absolute;
  width: 70px;
  height: 70px;
  background: white;
  border: 3px solid var(--orange);
  border-radius: 14px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  background: var(--coral);
  border-radius: 50%;
  display: block;
}

.cube-face.front  { transform: rotateY(  0deg) translateZ(35px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(35px); }
.cube-face.right  { transform: rotateY( 90deg) translateZ(35px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(35px); }
.cube-face.top    { transform: rotateX( 90deg) translateZ(35px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(35px); }

.cube-dice.show-1 { transform: translateZ(-35px) rotateY(   0deg); }
.cube-dice.show-2 { transform: translateZ(-35px) rotateY(-180deg); }
.cube-dice.show-3 { transform: translateZ(-35px) rotateY( -90deg); }
.cube-dice.show-4 { transform: translateZ(-35px) rotateY(  90deg); }
.cube-dice.show-5 { transform: translateZ(-35px) rotateX( -90deg); }
.cube-dice.show-6 { transform: translateZ(-35px) rotateX(  90deg); }

.cube-dice.rolling {
  animation: diceRollAnim 0.9s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

@keyframes diceRollAnim {
  0%   { transform: translateZ(-35px) rotateX(0deg) rotateY(0deg); }
  50%  { transform: translateZ(-35px) rotateX(480deg) rotateY(360deg); }
  100% { transform: translateZ(-35px) rotateX(1080deg) rotateY(720deg); }
}

/* World Map Box */
.world-map-box {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #B2EBF2;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.map-header {
  padding: 0.5rem 1rem;
  background: #E0F7FA;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-title { font-size: 1.15rem; color: var(--teal); font-weight: 700; }
.region-tag {
  background: white;
  color: var(--teal);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
}

.real-world-map-container {
  height: 180px;
  width: 100%;
}

/* ---- STATE / COUNTRY CARD STAGE ---- */
.state-card-stage {
  background: white;
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow-strong);
  border: 4px solid #FFE0B2;
}

.card-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-type-badge {
  background: #FFF3E0;
  color: var(--orange);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  border: 1px solid #FFE0B2;
}

.level-card-tag {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--green);
}

.card-title-area { margin-bottom: 1.25rem; }
.card-main-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--dark);
}

/* Flag Display */
.flag-display-box {
  background: #FFF9F0;
  border: 2px dashed var(--green);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.flag-img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
}

.flag-caption {
  display: block;
  font-size: 1.1rem;
  color: var(--green);
  font-weight: 700;
}

/* Clues Container */
.clues-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.clue-item {
  background: #FFF9F0;
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  border-left: 5px solid var(--yellow);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s;
}

.clue-item.unlocked {
  background: #F0FFF4;
  border-left-color: var(--green);
}

.clue-item.locked {
  opacity: 0.45;
  background: #F5F5F5;
  border-left-color: #ccc;
}

.clue-num {
  background: var(--yellow);
  color: var(--dark);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

.clue-item.unlocked .clue-num {
  background: var(--green);
  color: white;
}

/* Guess Input Area */
.guess-area {
  display: flex;
  gap: 0.75rem;
}

.guess-input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  border-radius: 50px;
  border: 2px solid #ddd;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.guess-input:focus { border-color: var(--orange); }

.btn-guess {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-guess:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
}

/* ---- RIGHT PANEL: LIFE CARDS INVENTORY ---- */
.life-card-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shape-card-item {
  background: var(--cream);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #E0E0E0;
  transition: transform 0.2s;
}

.shape-card-item:hover { transform: translateX(3px); }

.shape-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shape-icon { font-size: 1.6rem; }
.shape-name { font-weight: 800; font-size: 0.95rem; }
.shape-desc { font-size: 0.75rem; color: var(--mid); margin-bottom: 0; }

.shape-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shape-count-badge {
  background: var(--yellow);
  color: var(--dark);
  font-family: var(--font-head);
  font-size: 0.95rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

.btn-use-power {
  background: linear-gradient(135deg, var(--green), #10B981);
  color: white;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-use-power:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Penalties */
.penalty-box {
  background: #FFF3E0;
  border: 2px dashed var(--orange);
  border-radius: 16px;
  padding: 0.85rem;
  margin-top: 0.5rem;
}

.penalty-title { font-size: 1.15rem; color: var(--orange); font-weight: 700; margin-bottom: 0.25rem; }
.penalty-desc { font-size: 0.8rem; color: var(--mid); line-height: 1.5; margin-bottom: 0.5rem; }

.btn-skip-chance {
  background: var(--orange);
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ---- RULES MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open, .modal-overlay.active { display: flex; }

.modal-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-strong);
  border: 4px solid var(--yellow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title { font-size: 1.8rem; color: var(--orange); }

.modal-close {
  background: var(--red);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--mid);
}

/* ---- FOOTER (MATCHING HOME PAGE) ---- */
.footer {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.footer-doodles {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-name {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--yellow), var(--pink), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline { color: #aaa; font-size: 0.9rem; margin-bottom: 1rem; }

.footer-contact { margin-bottom: 1rem; }
.footer-contact p { color: #ddd; font-size: 0.95rem; font-weight: 700; }

.footer-email {
  color: var(--yellow);
  text-decoration: none;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 217, 61, 0.15);
  transition: all 0.2s ease;
}

.footer-email:hover {
  background: var(--yellow);
  color: var(--dark);
  text-decoration: underline;
}

.footer-copy { color: #888; font-size: 0.85rem; }

/* ---- HELPER CLASSES ---- */
.caveat-font { font-family: var(--font-hand) !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  .dice-arena {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 65px; left: 0; right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; border-radius: 8px; font-size: 1rem; }
  .hamburger { display: flex; }

  .game-top-bar { flex-direction: column; text-align: center; }
  .guess-area { flex-direction: column; }
}
