/* ---------- Banner ---------- */
#banner {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 32, 48, 0.7);
  backdrop-filter: blur(8px);
  color: #ffd24a;
  font-size: clamp(22px, 5vw, 40px);
  font-weight: 800;
  padding: 18px 36px;
  border-radius: 18px;
  border: 3px solid #ffd24a;
  z-index: 30;
  text-align: center;
  animation: bannerIn 0.5s ease;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- Kitten–mama reunion dialog (top of screen) ---------- */
#reunion-dialog {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: clamp(68px, 11vh, 110px);
  background: rgba(12, 20, 36, 0.38);
  pointer-events: auto;
}
#reunion-dialog.hidden { display: none; }
#reunion-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 24px;
  padding: 18px 24px 22px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
  text-align: center;
  max-width: min(92vw, 400px);
  animation: reunionIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes reunionIn {
  from { opacity: 0; transform: translateY(-24px) scale(0.88); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#reunion-img {
  width: min(260px, 72vw);
  height: auto;
  display: block;
  margin: 0 auto 10px;
  border-radius: 12px;
}
#reunion-msg {
  font-size: clamp(20px, 4.6vw, 28px);
  font-weight: 800;
  color: #4a3b31;
  margin-bottom: 6px;
}
#reunion-pts {
  font-size: clamp(30px, 6.5vw, 44px);
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 2px 0 #000,
    0 0 10px rgba(60, 220, 100, 0.95),
    0 0 22px rgba(40, 200, 80, 0.85);
  margin-bottom: 14px;
  transition: transform 0.45s cubic-bezier(0.34, 1.7, 0.4, 1);
}
#reunion-pts.beating {
  transform: scale(1.2);
  animation: reunionPtsPulse 1.2s ease-in-out infinite;
}
#reunion-pts.hidden {
  display: none;
}
@keyframes reunionPtsPulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.15); }
}
#reunion-ok-btn {
  pointer-events: auto;
  margin-top: 4px;
}
/* ---------- Cat dialogues (kitten + Bubu speech bubbles) ---------- */
.cat-name {
  background: #ffb3c2;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border-radius: 999px;
  padding: 2px 14px;
  margin-top: -22px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}
.cat-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}
.cat-ok-btn {
  background: linear-gradient(180deg, #ff8fab, #ff6d94);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  padding: 8px 30px;
  cursor: pointer;
  box-shadow: 0 3px 0 #d94f78;
  animation: okPulse 1.6s infinite;
}
.cat-ok-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* shared world-anchored speech bubble shell */
.quiz-host-dialog,
#kitten-dialog,
#mama-dialog,
.car-dialog {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
  transform: none;
  animation: none;
  display: block;
}
.quiz-host-bubble,
#kitten-bubble,
#mama-bubble,
.car-bubble {
  position: absolute;
  left: 0;
  top: 0;
  /* leave room below for the speech-tail triangle */
  transform: translate(-50%, calc(-100% - 22px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #4a3b31;
  border-radius: 22px;
  padding: 18px 26px 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  max-width: min(92vw, 520px);
  min-width: min(78vw, 320px);
  text-align: center;
  pointer-events: none;
  animation: speechBubbleIn 0.25s ease;
}
@keyframes speechBubbleIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.quiz-host-bubble::before,
.quiz-host-bubble::after,
#kitten-bubble::before,
#kitten-bubble::after,
#mama-bubble::before,
#mama-bubble::after,
.car-bubble::before,
.car-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.quiz-host-bubble::after,
#kitten-bubble::after,
#mama-bubble::after,
.car-bubble::after {
  bottom: -20px;
  transform: translateX(-50%);
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 20px solid;
}
.quiz-host-bubble::before,
#kitten-bubble::before,
#mama-bubble::before,
.car-bubble::before {
  bottom: -15px;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid rgba(255, 255, 255, 0.96);
  z-index: 1;
}
.quiz-host-bubble .cat-name,
#kitten-bubble .cat-name,
#mama-bubble .cat-name,
.car-bubble .cat-name {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 900;
  padding: 6px 22px;
  margin-top: -32px;
}
.quiz-host-bubble .cat-text,
#kitten-bubble .cat-text,
#mama-bubble .cat-text,
.car-bubble .cat-text {
  font-size: clamp(20px, 4.6vw, 28px);
  font-weight: 800;
  line-height: 1.5;
}
.quiz-host-ok-btn,
#kitten-ok-btn,
.car-drive-btn {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  pointer-events: auto;
  font-size: clamp(18px, 4vw, 22px);
  padding: 12px 40px;
  margin-top: 4px;
  animation: speechOkPulse 1.6s infinite;
}
@keyframes speechOkPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.quiz-host-ok-btn:active,
#kitten-ok-btn:active,
.car-drive-btn:active {
  transform: translateY(2px) scale(1);
  box-shadow: none;
  animation: none;
}

/* Quiz-host NPCs — theme colours from quiz-hosts.json via CSS variables */
.quiz-host-bubble {
  border: 3px solid var(--host-border, #b39dfb);
}
.quiz-host-bubble::after {
  border-top-color: var(--host-border, #b39dfb);
}
.quiz-host-bubble .cat-name {
  background: var(--host-name-bg, #a78bfa);
}
.quiz-host-ok-btn {
  background: linear-gradient(180deg, var(--host-btn-top, #b39dfb), var(--host-btn-bottom, #8b5cf6));
  box-shadow: 0 4px 0 var(--host-btn-shadow, #6d3fd4);
}

/* Kitten — pink */
#kitten-bubble { border: 3px solid #ffb3c2; }
#kitten-bubble::after { border-top-color: #ffb3c2; }
#kitten-bubble .cat-name { background: #ff8fab; }
#kitten-ok-btn {
  background: linear-gradient(180deg, #ff8fab, #ff6d94);
  box-shadow: 0 4px 0 #d94f78;
}

/* Mama — warm orange */
#mama-bubble { border: 3px solid #ffb07a; }
#mama-bubble::after { border-top-color: #ffb07a; }
#mama-bubble .cat-name { background: #ff8c4a; }

/* Cars — theme colours from interactables.json via CSS variables */
.car-bubble {
  border: 3px solid var(--host-border, #48dbfb);
}
.car-bubble::after {
  border-top-color: var(--host-border, #48dbfb);
}
.car-bubble .cat-name {
  background: var(--host-name-bg, #0abde3);
}
.car-drive-btn {
  background: linear-gradient(180deg, var(--host-btn-top, #48dbfb), var(--host-btn-bottom, #0abde3));
  box-shadow: 0 4px 0 var(--host-btn-shadow, #0891b2);
}
