/* ==========================================
   DESIGN SYSTEM & CUSTOM STYLES: DESERT OASIS NIGHT
   ========================================== */

/* Reset & Base Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --color-sky-dark: hsl(222, 45%, 7%);
  --color-sky-light: hsl(220, 35%, 15%);
  --color-sand-text: hsl(38, 25%, 82%);
  --color-sand-bright: hsl(38, 30%, 95%);
  --color-gold-glow: hsl(45, 95%, 55%);
  --color-gold-dim: hsl(45, 60%, 40%);
  --color-emerald: hsl(154, 75%, 38%);
  --color-emerald-light: hsl(154, 60%, 50%);
  --color-fire: hsl(28, 95%, 55%);
  --color-ruby: hsl(354, 70%, 50%);
  
  --font-display: 'Outfit', sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;
}

body {
  background-color: #03060a;
  color: var(--color-sand-text);
  font-family: var(--font-display);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* App Wrapper for centering and aspect ratio forcing on desktops */
#app-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

/* 9:16 Game Container Container */
#game-container {
  width: 100%;
  max-width: 430px; /* iPhone 14 Pro Max width approx */
  height: 100%;
  max-height: 900px;
  aspect-ratio: 9 / 16;
  background: linear-gradient(180deg, var(--color-sky-dark) 0%, var(--color-sky-light) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* For larger desktop screens, add border radius */
@media (min-width: 440px) and (min-height: 600px) {
  #game-container {
    border-radius: 24px;
  }
}

/* Screens Layout */
.game-screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
}

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

/* Glassmorphism styling helper */
.glass-panel {
  background: rgba(12, 24, 43, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 16px;
  padding: 16px;
}

/* Typography & Headers */
.game-title {
  font-family: var(--font-arabic);
  font-size: 2.2rem;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  margin-bottom: 4px;
}

.game-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-gold-glow);
  margin-bottom: 8px;
}

.game-tagline {
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.7;
}

/* 1. MENU SCREEN STYLING */
#menu-screen {
  justify-content: space-between;
  text-align: center;
}

.menu-header {
  margin-top: 30px;
  position: relative;
}

.mandala-decoration {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: radial-gradient(circle, var(--color-gold-glow) 0%, transparent 70%);
  opacity: 0.15;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z' fill='black'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}

.select-prompt {
  font-size: 1rem;
  color: var(--color-sand-bright);
  margin-bottom: 16px;
  font-weight: 600;
}

.topic-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.topic-card {
  background: rgba(12, 24, 43, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 16px;
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-gold-glow);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.topic-card:hover, .topic-card:active {
  background: rgba(20, 38, 66, 0.8);
  border-color: var(--color-gold-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}

.topic-card:hover::before, .topic-card:active::before {
  opacity: 1;
}

.topic-num {
  font-size: 0.75rem;
  color: var(--color-gold-glow);
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.topic-title {
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
  display: block;
}

.topic-desc {
  font-size: 0.8rem;
  color: var(--color-sand-text);
  opacity: 0.8;
  display: block;
  margin-top: 4px;
}

.creator-info {
  font-size: 0.8rem;
  opacity: 0.6;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* 2. PLAY SCREEN STYLING */
#play-screen {
  padding: 16px;
  justify-content: space-between;
}

.play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-sand-text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hud-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-sand-bright);
  max-width: 50%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.lives-container {
  display: flex;
  gap: 6px;
}

.life-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 5px var(--color-emerald));
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.life-icon.lost {
  opacity: 0.3;
  transform: scale(0.7);
  filter: grayscale(1);
}

/* Play Body & Room transitions */
.play-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}

#maze-room-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.room-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  top: 0;
  left: 0;
}

/* Slide animations for rooms */
.slide-out-left {
  animation: slideOutLeft 0.4s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
  animation: slideInRight 0.4s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideOutLeft {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Shake animation on wrong answer */
.shake-element {
  animation: shake 0.45s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Question panel card */
.question-container {
  background: rgba(10, 20, 37, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.question-instruction {
  font-size: 0.8rem;
  color: var(--color-sand-text);
  opacity: 0.8;
  margin-bottom: 4px;
}

.arabic-sentence {
  font-family: var(--font-arabic);
  font-size: 1.85rem;
  line-height: 2.5rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
  margin: 4px 0;
  font-weight: 700;
}

/* Gold highlighting for fill-in-the-blank sentences */
.rumpang-blank {
  color: var(--color-gold-glow);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  border-bottom: 2px dashed var(--color-gold-glow);
  padding: 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Maze Visual Area */
.maze-visual-area {
  flex-grow: 1;
  background: rgba(8, 16, 29, 0.4);
  border-radius: 20px;
  margin: 10px 0;
  border: 1px dashed rgba(212, 175, 55, 0.1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  position: relative;
  min-height: 180px;
}

.room-background-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Decorative torches with animation */
.torch {
  position: absolute;
  bottom: 85px;
  width: 8px;
  height: 32px;
  background: #332010;
  border-radius: 4px;
}

.torch-left { left: 40px; }
.torch-right { right: 40px; }

.fire {
  position: absolute;
  top: -15px;
  left: -5px;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, #fff 0%, #ff8000 60%, transparent 100%);
  border-radius: 50% 50% 20% 50%;
  transform: rotate(-45deg);
  animation: flicker 0.15s infinite alternate;
  box-shadow: 0 0 15px rgba(255, 128, 0, 0.8);
}

@keyframes flicker {
  0% { transform: rotate(-45deg) scale(0.9); }
  100% { transform: rotate(-45deg) scale(1.1); }
}

.oasis-reflection {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(0deg, rgba(154, 75, 38, 0.08) 0%, transparent 100%);
}

/* Maze Doors */
.doors-container {
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  padding: 0 6px;
  z-index: 5;
}

.maze-door {
  width: 86px;
  height: 125px;
  background: linear-gradient(180deg, #1b130a 0%, #0d0804 100%);
  border: 2px solid var(--color-gold-dim);
  border-radius: 12px 12px 2px 2px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), inset 0 2px 8px rgba(212, 175, 55, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.maze-door:hover, .maze-door:active {
  border-color: var(--color-gold-glow);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.4), inset 0 2px 10px rgba(212, 175, 55, 0.3);
  transform: scale(1.05);
}

.door-letter {
  font-size: 0.7rem;
  color: var(--color-gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
}

.door-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-sand-bright);
  font-weight: 600;
  text-shadow: 0 1px 2px #000;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  word-break: break-all;
}

.door-text.arabic-font {
  font-family: var(--font-arabic);
  font-size: 1.45rem;
  line-height: 1.8rem;
  font-weight: 700;
}

/* Play Footer - Story Scroll */
.play-footer {
  margin-bottom: 6px;
}

.story-scroll-panel {
  background: #fbf5e6;
  border-radius: 8px;
  padding: 10px 14px;
  color: #3b2812;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  border: 1px solid #e2d2b4;
}

.story-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8c5d26;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}

.story-text-content {
  font-size: 0.85rem;
  line-height: 1.35;
  font-weight: 400;
}

.scroll-decoration {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 4px;
  background: radial-gradient(circle, #d0bba0 0%, transparent 80%);
}

.scroll-top { top: 4px; }
.scroll-bottom { bottom: 4px; }


/* 3. COMPLETION SCREEN STYLING */
#complete-screen {
  justify-content: space-between;
  text-align: center;
  overflow-y: auto;
}

.completion-header {
  margin-top: 20px;
}

.check-circle-anim {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-emerald);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
  box-shadow: 0 0 15px rgba(26, 188, 156, 0.4);
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.completion-title {
  font-size: 1.35rem;
  color: #fff;
  font-weight: 700;
}

.completion-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 4px;
}

/* Beautiful Share Card */
.dakwah-card {
  background: linear-gradient(135deg, #101f37 0%, #081122 100%);
  border: 2px solid var(--color-gold-dim);
  border-radius: 20px;
  padding: 24px 20px;
  margin: 20px 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.dakwah-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  background-image: radial-gradient(var(--color-gold-glow) 1px, transparent 0);
  background-size: 12px 12px;
  pointer-events: none;
}

.dakwah-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-gold-glow);
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 12px;
}

.dakwah-quote-text {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--color-sand-bright);
  font-style: italic;
  margin-bottom: 8px;
  font-weight: 300;
}

.dakwah-quote-source {
  font-size: 0.8rem;
  color: var(--color-gold-dim);
  display: block;
  margin-bottom: 16px;
  font-style: normal;
  font-weight: 600;
}

.dakwah-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
  margin-bottom: 14px;
}

.card-footer-info {
  font-size: 0.8rem;
  opacity: 0.85;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-footer-info span {
  color: #fff;
  font-weight: 600;
}

/* Action Buttons */
.completion-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-display);
}

.primary-btn {
  background: var(--color-gold-glow);
  color: #03060a;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.primary-btn:hover {
  background: #ffdb58;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.text-btn {
  background: transparent;
  color: var(--color-sand-text);
  padding: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.text-btn:hover {
  opacity: 1;
  color: #fff;
}


/* CUSTOM POPUP MODAL (GLASSMORPHISM STYLE) */
.modal-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 5, 8, 0.85);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(14, 28, 48, 0.95) 0%, rgba(8, 16, 29, 0.95) 100%);
  border: 2px solid var(--color-gold-dim);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.25s ease-out;
  max-height: 85%;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-decor-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: float 2s ease-in-out infinite alternate;
}

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

.modal-heading {
  font-size: 1.25rem;
  color: var(--color-gold-glow);
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-body-content {
  margin-bottom: 20px;
  text-align: left;
}

.modal-message-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-sand-text);
  margin-bottom: 14px;
  text-align: center;
  font-style: italic;
}

.grammar-explanation-box {
  background: rgba(3, 6, 10, 0.5);
  border-radius: 8px;
  padding: 12px;
  border-left: 3px solid var(--color-ruby);
  font-size: 0.82rem;
  line-height: 1.4;
}

.grammar-explanation-box.correct-style {
  border-left-color: var(--color-emerald);
}

.grammar-explanation-box strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-gold-glow);
  color: #03060a;
  border: none;
  font-family: var(--font-display);
}

.modal-btn:hover {
  background: #ffdb58;
}

/* Custom Scrollbar for inner boxes */
.modal-card::-webkit-scrollbar, #complete-screen::-webkit-scrollbar, .sublevel-body::-webkit-scrollbar, .achievements-list::-webkit-scrollbar {
  width: 4px;
}

.modal-card::-webkit-scrollbar-thumb, #complete-screen::-webkit-scrollbar-thumb, .sublevel-body::-webkit-scrollbar-thumb, .achievements-list::-webkit-scrollbar-thumb {
  background: var(--color-gold-dim);
  border-radius: 4px;
}

/* Statistics Button Card on Menu Screen */
.stats-btn-card {
  background: rgba(26, 188, 156, 0.08);
  border: 1px solid rgba(26, 188, 156, 0.25);
  color: var(--color-emerald-light);
  font-weight: 600;
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s ease;
  font-family: var(--font-display);
}

.stats-btn-card:hover {
  background: rgba(26, 188, 156, 0.15);
  border-color: var(--color-emerald);
  box-shadow: 0 0 12px rgba(26, 188, 156, 0.2);
}

/* Sub-Level Selection Screen */
.sublevel-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin: 16px 0;
  overflow-y: auto;
  max-height: 520px;
}

.sublevel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
}

.sublevel-card {
  background: rgba(12, 24, 43, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sublevel-card:not(.locked):hover {
  background: rgba(20, 38, 66, 0.8);
  border-color: var(--color-gold-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.sublevel-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(3, 6, 10, 0.3);
}

.sublevel-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.sublevel-status {
  font-size: 0.8rem;
  color: var(--color-gold-glow);
  font-weight: 600;
}

.sublevel-card.locked .sublevel-status {
  color: var(--color-sand-text);
  opacity: 0.6;
}

/* Stats Modal Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.stat-item {
  background: rgba(3, 6, 10, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}

.stat-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-gold-glow);
}

.stat-lbl {
  display: block;
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* Achievements badges list */
.achievements-section {
  text-align: left;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 8px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(3, 6, 10, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  transition: all 0.2s ease;
}

.achievement-item.unlocked {
  border-color: rgba(26, 188, 156, 0.25);
  background: rgba(26, 188, 156, 0.06);
}

.achievement-badge {
  font-size: 1.3rem;
  filter: grayscale(1) opacity(0.4);
  transition: filter 0.3s;
}

.achievement-item.unlocked .achievement-badge {
  filter: none;
}

.achievement-info {
  flex-grow: 1;
}

.achievement-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-sand-text);
  margin-bottom: 1px;
}

.achievement-item.unlocked .achievement-name {
  color: #fff;
  text-shadow: 0 0 5px rgba(26, 188, 156, 0.3);
}

.achievement-desc {
  font-size: 0.68rem;
  opacity: 0.7;
  line-height: 1.25;
}

/* Timer Bar for Time Attack Mode */
.timer-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  z-index: 15;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background-color: var(--color-gold-glow);
  transition: width 1s linear, background-color 0.3s ease;
  box-shadow: 0 0 10px var(--color-gold-glow);
}

/* Combo Multiplier Badge */
.combo-badge {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--color-gold-glow);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.1);
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Glowing Correct Door Animation */
.maze-door.correct-glow {
  border-color: var(--color-emerald-light) !important;
  box-shadow: 0 0 25px var(--color-emerald) !important;
  background: linear-gradient(180deg, #0a1f14 0%, #030a06 100%) !important;
}

/* Sub-Level Room Theme Variations */
#game-container.theme-level-1 {
  --color-sky-light: hsl(220, 35%, 15%);
  --color-fire: hsl(28, 95%, 55%);
}
#game-container.theme-level-2 {
  --color-sky-light: hsl(200, 40%, 15%);
  --color-fire: hsl(190, 95%, 55%); /* Sapphire/Cyan Torches */
}
#game-container.theme-level-3 {
  --color-sky-light: hsl(345, 35%, 15%);
  --color-fire: hsl(355, 95%, 55%); /* Ruby Torches */
}
#game-container.theme-level-4 {
  --color-sky-light: hsl(280, 35%, 15%);
  --color-fire: hsl(280, 95%, 55%); /* Amethyst Torches */
}
#game-container.theme-level-5 {
  --color-sky-light: hsl(45, 40%, 12%);
  --color-fire: hsl(45, 95%, 55%); /* Golden Sun Torches */
}

/* User Profile Styling */
.profile-btn-corner {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(12, 24, 43, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 20px;
  padding: 5px 10px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  z-index: 10;
  font-family: var(--font-display);
}

.profile-btn-corner:hover {
  border-color: var(--color-gold-glow);
  background: rgba(20, 38, 66, 0.9);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.profile-icon-emoji {
  font-size: 0.9rem;
}

.profile-modal-card {
  max-width: 320px;
}

.profile-section {
  margin-bottom: 14px;
  text-align: left;
}

.profile-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-sand-bright);
  margin-bottom: 6px;
  font-weight: 600;
}

.profile-select-row, .profile-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.profile-select {
  flex-grow: 1;
  background: rgba(3, 6, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  font-family: var(--font-display);
}

.profile-input {
  flex-grow: 1;
  background: rgba(3, 6, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  font-family: var(--font-display);
}

.profile-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.profile-input:focus, .profile-select:focus {
  border-color: var(--color-gold-glow);
}

.profile-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: var(--font-display);
}

.profile-action-btn.create-btn {
  background: var(--color-emerald);
  color: #03060a;
  border: none;
}

.profile-action-btn.create-btn:hover {
  background: var(--color-emerald-light);
}

.profile-action-btn.delete-btn {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.4);
  color: #e74c3c;
}

.profile-action-btn.delete-btn:hover {
  background: #e74c3c;
  color: #fff;
}

.backup-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 16px;
}

.profile-backup-actions {
  display: flex;
  gap: 8px;
}

.backup-btn {
  flex: 1;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--color-gold-glow);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-display);
  transition: all 0.2s ease;
}

.backup-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-gold-glow);
}

/* Visual Card Preview in App */
.visual-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #03060a;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.card-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #03060a 0%, #0c182b 50%, #03060a 100%);
  z-index: 1;
}

.card-border-gold {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  right: 8px;
  border: 2px dashed rgba(212, 175, 55, 0.4);
  pointer-events: none;
  z-index: 2;
  border-radius: 8px;
}

.card-decor-stars {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 60px 120px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 150px 80px, #ddd, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 250px 200px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 280px 50px, #aaa, rgba(0,0,0,0));
  background-size: 150px 150px;
  opacity: 0.35;
  z-index: 2;
}

.card-header, .card-profile-section, .card-stats-row, .card-progress-section, .card-badges-section, .card-footer {
  position: relative;
  z-index: 3;
}

.card-title-arabic {
  display: block;
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  color: var(--color-gold-glow);
  line-height: 1.1;
  margin-top: 4px;
}

.card-title-sub {
  display: block;
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.card-profile-section {
  margin: 6px 0;
}

.card-profile-label {
  display: block;
  font-size: 0.55rem;
  color: var(--color-sand-bright);
}

.card-profile-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.card-stats-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0;
}

.card-stat-box {
  background: rgba(3, 6, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px;
  min-width: 60px;
}

.card-stat-val {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-gold-glow);
}

.card-stat-lbl {
  display: block;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.card-progress-section {
  text-align: left;
  margin: 6px 0;
  padding: 0 4px;
}

.card-section-title {
  display: block;
  font-size: 0.52rem;
  color: var(--color-gold-glow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.card-progress-item {
  margin-bottom: 4px;
}

.card-progress-lbl {
  display: block;
  font-size: 0.52rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
}

.card-progress-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-dim) 0%, var(--color-gold-glow) 100%);
  border-radius: 2px;
}

.card-badges-section {
  margin: 4px 0;
  padding: 0 4px;
}

.card-badges-list {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
}

.card-badge-icon {
  width: 24px;
  height: 24px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.card-footer {
  font-size: 0.45rem;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 4px;
  margin-bottom: 4px;
}

/* ==========================================
   COMPACT MENU HEADER
   ========================================== */
.menu-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  margin-bottom: 12px;
}

.menu-title-group {
  flex: 1;
}

.menu-title-group .game-title {
  font-size: 1.6rem;
  text-align: left;
  margin-bottom: 0;
}

.menu-title-group .game-tagline {
  font-size: 0.65rem;
  text-align: left;
  opacity: 0.6;
}

.menu-action-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.menu-icon-btn {
  background: rgba(12, 24, 43, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  padding: 6px 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1rem;
  transition: all 0.2s ease;
  min-width: 44px;
  max-width: 90px; /* cukup untuk 12 karakter nama profil */
}

.menu-icon-btn:hover {
  border-color: var(--color-gold-glow);
  background: rgba(20, 38, 66, 0.85);
}

.menu-icon-label {
  font-size: 0.55rem;
  font-weight: 700;
  opacity: 0.9;
  max-width: 80px; /* cukup untuk nama 12 karakter */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ==========================================
   ACCORDION BAB STYLING
   ========================================== */
#menu-screen {
  justify-content: flex-start;
  padding: 16px 20px;
}

.menu-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.menu-body::-webkit-scrollbar { display: none; }

.select-prompt {
  font-size: 0.8rem;
  color: var(--color-gold-glow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  background: rgba(12, 24, 43, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.accordion-item.open {
  border-color: rgba(212, 175, 55, 0.4);
}

.accordion-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  gap: 10px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: inherit;
}

.accordion-header:hover, .accordion-header:active {
  background: rgba(20, 38, 66, 0.5);
}

.accordion-bab-info {
  flex: 1;
}

.accordion-bab-num {
  font-size: 0.65rem;
  color: var(--color-gold-glow);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}

.accordion-bab-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.accordion-bab-desc {
  font-size: 0.68rem;
  color: var(--color-sand-text);
  opacity: 0.75;
  display: block;
  margin-top: 2px;
}

.accordion-bab-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.accordion-bab-progress {
  font-size: 0.65rem;
  color: var(--color-sand-text);
  opacity: 0.7;
}

.accordion-avg-stars {
  display: flex;
  gap: 1px;
  font-size: 0.75rem;
}

.accordion-chevron {
  font-size: 0.7rem;
  color: var(--color-gold-dim);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.open .accordion-body {
  max-height: 400px;
}

.accordion-sublevel-list {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  padding-top: 10px;
}

.sublevel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(3, 6, 10, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.sublevel-row:hover {
  border-color: rgba(212, 175, 55, 0.25);
  background: rgba(12, 24, 43, 0.7);
}

.sublevel-row.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.sublevel-num {
  width: 24px;
  height: 24px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-gold-glow);
  flex-shrink: 0;
}

.sublevel-info {
  flex: 1;
}

.sublevel-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  display: block;
}

.sublevel-stars {
  display: flex;
  gap: 1px;
  margin-top: 2px;
}

.star-filled {
  color: var(--color-gold-glow);
  font-size: 0.75rem;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
}

.star-empty {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

.sublevel-start-btn {
  background: var(--color-emerald);
  color: #03060a;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-display);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sublevel-start-btn:hover {
  background: var(--color-emerald-light);
  transform: scale(1.05);
}

.sublevel-start-btn.locked-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

/* ==========================================
   HUD: SESSION WRONG COUNTER (Replaces Lives)
   ========================================== */
.hud-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-wrong-display {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

#session-wrong-count {
  color: #e74c3c;
}

.wrong-icon {
  color: rgba(231, 76, 60, 0.7);
  font-size: 0.75rem;
}

/* ==========================================
   CORRECT ANSWER BOX (in modal)
   ========================================== */
.correct-answer-box {
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  text-align: center;
}

.correct-answer-label {
  display: block;
  font-size: 0.72rem;
  color: var(--color-emerald-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.correct-answer-text {
  display: block;
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  color: #fff;
  line-height: 1.4;
}

/* ==========================================
   STAR RESULT DISPLAY (Complete Screen)
   ========================================== */
.star-result-display {
  text-align: center;
  padding: 14px 0;
  margin: 8px 0;
}

.star-result-lbl {
  display: block;
  font-size: 0.72rem;
  color: var(--color-sand-text);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.star-result-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.star-anim {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.15);
  transition: color 0.3s ease, text-shadow 0.3s ease;
  transform: scale(0.8);
  display: inline-block;
}

.star-anim.lit {
  color: var(--color-gold-glow);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
  animation: starPop 0.4s ease forwards;
}

@keyframes starPop {
  0%   { transform: scale(0.5); opacity: 0.5; }
  60%  { transform: scale(1.35); }
  100% { transform: scale(1); opacity: 1; }
}

.star-result-desc {
  font-size: 0.8rem;
  color: var(--color-sand-bright);
  font-weight: 600;
}

/* ==========================================
   COMPLETION SCREEN ADJUSTMENTS
   ========================================== */
.completion-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.completion-body::-webkit-scrollbar { display: none; }

/* ==========================================
   WELCOME / FIRST-TIME NAME ENTRY MODAL
   ========================================== */
.welcome-modal-card {
  max-width: 340px;
  text-align: center;
}

.welcome-decor {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  color: var(--color-gold-glow);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  margin-bottom: 6px;
}

.welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: 0.78rem;
  color: var(--color-sand-text);
  line-height: 1.4;
  margin-bottom: 18px;
}

.welcome-input-section {
  margin-bottom: 16px;
}

.welcome-label {
  display: block;
  font-size: 0.72rem;
  color: var(--color-gold-glow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.welcome-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(3, 6, 10, 0.7);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.welcome-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.welcome-input:focus {
  border-color: var(--color-gold-glow);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.welcome-error {
  font-size: 0.7rem;
  color: var(--color-ruby);
  margin-top: 6px;
  min-height: 16px;
}

.welcome-start-btn {
  width: 100%;
  padding: 14px;
  background: var(--color-emerald);
  color: #03060a;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.welcome-start-btn:hover {
  background: var(--color-emerald-light);
  transform: scale(1.02);
}

.welcome-start-btn:active {
  transform: scale(0.98);
}

.welcome-footer-note {
  font-size: 0.6rem;
  color: var(--color-sand-text);
  opacity: 0.5;
}

/* ==========================================
   GAME TITLE / SPLASH SCREEN STYLING
   ========================================== */
#title-screen {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 32px 24px;
  text-align: center;
  background: radial-gradient(circle at center, var(--color-sky-light) 0%, var(--color-sky-dark) 100%);
  height: 100%;
}

#title-screen.active {
  display: flex;
}

/* Decorative Background */
.title-screen-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.title-mandala {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--color-gold-glow) 0%, transparent 65%);
  opacity: 0.08;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z' fill='black'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  animation: spinMandala 60s linear infinite;
}

@keyframes spinMandala {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.title-glow-effect {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 40%;
  background: radial-gradient(ellipse at bottom, rgba(26, 188, 156, 0.15) 0%, transparent 80%);
}

/* Content Area */
.title-content-area {
  z-index: 2;
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInDownTitle 1s ease-out;
}

@keyframes fadeInDownTitle {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-arab-ornament {
  color: var(--color-gold-glow);
  font-size: 1rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.title-game-arabic {
  font-family: var(--font-arabic);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 40px rgba(212, 175, 55, 0.3);
  margin-bottom: 4px;
}

.title-game-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-gold-glow);
  margin-bottom: 8px;
}

.title-game-tagline {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.75;
  color: var(--color-sand-text);
}

.title-divider-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold-glow), transparent);
  margin-top: 18px;
}

/* Action Area */
.title-actions-area {
  z-index: 2;
  width: 100%;
  max-width: 280px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeInUpTitle 1s ease-out 0.3s backwards;
}

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

.title-start-btn {
  width: 100%;
  padding: 16px;
  background: var(--color-emerald);
  color: #03060a;
  border: 1px solid rgba(26, 188, 156, 0.4);
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 188, 156, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-start-btn:hover {
  background: var(--color-emerald-light);
  box-shadow: 0 6px 25px rgba(26, 188, 156, 0.4);
  transform: translateY(-2px);
}

.pulsing-btn {
  animation: buttonPulse 2.5s infinite;
}

@keyframes buttonPulse {
  0% {
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.25);
  }
  50% {
    box-shadow: 0 4px 25px rgba(26, 188, 156, 0.6), 0 0 0 8px rgba(26, 188, 156, 0.15);
  }
  100% {
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.25);
  }
}

.title-footer-note {
  font-size: 0.65rem;
  color: var(--color-sand-text);
  opacity: 0.45;
}

.title-footer {
  z-index: 2;
  width: 100%;
  animation: fadeInUpTitle 1s ease-out 0.6s backwards;
}
