/* v22 · Cartas Who am I?: sección «Colecciona» con el sobre del día.
   Azul de noche y dorado, los mismos colores del dorso de las cartas. */
#cartas {
  --cw-oro: #c8a96a;
  --cw-oro-claro: #e9d3a0;
  background:
    radial-gradient(ellipse 60% 55% at 28% 45%, #3fa9f52b, transparent 70%),
    radial-gradient(ellipse 45% 40% at 85% 10%, #c8a96a1f, transparent 70%),
    radial-gradient(circle at 12% 88%, #9b6bf21c, transparent 40%),
    #0b1022;
  border-top: 1px solid #c8a96a33;
  border-bottom: 1px solid #c8a96a33;
  position: relative;
  overflow: hidden;
}
/* polvo de estrellas */
#cartas::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 41% 12%, #e9d3a0aa 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 63% 84%, #fff7 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 78% 30%, #fff6 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 92% 62%, #e9d3a099 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 52% 48%, #fff5 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 33% 40%, #fff5 50%, transparent 51%);
}
.cartas-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.cartas-arte { position: relative; }
.cartas-arte::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -2%;
  height: 14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #000a, transparent);
  filter: blur(8px);
  z-index: 0;
}
.cartas-arte img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 40px #3fa9f533);
  animation: cartas-flota 7s ease-in-out infinite;
}
@keyframes cartas-flota {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-0.6deg); }
}
.cartas-texto .eyebrow { color: var(--cw-oro); }
#cartas h2 { color: #f4eedf; }
#cartas h2 em { color: var(--cw-oro-claro); }
.cartas-intro { color: #cfd5e6; max-width: 34em; }
.cartas-paso {
  margin: 22px 0 10px;
  font: 600 13px/1.3 "Barlow Condensed", "DM Sans", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb0d6;
}
.cartas-rutas { display: flex; flex-wrap: wrap; gap: 8px; }
.cartas-rutas button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #c8a96a66;
  background: #ffffff08;
  color: #ece6d8;
  font: 600 14px/1 "DM Sans", sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.cartas-rutas button:hover { border-color: var(--cw-oro); transform: translateY(-1px); }
.cartas-rutas button[aria-pressed="true"] { background: var(--cw-oro); border-color: var(--cw-oro); color: #1a1407; }
.cartas-rutas button:focus-visible { outline: 3px solid var(--cw-oro-claro); outline-offset: 2px; }
.cartas-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }
#cartas .cartas-abrir {
  background: linear-gradient(180deg, #e9d3a0, #c8a96a);
  color: #1a1407;
  border-color: #c8a96a;
  box-shadow: 0 0 0 0 #c8a96a66, 0 8px 24px #c8a96a33;
  animation: cartas-latido 2.6s ease-in-out infinite;
}
#cartas .cartas-abrir:disabled { animation: none; opacity: 0.7; cursor: default; background: #2a3150; color: #cfd5e6; border-color: #3a4266; box-shadow: none; }
#cartas .cartas-abrir.cargando { cursor: progress; }
@keyframes cartas-latido {
  0%, 100% { box-shadow: 0 0 0 0 #c8a96a55, 0 8px 24px #c8a96a33; }
  50% { box-shadow: 0 0 0 10px #c8a96a00, 0 8px 28px #c8a96a55; }
}
#cartas .cartas-album { color: #ece6d8; border-color: #c8a96a77; }
#cartas .cartas-album:hover { border-color: var(--cw-oro); }
.cartas-cuenta { margin-left: 6px; font-weight: 700; color: var(--cw-oro-claro); }
.cartas-cuenta:empty { display: none; }
.cartas-estado { min-height: 1.4em; margin: 12px 0 0; color: #e9d3a0; font-size: 15px; }
.cartas-datos {
  display: flex;
  gap: 26px;
  margin: 22px 0 0;
  padding: 16px 0 0;
  list-style: none;
  border-top: 1px solid #c8a96a2e;
}
.cartas-datos li { display: flex; flex-direction: column; gap: 2px; }
.cartas-datos strong { font: 700 28px/1 "Roboto Slab", Georgia, serif; color: #f4eedf; }
.cartas-datos span { font-size: 13px; color: #9fb0d6; text-transform: uppercase; letter-spacing: 0.08em; }
.cartas-extra { margin: 16px 0 0; font-size: 14px; color: #9fb0d6; }

/* aviso de sobre ganado */
.cartas-premio {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(92vw, 460px);
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #c8a96a88;
  background: #10162af2;
  box-shadow: 0 18px 50px #000a, 0 0 30px #c8a96a33;
  color: #ece6d8;
  transform: translate(-50%, 140%);
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.cartas-premio.visible { transform: translate(-50%, 0); }
.cartas-premio-ico {
  flex: none;
  width: 44px;
  height: 58px;
  border-radius: 6px;
  border: 1px solid #c8a96a;
  background: linear-gradient(160deg, #1b2547, #0b1022);
  display: grid;
  place-items: center;
  color: #c8a96a;
  font-size: 22px;
}
.cartas-premio-txt { flex: 1; min-width: 0; }
.cartas-premio-txt strong { display: block; font: 700 16px/1.25 "Roboto Slab", Georgia, serif; color: #f4eedf; }
.cartas-premio-txt span { display: block; font-size: 13px; color: #9fb0d6; margin-top: 2px; }
.cartas-premio .primary { flex: none; padding: 10px 16px; background: #c8a96a; border-color: #c8a96a; color: #1a1407; }
.cartas-premio .cartas-premio-x { flex: none; background: none; border: 0; color: #9fb0d6; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px; }

@media (max-width: 860px) {
  .cartas-layout { grid-template-columns: 1fr; }
  .cartas-arte { max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 520px) {
  .cartas-rutas button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .cartas-acciones > button { flex: 1 1 100%; justify-content: center; text-align: center; }
  .cartas-datos { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cartas-arte img, #cartas .cartas-abrir { animation: none; }
}
body.still .cartas-arte img, body.still #cartas .cartas-abrir { animation: none; }
/* si la barra del libro está abajo, el aviso de premio sube */
body:has(#book-bar:not([hidden])) .cartas-premio { bottom: 92px; }

/* v24 · Álbum para imprimir: muestra del tomo 5 dentro de #cartas.
   Papel crema y rosa del tomo, para que se sienta como el objeto real. */
.tomo-bloque {
  --tomo-acento: #1f78b4;
  --tomo-tinta: #2a1b2e;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-areas: "tabs tabs" "visor cabeza" "visor detalle";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: 0;
  align-items: start;
  margin-top: clamp(48px, 7vw, 88px);
  padding: clamp(22px, 3.4vw, 44px);
  border-radius: 24px;
  background:
    radial-gradient(70% 60% at 0% 0%, color-mix(in srgb, var(--tomo-acento) 22%, transparent) 0, transparent 60%),
    radial-gradient(60% 50% at 100% 100%, #fbe3c4 0, transparent 60%),
    #f6eedf;
  color: var(--tomo-tinta);
  box-shadow: 0 30px 80px #0008, 0 0 0 1px #c8a96a55;
}
.tomo-visor { grid-area: visor; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tomo-hoja { position: relative; margin: 0; width: min(100%, 420px); }
.tomo-hoja img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: 0 2px 0 #fff inset, 0 18px 40px #2a1b2e40, 0 4px 10px #2a1b2e26;
  transform: rotate(-1.2deg);
  transition: opacity 0.25s ease, transform 0.35s ease;
}
.tomo-hoja img.cambiando { opacity: 0.25; transform: rotate(-1.2deg) translateX(-6px); }
.tomo-flecha {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: var(--tomo-acento);
  color: #fff;
  font: 700 28px/1 Georgia, serif;
  cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tomo-acento) 40%, transparent);
  transition: transform 0.2s;
}
.tomo-flecha:hover { transform: scale(1.08); }
.tomo-flecha:focus-visible, .tomo-minis button:focus-visible, .tomo-btn:focus-visible { outline: 3px solid var(--tomo-tinta); outline-offset: 3px; }
.tomo-prev { left: -16px; }
.tomo-next { right: -16px; }
.tomo-flecha[hidden] { display: none; }
.tomo-pie { margin: 6px 0 0; font: 600 13px/1.3 "DM Sans", sans-serif; color: #6b5368; }
.tomo-minis { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tomo-minis button {
  width: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.tomo-minis button img { display: block; width: 100%; height: auto; border-radius: 3px; }
.tomo-minis button:hover { opacity: 1; transform: translateY(-2px); }
.tomo-minis button[aria-pressed="true"] { opacity: 1; border-color: var(--tomo-acento); }
.tomo-cabeza { grid-area: cabeza; align-self: end; }
.tomo-detalle { grid-area: detalle; margin-top: 22px; }
.tomo-cabeza .eyebrow { color: var(--tomo-acento); }
.tomo-cabeza h3 { margin: 6px 0 0; font: 700 clamp(30px, 3.6vw, 44px)/1.05 "Roboto Slab", Georgia, serif; color: var(--tomo-tinta); }
.tomo-cabeza h3 em { font-style: normal; color: var(--tomo-acento); }
.tomo-intro { margin: 14px 0 0; font-size: 16.5px; line-height: 1.6; color: #4a3a4c; max-width: 34em; }
.tomo-incluye { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.tomo-incluye li { position: relative; padding-left: 28px; font-size: 15.5px; line-height: 1.45; color: #3a2a3c; }
.tomo-incluye li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tomo-acento) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.tomo-compra { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 24px; padding-top: 20px; border-top: 1px dashed #c9a5b7; }
.tomo-precio { display: flex; align-items: center; gap: 10px; }
.tomo-precio strong { font: 700 44px/1 "Roboto Slab", Georgia, serif; color: var(--tomo-tinta); }
.tomo-precio span { font: 600 12.5px/1.3 "DM Sans", sans-serif; letter-spacing: 0.04em; color: #6b5368; text-transform: uppercase; }
.tomo-botones { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 280px; }
.tomo-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 12px 20px;
  border: 2px solid var(--tomo-acento);
  border-radius: 12px;
  background: var(--tomo-acento);
  color: #fff;
  font: 700 16px/1.2 "DM Sans", sans-serif;
  text-decoration: none;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--tomo-acento) 30%, transparent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tomo-btn small { font-size: 12px; font-weight: 500; opacity: 0.9; }
.tomo-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--tomo-acento) 40%, transparent); }
.tomo-btn-alt { background: transparent; color: var(--tomo-tinta); box-shadow: none; }
.tomo-btn-alt:hover { background: color-mix(in srgb, var(--tomo-acento) 8%, transparent); box-shadow: none; }
.tomo-nota { margin: 14px 0 0; font-size: 13.5px; color: #6b5368; }
@media (max-width: 860px) {
  .tomo-bloque { grid-template-columns: 1fr; row-gap: 22px; }
}
/* pestañas de tomos */
.tomo-tabs {
  grid-area: tabs;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(18px, 2.6vw, 30px);
  padding-bottom: clamp(14px, 2vw, 22px);
  border-bottom: 1px dashed #c9b8a8;
}
.tomo-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 5px 14px 5px 5px;
  border: 1.5px solid #d8c8b4;
  border-radius: 999px;
  background: #fffaf2;
  color: var(--tomo-tinta);
  font: 600 13.5px/1.2 "DM Sans", sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.tomo-tabs button:hover { border-color: var(--tomo-acento); transform: translateY(-1px); }
.tomo-tabs button:focus-visible { outline: 3px solid var(--tomo-tinta); outline-offset: 2px; }
.tomo-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #efe3d3;
  font: 700 13px/1 "Roboto Slab", Georgia, serif;
}
.tomo-tabs button[aria-pressed="true"] { background: var(--tomo-acento); border-color: var(--tomo-acento); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--tomo-acento) 35%, transparent); }
.tomo-tabs button[aria-pressed="true"] .tomo-num { background: #fff; color: var(--tomo-acento); }
.tomo-tab-pronto::after { content: "pronto"; margin-left: 2px; padding: 2px 7px; border-radius: 999px; background: #efe3d3; color: #7a6656; font: 600 10.5px/1.2 "DM Sans", sans-serif; letter-spacing: 0.04em; }
.tomo-tabs button.tomo-tab-pronto[aria-pressed="true"]::after { background: #ffffff33; color: #fff; }
.tomo-nombre { margin: 0 0 4px; font: 700 15px/1.3 "DM Sans", sans-serif; letter-spacing: 0.02em; color: var(--tomo-acento); }
.tomo-btn-pronto { opacity: 0.55; cursor: default; box-shadow: none; }
.tomo-btn-pronto:hover { transform: none; box-shadow: none; }
@media (max-width: 860px) {
  .tomo-bloque { grid-template-areas: "cabeza" "tabs" "visor" "detalle"; }
  .tomo-detalle { margin-top: 0; }
  .tomo-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px 14px; }
  .tomo-tabs::-webkit-scrollbar { display: none; }
  .tomo-tabs button { flex: none; }
}

@media (max-width: 520px) {
  .tomo-bloque { padding: 22px 16px 24px; border-radius: 18px; }
  .tomo-hoja { width: min(100%, 320px); }
  .tomo-prev { left: -10px; }
  .tomo-next { right: -10px; }
  .tomo-minis button { width: 46px; }
  .tomo-botones .tomo-btn { flex: 1 1 100%; }
  .tomo-precio strong { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .tomo-hoja img, .tomo-hoja img.cambiando { transition: none; transform: none; }
}
body.still .tomo-hoja img { transition: none; }
