/* Modal Overlay Base System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px 10px;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Welcome Launcher Modal */
.welcome-card {
  background: rgba(25, 30, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 540px;
  width: 92vw;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(170, 204, 136, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.welcome-hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #d8f3dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.welcome-preview-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 20px;
  height: 150px;
  background: #111;
}

.welcome-preview-card canvas, .welcome-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.welcome-artwork-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.quick-diff-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.quick-diff-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 4px 8px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.quick-diff-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.quick-diff-btn.active {
  background: var(--accent-green);
  color: #1e231a;
  border-color: var(--accent-green);
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(170, 204, 136, 0.4);
}

.quick-diff-num {
  font-size: 1.1rem;
  font-weight: 800;
}

.quick-diff-lbl {
  font-size: 0.65rem;
  opacity: 0.85;
}

/* Gamified Difficulty Tags */
.diff-chip-tag {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.2px;
  margin-top: 2px;
  text-transform: uppercase;
}

.tag-warmup {
  background: rgba(255, 255, 255, 0.1);
  color: #c5ccc0;
}

.tag-rec {
  background: rgba(255, 209, 102, 0.25);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.4);
}

.quick-diff-btn.active .tag-rec {
  background: #1e231a;
  color: #ffd166;
  border: none;
}

.tag-xp {
  background: rgba(255, 107, 129, 0.2);
  color: #ff8a98;
  border: 1px solid rgba(255, 107, 129, 0.4);
}

.quick-diff-btn.active .tag-xp {
  background: #1e231a;
  color: #ff6b81;
  border: none;
}

.tag-trophy {
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe;
  border: 1px solid rgba(79, 172, 254, 0.4);
}

.quick-diff-btn.active .tag-trophy {
  background: #1e231a;
  color: #4facfe;
  border: none;
}

.category-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.cat-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-pill:hover, .cat-pill.active {
  background: rgba(170, 204, 136, 0.25);
  border-color: var(--accent-green);
  color: #fff;
}

/* Visual Photo Gallery Modal */
.gallery-modal-card {
  background: rgba(25, 30, 22, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 24px;
  max-width: 920px;
  width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.7);
  overflow: hidden;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.gallery-search-bar {
  margin-bottom: 14px;
  position: relative;
  flex-shrink: 0;
}

.gallery-search-bar input:focus {
  border-color: var(--accent-green) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 0 12px rgba(170, 204, 136, 0.35);
}

.gallery-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px 2px;
  margin-bottom: 14px;
  scrollbar-width: none;
  flex-shrink: 0;
}

.gallery-tab-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 7px 16px;
  border-radius: 20px;
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-tab-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-green);
}

.gallery-tab-btn.active, .gallery-tab-btn:hover {
  background: var(--accent-green);
  color: #1e231a;
  border-color: var(--accent-green);
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: 120px;
  gap: 14px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1;
  min-height: 0;
  max-height: 55vh;
}

.gallery-card, .gallery-item {
  position: relative;
  height: 125px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  background: #151a14;
}

.gallery-card:hover, .gallery-item:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent-green);
  box-shadow: 0 8px 22px rgba(0,0,0,0.6);
  z-index: 2;
}

.gallery-card img, .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-card:hover img, .gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-card-info, .gallery-item-info, .gallery-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0) 100%);
  color: #ffffff;
  pointer-events: none;
}

.gallery-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Rewarded Video Ad Modal */
.rewarded-ad-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px;
  width: 90%;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 209, 102, 0.15);
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd166;
  margin-bottom: 14px;
}

.ad-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.ad-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 18px;
  line-height: 1.4;
}

.video-player-screen {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: #000;
  margin-bottom: 16px;
}

.video-player-screen canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.video-overlay-info {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #fff;
}

.ad-timer-pill {
  background: rgba(0, 0, 0, 0.75);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.sponsor-tag {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}

.ad-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #aacc88, #ffd166);
  transition: width 0.1s linear;
}

/* Clean, Minimal & High-Impact Victory Modal */
.victory-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 22px 22px 18px;
  width: 92%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(24px);
}

.victory-header-clean {
  margin-bottom: 12px;
}

.victory-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 3px;
  background: linear-gradient(135deg, #ffffff 0%, #d8f3dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.victory-subtitle-clean {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.victory-artwork-name {
  font-weight: 700;
  color: var(--accent-green);
}

.victory-dot-sep {
  opacity: 0.5;
}

.victory-streak-badge {
  color: #ffd166;
  font-weight: 700;
}

/* Compact Clean Stat Strip */
.stat-strip-clean {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.stat-item-clean {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: left;
}

.stat-icon-clean {
  font-size: 1.15rem;
}

.stat-val-clean {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.stat-lbl-clean {
  font-size: 0.55rem;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Hero Auto-Play Next Card */
.next-hero-card {
  background: linear-gradient(135deg, rgba(170, 204, 136, 0.08) 0%, rgba(255, 209, 102, 0.08) 100%);
  border: 1px solid rgba(170, 204, 136, 0.3);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  text-align: left;
}

.next-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.next-teaser-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
}

.next-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.teaser-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 6px #ffd166;
  animation: pulseDot 1.4s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.dynamic-scale-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(170, 204, 136, 0.2);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.auto-play-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pause-countdown-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.pause-countdown-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.auto-countdown-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  overflow: hidden;
}

.auto-countdown-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffd166, #ff6b81);
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Minimal 2-Action Secondary Footer */
.victory-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.victory-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.victory-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.victory-action-btn.primary {
  border-color: rgba(255, 209, 102, 0.4);
  color: #ffd166;
}

.victory-action-btn.primary:hover {
  background: rgba(255, 209, 102, 0.18);
}  font-weight: 800;
}

/* How to Play Step Slider Modal */
.help-slider-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.step-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  background: rgba(170, 204, 136, 0.15);
  border: 1px solid rgba(170, 204, 136, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
}

.help-slides-container {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInSlide 0.3s ease;
}

.help-slide.active {
  display: flex;
}

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

.slide-illustration {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.slide-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.slide-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 340px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  width: 24px;
  border-radius: 10px;
  background: var(--accent-green);
}

.slider-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Reference Image Modal */
.img-modal-card {
  background: #000;
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px;
  max-width: 80vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-modal-card canvas, .img-modal-card img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

/* Floating Onboarding Tip & Resume Banner */
.onboarding-tip-pill {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 25, 18, 0.92);
  border: 1px solid var(--accent-green);
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 100;
  animation: bounceTip 2s infinite ease-in-out;
}

@keyframes bounceTip {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

.resume-banner-pill {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(35, 45, 30, 0.95);
  border: 1px solid rgba(255, 209, 102, 0.6);
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.82rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 101;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
  .rewarded-ad-card, .victory-card, .help-slider-card {
    padding: 20px 16px;
    border-radius: 18px;
  }
}
