/* ===================================================================
   Qualities of Ganesha: Trait Match — Game Stylesheet
   Disney/Pixar Warm Storybook Theme (Gold, Terracotta, Ivory & Rich Wood)
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Yatra+One&family=Nunito:wght@700;800;900&display=swap');

:root {
  --font-display: 'Fredoka', 'Yatra One', cursive, sans-serif;
  --font-body: 'Nunito', 'Fredoka', sans-serif;
  --color-gold: #f6c042;
  --color-gold-glow: #ffe07a;
  --color-terracotta: #d35400;
  --color-parchment: #fdf6e7;
  --color-parchment-border: #d4a853;
  --color-dark-wood: #3a2211;
  --color-card-bg: rgba(45, 26, 14, 0.92);
  --shadow-warm: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(246, 192, 66, 0.25);
  --shadow-glow: 0 0 25px rgba(255, 215, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #120904;
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Viewport Container (Full Screen 100vw x 100vh edge-to-edge) */
#game-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #120904;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background layers */
.screen-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.bg-ambient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 210, 120, 0.15), rgba(20, 10, 5, 0.65));
  z-index: 2;
  pointer-events: none;
}

/* General Screen Wrapper */
.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  opacity: 0;
  transition: opacity 0.45s ease-in-out;
  overflow: hidden;
}

.game-screen.active {
  display: flex;
  opacity: 1;
}

/* ===================================================================
   1. INTRO / STORY SCREEN
   =================================================================== */
#intro-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#intro-screen.active {
  display: block;
  opacity: 1;
}

/* Cave Background with Stone Table on Left */
.intro-cave-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* Game Title Lettering (Top Center) */
.intro-title-wrapper {
  position: absolute;
  left: 50.8%;
  top: -3.5%;
  width: 62.7%;
  height: 34.4%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.intro-title-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 25px rgba(255, 215, 0, 0.5));
  animation: floatBounce 4s ease-in-out infinite;
  pointer-events: none;
}

/* Lord Ganesha Seated Directly on the Cave Ground Writing (No Borders) */
.intro-ganesha-wrapper {
  position: absolute;
  bottom: 1%;
  left: 48%;
  transform: translateX(-40%);
  width: clamp(300px, 37vw, 520px);
  z-index: 12;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.intro-ganesha-img {
  width: 100%;
  height: auto;
  display: block;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.7));
  animation: breathingGanesha 4s ease-in-out infinite alternate;
}

/* Start Button */
.intro-start-wrapper {
  position: absolute;
  bottom: 5%;
  right: 7%;
  z-index: 25;
  text-align: center;
}

.btn-start-wrapper {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.btn-start-img {
  width: clamp(210px, 22vw, 300px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
  animation: pulseButton 2s ease-in-out infinite;
}

.btn-start-wrapper:hover .btn-start-img {
  transform: scale(1.08);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 30px rgba(255, 230, 100, 0.85));
}

.btn-start-wrapper:active .btn-start-img {
  transform: scale(0.95);
}

/* ===================================================================
   2. MAIN GAMEPLAY SCREEN ("TRAIT MATCH - SPIN THE WHEEL")
   =================================================================== */
#game-screen {
  left: -0.5%;
  top: 0.2%;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 20px 12px 20px;
}

/* Top Header */
.game-header {
  position: relative;
  left: 33%;
  top: 0.5%;
  width: 38.4%;
  height: 10%;
  z-index: 25;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 10px;
}

/* Center Title Banner (Parchment Scroll Ribbon Look) */
.header-title-banner {
  position: relative;
  left: -4.6%;
  top: 0%;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  background: linear-gradient(180deg, #fff2cc 0%, #fae19c 100%);
  border: 3px solid #b78103;
  border-radius: 24px;
  padding: 0.3em 1.5em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  font-size: 20px;
}

.header-banner-title {
  font-family: var(--font-display);
  font-size: inherit;
  color: #5c2800;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

/* Main Play Area (3 Columns) */
.game-main-content {
  position: relative;
  z-index: 15;
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-height: calc(100% - 100px);
  gap: 15px;
  overflow: visible;
}

/* -------------------------------------------------------------------
   LEFT COLUMN: Ganesha Guide, Speech Bubble & Bottom-Left Stars Board
   ------------------------------------------------------------------- */
.ganesha-guide-col {
  position: relative;
  left: 0.1%;
  top: 0.1%;
  flex: 0 0 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 5px;
  overflow: visible;
}

/* Speech Bubble (Generous size & inner padding so text NEVER overflows) */
.speech-bubble-wrapper {
  position: relative;
  left: 5.2%;
  top: 22%;
  width: 75.6%;
  height: 24.3%;
  min-height: clamp(135px, 17vh, 170px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(26px, 3vh, 36px) clamp(34px, 3.6vw, 48px) clamp(30px, 3.2vh, 40px) clamp(34px, 3.6vw, 48px);
  margin-bottom: -15px;
  z-index: 18;
  transform-origin: 35% 90%;
}

.speech-bubble-wrapper.bubble-pop-anim {
  animation: speechBubblePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes speechBubblePop {
  0% {
    transform: scale(0.75);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  75% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.speech-bubble-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
  z-index: -1;
  transform: scaleX(-1);
}

.speech-bubble-text {
  color: #3b1700;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.35vw, 19px);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  max-width: 82%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: opacity 0.18s ease;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
}

/* Ganesha Seated Naturally */
.ganesha-guide-portrait {
  position: relative;
  left: 43%;
  top: -4.2%;
  width: 56.7%;
  height: 74.4%;
  z-index: 12;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.ganesha-guide-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
  animation: breathingGanesha 4s ease-in-out infinite alternate;
}

/* Bottom-Left Stars Collected Sign Board */
.stars-collected-board,
#stars-collected-board {
  position: relative;
  left: 255.3%;
  top: -105.5%;
  width: 56%;
  height: 9.8%;
  font-size: 22px;
  min-width: 170px;
  min-height: 50px;
  margin-top: -10px;
  z-index: 20;
  background: linear-gradient(180deg, #5c3014 0%, #3a1a07 100%);
  border: 2px solid #e0aa3e;
  border-radius: 16px;
  padding: 6px 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65), inset 0 1px 3px rgba(255, 230, 150, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.stars-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}

.star-slot {
  width: clamp(22px, 2.2vw, 34px);
  height: clamp(22px, 2.2vw, 34px);
  max-width: 18.5%;
  max-height: 90%;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.star-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

.star-slot.filled img {
  animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9));
}

/* -------------------------------------------------------------------
   CENTER COLUMN: Wheel of Qualities
   ------------------------------------------------------------------- */
.wheel-center-col {
  position: relative;
  left: 0.4%;
  top: 1.5%;
  width: 69.4%;
  height: 102.7%;
  flex: 0 0 44%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.wheel-assembly,
#wheel-assembly {
  position: relative;
  left: -2.2%;
  top: -4.2%;
  width: 103.7%;
  height: 94.5%;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.85));
  transition: filter 0.4s ease, transform 0.4s ease;
  overflow: visible;
}

.wheel-assembly.blurred {
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.85)) blur(9px) brightness(0.65);
  pointer-events: none;
}

/* Rotating segments disc layer (Sized to 100% matching resized_wheel_with_frame_bigger_wheel) */
.wheel-segments-disc {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  z-index: 5;
  transform: rotate(0deg);
  transition: transform 0.05s linear;
  max-width: none;
  max-height: none;
}

/* Static Frame + Pointer + Center Om Hub layer */
.wheel-frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 10;
  pointer-events: none;
  max-width: none;
  max-height: none;
}

/* Stationary Top Pointer Pin */
.wheel-pointer-pin {
  position: absolute;
  top: 3.0%;
  left: 50%;
  transform: translateX(-50%);
  width: 7.8%;
  height: auto;
  z-index: 15;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* Center Om Clickable Spin Button (Stationary & Upright) */
.wheel-spin-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 25.5%;
  height: 25.5%;
  border-radius: 50%;
  z-index: 20;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.wheel-om-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.wheel-spin-hub:hover {
  transform: translate(-50%, -50%) scale(1.08);
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.85));
}

.wheel-spin-hub:active {
  transform: translate(-50%, -50%) scale(0.93);
}

.wheel-spin-hub.disabled {
  pointer-events: none;
  opacity: 0.9;
}

/* Unified Bottom Slot: Holds Spin Button */
.wheel-bottom-slot {
  position: relative;
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  z-index: 15;
}

/* Medium-Intensity Background Blur when Output Popup is Active */
#game-screen.modal-open .screen-bg,
#game-screen.modal-open .bg-ambient-overlay,
#game-screen.modal-open .game-header,
#game-screen.modal-open .ganesha-guide-col,
#game-screen.modal-open .rules-sidebar-col,
#game-screen.modal-open .wheel-assembly {
  filter: blur(6px) brightness(0.65);
  transition: filter 0.35s ease;
  pointer-events: none;
}

/* Decision Popup Modal (Pops up crystal clear over blurred background) */
.trait-decision-modal,
#trait-decision-modal {
  position: absolute;
  top: 50%;
  left: 48%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: min(94%, 530px);
  filter: none !important;
}

.trait-decision-modal.active,
#trait-decision-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.decision-card-box {
  position: relative;
  background: radial-gradient(circle at 50% 15%, #fffdf4 0%, #fae8be 45%, #f1cd7f 85%, #e2b658 100%);
  border: 3.5px solid #d4982a;
  border-radius: 46px 14px 46px 14px;
  padding: 24px 32px 22px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 3.5px #4f1d04, 0 0 40px rgba(255, 205, 75, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.95), inset 0 -3px 8px rgba(180, 110, 20, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 13px;
  width: 100%;
}

.decision-trait-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(180deg, #4d1d05 0%, #290d01 100%);
  border: 2px solid #f0ba4a;
  border-radius: 32px;
  padding: 9px 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 230, 140, 0.45);
}

.decision-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 80%;
  margin: -2px 0 0 0;
  color: #b87514;
  font-size: 14px;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.decision-divider::before,
.decision-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #b87514, transparent);
}

.decision-trait-icon {
  font-size: clamp(34px, 3.8vw, 46px);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.decision-trait-name {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.7vw, 34px);
  color: #ffe699;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.4);
  letter-spacing: 0.8px;
}

.decision-trait-question {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.05vw, 26px);
  color: #381400;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  max-width: 96%;
}

.decision-trait-question strong {
  color: #8c1e00;
  font-weight: 900;
}

.decision-action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  width: 100%;
  margin-top: 4px;
}

.btn-decision-choice {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  max-width: 170px;
}

.btn-decision-choice img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-decision-choice:hover:not(:disabled) img {
  transform: scale(1.08);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.75)) brightness(1.06);
}

.btn-decision-choice:active:not(:disabled) img {
  transform: scale(0.94);
}

.btn-decision-choice:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Primary Spin Button */
.btn-spin-action {
  position: relative;
  left: 25.4%;
  top: -22.8%;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd700, #ff8c00);
  border: 3px solid #fff;
  color: #3b1700;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 800;
  padding: 8px 34px;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-spin-action.hidden {
  display: none !important;
}

.btn-spin-action:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 230, 100, 0.85);
}

.btn-spin-action:active:not(:disabled) {
  transform: scale(0.94);
}

.btn-spin-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------------------------------------------------
   RIGHT COLUMN: Blank Scroll Panel with Stacked Action Buttons
   ------------------------------------------------------------------- */
.rules-sidebar-col {
  position: relative;
  left: -4.5%;
  top: -5.4%;
  width: 35%;
  height: 129%;
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.scroll-panel-wrapper {
  position: relative;
  left: 4.1%;
  top: -2.4%;
  width: 87.5%;
  height: 56.3%;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15% 13% 12% 13%;
  overflow: visible;
  box-sizing: border-box;
}

.scroll-panel-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65));
  z-index: -1;
  pointer-events: none;
}

/* Title Inscribed on Upper Scroll Roll */
.scroll-upper-title,
#scroll-upper-title {
  position: absolute;
  left: 48.6%;
  top: 21.2%;
  transform: translateX(-50%);
  width: 95.5%;
  height: 14.6%;
  font-size: 23px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
}

.scroll-upper-icon {
  font-size: 1.2em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(70, 30, 0, 0.45));
}

.scroll-upper-heading {
  font-family: var(--font-display);
  color: #3b1600;
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 0 rgba(255, 245, 215, 0.85);
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  text-decoration-color: #7b2c00;
}

/* Inner Content: 4 Rules + Reminder Box */
.scroll-content,
#scroll-hint-panel {
  position: relative;
  top: 7%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  box-sizing: border-box;
  text-align: left;
  gap: clamp(8px, 1.2vh, 14px);
}

/* 4 Inscribed Rules List */
.scroll-rules-list {
  position: relative;
  left: 0.5%;
  top: 11.8%;
  width: 90.9%;
  height: 80.9%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: clamp(8px, 1.2vh, 16px);
  padding: 0;
}

.scroll-rule-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 10px);
  padding: 2px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  font-size: clamp(13px, 1.35vw, 17px);
}

.scroll-rule-item:hover {
  background: rgba(255, 235, 185, 0.35);
  transform: translateX(3px);
}

.rule-bullet {
  font-size: 1.15em;
  color: #6b2d03;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 245, 215, 0.8);
  flex-shrink: 0;
}

#scroll-rule-1 {
  left: 6.6%;
  top: 13%;
  width: 93.1%;
  height: 16%;
  font-size: 19px;
}

#scroll-rule-2 {
  left: 6.7%;
  top: -2.2%;
  width: 87.9%;
  height: 13.8%;
  font-size: 19px;
}

#scroll-rule-3 {
  left: 7.4%;
  top: -17.5%;
  width: 83.4%;
  height: 13.7%;
  font-size: 19px;
}

#scroll-rule-4 {
  left: 7%;
  top: -32.8%;
  width: 87%;
  height: 13.9%;
  font-size: 19px;
}

.rule-icon {
  font-size: 1.35em;
  flex-shrink: 0;
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(60, 20, 0, 0.4)) drop-shadow(0 0 7px rgba(255, 185, 30, 0.85));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  animation: ruleEmojiGlow 3s ease-in-out infinite alternate;
}

#scroll-rule-1 .rule-icon { animation-delay: 0s; }
#scroll-rule-2 .rule-icon { animation-delay: 0.65s; }
#scroll-rule-3 .rule-icon { animation-delay: 1.3s; }
#scroll-rule-4 .rule-icon { animation-delay: 1.95s; }

.scroll-rule-item:hover .rule-icon {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 3px 6px rgba(60, 20, 0, 0.45)) drop-shadow(0 0 14px rgba(255, 210, 50, 1));
}

.rule-text-block {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: inherit;
}

.rule-text-block strong {
  font-family: var(--font-display);
  font-size: 1em;
  color: #4a1900;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(255, 245, 215, 0.8);
  white-space: nowrap;
}

/* ===================================================================
   3. WIN / CELEBRATION SCREEN
   =================================================================== */
#win-screen {
  left: -0.2%;
  top: -0.5%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 40px;
}

.win-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
}

.win-container {
  position: relative;
  left: 0.6%;
  top: 1.9%;
  z-index: 25;
  width: 100%;
  height: 100%;
  overflow: hidden;
  animation: scaleInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.win-banner-wrapper {
  position: absolute;
  left: 51.3%;
  top: -1.4%;
  width: 80.4%;
  height: 48.7%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
}

.win-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.7));
  z-index: -1;
}

.win-banner-text {
  position: absolute;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  width: 78%;
  font-family: var(--font-display);
  color: #7b2c00;
  font-size: clamp(18px, 2.2vw, 30px);
  text-align: center;
  font-weight: 800;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  padding: 4px 12px;
  margin: 0;
  z-index: 5;
  cursor: text;
  outline: none;
  box-sizing: border-box;
  border-radius: 8px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.win-banner-text:hover {
  background: rgba(255, 255, 255, 0.18);
}

.win-banner-text:focus {
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.9), 0 0 12px rgba(245, 158, 11, 0.4);
}

.win-ganesha-box {
  position: absolute;
  left: 40.4%;
  top: 44.6%;
  width: 21%;
  height: 46.8%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.8));
  animation: breathingGanesha 4s ease-in-out infinite alternate;
  z-index: 28;
}

.win-ganesha-box::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(12, 5, 2, 0.8) 0%, rgba(12, 5, 2, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.win-ganesha-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.win-stars-display {
  position: relative;
  left: 30.3%;
  top: 23.7%;
  width: 42%;
  height: 14%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  z-index: 35;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

.win-stars-display img {
  width: clamp(48px, 4.8vw, 68px);
  height: clamp(48px, 4.8vw, 68px);
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
  animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.win-actions {
  margin-top: 15px;
}

.btn-play-again {
  cursor: pointer;
  background: linear-gradient(180deg, #ffd700, #ff8c00);
  border: 3px solid #fff;
  color: #3b1700;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 800;
  padding: 12px 42px;
  border-radius: 35px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.7);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
}

.btn-play-again:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 35px rgba(255, 230, 100, 0.9);
}

.btn-play-again:active {
  transform: scale(0.94);
}

/* ===================================================================
   ANIMATIONS & KEYFRAMES
   =================================================================== */
@keyframes floatBounce {

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

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

@keyframes pulseButton {

  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
  }

  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 28px rgba(255, 230, 100, 0.85));
  }
}

@keyframes breathingGanesha {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.02);
  }
}

@keyframes starPop {
  0% {
    transform: scale(0.4) rotate(-30deg);
    opacity: 0.5;
  }

  60% {
    transform: scale(1.3) rotate(15deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes starPulse {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.15);
  }
}

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

  100% {
    transform: translateY(-12px);
  }
}

@keyframes scaleInBounce {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

.shake-animation {
  animation: shakeCard 0.4s ease-in-out;
}

@keyframes shakeCard {

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

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

@keyframes bulbGlow {
  0% {
    filter: drop-shadow(0 1px 2px rgba(60, 20, 0, 0.35)) drop-shadow(0 0 0 rgba(255, 200, 50, 0));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 2px 4px rgba(60, 20, 0, 0.35)) drop-shadow(0 0 8px rgba(255, 190, 30, 0.75));
    transform: scale(1.08);
  }
}

@keyframes ruleEmojiGlow {
  0% {
    filter: drop-shadow(0 2px 4px rgba(60, 20, 0, 0.35)) drop-shadow(0 0 5px rgba(255, 185, 30, 0.6));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 3px 6px rgba(60, 20, 0, 0.4)) drop-shadow(0 0 11px rgba(255, 215, 60, 0.95));
    transform: scale(1.06);
  }
}