/* ==================== SPIKEY TUTORIAL SYSTEM ==================== */
/* Spikey the Bat — TombPlay mascot guide overlay                  */

/* ── Tour Selector (initial modal) ───────────────────────────────── */
.spikey-selector {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  animation: spikey-fade-in 0.35s ease;
}

.spikey-selector-card {
  background: linear-gradient(155deg, #1E1040 0%, #2D1567 60%, #1a0c3a 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 24px;
  padding: 32px 24px 28px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(167,139,250,0.15);
  animation: spikey-bounce-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spikey-selector-mascot {
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 16px rgba(124, 58, 237, 0.5));
  animation: spikey-idle 3s ease-in-out infinite;
}

.spikey-selector-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.spikey-selector-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 26px;
  line-height: 1.65;
}

.spikey-tour-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.spikey-tour-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  width: 100%;
}

.spikey-tour-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: #A78BFA;
  transform: translateY(-1px);
}

.spikey-tour-btn:active { transform: scale(0.98); }

.spikey-tour-btn-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.spikey-tour-btn-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.spikey-tour-btn-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.spikey-skip-link {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  border: none;
  background: none;
  padding: 6px;
  margin-top: 2px;
  display: inline-block;
  transition: color 0.2s;
}
.spikey-skip-link:hover { color: rgba(255, 255, 255, 0.6); }

/* ── Main Overlay ──────────────────────────────────────────────────── */
#spikey-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}

/* Four-corner spotlight shades */
.spikey-shade {
  position: fixed;
  background: rgba(0, 0, 0, 0.82);
  pointer-events: all;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9001;
}

/* Highlight ring around targeted element */
.spikey-ring {
  position: fixed;
  border-radius: 12px;
  border: 2px solid #A78BFA;
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.25),
    inset 0 0 20px rgba(167, 139, 250, 0.08);
  pointer-events: none;
  z-index: 9002;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: ring-pulse 2.4s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { border-color: #A78BFA; box-shadow: 0 0 0 4px rgba(167,139,250,0.25); }
  50% { border-color: #C4B5FD; box-shadow: 0 0 0 6px rgba(167,139,250,0.4), 0 0 24px rgba(167,139,250,0.2); }
}

/* Highlight label badge */
.spikey-highlight-label {
  position: fixed;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: white;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 9003;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  letter-spacing: 0.02em;
}

/* ── Arrow ─────────────────────────────────────────────────────────── */
.spikey-arrow {
  position: fixed;
  pointer-events: none;
  z-index: 9004;
  font-size: 26px;
  line-height: 1;
  animation: arrow-bounce 0.7s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 6px rgba(124, 58, 237, 0.5));
}

@keyframes arrow-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(7px); }
}

/* ── Spikey Character ──────────────────────────────────────────────── */
.spikey-character {
  position: fixed;
  z-index: 9006;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(124, 58, 237, 0.45));
}

.spikey-character.emotion-idle {
  animation: spikey-idle 3s ease-in-out infinite;
}
.spikey-character.emotion-excited {
  animation: spikey-excited 0.55s ease-in-out infinite;
}
.spikey-character.emotion-proud {
  animation: spikey-proud 2s ease-in-out infinite;
}
.spikey-character.emotion-pointing {
  animation: spikey-pointing 1.8s ease-in-out infinite;
}

@keyframes spikey-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40%       { transform: translateY(-5px) rotate(-1deg); }
  80%       { transform: translateY(-3px) rotate(1deg); }
}
@keyframes spikey-excited {
  0%   { transform: scale(1) rotate(0deg); }
  25%  { transform: scale(1.08) rotate(-4deg); }
  75%  { transform: scale(1.08) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes spikey-proud {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-6px) scale(1.04); }
}
@keyframes spikey-pointing {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(4px); }
}

/* ── Speech Bubble ─────────────────────────────────────────────────── */
.spikey-bubble {
  position: fixed;
  z-index: 9007;
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 16px 12px;
  max-width: 230px;
  min-width: 180px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(124, 58, 237, 0.15);
  pointer-events: none;
  animation: spikey-fade-in 0.3s ease;
  border: 1.5px solid rgba(229, 231, 235, 0.9);
}

/* Bubble tail — pointing down-right (Spikey on bottom-right) */
.spikey-bubble::after {
  content: '';
  position: absolute;
  bottom: -16px;
  right: 36px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 4px solid transparent;
  border-top: 16px solid #ffffff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}

/* Bubble tail — pointing down-left (Spikey on bottom-left) */
.spikey-bubble.bubble-left::after {
  right: auto;
  left: 36px;
  border-left: 4px solid transparent;
  border-right: 10px solid transparent;
}

.spikey-bubble-title {
  font-weight: 800;
  font-size: 14px;
  color: #4C1D95;
  margin-bottom: 5px;
  line-height: 1.3;
}

.spikey-bubble-text {
  font-size: 12.5px;
  color: #1F2937;
  line-height: 1.6;
  font-weight: 500;
}

/* ── Controls ──────────────────────────────────────────────────────── */
.spikey-controls {
  position: fixed;
  bottom: 70px; /* above tab bar */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 9010;
  pointer-events: all;
  white-space: nowrap;
  animation: spikey-fade-in 0.35s ease 0.1s both;
}

.spikey-btn {
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  line-height: 1;
}
.spikey-btn:active { transform: scale(0.94); }

.spikey-btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  color: white;
  box-shadow: 0 3px 14px rgba(124, 58, 237, 0.45);
}
.spikey-btn-primary:hover {
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.6);
  transform: translateY(-1px);
}

.spikey-btn-back {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.spikey-btn-back:hover { background: rgba(255, 255, 255, 0.2); }

.spikey-btn-skip {
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  padding: 8px 10px;
  font-weight: 500;
  text-decoration: underline;
}
.spikey-btn-skip:hover { color: rgba(255, 255, 255, 0.65); }

/* ── Progress Dots ─────────────────────────────────────────────────── */
.spikey-progress {
  position: fixed;
  bottom: 116px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 9010;
  pointer-events: none;
}

.spikey-dot {
  height: 6px;
  width: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.spikey-dot.done    { background: rgba(167, 139, 250, 0.5); }
.spikey-dot.active  { width: 22px; border-radius: 3px; background: #A78BFA; }

/* ── Step counter badge ────────────────────────────────────────────── */
.spikey-step-badge {
  position: fixed;
  top: 56px; /* below top nav */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  z-index: 9010;
  pointer-events: none;
  letter-spacing: 0.04em;
  animation: spikey-fade-in 0.3s ease;
}

/* ── Full-screen blank overlay (no selector steps) ─────────────────── */
.spikey-full-shade {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9001;
  pointer-events: all;
}

/* ── Completion screen ─────────────────────────────────────────────── */
.spikey-completion {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  animation: spikey-fade-in 0.4s ease;
  pointer-events: all;
}

.spikey-completion-card {
  background: linear-gradient(155deg, #1E1040, #2D1567 60%, #1a0c3a);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 24px;
  padding: 36px 24px 28px;
  max-width: 320px;
  width: 88%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  animation: spikey-bounce-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spikey-completion-mascot {
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 20px rgba(124, 58, 237, 0.6));
  animation: spikey-proud 2s ease-in-out infinite;
}

.spikey-completion-title {
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}

.spikey-completion-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 24px;
  line-height: 1.6;
}

.spikey-completion-xp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: white;
  font-weight: 800;
  font-size: 16px;
  padding: 8px 18px;
  border-radius: 20px;
  margin-bottom: 22px;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}

.spikey-completion-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: white;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.spikey-completion-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}

/* ── Notification Settings Bottom Sheet ───────────────────────────── */
.notif-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: spikey-fade-in 0.25s ease;
}

.notif-settings-sheet {
  background: var(--bg-secondary, #1a1a1a);
  border-radius: 24px 24px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 12px);
  width: 100%;
  max-width: 480px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.notif-settings-inner {
  padding: 0 20px 24px;
}

.notif-settings-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  margin: 12px auto 20px;
}

.notif-settings-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 22px;
  text-align: center;
}

.notif-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-tertiary, #888);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.notif-row:last-child { border-bottom: none; }

.notif-row-info { flex: 1; }

.notif-row-title {
  font-size: 14px;
  color: var(--text-primary, #fff);
  font-weight: 500;
}

.notif-row-desc {
  font-size: 11.5px;
  color: var(--text-tertiary, #888);
  margin-top: 2px;
}

/* Toggle switch */
.notif-toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.notif-toggle.on { background: #7C3AED; }
.notif-toggle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.notif-toggle.on::after { transform: translateX(18px); }

/* Tutorial restart button */
.notif-tutorial-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #C4B5FD;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: background 0.2s, transform 0.15s;
}
.notif-tutorial-btn:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(168, 85, 247, 0.4));
  transform: translateY(-1px);
}

.notif-section-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 16px 0;
}

/* ── Shared Animations ─────────────────────────────────────────────── */
@keyframes spikey-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes spikey-bounce-in {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
