/* ══════════════════════════════════════════════════════════════════════════════
   مغامرة أبطال الكسور — Stylesheet (fractions_adventure_game.css)
   Full Arabic, RTL-first, Touch-First (iPad Optimized), Responsive & Dynamic
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Games Hub Tile Styling ── */
.fractions-challenge-tile {
  background: linear-gradient(135deg, #d97706 0%, #b45309 45%, #78350f 100%) !important;
  border: 3px solid rgba(255, 255, 255, 0.45) !important;
  border-radius: 26px !important;
  padding: 22px 20px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 14px 32px rgba(180, 83, 9, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 420px;
}

.fractions-challenge-tile:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 42px rgba(217, 119, 6, 0.55) !important;
  border-color: #fde68a !important;
}

.fractions-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.frac-particle {
  position: absolute;
  font-family: var(--font-kids, 'Cairo', sans-serif);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.22);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: floatMathEquation 4.5s ease-in-out infinite alternate;
}

.frac-particle.p1 { top: 8%; left: 8%; font-size: 1.25rem; animation-delay: 0s; }
.frac-particle.p2 { top: 18%; right: 10%; font-size: 1.35rem; animation-delay: 1.2s; color: rgba(253, 224, 71, 0.35); }
.frac-particle.p3 { bottom: 26%; left: 12%; font-size: 2rem; animation-delay: 1.8s; }
.frac-particle.p4 { bottom: 16%; right: 8%; font-size: 1.2rem; animation-delay: 2.5s; color: rgba(251, 191, 36, 0.4); }
.frac-particle.p5 { top: 48%; left: 6%; font-size: 1.4rem; animation-delay: 0.9s; }

.fractions-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  width: 100%;
}

.fractions-tile-title {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
  margin: 4px 0 0 0 !important;
  line-height: 1.25 !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fractions-tile-character-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0 12px 0;
}

.fractions-character-avatar {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 12px auto;
}

.fractions-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  border: 2.5px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.3s ease;
}

.fractions-challenge-tile:hover .fractions-character-avatar img {
  transform: scale(1.04);
}

.fractions-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  border-radius: 16px !important;
  padding: 12px 20px !important;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fractions-play-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.5) !important;
}

/* ── 2. Main Game View Container (#fractions-game-view) ── */
#fractions-game-view {
  min-height: 100vh;
  padding: 24px 16px 60px 16px;
  background: radial-gradient(circle at top center, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  color: #f8fafc;
  font-family: var(--font-kids, 'Cairo', sans-serif);
  direction: rtl;
}

.frac-game-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── 3. Top Navigation & Status Bar ── */
.frac-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.frac-back-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.frac-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(3px);
}

.frac-top-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.frac-title-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

.frac-title-text h1 {
  font-size: 22px;
  font-weight: 800;
  color: #fde68a;
  margin: 0;
  line-height: 1.2;
}

.frac-title-text span {
  font-size: 13px;
  color: #cbd5e1;
}

.frac-top-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.frac-stat-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frac-sound-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.frac-sound-toggle-btn:hover {
  transform: scale(1.1);
}

/* ── 4. Worlds Selection Tabs (العوالم الثمانية) ── */
.frac-worlds-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 22px;
  scrollbar-width: thin;
}

.frac-world-tab {
  flex: 0 0 auto;
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 12px 18px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: 56px;
}

.frac-world-tab:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f1f5f9;
  transform: translateY(-2px);
}

.frac-world-tab.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #fde68a;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
  transform: translateY(-3px) scale(1.03);
}

.frac-world-tab-icon {
  font-size: 24px;
}

.frac-world-tab-info {
  text-align: right;
}

.frac-world-tab-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.frac-world-tab-grade {
  font-size: 11px;
  opacity: 0.8;
}

/* ── 5. Main Game Stage Card ── */
.frac-stage-card {
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(18px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

/* ── Falfool Guide Banner (المرشد فلفول) ── */
.frac-guide-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(253, 224, 71, 0.25);
  border-radius: 20px;
  padding: 14px 20px;
  margin-bottom: 24px;
}

.falfool-avatar-wrap {
  flex: 0 0 60px;
  height: 60px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  border: 2px solid #fde68a;
  animation: falfoolBounce 3s infinite alternate ease-in-out;
}

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

.falfool-speech-bubble {
  flex: 1;
}

.falfool-name {
  font-size: 13px;
  font-weight: 800;
  color: #fde68a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.falfool-text {
  font-size: 16px;
  color: #f8fafc;
  line-height: 1.45;
  font-weight: 600;
}

.falfool-hint-btn {
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid #f59e0b;
  color: #fde68a;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.falfool-hint-btn:hover {
  background: #f59e0b;
  color: #0f172a;
}

/* ── 6. Mission Header & Visual Fractions Area ── */
.frac-mission-header {
  text-align: center;
  margin-bottom: 20px;
}

.frac-mission-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid #818cf8;
  color: #c7d2fe;
  border-radius: 30px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.frac-mission-title {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.frac-mission-instruction {
  font-size: 16px;
  color: #94a3b8;
}

/* ── 7. Interactive Canvas / Play Area ── */
.frac-interactive-canvas-area {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 24px 16px;
  margin-bottom: 24px;
  position: relative;
}

/* Dynamic Pizza SVG Container */
.pizza-interactive-container {
  width: 280px;
  height: 280px;
  position: relative;
  margin: 0 auto 16px auto;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.4));
}

.pizza-slice-svg {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
  transform-origin: 140px 140px;
}

.pizza-slice-svg:hover {
  filter: brightness(1.15) drop-shadow(0 0 10px rgba(253, 224, 71, 0.6));
  transform: scale(1.03);
}

.pizza-slice-svg.selected {
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.9));
  transform: scale(1.05);
}

/* Fraction Counter Live Display */
.frac-live-counter {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 10px 22px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
  margin-top: 10px;
}

.frac-num-row {
  font-size: 26px;
  font-weight: 900;
  color: #fde68a;
  line-height: 1;
  font-family: 'Outfit', 'Cairo', sans-serif;
}

.frac-bar-line {
  width: 100%;
  height: 3px;
  background: #fde68a;
  border-radius: 2px;
  margin: 4px 0;
}

.frac-denom-row {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  font-family: 'Outfit', 'Cairo', sans-serif;
}

/* Fruit Basket Market Style */
.fruit-market-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  max-width: 600px;
  margin-bottom: 20px;
}

.fruit-item-btn {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fruit-item-btn:hover {
  transform: translateY(-4px) scale(1.1);
  background: rgba(255, 255, 255, 0.15);
}

.fruit-item-btn.selected {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
  transform: scale(1.12);
}

/* Percentage Pie & Stat Badge */
.percentage-visual-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.percentage-stat-badge {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #f59e0b;
  border-radius: 18px;
  padding: 8px 24px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.stat-highlight {
  font-size: 26px;
  font-weight: 900;
  color: #fbbf24;
  font-family: 'Outfit', 'Cairo', sans-serif;
  letter-spacing: 0.5px;
}

.stat-sub {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}

/* Equivalent Bars & Circles */
.equiv-bars-container {
  width: 100%;
  padding: 10px;
}

.equiv-circles-container,
.beaker-visual-container,
.frac-math-visual-row,
.mixed-pizzas-visual,
.simplify-visual-row,
.addition-three-visual {
  width: 100%;
  animation: fadeInFrac 0.3s ease-out;
}

@keyframes fadeInFrac {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Comparison Balance Scales */
.balance-scale-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
  width: 100%;
}

.scale-pan {
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 18px 24px;
  min-width: 150px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.scale-pan.heavier {
  transform: translateY(12px);
  border-color: #10b981;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.scale-pan.lighter {
  transform: translateY(-12px);
}

.scale-symbol-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* ── Live Fraction Counter Box ── */
.frac-live-counter-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid #f59e0b;
  border-radius: 18px;
  padding: 10px 22px;
  margin: 14px auto 6px auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.frac-num-row {
  font-size: 26px;
  font-weight: 900;
  color: #fbbf24;
  line-height: 1.1;
  font-family: 'Outfit', 'Cairo', sans-serif;
}

.frac-bar-line {
  width: 100%;
  min-width: 32px;
  height: 3px;
  background: #fde68a;
  border-radius: 2px;
  margin: 4px 0;
}

.frac-denom-row {
  font-size: 26px;
  font-weight: 900;
  color: #fde68a;
  line-height: 1.1;
  font-family: 'Outfit', 'Cairo', sans-serif;
}

/* ── 8. Options and Action Buttons Grid ── */
.frac-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 20px auto;
}

.frac-option-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 12px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Outfit', 'Cairo', sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.frac-option-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fde68a;
  transform: translateY(-3px) scale(1.03);
}

.frac-option-btn.selected {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #fde68a;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.5);
  transform: scale(1.05);
}

/* ── 9. Verification & Next Action Bar ── */
.frac-action-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.frac-verify-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 14px 38px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  min-width: 200px;
  min-height: 60px;
}

.frac-verify-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.55);
}

.frac-reset-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  border-radius: 18px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* ── 10. Success & Celebration Modal Overlay ── */
.frac-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.frac-modal-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 2.5px solid #f59e0b;
  border-radius: 32px;
  padding: 36px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: fracModalPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fracModalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.frac-modal-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: fracPulse 1.5s infinite alternate;
}

@keyframes fracPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.frac-modal-title {
  font-size: 26px;
  font-weight: 900;
  color: #fde68a;
  margin-bottom: 10px;
}

.frac-modal-msg {
  font-size: 17px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 20px;
}

.frac-stars-award-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 32px;
  color: #fbbf24;
  margin-bottom: 24px;
}

.frac-modal-next-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 2px solid #fde68a;
  border-radius: 20px;
  padding: 14px 34px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
  transition: all 0.2s ease;
  width: 100%;
  min-height: 56px;
}

.frac-modal-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.6);
}

/* ── 11. Fractions Lobby & Levels/Modes Selection ── */
.frac-game-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}

.frac-header-card {
  background: linear-gradient(135deg, #78350f 0%, #b45309 45%, #d97706 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--border-radius-lg, 24px);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 28px rgba(180, 83, 9, 0.25);
  color: #ffffff;
}

.frac-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.frac-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.frac-icon-badge {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.2);
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.3);
}

.frac-game-heading {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.frac-game-subheading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fde68a;
  margin: 0;
}

.frac-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.frac-header-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(253, 224, 71, 0.4);
  font-size: 1.1rem;
  font-weight: 900;
  color: #fbbf24;
}

/* ── 8 Worlds Selection Grid ── */
.frac-worlds-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.frac-world-select-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  min-height: 140px;
}

.frac-world-select-card:hover {
  transform: translateY(-4px);
  border-color: #d97706;
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.15);
}

.frac-world-select-card.selected {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.25), 0 8px 20px rgba(217, 119, 6, 0.15);
}

.frac-world-select-card .card-check-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.frac-world-select-card.selected .card-check-badge {
  background: #d97706;
  content: "✓";
}

.frac-world-icon-wrap {
  font-size: 2rem;
  margin-bottom: 8px;
}

.frac-world-card-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #78350f;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.frac-world-card-grade {
  display: inline-block;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.frac-world-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

/* ── Stage Top Bar in Real Game ── */
.frac-stage-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.frac-lobby-btn {
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  padding: 8px 16px !important;
  border-radius: 14px !important;
}

.frac-stage-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.frac-timer-pill {
  background: #fff7ed;
  border: 2px solid #fdba74;
  color: #ea580c;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.frac-timer-pill.urgent {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
  animation: pulseUrgent 0.6s infinite alternate;
}

@keyframes pulseUrgent {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

.frac-lives-pill {
  background: #fdf2f8;
  border: 2px solid #fbcfe8;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.frac-progress-pill {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
}

.frac-progress-track {
  margin-bottom: 18px;
  height: 10px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.frac-progress-fill {
  background: linear-gradient(90deg, #d97706, #f59e0b) !important;
}

/* ── 12. Touch Ergonomics on iPad & Tablets ── */
@media (max-width: 1024px) {
  .frac-worlds-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .frac-top-bar {
    padding: 12px 16px;
  }
  .frac-title-text h1 {
    font-size: 20px;
  }
  .pizza-interactive-container {
    width: 250px;
    height: 250px;
  }
  .frac-option-btn {
    min-height: 64px;
  }
}

@media (max-width: 640px) {
  .frac-worlds-grid {
    grid-template-columns: 1fr;
  }
  .frac-top-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .frac-top-stats {
    width: 100%;
    justify-content: space-between;
  }
  .balance-scale-wrap {
    flex-direction: column;
    gap: 16px;
  }
  .frac-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
