/* CHATI-AI V12 — visual novel mode, seasonal themes, photo album,
   week recap, surprise crossover and the phone ✨ menu. */

/* ---------- Home actions ---------- */
.v12-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.v12-home-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
  border: 1px solid var(--v9-surface-line, rgba(255, 255, 255, 0.1));
  border-radius: 999px;
  background: var(--v9-surface, rgba(24, 22, 36, 0.78));
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
}

.v12-home-actions button:hover {
  border-color: var(--v9-accent-line, rgba(167, 139, 250, 0.4));
  background: var(--v9-accent-soft, rgba(139, 92, 246, 0.16));
}

.v12-home-actions button:active {
  transform: scale(0.95);
}

/* ---------- Chat header: VN button + phone ✨ menu ---------- */
#v12MoreBtn {
  display: none;
  font-size: 18px;
}

@media (max-width: 600px) {
  #v11CardBtn,
  #v11TimelineBtn,
  #v12VnBtn {
    display: none !important;
  }

  #v12MoreBtn {
    display: inline-flex;
  }
}

.v12-more-menu {
  position: fixed;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(22, 19, 36, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  animation: v10-zoom 0.18s ease both;
}

.v12-more-menu button {
  padding: 11px 12px;
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  color: #f4f2ff;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.v12-more-menu button:hover {
  background: var(--v11-soft, var(--v9-accent-soft));
}

/* ---------- Visual novel mode ---------- */
.v12-vn {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: #fff;
  background: #07060d;
  animation: v10-fade 0.3s ease both;
}

.v12-vn-bg {
  position: absolute;
  inset: -20px;
  background: center / cover no-repeat;
  filter: saturate(1.05);
  animation: v12-kenburns 30s ease-in-out infinite alternate;
}

.v12-vn-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 4, 10, 0.15) 0%, rgba(5, 4, 10, 0) 35%, rgba(5, 4, 10, 0.55) 70%, rgba(5, 4, 10, 0.92) 100%);
}

.v12-vn-sprite {
  position: absolute;
  left: 50%;
  bottom: 190px;
  width: min(380px, 70vw);
  height: min(62dvh, 560px);
  object-fit: cover;
  object-position: top;
  border-radius: 28px;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.6));
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  animation: v12-sprite-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.v12-vn.v12-vn-user .v12-vn-sprite {
  opacity: 0.55;
  filter: brightness(0.7) drop-shadow(0 20px 50px rgba(0, 0, 0, 0.6));
  transform: translateX(-50%) scale(0.97);
}

.v12-vn-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  width: 42px;
  height: 42px;
  font-size: 17px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(10, 8, 18, 0.5);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.v12-vn-box {
  position: relative;
  z-index: 2;
  width: min(860px, calc(100% - 24px));
  min-height: 150px;
  margin: 0 auto 10px;
  padding: 26px 22px 14px;
  border: 1px solid var(--v11-line, rgba(167, 139, 250, 0.4));
  border-radius: 22px;
  background: rgba(14, 11, 26, 0.86);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  outline: none;
}

.v12-vn-name {
  position: absolute;
  top: -16px;
  left: 18px;
  padding: 6px 16px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  background: var(--v11-grad, var(--v9-gradient));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.v12-vn.v12-vn-user .v12-vn-name {
  background: rgba(255, 255, 255, 0.16);
}

.v12-vn-picture {
  display: block;
  max-width: 160px;
  max-height: 160px;
  margin-bottom: 10px;
  border-radius: 12px;
  cursor: zoom-in;
}

.v12-vn-text {
  min-height: 72px;
  max-height: 32dvh;
  overflow-y: auto;
  font-size: 17px;
  line-height: 1.6;
  cursor: pointer;
}

.v12-vn-text em {
  color: rgba(255, 255, 255, 0.68);
  font-family: Georgia, "Times New Roman", serif;
}

.v12-vn-hint {
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

.v12-vn-typing {
  display: none;
  gap: 5px;
  margin-top: 8px;
}

.v12-vn.v12-vn-busy .v12-vn-typing {
  display: flex;
}

.v12-vn-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v11-a1, #a78bfa);
  animation: v10-dot 1.1s ease-in-out infinite;
}

.v12-vn-typing i:nth-child(2) { animation-delay: 0.15s; }
.v12-vn-typing i:nth-child(3) { animation-delay: 0.3s; }

.v12-vn-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

.v12-vn-nav button {
  width: 32px;
  height: 28px;
  font-size: 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.v12-vn-input {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  width: min(860px, calc(100% - 24px));
  margin: 0 auto max(14px, env(safe-area-inset-bottom));
}

.v12-vn-input input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(14, 11, 26, 0.8);
  outline: none;
}

.v12-vn-input input:focus {
  border-color: var(--v11-line, rgba(167, 139, 250, 0.5));
}

.v12-vn-input button {
  width: 52px;
  height: 48px;
  font-size: 20px;
  color: #fff;
  border: 0;
  border-radius: 16px;
  background: var(--v11-grad, var(--v9-gradient));
  cursor: pointer;
}

@keyframes v12-kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.12) translate(-1.5%, -1%); }
}

@keyframes v12-sprite-in {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to { opacity: 1; transform: translateX(-50%); }
}

@media (min-width: 900px) {
  .v12-vn-sprite {
    left: 8%;
    bottom: 0;
    height: 84dvh;
    width: min(460px, 34vw);
    transform: none;
    animation-name: v12-sprite-in-desk;
  }

  .v12-vn.v12-vn-user .v12-vn-sprite {
    transform: scale(0.97);
  }

  .v12-vn-box,
  .v12-vn-input {
    margin-left: auto;
    margin-right: 5%;
    width: min(760px, 58%);
  }
}

@keyframes v12-sprite-in-desk {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Photo album ---------- */
.v12-album {
  width: min(760px, 100%);
}

.v12-album-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.v12-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px;
  padding: 6px 4px 10px;
}

.v12-polaroid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 10px;
  color: #1c1726;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: #fbf8f1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transform: rotate(var(--tilt, 0deg));
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.v12-polaroid:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55);
}

.v12-polaroid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
}

.v12-polaroid strong {
  margin-top: 6px;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 14px;
}

.v12-polaroid small {
  font-size: 11px;
  opacity: 0.6;
}

.v12-album-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 10px;
  text-align: center;
  opacity: 0.85;
}

.v12-album-empty img {
  width: 72px;
  height: 72px;
}

/* ---------- Week recap ---------- */
.v12-recap-box .v11-card-preview {
  max-height: 70dvh;
  width: auto;
  margin: 0 auto;
}

/* ---------- Crossover ---------- */
.v12-cross {
  text-align: center;
}

.v12-cross-kicker {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: var(--v9-accent-soft, rgba(139, 92, 246, 0.16));
}

.v12-cross-faces {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 12px;
}

.v12-cross-faces div {
  width: 120px;
  height: 160px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: #241d3a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: v12-flip-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.v12-cross-faces div:last-child {
  animation-delay: 0.08s;
}

.v12-cross-faces img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v12-cross-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 54px;
  font-weight: 800;
  opacity: 0.6;
}

.v12-cross-faces b {
  font-size: 34px;
  color: #c4b5fd;
}

.v12-cross-title {
  display: block;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 22px;
}

.v12-cross-text {
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.85;
}

@keyframes v12-flip-in {
  from { opacity: 0; transform: rotateY(70deg) scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* ---------- Seasonal themes ---------- */
.v12-season-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.v12-season-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  animation: v11-pop 0.4s ease both;
}

.v12-season-banner strong {
  font-size: 14px;
}

.v12-season-banner span {
  font-size: 12.5px;
  opacity: 0.8;
}

html.season-halloween .v12-season-banner {
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.22), rgba(88, 28, 135, 0.28));
}

html.season-winter .v12-season-banner {
  border: 1px solid rgba(147, 197, 253, 0.45);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(165, 180, 252, 0.18));
}

html.season-valentine .v12-season-banner {
  border: 1px solid rgba(244, 114, 182, 0.45);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(190, 24, 93, 0.18));
}

html.season-halloween #homeView {
  background-image:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(234, 88, 12, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 95% 20%, rgba(126, 34, 206, 0.16), transparent 70%) !important;
}

html.season-winter #homeView {
  background-image:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(96, 165, 250, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 95% 20%, rgba(199, 210, 254, 0.12), transparent 70%) !important;
}

html.season-valentine #homeView {
  background-image:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(236, 72, 153, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 95% 20%, rgba(244, 114, 182, 0.12), transparent 70%) !important;
}

html.season-halloween #homeView .top-bar h2::before { content: "🎃 "; }
html.season-winter #homeView .top-bar h2::before { content: "❄️ "; }
html.season-valentine #homeView .top-bar h2::before { content: "💘 "; }

html.season-halloween .v8-chati-fab::after,
html.season-winter .v8-chati-fab::after,
html.season-valentine .v8-chati-fab::after {
  position: absolute;
  top: -10px;
  right: -6px;
  font-size: 20px;
  pointer-events: none;
}

html.season-halloween .v8-chati-fab::after { content: "🎃"; }
html.season-winter .v8-chati-fab::after { content: "🎅"; }
html.season-valentine .v8-chati-fab::after { content: "💘"; }

html.season-halloween .v9-hero {
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.35), 0 18px 50px rgba(234, 88, 12, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .v12-vn-bg,
  .v12-vn-sprite,
  .v12-cross-faces div,
  .v12-season-banner {
    animation: none !important;
  }
}
