/* ── Level-up overlay ────────────────────────────────────────────────────────── */
#lvlup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: lvl-anim 2.2s ease-out forwards;
  background: radial-gradient(ellipse at center, rgba(124,58,237,0.18) 0%, transparent 65%);
}

#lvlup-box { text-align: center; }

#lvlup-label {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent), 0 0 80px rgba(124,58,237,0.5);
}

#lvlup-num {
  font-size: 110px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 60px var(--accent), 0 0 120px rgba(124,58,237,0.4);
}

#lvlup-unlock {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 0 30px rgba(251,191,36,0.6);
}
#lvlup-unlock:empty { display: none; }

@keyframes lvl-anim {
  0%   { opacity: 0; transform: scale(0.4); }
  18%  { opacity: 1; transform: scale(1.08); }
  35%  { transform: scale(1); }
  72%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ── Confirm modal ────────────────────────────────────────────────────────── */
#confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 700; /* above every modal (600) and the house overlay (500): a confirm can come from any of them */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

#confirm-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 22px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

#confirm-msg {
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 22px;
  text-align: center;
}

.confirm-btns {
  display: flex;
  gap: 10px;
}

.confirm-btns button {
  flex: 1;
}

#confirm-ok {
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

#confirm-ok:hover { background: #dc2626; border-color: #dc2626; }

/* ── Tutorial (guided tour) ────────────────────────────────────────────────── */
#tutorial-btn { margin-left: auto; }

#tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 600; /* above the house overlay (500) so the tour drives it too */
  pointer-events: none; /* let clicks reach the page; the click-guard enforces lock-out */
}

#tut-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 18, 0.82);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

#tut-spotlight {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(8, 8, 18, 0.82), 0 0 24px var(--glow);
  pointer-events: none;
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}

#tut-tooltip {
  position: fixed;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  z-index: 1;
}

#tut-progress {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
}

#tut-title .tut-en {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
#tut-title .tut-fr {
  display: block;
  font-size: 13px;
  font-style: italic;
  color: var(--accent2);
  margin-top: 2px;
}

#tut-body {
  margin-top: 12px;
}
#tut-body .tut-en {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
#tut-body .tut-fr {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  font-style: italic;
  color: var(--muted);
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

#tut-action {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.4);
}
#tut-action .tut-en {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
#tut-action .tut-fr {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  margin-top: 4px;
}

#tut-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.tut-nav-right {
  display: flex;
  gap: 8px;
}
#tut-nav button {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 9px;
}
#tut-skip { padding-left: 0; }

/* On phones the card fills the viewport, so the tooltip can't sit beside it.
   tutorial.js docks it as a bottom sheet (left/right/bottom set inline); cap its
   height and let it scroll so it never grows tall enough to bury the card. */
@media (max-width: 720px) {
  #tut-tooltip {
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
