/* ==========================================================================
   MADRASAH FATIH – BORDERLESS SWIPE GAME CAROUSEL
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@400;500;600;700;800;900&family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  --nx-font-ui: 'Rajdhani', sans-serif;
  --nx-font-title: 'Exo 2', sans-serif;
  --nx-font-body: 'Fredoka', sans-serif;
  --nx-bg: #f0f4ff;
  --nx-text: #2d3250;
  --nx-text-dim: rgba(45, 50, 80, 0.55);
  --nx-active-color: #8b5cf6;
  --nx-active-rgb: 139, 92, 246;
}

/* BASE */
.nx-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  background: var(--nx-bg);
  font-family: var(--nx-font-ui);
  color: var(--nx-text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.nx-body .grid-overlay,
.nx-body .glow-bg-accent,
.nx-body .particle-orb,
.nx-body .app-header,
.nx-body .app-footer {
  display: none !important;
}

/* PIXEL BG */
.pixel-bg-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pixel-bg-world canvas {
  width: 100%;
  height: 100%;
  opacity: 0.06;
}

.soft-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(96, 211, 148, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(253, 186, 116, 0.08) 0%, transparent 60%);
}

/* TOP BAR */
.nx-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 12px rgba(100, 120, 200, 0.06);
  width: 100%;
  box-sizing: border-box;
}

.nx-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nx-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(124, 58, 237, 0.15));
}

.nx-logo-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nx-logo-label {
  font-family: var(--nx-font-ui);
  font-weight: 700;
  font-size: 14px;
  color: var(--nx-text);
  letter-spacing: 0.5px;
  line-height: 1.15;
}

.nx-logo-label b {
  color: #7c3aed;
}

.nx-logo-sublabel {
  font-family: var(--nx-font-body);
  font-weight: 500;
  font-size: 9.5px;
  color: var(--nx-text-dim);
  letter-spacing: 0.2px;
  line-height: 1.15;
}

.nx-topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nx-hub-label {
  font-family: var(--nx-font-title);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--nx-text);
}

.nx-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nx-clock {
  font-family: var(--nx-font-ui);
  font-weight: 600;
  font-size: 14px;
  color: var(--nx-text-dim);
  letter-spacing: 1px;
}

.nx-icon-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--nx-text-dim);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.nx-icon-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--nx-text);
  box-shadow: 0 2px 10px rgba(100, 120, 200, 0.15);
}

/* MAIN STAGE */
.nx-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Align contents to the top */
  align-items: center;
  overflow: hidden;
  padding: 35px 0 0 0;
}

/* ==========================================================================
   SWIPE CAROUSEL – BORDERLESS
   ========================================================================== */
.swipe-carousel {
  width: 100%;
  height: 400px;
  /* Fixed height raises active logos & arrow buttons */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.swipe-track {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

/* Individual slide – just a floating logo */
.swipe-slide {
  position: absolute;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.22, 0.68, 0.32, 1.0);
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

.swipe-slide-logo {
  width: 440px;
  max-width: 78vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.10));
  transition: filter 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

/* Active slide */
.swipe-slide.active .swipe-slide-logo {
  filter: drop-shadow(0 16px 40px rgba(var(--card-rgb), 0.45));
  animation: logoBreath 3s ease-in-out infinite alternate;
}

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

  100% {
    transform: translateY(-10px) scale(1.03);
  }
}

/* Non-active hover */
.swipe-slide:not(.active):hover {
  opacity: 0.7 !important;
}

/* ==========================================================================
   GAME-STYLE NAV ARROWS
   ========================================================================== */
.game-arrow {
  position: absolute;
  z-index: 30;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--nx-active-rgb), 0.15), rgba(var(--nx-active-rgb), 0.05));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgb(var(--nx-active-rgb));
  box-shadow:
    0 4px 16px rgba(var(--nx-active-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-arrow svg {
  width: 22px;
  height: 22px;
}

.game-arrow-left {
  left: 40px;
}

.game-arrow-right {
  right: 40px;
}

.game-arrow:hover {
  background: linear-gradient(135deg, rgba(var(--nx-active-rgb), 0.3), rgba(var(--nx-active-rgb), 0.12));
  box-shadow:
    0 6px 24px rgba(var(--nx-active-rgb), 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.game-arrow:active {
  transform: translateY(-50%) scale(0.92);
  box-shadow: 0 2px 8px rgba(var(--nx-active-rgb), 0.2);
}

/* Pulse animation on arrows */
.game-arrow::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  border: 2px solid rgba(var(--nx-active-rgb), 0.15);
  animation: arrowPulse 2.5s ease-in-out infinite;
}

@keyframes arrowPulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* ==========================================================================
   GAME INFO PANEL
   ========================================================================== */
.game-info {
  width: 100%;
  max-width: 460px;
  padding: 0 24px;
  text-align: center;
  flex-shrink: 0;
  margin-top: -30px;
  /* Pull info content nicely closer to the logo */
  position: relative;
  z-index: 20;
}

.game-info-inner {
  transition: opacity 0.3s ease;
}

.game-info-inner.fade-switch {
  animation: infoFade 0.35s ease-out both;
}

@keyframes infoFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-info-metas {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.game-info-badge {
  font-family: var(--nx-font-title);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgb(var(--nx-active-rgb));
  background: rgba(var(--nx-active-rgb), 0.1);
  border: 1px solid rgba(var(--nx-active-rgb), 0.2);
  padding: 3px 14px;
  border-radius: 14px;
  transition: all 0.4s;
}

.game-info-meta {
  font-family: var(--nx-font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--nx-text-dim);
}

.game-info-desc {
  font-family: var(--nx-font-body);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--nx-text-dim);
  line-height: 1.5;
  margin: 0 0 12px;
}

/* PLAY BUTTON – game style */
.game-play-btn {
  background: linear-gradient(135deg, rgb(var(--nx-active-rgb)), rgba(var(--nx-active-rgb), 0.75));
  border: none;
  color: white;
  font-family: var(--nx-font-title);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 3px;
  padding: 14px 44px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    0 8px 28px rgba(var(--nx-active-rgb), 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.game-play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0% {
    left: -100%;
  }

  50%,
  100% {
    left: 100%;
  }
}

.game-play-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 36px rgba(var(--nx-active-rgb), 0.5);
}

.game-play-btn:active {
  transform: translateY(0) scale(0.97);
}

.play-icon {
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.game-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.game-tutorial-btn {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(var(--nx-active-rgb), 0.25);
  color: rgb(var(--nx-active-rgb));
  font-family: var(--nx-font-title);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 10px 32px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-tutorial-btn:hover {
  background: rgb(var(--nx-active-rgb));
  color: white;
  border-color: rgb(var(--nx-active-rgb));
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(var(--nx-active-rgb), 0.25);
}

.game-tutorial-btn:active {
  transform: translateY(0) scale(0.98);
}


/* ==========================================================================
   DOTS
   ========================================================================== */
.swipe-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 20px;
  position: relative;
  z-index: 20;
}

.swipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--nx-active-rgb), 0.18);
  cursor: pointer;
  transition: all 0.35s ease;
}

.swipe-dot.active {
  width: 28px;
  border-radius: 10px;
  background: rgb(var(--nx-active-rgb));
  box-shadow: 0 0 12px rgba(var(--nx-active-rgb), 0.4);
}

.swipe-dot:hover:not(.active) {
  background: rgba(var(--nx-active-rgb), 0.35);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.nx-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 8px 20px;
  font-family: var(--nx-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--nx-text-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ==========================================================================
   LAUNCH SPLASH
   ========================================================================== */
.swipe-slide.card-launching .swipe-slide-logo {
  animation: logoLaunch 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes logoLaunch {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  40% {
    transform: translateY(-80px) scale(1.2);
    opacity: 1;
  }

  100% {
    transform: translateY(-160px) scale(0.5);
    opacity: 0;
  }
}

.launch-hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.01s;
}

.launch-hero-overlay.active {
  pointer-events: all;
  opacity: 1;
  visibility: visible;
}

.launch-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--nx-active-rgb), 0.15) 0%, rgba(255, 255, 255, 0.92) 40%, rgba(255, 255, 255, 0.97) 100%);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  transform: scale(0);
  border-radius: 50%;
  animation: none;
}

.launch-hero-overlay.active .launch-hero-bg {
  animation: heroBgExpand 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes heroBgExpand {
  0% {
    transform: scale(0);
    border-radius: 50%;
    opacity: 0;
  }

  60% {
    border-radius: 20%;
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    border-radius: 0;
    opacity: 1;
  }
}

.launch-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(30px);
}

.launch-hero-overlay.active .launch-hero-content {
  animation: heroIn 0.5s 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes heroIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.launch-hero-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
  filter: drop-shadow(0 12px 32px rgba(var(--nx-active-rgb), 0.45));
}

.launch-logo-img {
  width: 320px;
  max-width: 78vw;
  height: auto;
  object-fit: contain;
}

.launch-hero-overlay.active .launch-hero-icon {
  animation: heroIconBounce 1.2s 0.6s ease-in-out infinite alternate;
}

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

  50% {
    transform: translateY(-10px) scale(1.03);
  }

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

.launch-hero-title {
  font-family: var(--nx-font-title);
  font-weight: 800;
  font-size: clamp(18px, 4vw, 26px);
  color: var(--nx-text);
  letter-spacing: -0.5px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(var(--nx-active-rgb), 0.15);
}

.launch-hero-subtitle {
  font-family: var(--nx-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--nx-text-dim);
  letter-spacing: 1px;
  margin-top: 4px;
}

.launch-hero-loader {
  width: 200px;
  height: 4px;
  border-radius: 4px;
  background: rgba(var(--nx-active-rgb), 0.15);
  overflow: hidden;
  margin-top: 8px;
}

.launch-hero-loader-bar {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgb(var(--nx-active-rgb)), rgba(var(--nx-active-rgb), 0.6));
  box-shadow: 0 0 8px rgba(var(--nx-active-rgb), 0.4);
}

.launch-hero-overlay.active .launch-hero-loader-bar {
  animation: loaderFill 1.8s 0.5s ease-in-out forwards;
}

@keyframes loaderFill {
  0% {
    width: 0
  }

  30% {
    width: 40%
  }

  60% {
    width: 70%
  }

  85% {
    width: 90%
  }

  100% {
    width: 100%
  }
}

.nx-body.launching .nx-topbar,
.nx-body.launching .nx-stage,
.nx-body.launching .nx-footer {
  transition: opacity 0.4s ease, filter 0.4s ease;
  opacity: 0.3;
  filter: blur(6px);
  pointer-events: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
/* Bottom Navigation Bar for Mobile */
.mobile-nav-slider {
  display: none;
}

@media (max-width: 600px) {
  #global-fullscreen-btn {
    display: none !important;
  }

  .nx-stage {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
    flex: 1;
    min-height: 0;
  }

  .nx-footer {
    display: none !important;
  }

  .nx-topbar {
    padding: 10px 14px;
  }

  .nx-logo-label {
    display: none;
  }

  .nx-hub-label {
    font-size: 13px;
  }

  .swipe-carousel {
    height: 240px;
    /* Simplified mobile carousel height */
    margin-top: auto;
    margin-bottom: 0;
  }

  .swipe-slide-logo {
    width: 250px;
    /* Simplified mobile active card width */
    max-width: 60vw;
  }

  .game-arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .game-arrow svg {
    width: 18px;
    height: 18px;
  }

  .game-arrow-left {
    left: 16px;
  }

  .game-arrow-right {
    right: 16px;
  }

  .game-play-btn {
    padding: 12px 34px;
    font-size: 13px;
    letter-spacing: 2px;
  }

  .game-tutorial-btn {
    padding: 8px 24px;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .game-actions {
    margin-top: 10px;
    gap: 10px;
  }

  .game-info {
    padding: 0 16px;
    margin-top: 0;
    margin-bottom: auto;
  }

  .game-info-desc {
    font-size: 11.5px;
    margin: 6px 0 12px 0;
    min-height: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
  }

  .swipe-dots {
    display: none !important;
    /* Hide dots on mobile */
  }

  /* Bottom Navigation Slider Styles */
  .mobile-nav-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: auto;
    padding: 6px 0 calc(10px + env(safe-area-inset-bottom, 6px)); /* reduced padding */
    z-index: 20;
    box-sizing: border-box;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  }

  .mobile-nav-label {
    font-family: var(--nx-font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--nx-text-dim);
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0.5px;
  }

  .mobile-nav-track {
    display: flex;
    gap: 14px;
    padding: 8px 0; /* reduced padding */
    width: max-content;
    transition: transform .4s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
    justify-content: flex-start;
    touch-action: pan-y;
    align-self: flex-start;
  }

  .mobile-nav-track::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-item {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transition: transform .3s cubic-bezier(.2, 1.2, .4, 1), border-color 0.3s, box-shadow .3s;
    padding: 8px;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
  }

  .mobile-nav-item.active {
    background: #ffffff;
    border-color: var(--tc);
    transform: scale(1.12) translateY(-3px);
    outline: 3px solid var(--tc);
    outline-offset: 2px;
    box-shadow: 0 6px 16px rgba(var(--nx-active-rgb), 0.3);
  }
}

@media (max-width: 400px) {
  .swipe-carousel {
    height: 200px;
    /* Extremely small height adjustment */
  }

  .swipe-slide-logo {
    width: 200px;
    max-width: 55vw;
  }

  .game-info-desc {
    display: none;
  }

  .game-arrow {
    width: 34px;
    height: 34px;
  }

  .game-arrow-left {
    left: 10px;
  }

  .game-arrow-right {
    right: 10px;
  }

  .game-info {
    margin-top: -15px;
  }
}

/* ==========================================================================
   CHALKBOARD (PAPAN TULIS) MODAL STYLING OVERRIDES
   ========================================================================== */
.global-modal-inner {
  background: #1a2d22 !important;
  /* Chalkboard green */
  border: 12px solid #5a3d28 !important;
  /* Wooden frame */
  border-radius: 16px !important;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.6) !important;
  color: #f5eedc !important;
}

.global-modal-header {
  border-bottom: 2px dashed rgba(255, 255, 255, 0.15) !important;
  padding: 20px 24px 14px 24px !important;
}

.global-modal-header h3 {
  color: #f5eedc !important;
  font-family: var(--nx-font-body) !important;
  font-weight: 700 !important;
  font-size: 19px !important;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.3) !important;
  letter-spacing: 0.5px !important;
}

.global-modal-close-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f5eedc !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: all 0.2s !important;
}

.global-modal-close-btn:hover {
  background: #a93226 !important;
  color: white !important;
  border-color: #a93226 !important;
}

.global-modal-tabs {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  margin: 16px 24px !important;
  padding: 4px !important;
}

.global-modal-tabs .tab-btn {
  color: rgba(255, 255, 255, 0.5) !important;
  font-family: var(--nx-font-title) !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  transition: all 0.2s !important;
}

.global-modal-tabs .tab-btn.active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fbbf24 !important;
  /* Yellow chalk */
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.global-modal-content {
  padding: 0 24px 24px 24px !important;
}

.tutorial-rules-list li {
  color: #f3ebe1 !important;
  font-family: var(--nx-font-body) !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.tutorial-rules-list li::before {
  color: #fbbf24 !important;
  /* Yellow chalk */
  font-size: 15px !important;
}

.setting-option-row {
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.15) !important;
}

.setting-option-label {
  color: #f5eedc !important;
  font-family: var(--nx-font-title) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

/* Custom switch toggle modifications to fit chalkboard */
.slider-toggle {
  background-color: rgba(255, 255, 255, 0.18) !important;
}

input:checked+.slider-toggle {
  background-color: #1b8543 !important;
  /* Active green chalk */
  box-shadow: none !important;
}

.reset-game-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fbbf24 !important;
  /* Yellow chalk styling */
  font-family: var(--nx-font-title) !important;
  font-weight: 700 !important;
  transition: all 0.2s !important;
}

.reset-game-btn:hover {
  background: #a93226 !important;
  color: white !important;
  border-color: #a93226 !important;
}

/* Lobby Burger Dropdown Styles */
.burger-dropdown-lobby {
  position: absolute;
  top: 45px;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  width: 180px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  backdrop-filter: blur(12px);
}

.burger-dropdown-lobby button {
  background: transparent;
  border: none;
  color: #334155;
  padding: 10px 14px;
  text-align: left;
  border-radius: 8px;
  font-family: var(--nx-font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.burger-dropdown-lobby button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.burger-dropdown-lobby button .icon {
  font-size: 14px;
}

/* Modern clean UI styles for custom lobby modal (Donations & Credits) - White Theme */
#lobby-custom-modal .global-modal-inner {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
  color: #1e293b !important;
  padding: 8px !important;
  max-width: 480px;
  width: 90%;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

#lobby-custom-modal .global-modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 16px 20px !important;
}

#lobby-custom-modal .global-modal-header h3 {
  color: #0f172a !important;
  font-family: var(--nx-font-title), sans-serif !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  letter-spacing: 0.2px !important;
  text-shadow: none !important;
}

#lobby-custom-modal .global-modal-close-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #64748b !important;
  border: none !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  font-size: 20px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  padding: 0 !important;
  line-height: 1 !important;
}

#lobby-custom-modal .global-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

#lobby-custom-modal .global-modal-content {
  padding: 20px !important;
}

/* Enable text selection inside lobby custom modal */
#lobby-custom-modal,
#lobby-custom-modal * {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* ==========================================================================
   LACI PENCARIAN & PINTASAN GAME (DEKSTOP SAJA)
   ========================================================================== */
.drawer,
.handle,
.scrim-drawer {
  display: none !important;
}

@media (min-width: 601px) {
  .drawer {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    top: 60px;
    /* Tinggi header navigasi */
    z-index: 45;
    /* Di bawah header (50) tapi di atas konten */
    transform: translateY(-100%);
    will-change: transform;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(139, 92, 246, 0.25);
    padding: 16px 24px 22px;
    box-shadow: 0 10px 30px rgba(100, 120, 200, 0.08);
    box-sizing: border-box;
  }

  .drawer__grabber {
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: rgba(139, 92, 246, 0.15);
    margin: 0 auto 16px;
  }

  .drawer__search-box {
    max-width: 480px;
    margin: 0 auto 20px;
  }

  .drawer-search-input {
    width: 100%;
    padding: 11px 18px;
    border-radius: 30px;
    border: 1.5px solid rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.7);
    font-family: var(--nx-font-body);
    font-size: 14px;
    color: var(--nx-text);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
  }

  .drawer-search-input:focus {
    border-color: #8b5cf6;
    background: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
  }

  .drawer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
  }

  .tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--nx-text-dim);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    box-sizing: border-box;
  }

  .tile:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-3px);
    color: var(--nx-text);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
  }

  .tile__icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
  }

  .tile:hover .tile__icon {
    background: rgba(139, 92, 246, 0.15);
    transform: scale(1.05);
  }

  .tile__logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }

  .tile__label {
    font-family: var(--nx-font-title);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    line-height: 1.2;
  }

  .tile__badge {
    font-family: var(--nx-font-ui);
    font-weight: 700;
    font-size: 9px;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
  }

  .scrim-drawer {
    display: block !important;
    position: fixed;
    inset: 60px 0 0 0;
    z-index: 44;
    background: rgba(45, 50, 80, 0.35);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .drawer-bottom-bar {
    position: absolute;
    bottom: -28px; /* Celah melayang 12px di bawah header navigasi agar bersih dan modern */
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: center;
    pointer-events: none;
    z-index: 46;
  }

  .handle {
    display: flex !important;
    position: relative;
    pointer-events: auto; /* Aktifkan interaksi klik/tarik pada tombol */
    width: 80px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent; /* Sepenuhnya tanpa latar belakang */
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    box-shadow: none; /* Sepenuhnya tanpa bayangan/kotak border */
    box-sizing: border-box;
  }

  .android-drag-line {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #8b5cf6; /* Warna ungu khas */
    opacity: 0.6;
    transition: background-color 0.25s, opacity 0.25s, transform 0.25s;
  }

  .handle:hover .android-drag-line {
    opacity: 1;
    background-color: #7c3aed;
    transform: scaleX(1.2); /* Efek regang (stretching) ala Android 13/14 saat disorot */
  }

  .handle:active .android-drag-line {
    cursor: grabbing;
    opacity: 1;
    background-color: #6d28d9;
    transform: scaleX(0.85); /* Efek ciut (squishing) dinamis saat tombol ditarik/ditekan */
  }
}

/* ==========================================================================
   QURAN REMINDER MODAL STYLES
   ========================================================================== */

/* Custom styling for the Quran modal inner to make it feel like a nice card/memo */
.quran-modal-inner {
  max-width: 520px !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  border: 1px solid rgba(139, 92, 246, 0.15) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden;
  animation: quran-modal-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quran-modal-inner .global-modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: #ffffff !important;
  padding: 20px 28px 16px 28px !important;
  display: flex !important;
  justify-content: space-between !important;
}

.quran-modal-inner .global-modal-header h3 {
  color: #1e293b !important; /* Dark Slate Slate-800 */
  font-family: var(--nx-font-title), sans-serif !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  text-shadow: none !important;
  letter-spacing: 0.5px !important;
  margin: 0 !important;
}

.quran-modal-inner .global-modal-close-btn {
  background: transparent !important;
  color: #475569 !important; /* Dark slate-600 */
  border: none !important;
  font-size: 28px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.quran-modal-inner .global-modal-close-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.quran-header-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.quran-modal-subtitle {
  font-family: var(--nx-font-body), sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #64748b !important;
}

.quran-modal-info {
  font-family: var(--nx-font-body), sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8 !important;
  line-height: 1.3;
  text-align: center;
}

@keyframes quran-modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.quran-modal-content {
  padding: 10px 16px 14px 16px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.02) 0%, transparent 70%);
  overflow: hidden !important;
}

/* --- THE BOOK CONTAINER (ADJUSTED COLORS TO DEEP PURPLE LOBBY THEME) --- */
.book {
  position: relative;
  background: #201540; /* deep violet cover */
  border-radius: 16px;
  padding: 8px 8px 24px;
  box-shadow: 0 15px 35px rgba(20, 12, 42, 0.35), 0 0 0 1px #140c2a inset;
}

.book__stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  min-height: clamp(210px, 32vh, 260px); /* compact height to avoid scroll entirely */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
  touch-action: pan-y;
  cursor: pointer;
  background: #140c2a;
}

.book__hint {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--nx-font-body), sans-serif;
  font-size: 10.5px;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.book__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  color: #201540;
  display: grid;
  place-items: center;
  z-index: 4;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  transition: background 0.2s ease, transform 0.2s ease;
}

.book__nav:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.08);
}

.book__nav svg {
  width: 16px;
  height: 16px;
}

.book__nav--next {
  right: 8px;
}

/* Page slide item styling (compact offsets) */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px; /* tight spacing to fit perfectly */
  text-align: center;
  padding: 12px clamp(12px, 4vw, 20px);
  background-color: var(--paper, #FFF6D6);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, rgba(0,0,0,0.03) 30px);
  box-shadow: 0 0 30px -12px rgba(0,0,0,0.3);
  will-change: transform, opacity;
  box-sizing: border-box;
}

/* Colors for cycle */
.page--c0 { --paper: #FFF6D6; } /* Warm Yellow */
.page--c1 { --paper: #E2F5E6; } /* Soft Mint */
.page--c2 { --paper: #E3F0FF; } /* Pale Sky Blue */
.page--c3 { --paper: #FFE9D8; } /* Peach */
.page--c4 { --paper: #F0E7FF; } /* Lavender */
.page--c5 { --paper: #FFE4ED; } /* Rose Pink */

.page__ref {
  font-family: var(--nx-font-body), sans-serif;
  font-style: italic;
  font-size: 11px;
  color: #5d5547;
  letter-spacing: .03em;
  font-weight: 500;
}

.page__arabic {
  font-family: "Amiri", serif;
  direction: rtl;
  margin: 0;
  color: #2b2620;
  font-size: clamp(18px, 4.5vw, 22px);
  line-height: 1.6;
  font-weight: 400;
  word-spacing: 2px;
}

.page__rule {
  width: 44px;
  height: 1px;
  background: rgba(0,0,0,0.1);
}

.page__translation {
  font-family: var(--nx-font-body), sans-serif;
  margin: 0;
  color: #5d5547;
  font-size: clamp(11.5px, 3.2vw, 13px);
  line-height: 1.5;
  max-width: 38ch;
}

/* Close button (solid purple) */
.quran-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #8b5cf6;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--nx-font-title), sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.quran-btn-close:hover {
  background: #7c3aed;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.quran-btn-close:active {
  transform: translateY(0);
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
  .quran-modal-inner {
    margin: 12px;
    border-radius: 16px !important;
    max-width: calc(100% - 24px) !important;
  }
  
  .quran-modal-content {
    padding: 10px 12px 12px 12px !important;
    gap: 10px;
  }
}

#global-fullscreen-btn {
  display: none !important;
}