/* Tarot-Chat Rider-Waite (Esmeralda).
   Piel NOCTURNA (2026-08-08): mismos selectores y maquetación que la
   versión de WordPress, pero con la paleta del tema — noche #0a0816,
   oro #c9a45c / #e9c87f, lila de la sección chat #d8a8e8. Autónomo:
   valores en duro, sin variables del tema (con su mismo resultado).
   Incluye el mazo interactivo de 78 cartas boca abajo (.ct-deck). */
.ct-page { max-width: 760px; margin: 0 auto; }
.ct-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.ct-intro { color: #9a92b0; max-width: 46rem; margin: 0 auto 1.2rem; line-height: 1.55; text-align: center; }

.ct-window {
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(201, 164, 92, .30);
  border-radius: 16px;
  padding: 1rem;
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}

.ct-messages { display: flex; flex-direction: column; gap: .65rem; }

.ct-msg {
  max-width: 85%;
  padding: .6rem .85rem;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: ct-in .25s ease both;
  color: #f0ebf6;
  font-size: 1rem;
}
.ct-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #46306b, #5a3f85);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ct-msg.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .10);
  border-bottom-left-radius: 4px;
}
.ct-msg.assistant::before { content: '🔮 '; }

/* Cursor parpadeante mientras el texto se va "escribiendo" */
.ct-msg.assistant.is-typing::after {
  content: '▍';
  animation: ct-cursor .8s steps(1) infinite;
  opacity: .8;
}
@keyframes ct-cursor { 50% { opacity: 0; } }
@keyframes ct-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Tirada de cartas dentro del chat */
.ct-cards {
  align-self: center;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .35rem 0;
}
.ct-cards figure { margin: 0; text-align: center; width: 88px; animation: ct-flipin .55s ease both; animation-delay: var(--d, 0s); perspective: 600px; }
.ct-cards img { width: 88px; border-radius: 8px; border: 1px solid rgba(201, 164, 92, .45); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.ct-cards figcaption { font-size: .72rem; margin-top: .3rem; color: #d8a8e8; font-family: Georgia, 'Times New Roman', serif; }
/* Posición de la carta en la tirada (pasado / presente / futuro) */
.ct-cards__pos {
  display: block;
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #c9a45c;
  margin-bottom: .1rem;
}
/* Las cartas elegidas entran girando, como si se voltearan sobre la mesa */
@keyframes ct-flipin {
  from { opacity: 0; transform: rotateY(95deg) translateY(4px); }
  to   { opacity: 1; transform: rotateY(0) translateY(0); }
}

/* ── Mazo interactivo: 78 dorsos en abanico desplazable ─────────────── */
.ct-deck { align-self: stretch; margin: .4rem 0 .2rem; animation: ct-in .3s ease both; }
.ct-deck__hint {
  text-align: center;
  font-size: .85rem;
  color: #d8a8e8;
  margin: 0 0 .45rem;
}
/* Cartas repartidas sobre la mesa: sin solapado ni scroll — se centran
   solas y saltan de fila cuando no caben (robusto dentro de cualquier
   tema y en cualquier ancho de pantalla). */
.ct-deck__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem .45rem;
  padding: .7rem .2rem .8rem;
}
.ct-deck__card {
  flex: 0 0 auto;
  width: 56px;
  height: 95px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(201, 164, 92, .55);
  border-radius: 6px;
  background: #182448;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, opacity .3s ease;
}
/* El dorso es una <img> dentro del botón (así el hover no lo pisa). */
.ct-deck__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  border-radius: inherit;
}
.ct-deck__card:hover img, .ct-deck__card.sel img { filter: brightness(1.12); }
.ct-deck__card:hover, .ct-deck__card:focus-visible { transform: translateY(-8px); z-index: 2; }
.ct-deck__card:focus-visible { outline: 3px solid #e9c87f; outline-offset: 3px; }
.ct-deck__card.sel {
  transform: translateY(-14px);
  box-shadow: 0 0 0 2px #c9a45c, 0 8px 18px rgba(0, 0, 0, .5);
  z-index: 3;
}
/* Numerito del orden de elección (1, 2, 3) */
.ct-deck__card.sel::after {
  content: attr(data-n);
  position: absolute;
  top: -9px;
  right: -7px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #c9a45c;
  color: #1a1108;
  font-size: .7rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
/* Elección completa: el resto del mazo se apaga mientras llega la lectura */
.ct-deck.done .ct-deck__card:not(.sel) { opacity: .4; pointer-events: none; }
.ct-deck.done .ct-deck__card.sel { pointer-events: none; }

/* Indicador de "escribiendo…" */
.ct-typing { display: flex; gap: .3rem; padding: .7rem .5rem 0; }
.ct-typing[hidden] { display: none; } /* display:flex pisa al atributo hidden */
.ct-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d8a8e8;
  animation: ct-dot 1.1s ease-in-out infinite;
}
.ct-typing span:nth-child(2) { animation-delay: .18s; }
.ct-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ct-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* Formulario */
.ct-form { display: flex; gap: .6rem; margin-top: .9rem; align-items: flex-end; }
.ct-input {
  flex: 1;
  resize: none;
  border-radius: 12px;
  padding: .65rem .8rem;
  font: inherit;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  color-scheme: dark;
}
.ct-input::placeholder { color: #9a92b0; }
.ct-input:focus { outline: 2px solid #e9c87f; }
.ct-input:disabled { opacity: .55; cursor: not-allowed; }
.ct-send {
  white-space: nowrap;
  background: linear-gradient(180deg, #f3d9a4, #d9a05c);
  color: #2a1420;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: .65rem 1.3rem;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
  transition: filter .18s ease;
}
.ct-send:hover { filter: brightness(1.07); }
.ct-send:disabled { opacity: .55; cursor: progress; }

.ct-actions { text-align: center; margin-top: .8rem; }
.ct-restart {
  background: transparent;
  color: #e9c87f;
  border: 1px solid rgba(201, 164, 92, .40);
  border-radius: 12px;
  padding: .5rem 1.1rem;
  cursor: pointer;
  font-size: .95rem;
  transition: background .18s ease;
}
.ct-restart:hover { background: rgba(201, 164, 92, .12); }
.ct-restart:disabled { opacity: .55; }
.ct-disclaimer { text-align: center; font-size: .8rem; color: #7d7591; margin-top: 1rem; }
.ct-privacy { text-align: center; font-size: .76rem; line-height: 1.45; color: #716a83; margin: .35rem auto 0; max-width: 42rem; }
.ct-privacy__link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.ct-privacy__link:hover, .ct-privacy__link:focus-visible { color: #8b849d; border-bottom-color: currentColor; outline: none; }

@media (max-width: 560px) {
  .ct-window { max-height: 55vh; }
  .ct-msg { max-width: 92%; }
  .ct-cards figure, .ct-cards img { width: 72px; }
  /* En móvil: dos filas de 6 cartas, centradas */
  .ct-deck__strip { gap: .45rem .35rem; }
  .ct-deck__card { width: 44px; height: 75px; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-msg, .ct-cards figure, .ct-deck { animation: none; }
  .ct-deck__card, .ct-deck__card.sel { transition: none; }
  .ct-window { scroll-behavior: auto; }
}

/* ── Sala privada de Esmeralda · rediseño 2026-08-19 ─────────────── */
.ct-page {
  max-width: 920px;
  position: relative;
}

.ct-hero {
  position: relative;
  isolation: isolate;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid rgba(222, 181, 105, .34);
  border-radius: 26px;
  background: #100b1d;
  box-shadow: 0 26px 65px rgba(0, 0, 0, .52), 0 0 0 1px rgba(255, 255, 255, .025) inset;
}
.ct-hero::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 70px rgba(4, 2, 10, .35);
}
.ct-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.ct-hero__veil {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 6, 18, .04) 18%, rgba(10, 6, 18, .28) 48%, rgba(9, 5, 16, .94) 100%);
}
.ct-hero__copy {
  position: relative;
  z-index: 3;
  width: min(43%, 355px);
  margin-left: auto;
  padding: 3.25rem 2.4rem 2.7rem 1rem;
  text-align: left;
}
.ct-hero__kicker {
  display: block;
  margin-bottom: .8rem;
  color: #e8c985;
  font: 700 .68rem/1.2 system-ui, sans-serif;
  letter-spacing: .22em;
}
.ct-hero h2 {
  margin: 0 0 .7rem;
  color: #fff8ec;
  font: 400 clamp(2rem, 4vw, 3.1rem)/.98 Georgia, 'Times New Roman', serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.ct-hero__copy p {
  margin: 0;
  color: #c9bfd4;
  font-size: .94rem;
  line-height: 1.58;
}

.ct-intro {
  max-width: 48rem;
  margin: 1.45rem auto 1.55rem;
  color: #aaa0bb;
  font-size: .96rem;
}

.ct-app {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(215, 171, 91, .27);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(112, 65, 144, .18), transparent 34%),
    linear-gradient(145deg, rgba(26, 17, 39, .98), rgba(10, 7, 18, .99));
  box-shadow: 0 28px 75px rgba(0, 0, 0, .46), inset 0 1px rgba(255, 255, 255, .035);
}
.ct-app::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(circle at 15% 22%, #d6b56e 0 1px, transparent 1.5px),
    radial-gradient(circle at 86% 16%, #bea1d8 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 76%, #d6b56e 0 1px, transparent 1.5px);
}

.ct-reader {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 70px;
  padding: .25rem .35rem 1rem;
}
.ct-reader__portrait {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
}
.ct-reader__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid rgba(229, 194, 124, .78);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(205, 166, 91, .09), 0 8px 25px rgba(0, 0, 0, .42);
}
.ct-reader__pulse {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 13px;
  height: 13px;
  border: 2px solid #171021;
  border-radius: 50%;
  background: #72d5a0;
  box-shadow: 0 0 11px rgba(114, 213, 160, .75);
}
.ct-reader__identity { display: flex; flex-direction: column; min-width: 0; }
.ct-reader__identity strong {
  color: #fff5e6;
  font: 400 1.38rem/1.1 Georgia, 'Times New Roman', serif;
}
.ct-reader__identity span { margin-top: .22rem; color: #9388a4; font-size: .78rem; letter-spacing: .045em; }
.ct-reader__status {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  padding: .42rem .68rem;
  border: 1px solid rgba(114, 213, 160, .18);
  border-radius: 999px;
  background: rgba(114, 213, 160, .055);
  color: #9fc7ad;
  font-size: .72rem;
}
.ct-reader__status i { width: 6px; height: 6px; border-radius: 50%; background: #72d5a0; }

.ct-window {
  position: relative;
  z-index: 1;
  min-height: 370px;
  max-height: 64vh;
  padding: 1.25rem;
  border: 1px solid rgba(225, 190, 125, .18);
  border-radius: 19px;
  background:
    radial-gradient(circle at 12% 0%, rgba(126, 78, 158, .11), transparent 32%),
    linear-gradient(180deg, rgba(7, 5, 13, .93), rgba(11, 7, 17, .97));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), inset 0 -40px 80px rgba(0, 0, 0, .13);
}
.ct-messages { gap: .8rem; }
.ct-msg {
  max-width: 80%;
  padding: .74rem 1rem;
  border-radius: 16px;
  font-size: .98rem;
  line-height: 1.58;
  box-shadow: 0 7px 22px rgba(0, 0, 0, .18);
}
.ct-msg.assistant {
  border: 1px solid rgba(217, 177, 103, .16);
  border-bottom-left-radius: 5px;
  background: linear-gradient(135deg, rgba(49, 35, 56, .95), rgba(30, 23, 39, .96));
  color: #eee7f1;
}
.ct-msg.assistant::before { content: '✦'; color: #d9b367; margin-right: .38rem; }
.ct-msg.user {
  border: 1px solid rgba(209, 178, 232, .18);
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, #5b3976, #3e285d);
  color: #fff;
}

.ct-deck {
  margin: .65rem 0 .25rem;
  padding: 1rem .75rem .7rem;
  border: 1px solid rgba(211, 170, 94, .22);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at center, rgba(111, 53, 104, .30), transparent 68%),
    linear-gradient(135deg, rgba(47, 16, 45, .86), rgba(21, 9, 27, .94));
  box-shadow: inset 0 0 35px rgba(0, 0, 0, .32), 0 10px 25px rgba(0, 0, 0, .18);
}
.ct-deck__hint { color: #e4c782; font-family: Georgia, 'Times New Roman', serif; font-size: .93rem; }
.ct-deck__hint:focus { outline: none; }
.ct-deck__strip { gap: .65rem .5rem; padding: .85rem .25rem 1rem; }
.ct-deck__card { width: 58px; height: 99px; border-color: rgba(226, 190, 118, .60); box-shadow: 0 5px 11px rgba(0, 0, 0, .35); }
.ct-deck__card.sel { box-shadow: 0 0 0 2px #e3bd6d, 0 0 20px rgba(227, 189, 109, .33), 0 12px 22px rgba(0, 0, 0, .55); }

.ct-cards { gap: 1rem; margin: .65rem 0 .8rem; }
.ct-cards figure { width: 106px; }
.ct-cards img { width: 106px; border: 1px solid rgba(229, 193, 120, .62); box-shadow: 0 12px 28px rgba(0, 0, 0, .52), 0 0 20px rgba(157, 103, 182, .10); }
.ct-cards figcaption { margin-top: .48rem; color: #e0c8e7; font-size: .76rem; }
.ct-cards__pos { color: #d9b367; }

.ct-form {
  position: relative;
  z-index: 1;
  gap: .65rem;
  margin-top: .85rem;
  padding: .48rem;
  border: 1px solid rgba(218, 181, 112, .22);
  border-radius: 16px;
  background: rgba(4, 3, 9, .52);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}
.ct-input {
  min-height: 46px;
  padding: .72rem .78rem;
  border: 0;
  background: transparent;
  color: #fff9f1;
}
.ct-input:focus { outline: none; }
.ct-form:focus-within { border-color: rgba(231, 196, 127, .65); box-shadow: 0 0 0 3px rgba(221, 183, 108, .08); }
.ct-send {
  min-height: 46px;
  padding: .7rem 1.45rem;
  border: 1px solid rgba(255, 238, 199, .24);
  background: linear-gradient(180deg, #f0d391, #c99149);
  color: #241426;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 255, 255, .4);
}
.ct-send:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ct-actions { position: relative; z-index: 1; margin: .8rem 0 0; }
.ct-restart { border-color: rgba(211, 173, 100, .26); color: #cbae79; font-size: .82rem; }
.ct-disclaimer { position: relative; z-index: 1; margin: .8rem 0 0; color: #686076; font-size: .72rem; }
.ct-privacy { position: relative; z-index: 1; margin-top: .24rem; color: #5e576b; font-size: .68rem; }
.ct-privacy__link:hover, .ct-privacy__link:focus-visible { color: #777084; }

@media (max-width: 700px) {
  .ct-hero { min-height: 355px; border-radius: 21px; }
  .ct-hero__image { object-position: 31% center; }
  .ct-hero__veil { background: linear-gradient(180deg, rgba(8, 5, 14, .02) 22%, rgba(8, 5, 14, .22) 48%, rgba(8, 5, 14, .97) 85%); }
  .ct-hero__copy { position: absolute; inset: auto 0 0; width: auto; padding: 6rem 1.35rem 1.3rem; text-align: center; }
  .ct-hero__kicker { margin-bottom: .55rem; font-size: .62rem; }
  .ct-hero h2 { font-size: 2.15rem; }
  .ct-hero__copy p { max-width: 29rem; margin: 0 auto; font-size: .87rem; }
  .ct-intro { margin: 1.15rem .35rem 1.25rem; font-size: .89rem; }
  .ct-app { padding: .72rem; border-radius: 20px; }
  .ct-reader { min-height: 60px; padding: .1rem .15rem .75rem; }
  .ct-reader__portrait { flex-basis: 50px; width: 50px; height: 50px; }
  .ct-reader__identity strong { font-size: 1.2rem; }
  .ct-reader__status { padding: .34rem .5rem; font-size: .64rem; }
  .ct-window { min-height: 340px; max-height: 58vh; padding: .8rem; border-radius: 16px; }
  .ct-msg { max-width: 91%; padding: .68rem .82rem; font-size: .94rem; }
  .ct-cards { gap: .65rem; }
  .ct-cards figure, .ct-cards img { width: 82px; }
  .ct-deck { padding: .8rem .35rem .55rem; }
  .ct-deck__strip { gap: .48rem .34rem; }
  .ct-deck__card { width: 45px; height: 77px; }
  .ct-form { gap: .35rem; padding: .36rem; }
  .ct-send { min-height: 43px; padding: .62rem .9rem; font-size: .91rem; }
}

@media (max-width: 390px) {
  .ct-reader__status { max-width: 86px; text-align: right; }
  .ct-hero { min-height: 335px; }
  .ct-deck__card { width: 42px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-reader__pulse { box-shadow: none; }
  .ct-send:hover { transform: none; }
}
