/* ============================================================
   QUEST INFO PANEL — Solo Leveling Daily Quest screen
   ============================================================ */

.qi-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(ellipse at center, rgba(2, 6, 17, 0.92), rgba(2, 6, 17, 0.98));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  padding: 20px;
  overflow-y: auto;
}
.qi-overlay.show { display: flex; opacity: 1; }

.qi-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(8, 24, 50, 0.95), rgba(15, 30, 60, 0.92));
  border: 1px solid rgba(0, 246, 255, 0.7);
  padding: 38px 28px 30px;
  font-family: 'Rajdhani', sans-serif;
  color: #d8e6ff;
  box-shadow:
    0 0 0 1px rgba(0, 246, 255, 0.25) inset,
    0 0 60px rgba(0, 246, 255, 0.45),
    0 0 120px rgba(0, 246, 255, 0.18);
  clip-path: polygon(
    18px 0, calc(100% - 18px) 0, 100% 18px,
    100% calc(100% - 18px), calc(100% - 18px) 100%,
    18px 100%, 0 calc(100% - 18px), 0 18px
  );
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.qi-overlay.show .qi-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Hex corners */
.qi-panel::before,
.qi-panel::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.qi-panel::before {
  top: 6px; left: 6px;
  border-top: 2px solid #00f6ff;
  border-left: 2px solid #00f6ff;
  filter: drop-shadow(0 0 6px rgba(0, 246, 255, 0.7));
}
.qi-panel::after {
  bottom: 6px; right: 6px;
  border-bottom: 2px solid #00f6ff;
  border-right: 2px solid #00f6ff;
  filter: drop-shadow(0 0 6px rgba(0, 246, 255, 0.7));
}

/* Title */
.qi-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
}
.qi-title {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 246, 255, 0.9), 0 0 4px #fff;
  animation: qi-glitch 4s infinite;
  position: relative;
}
.qi-title::before {
  content: '⚠';
  display: inline-block;
  margin-right: 8px;
  color: #00f6ff;
  text-shadow: 0 0 12px #00f6ff;
  font-size: 17px;
}
.qi-title-line {
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00f6ff, transparent);
  margin: 0 auto 22px;
  box-shadow: 0 0 8px #00f6ff;
}

.qi-subtitle {
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 18px;
  padding: 0 10px;
  line-height: 1.5;
  opacity: 0;
  animation: qi-fadein 0.5s 0.3s forwards;
}

.qi-goals-label {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: #00ffa3;
  text-shadow: 0 0 10px rgba(0, 255, 163, 0.6);
  margin-bottom: 18px;
  opacity: 0;
  animation: qi-fadein 0.5s 0.5s forwards;
}

/* Goal cards */
.qi-goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.qi-goal {
  font-family: 'Rajdhani', sans-serif;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.04), rgba(123, 45, 255, 0.03));
  border: 1px solid rgba(0, 246, 255, 0.18);
  padding: 12px 14px 11px;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  opacity: 0;
  transform: translateX(-15px);
  animation: qi-slidein 0.5s forwards;
}
.qi-goal:hover {
  border-color: rgba(0, 246, 255, 0.4);
}
.qi-goal.is-met {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.07), rgba(0, 246, 255, 0.03));
  border-color: rgba(0, 255, 163, 0.45);
  box-shadow: 0 0 14px rgba(0, 255, 163, 0.18);
}
.qi-goal:nth-child(1) { animation-delay: 0.55s; }
.qi-goal:nth-child(2) { animation-delay: 0.7s; }
.qi-goal:nth-child(3) { animation-delay: 0.85s; }
.qi-goal:nth-child(4) { animation-delay: 1s; }
.qi-goal:nth-child(5) { animation-delay: 1.15s; }
.qi-goal:nth-child(6) { animation-delay: 1.3s; }

/* Head row: status badge | name | quick-add */
.qi-goal-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
}

.qi-status {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 9px;
  border: 1px solid;
  text-align: center;
  border-radius: 2px;
}
.qi-status.complete {
  color: #00ffa3;
  border-color: rgba(0, 255, 163, 0.6);
  background: rgba(0, 255, 163, 0.1);
  text-shadow: 0 0 6px rgba(0, 255, 163, 0.6);
}
.qi-status.incomplete {
  color: #ff3366;
  border-color: rgba(255, 51, 102, 0.5);
  background: rgba(255, 51, 102, 0.06);
}

.qi-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Progress bar under the head row */
.qi-goal-bar {
  height: 6px;
  background: rgba(0, 246, 255, 0.07);
  border: 1px solid rgba(0, 246, 255, 0.12);
  position: relative;
  margin-bottom: 7px;
  overflow: hidden;
}
.qi-goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f6ff 0%, #7b2dff 100%);
  box-shadow: 0 0 10px rgba(0, 246, 255, 0.5);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.qi-goal-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: qi-shimmer 2.4s linear infinite;
}
.qi-goal-bar-fill.met {
  background: linear-gradient(90deg, #00ffa3 0%, #00f6ff 100%);
  box-shadow: 0 0 12px rgba(0, 255, 163, 0.7);
}

.qi-goal-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Orbitron', monospace;
}
.qi-progress {
  font-size: 13px;
  font-weight: 700;
  color: #d8e6ff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: inline-block;
}
.qi-progress.met { color: #00ffa3; text-shadow: 0 0 8px rgba(0, 255, 163, 0.5); }
.qi-progress.pop { animation: qi-val-pop 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.qi-pct {
  font-size: 11px;
  font-weight: 700;
  color: rgba(0, 246, 255, 0.7);
  letter-spacing: 0.1em;
}
.qi-goal.is-met .qi-pct { color: #00ffa3; }

/* Inline +25 / +1KM quick-add button — feels like a satisfying tap target */
.qi-quickadd {
  position: relative;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.18) 0%, rgba(123, 45, 255, 0.12) 100%);
  border: 1px solid rgba(0, 246, 255, 0.6);
  color: #00f6ff;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.18s, background 0.18s, color 0.18s;
  text-transform: uppercase;
  min-width: 68px;
  text-align: center;
  white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  text-shadow: 0 0 6px rgba(0, 246, 255, 0.6);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.qi-quickadd:hover,
.qi-quickadd:focus-visible {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.36) 0%, rgba(123, 45, 255, 0.24) 100%);
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 246, 255, 0.9);
  box-shadow: 0 0 18px rgba(0, 246, 255, 0.5), inset 0 0 12px rgba(0, 246, 255, 0.25);
  outline: none;
}
.qi-quickadd:active { transform: scale(0.94); }

/* Tap ripple — fires on every press via JS class toggle */
.qi-quickadd.tap-pulse::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid #00f6ff;
  clip-path: inherit;
  animation: qi-tap-ripple 0.5s ease-out forwards;
  pointer-events: none;
}

/* Floating "+25" particle that drifts up and fades */
.qi-float {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #00ffa3;
  text-shadow: 0 0 10px rgba(0, 255, 163, 0.95), 0 0 4px #00ffa3;
  pointer-events: none;
  animation: qi-float-up 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

/* Check ✓ for met goals */
.qi-check {
  font-size: 22px;
  width: 68px;
  text-align: center;
}
.qi-check.met {
  color: #00ffa3;
  text-shadow: 0 0 12px rgba(0, 255, 163, 0.8), 0 0 4px #00ffa3;
  animation: qi-check-pop 0.5s ease-out;
}

@keyframes qi-tap-ripple {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes qi-float-up {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}
@keyframes qi-val-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); color: #00ffa3; text-shadow: 0 0 12px rgba(0, 255, 163, 0.8); }
  100% { transform: scale(1); }
}
@keyframes qi-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Quick-add chips row (+10 / +25 / +50 or +0.5 / +1 / +2 km) ───── */
.qi-chips {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}
.qi-chip {
  position: relative;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.1), rgba(123, 45, 255, 0.06));
  border: 1px solid rgba(0, 246, 255, 0.4);
  color: rgba(0, 246, 255, 0.9);
  padding: 9px 6px;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.18s, background 0.18s, color 0.18s;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.qi-chip:hover, .qi-chip:focus-visible {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.26), rgba(123, 45, 255, 0.15));
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.8);
  box-shadow: 0 0 14px rgba(0, 246, 255, 0.45);
  outline: none;
}
.qi-chip:active { transform: scale(0.93); }
.qi-chip.tap-pulse::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid #00f6ff;
  animation: qi-tap-ripple 0.5s ease-out forwards;
  pointer-events: none;
}

/* ── Configuration cog (small, hidden until hover unless mobile) ─── */
.qi-goal-cog {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  border-radius: 4px;
  transition: all 0.18s;
  opacity: 0.5;
}
.qi-goal:hover .qi-goal-cog { opacity: 1; }
.qi-goal-cog:hover, .qi-goal-cog:focus-visible {
  border-color: rgba(0, 246, 255, 0.5);
  color: #00f6ff;
  background: rgba(0, 246, 255, 0.08);
  outline: none;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.6);
}

/* ── Inline goal config editor (NAME / TARGET / HAVE + SAVE/DEL/CANCEL) ─── */
.qi-goal-edit-row {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(0, 246, 255, 0.3);
  border-radius: 4px;
  animation: qi-fadein 0.22s ease-out;
}
.qi-edit-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.qi-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qi-edit-field span {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(0, 246, 255, 0.7);
  font-weight: 700;
}
.qi-edit-field input {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;  /* ≥16 to prevent iOS zoom */
  font-weight: 700;
  background: rgba(2, 6, 17, 0.7);
  border: 1px solid rgba(0, 246, 255, 0.3);
  color: #fff;
  padding: 8px 10px;
  outline: none;
  width: 100%;
  min-width: 0;
  transition: border-color 0.18s, box-shadow 0.18s;
  -moz-appearance: textfield;
}
.qi-edit-field input::-webkit-outer-spin-button,
.qi-edit-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qi-edit-field input:focus {
  border-color: #00f6ff;
  box-shadow: 0 0 10px rgba(0, 246, 255, 0.3) inset;
}
.qi-goal-edit-actions {
  display: flex;
  gap: 8px;
}
.qi-goal-edit-actions button {
  flex: 1;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 9px 10px;
  cursor: pointer;
  text-transform: uppercase;
  border: 1px solid rgba(0, 246, 255, 0.45);
  background: rgba(0, 246, 255, 0.06);
  color: rgba(0, 246, 255, 0.85);
  transition: all 0.18s;
}
.qi-goal-edit-actions button.primary {
  border-color: #00f6ff;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.22), rgba(123, 45, 255, 0.12));
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 246, 255, 0.7);
}
.qi-goal-edit-actions button.del {
  border-color: rgba(255, 51, 102, 0.5);
  color: #ff7a99;
  background: rgba(255, 51, 102, 0.06);
}
.qi-goal-edit-actions button.del:hover {
  border-color: #ff3366;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.45);
}
.qi-goal-edit-actions button.ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
}
.qi-goal-edit-actions button:hover { color: #fff; }

/* + ADD NEW GOAL — full-width dashed */
.qi-add-goal {
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  background: transparent;
  border: 1px dashed rgba(0, 246, 255, 0.35);
  color: rgba(0, 246, 255, 0.7);
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
}
.qi-add-goal:hover {
  border-color: #00f6ff;
  color: #00f6ff;
  background: rgba(0, 246, 255, 0.05);
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.5);
}

/* Warning */
.qi-warning {
  font-size: 13.5px;
  line-height: 1.55;
  text-align: center;
  padding: 14px 8px;
  margin-bottom: 16px;
  color: #ffeaea;
  border-top: 1px dashed rgba(255, 51, 102, 0.35);
  border-bottom: 1px dashed rgba(255, 51, 102, 0.35);
  opacity: 0;
  animation: qi-fadein 0.5s 1.9s forwards;
}
.qi-warning .tag {
  color: #ff3366;
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.7);
  animation: qi-pulse-warn 1.4s ease-in-out infinite;
  display: inline-block;
}

/* Countdown */
.qi-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 14px rgba(0, 246, 255, 0.8);
  letter-spacing: 0.12em;
  opacity: 0;
  animation: qi-fadein 0.5s 2.1s forwards;
  margin-bottom: 16px;
}
.qi-countdown svg {
  width: 22px; height: 22px;
  filter: drop-shadow(0 0 6px rgba(0, 246, 255, 0.7));
}

/* Action buttons */
.qi-actions {
  display: flex;
  gap: 10px;
  opacity: 0;
  animation: qi-fadein 0.5s 2.3s forwards;
}
.qi-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(123, 45, 255, 0.04));
  border: 1px solid rgba(0, 246, 255, 0.55);
  color: #00f6ff;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.qi-btn:hover {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.18), rgba(123, 45, 255, 0.1));
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.7);
  box-shadow: 0 0 22px rgba(0, 246, 255, 0.5);
}
.qi-btn.danger {
  border-color: rgba(255, 51, 102, 0.5);
  color: #ff7a99;
}
.qi-btn.danger:hover {
  border-color: #ff3366;
  color: #fff;
  box-shadow: 0 0 22px rgba(255, 51, 102, 0.5);
}

/* Animations */
@keyframes qi-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qi-slidein {
  from { opacity: 0; transform: translateX(-15px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes qi-glitch {
  0%, 100% { text-shadow: 0 0 12px rgba(0, 246, 255, 0.9), 0 0 4px #fff; }
  92% { text-shadow: 0 0 12px rgba(0, 246, 255, 0.9), 0 0 4px #fff; }
  93% { text-shadow: -2px 0 #ff3366, 2px 0 #00f6ff, 0 0 12px rgba(0, 246, 255, 0.9); }
  94% { text-shadow: 2px 0 #ff3366, -2px 0 #00f6ff, 0 0 12px rgba(0, 246, 255, 0.9); }
  95% { text-shadow: 0 0 12px rgba(0, 246, 255, 0.9), 0 0 4px #fff; }
}
@keyframes qi-check-pop {
  0%   { transform: scale(0) rotate(-90deg); }
  60%  { transform: scale(1.4) rotate(0deg); }
  100% { transform: scale(1); }
}
@keyframes qi-pulse-warn {
  0%, 100% { text-shadow: 0 0 12px rgba(255, 51, 102, 0.7); }
  50%      { text-shadow: 0 0 20px rgba(255, 51, 102, 1), 0 0 32px rgba(255, 51, 102, 0.6); }
}
