/* ═══ CHALLENGES MODAL — HACKER THEME ═══ */
/* Overlay and panel chrome use the shared fp-overlay / fp-panel system
   from float-panels.css. Only challenge-specific theme overrides live here. */

/* Immediate dim when challenge check-in modal is open */
#fp-challenges.fp-overlay--checkin-dim .fp-panel {
  filter: brightness(0.18);
  transition: filter 0.12s ease;
}

@keyframes chalFlashRed {
  0%   { box-shadow: 0 0 0 1px rgba(0,255,255,0.08), 0 0 40px rgba(0,255,255,0.18), inset 0 0 80px rgba(0,255,255,0.03); border-color: rgba(0,255,255,0.45); }
  20%  { box-shadow: 0 0 0 2px rgba(255,40,40,0.6), 0 0 40px rgba(255,40,40,0.55), inset 0 0 80px rgba(255,40,40,0.08); border-color: rgba(255,60,60,0.9); }
  50%  { box-shadow: 0 0 0 2px rgba(255,40,40,0.8), 0 0 60px rgba(255,40,40,0.7), inset 0 0 80px rgba(255,40,40,0.12); border-color: rgba(255,80,80,1); }
  80%  { box-shadow: 0 0 0 2px rgba(255,40,40,0.4), 0 0 40px rgba(255,40,40,0.35), inset 0 0 80px rgba(255,40,40,0.06); border-color: rgba(255,60,60,0.6); }
  100% { box-shadow: 0 0 0 1px rgba(0,255,255,0.08), 0 0 40px rgba(0,255,255,0.18), inset 0 0 80px rgba(0,255,255,0.03); border-color: rgba(0,255,255,0.45); }
}
.chal-modal--too-far {
  animation: chalFlashRed 0.7s ease forwards !important;
}

/* ── Scanline CRT overlay ── */
.chal-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 255, 0.018) 2px,
    rgba(0, 255, 255, 0.018) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* ── Scrollable inner ── */
.chal-modal-inner {
  position: relative;
  z-index: 11;
  padding: 22px 22px 26px;
  overflow-y: auto;
  max-height: 88vh;
  overscroll-behavior: contain;
}
.chal-modal-inner::-webkit-scrollbar { width: 4px; }
.chal-modal-inner::-webkit-scrollbar-track { background: #000; }
.chal-modal-inner::-webkit-scrollbar-thumb { background: rgba(0, 255, 255, 0.35); border-radius: 2px; }


/* ── How it works ── */
.chal-how {
  border: 1px solid rgba(0, 255, 255, 0.18);
  border-radius: 2px;
  margin-bottom: 18px;
  background: rgba(0, 255, 255, 0.02);
}
.chal-how-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.1em;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
  transition: color 0.2s;
}
.chal-how-toggle::-webkit-details-marker { display: none; }
.chal-how-toggle::before {
  content: '▶';
  font-size: 12px;
  transition: transform 0.2s;
  display: inline-block;
}
.chal-how[open] .chal-how-toggle::before { transform: rotate(90deg); }
.chal-how-toggle:hover { color: rgba(0, 255, 255, 0.85); }
.chal-how-body {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(0, 255, 255, 0.12);
}
.chal-how-line {
  color: rgba(0, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.9;
}
.chal-how-line strong { color: rgba(0, 255, 255, 0.85); }

/* ── Mode pills ── */
.chal-mode-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.chal-mode-pill {
  flex: 1;
  background: #000;
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 3px;
  color: rgba(0, 255, 255, 0.4);
  cursor: pointer;
  font-family: var(--font-primary);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.chal-mode-pill:hover {
  border-color: rgba(0, 255, 255, 0.55);
  color: rgba(0, 255, 255, 0.75);
}
.chal-mode-pill.active {
  border-color: #00ffff;
  color: #00ffff;
  background: rgba(0, 255, 255, 0.07);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.2), inset 0 0 24px rgba(0, 255, 255, 0.04);
}
.chal-mode-pill.chal-pill-locked {
  opacity: 0.28;
  cursor: not-allowed;
}
.chal-pill-label {
  font-size: 16px;
  letter-spacing: 0.2em;
}
.chal-pill-sub {
  font-size: 12px;
  opacity: 0.8;
}

/* ── Active challenge area ── */
.chal-active-area {
  min-height: 90px;
  margin-bottom: 18px;
}

/* Monthly reset info */
.chal-month-reset {
  color: rgba(0, 255, 255, 0.35);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  margin: -10px 0 14px;
}

/* Empty state — typewriter */
.chal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 12px;
  gap: 8px;
}
.chal-empty-typerow {
  display: flex;
  align-items: center;
  gap: 1px;
  min-height: 1.5em;
}
.chal-typewriter-text {
  color: rgba(0, 255, 255, 0.65);
  font-size: 14px;
  letter-spacing: 0.04em;
}
@keyframes chalCursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.chal-cursor-blink {
  color: #00ffff;
  font-size: 16px;
  animation: chalCursorBlink 0.9s step-end infinite;
  line-height: 1;
}
.chal-empty-sub {
  color: rgba(0, 255, 255, 0.22);
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* Active challenge card */
@keyframes chalCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chal-active-card {
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 3px;
  padding: 14px 16px;
  background: rgba(0, 255, 255, 0.04);
  animation: chalCardIn 0.3s ease;
}
.chal-card-tag {
  color: rgba(0, 255, 255, 0.45);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.chal-card-name {
  color: #00ffff;
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  word-break: break-word;
}
.chal-card-dist {
  color: rgba(0, 255, 255, 0.6);
  font-size: 12px;
  margin-bottom: 10px;
}
.chal-card-dist strong {
  color: #00ffff;
  font-weight: 700;
}
.chal-card-hint {
  color: rgba(0, 255, 255, 0.4);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}
/* Challenge card action buttons */
.chal-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.chal-map-btn,
.chal-checkin-btn {
  flex: 1;
  border-radius: 2px;
  font-family: var(--font-primary);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 10px 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
  white-space: nowrap;
}
.chal-map-btn {
  background: rgba(0, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 255, 0.4);
  color: rgba(0, 255, 255, 0.7);
}
.chal-map-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  color: #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
}
.chal-checkin-btn {
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid #00ffff;
  color: #00ffff;
}
.chal-checkin-btn:hover {
  background: rgba(0, 255, 255, 0.18);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.4);
}
.chal-checkin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Re-roll cost label */
.chal-regen-cost {
  text-align: center;
  color: rgba(0, 255, 255, 0.45);
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-top: 7px;
}

/* No bench in radius */
.chal-no-bench {
  color: rgba(0, 255, 255, 0.5);
  font-size: 12px;
  text-align: center;
  padding: 18px 16px;
  border: 1px dashed rgba(0, 255, 255, 0.22);
  border-radius: 3px;
  line-height: 1.7;
  animation: chalCardIn 0.3s ease;
}
.chal-no-bench strong { color: rgba(0, 255, 255, 0.75); }

/* ── Generate button ── */
@keyframes chalGenPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 255, 0.25); }
  50%       { box-shadow: 0 0 22px rgba(0, 255, 255, 0.55), 0 0 44px rgba(0, 255, 255, 0.15); }
}
.chal-gen-btn {
  width: 100%;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid #00ffff;
  color: #00ffff;
  font-family: var(--font-primary);
  font-size: 14px;
  letter-spacing: 0.14em;
  padding: 13px;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  animation: chalGenPulse 2.8s ease-in-out infinite;
  transition: background 0.2s;
}
.chal-gen-btn:hover {
  background: rgba(0, 255, 255, 0.13);
}
.chal-gen-btn:disabled {
  opacity: 0.45;
  animation: none;
  cursor: not-allowed;
}

/* ── Desktop header Challenges button ── */
/* ── Mobile: hide desktop header btn ── */
@media (max-width: 1024px) {
  .chal-header-btn { display: none !important; }
}

/* ── Mobile: inner padding override ── */
@media (max-width: 479px) {
  .chal-modal-inner {
    padding: 18px 16px 28px;
  }
}

/* ── Challenge achievements — hacker theme in profile view ── */
.achievement.achievement-theme-chal {
  background: #000 !important;
  border: 1px solid rgba(0, 255, 255, 0.4) !important;
  color: rgba(0, 255, 255, 0.85) !important;
  font-family: var(--font-primary) !important;
}
.achievement.achievement-theme-chal.earned {
  border-color: rgba(0, 255, 255, 0.75) !important;
  background: rgba(0, 255, 255, 0.07) !important;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.18) !important;
  color: #00ffff !important;
}
.achievement.achievement-theme-chal.locked {
  opacity: 0.38 !important;
  filter: grayscale(0.5) !important;
}
.achievement.achievement-theme-chal .achievement-icon {
  font-size: 1.1em;
}


#chal-tab-findit {
  overflow-y: auto;
}

#chalRegenCost {
  display: none;
}


/* ── MISSIONS TAB ──── */
.chal-missions-inner {
  padding: 16px;
  background: #000;
  min-height: 200px;
}

.mission-card {
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.20);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.mission-type {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(0, 255, 255, 0.50);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.mission-title {
  font-size: 14px;
  color: rgba(200, 240, 200, 0.90);
  margin-bottom: 4px;
}

.mission-reward {
  font-size: 12px;
  color: rgba(0, 255, 255, 0.70);
}

.mission-progress {
  margin-top: 8px;
  height: 3px;
  background: rgba(0, 255, 255, 0.10);
  border-radius: 2px;
  overflow: hidden;
}

.mission-progress-fill {
  height: 100%;
  background: #0ff;
  border-radius: 2px;
  transition: width 0.5s ease;
}
