/* Consulta y ritual de Naipora: la mesa vista desde arriba. Medidas del comp (1152 × 2048): px / 11.52 = cqw.
   Todo lo que se lee en móvil lleva suelo en px (16 en campos, 13 en etiquetas, 12,5 como mínimo). */

.table-stage { position: relative; background: #141710; }
.table {
  position: relative; width: 100%; aspect-ratio: 1152 / 2048; /* crece si el contenido no cabe (no es contenedor de scroll) */
  container-type: inline-size; overflow-x: clip; isolation: isolate;
  color: #e4cfa9; background: #1d1f15;
}
/* el paño ocupa la mesa entera; si el contenido crece en móvil, se estira un poco en alto (la orla sigue en su sitio) */
.cloth { position: absolute; inset: 0; z-index: -1; overflow: hidden;
  /* franja central sin pétalos, en espejo: el paño sigue con su orla aunque la mesa crezca (lectura larga) */
  background: #1d1f15 image-set(url('/assets/plates/cloth-band.webp') type('image/webp'), url('/assets/plates/cloth-band.png') type('image/png')) center top / 100% auto repeat-y; }
.cloth img { position: absolute; left: 0; width: 100%; height: auto; display: block; filter: brightness(1.22); } /* valor del paño del comp */
.cloth picture img { top: 0; z-index: 1; -webkit-mask-image: linear-gradient(#000 62%, transparent 88%); mask-image: linear-gradient(#000 62%, transparent 88%); }
.cloth .cloth-low { bottom: 0; -webkit-mask-image: linear-gradient(transparent 12%, #000 38%); mask-image: linear-gradient(transparent 12%, #000 38%); }
.backdrop { display: none; }
@media (min-aspect-ratio: 1152 / 2048) {
  .table-stage { overflow: hidden; }
  .table { width: min(100%, calc(100svh * 1152 / 2048)); margin: 0 auto; box-shadow: 0 0 6vw rgb(0 0 0 / .6); }
  .backdrop { display: block; position: absolute; inset: 0; }
  .backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(.85) brightness(.45); transform: scale(1.1); }
}

/* ---- Cabecera ---- */
.table-top { position: relative; height: 10.9cqw; }
.t-brand {
  position: absolute; left: 3.3cqw; top: 2.43cqw; height: 6.25cqw; display: flex; align-items: center;
  font: 400 5.47cqw/1 'Linden Hill', serif; color: #e8ceaf; text-decoration: none; letter-spacing: .02em;
}
.t-star { position: absolute; left: 45.83cqw; top: 2.6cqw; width: 8.33cqw; height: 8.33cqw; color: #c9a464; }
.t-lang {
  position: absolute; right: 4.25cqw; top: 3.47cqw; height: 4.17cqw; display: flex; align-items: center; gap: 1.6cqw;
  font: 500 max(13px, 3.2cqw)/1 'Cormorant Garamond', serif; color: #ebd7b4; letter-spacing: .04em;
}
.t-lang a { color: #c9b48e; text-decoration: none; min-height: 24px; display: inline-flex; align-items: center; }
.t-brand:hover, .t-lang a:hover { color: #fff3dc; }
.t-brand:focus-visible, .t-lang a:focus-visible { outline: 3px solid #f3e1bf; outline-offset: 4px; border-radius: 2px; }

/* ---- Consulta ---- */
.t-title {
  margin: 8.3cqw 0 0; text-align: center;
  font: 400 9.03cqw/1 'Linden Hill', serif; color: #e4cfa9; letter-spacing: .005em;
  text-shadow: 0 .3cqw 1cqw rgb(8 10 4 / .6);
}
#ask { display: block; }

/* fichas: papel pintado (textura sacada del comp) que descansa sobre el paño */
.slip {
  position: relative; box-sizing: border-box;
  background: #c9b58b image-set(url('/assets/plates/paper.webp') type('image/webp'), url('/assets/plates/paper.png') type('image/png')) repeat; background-size: 15.6cqw auto;
  border-radius: 1.6cqw; color: #2b241a;
  box-shadow: 0 .8cqw 1.8cqw rgb(4 6 2 / .55), 0 .15cqw .3cqw rgb(4 6 2 / .5), inset 0 0 1.4cqw rgb(110 82 44 / .32);
}
.slip:focus-within { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(3px, .45cqw); }
.slip-q { width: 72.05%; margin: 2.9cqw auto 0; min-height: 23.6cqw; display: flex; align-items: center; padding: 2cqw 6cqw; }
.slip-q textarea {
  width: 100%; margin: 0; padding: 0; border: 0; background: transparent; resize: none; outline: 0;
  font: 500 max(16px, 4.34cqw)/1.3 'Cormorant Garamond', serif; color: #2b241a; text-align: center;
  field-sizing: content; min-height: 2.6em; max-height: 5.2em;
}
.slip input::placeholder, .slip textarea::placeholder { color: #4d4232; opacity: 1; } /* 4,89:1 sobre el color base del papel */
.slips { width: 72.3%; margin: 1.9cqw auto 0; display: flex; gap: 3cqw; }
.slip-sm { flex: 1; min-width: 0; min-height: 11.8cqw; padding: 1.6cqw 1.8cqw 1.4cqw 3.4cqw; display: flex; flex-direction: column; justify-content: flex-start; }
.slip-sm label { margin: 0; font: 500 max(13px, 2.52cqw)/1.15 'Cormorant Garamond', serif; color: #3a3123; }
.slip-sm label.it { font-style: italic; font-weight: 500; font-size: max(13px, 2.4cqw); letter-spacing: -.01em; }
.slip-sm input {
  width: 100%; min-height: 0; margin: auto 0 0; padding: .4cqw 0 0; border: 0; background: transparent; outline: 0;
  font: 500 max(16px, 3.65cqw)/1.1 'Cormorant Garamond', serif; color: #2b241a; color-scheme: light;
}
.slip-sm input[type=date] { font-size: max(16px, 3.1cqw); }
/* la ficha de la fecha se ve vacía, como en el comp, hasta que se toca; el calendario es un icono propio en oro de filete
   (el indicador nativo sigue encima, invisible, para abrir el selector) */
.slip-sm input[type=date] { padding-right: max(26px, 5cqw); background: url('/assets/calendar.svg') right center / max(20px, 3.6cqw) no-repeat; }
.slip-sm input[type=date]::-webkit-datetime-edit { color: #2b241a; }
.slip-sm input[type=date].is-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
.slip-sm input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0; width: max(26px, 5cqw); height: 100%; margin: 0; }

/* tiradas: siluetas doradas de 1, 2 y 3 huecos dibujadas en el paño */
.table .spreads { display: block; border: 0; margin: 4.2cqw 0 0; padding: 0; min-width: 0; }
.t-heading { /* legend flotante: así respeta el margen de arriba en vez de montarse en el borde del fieldset */
  float: left; display: flex; align-items: center; justify-content: center; gap: 2cqw; width: 100%; padding: 0; margin: 0;
  font: 500 max(15px, 3.82cqw)/1.1 'Cormorant Garamond', serif; color: #e4cfa9;
}
.t-heading::before, .t-heading::after { content: ''; width: 7.8cqw; height: 1px; background: linear-gradient(90deg, transparent, #a98b55); }
.t-heading::after { transform: scaleX(-1); }
.spread-row { clear: both; display: flex; align-items: flex-start; gap: 2.4cqw; padding: 3.3cqw 0 0 15.6%; }
.table .spread { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-weight: 500; }
.spread-one_card { width: 14.32cqw; }
.spread-yes_no { width: 23.78cqw; } /* una sola carta: la tirada de sí o no se responde con una */
.spread-three_cards { width: 32.81cqw; }
.spread-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.outlines { display: flex; gap: 1cqw; padding: .55cqw; border-radius: 1.3cqw; transition: box-shadow .35s ease, outline-color .35s ease; outline: .25cqw solid transparent; outline-offset: .2cqw; }
.outline {
  position: relative; display: grid; place-items: center; width: 11.1cqw; aspect-ratio: 128 / 228;
  border: max(1.5px, .3cqw) solid #b0915a; border-radius: .9cqw; color: #c9a464;
  transition: border-color .35s ease, box-shadow .35s ease;
}
.outline::before { /* filete interior con una estrellita en cada esquina, como las siluetas pintadas del comp */
  content: ''; position: absolute; inset: .7cqw; border: 1px solid rgb(176 145 90 / .7); border-radius: .4cqw;
  background: url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat;
  background-size: 1.6cqw; background-position: .3cqw .3cqw, calc(100% - .3cqw) .3cqw, .3cqw calc(100% - .3cqw), calc(100% - .3cqw) calc(100% - .3cqw);
}
.outline svg { width: 3.2cqw; height: 3.2cqw; }
.spread-three_cards .outline { width: 9.6cqw; }
.spread-name { margin-top: 1.7cqw; font: 500 max(15px, 3.82cqw)/1.1 'Cormorant Garamond', serif; color: #d9c59f; text-align: center; text-wrap: balance; }
.spread-one_card .spread-name, .spread-yes_no .spread-name { white-space: nowrap; }
.spread-three_cards .spread-name { white-space: nowrap; font-size: max(15px, 3.4cqw); } /* el nombre real es largo: una línea, algo más pequeño */
.spread:hover .outline { border-color: #cdb07a; }
/* la tirada elegida se ilumina como en el comp: marco claro y halo cálido */
.spread:has(:checked) .outlines { outline-color: #ecd9ae; box-shadow: 0 0 1.6cqw rgb(240 210 150 / .35), inset 0 0 1cqw rgb(240 210 150 / .18); }
.spread:has(:checked) .outline { border-color: #ecd9ae; box-shadow: 0 0 .9cqw rgb(240 210 150 / .3); }
.spread:has(:checked) .spread-name { color: #f1e1bf; }
.spread:has(:focus-visible) .outlines { outline-color: #b9792a; outline-width: max(2px, .3cqw); outline-offset: max(3px, .6cqw); }

/* casillas: cuadro de filete dorado; marcada, un cuadro de oro dentro */
.tick { display: flex; align-items: center; justify-content: center; gap: 2.4cqw; margin: 4.2cqw auto 0; width: max-content; max-width: 76%;
  font: 500 max(15px, 3.65cqw)/1.2 'Cormorant Garamond', serif; color: #e0cba4; cursor: pointer; }
.tick input {
  appearance: none; flex: none; width: max(22px, 4.5cqw); height: max(22px, 4.5cqw); margin: 0; cursor: pointer;
  border: max(1.5px, .2cqw) solid #c9b48a; border-radius: .5cqw; background: rgb(14 16 8 / .55);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.tick input:checked { background: rgb(14 16 8 / .55) url('/assets/corner-star.svg') center / 70% no-repeat; }
.tick input:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(3px, .4cqw); }
.rule-star { display: flex; align-items: center; gap: 1.4cqw; width: 38.7%; margin: 1.7cqw auto 0; color: #b6965e; }
.rule-star::before, .rule-star::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #a98b55); }
.rule-star::after { transform: scaleX(-1); }
.rule-star svg { width: 3cqw; height: 3cqw; }
.consent { margin-top: 1.4cqw; max-width: 82%; align-items: flex-start; font: 500 max(13px, 2.7cqw)/1.25 'Cormorant Garamond', serif; color: #d1b890; text-align: left; gap: 2cqw; position: relative; isolation: isolate; }
.consent input { width: max(20px, 3.4cqw); height: max(20px, 3.4cqw); margin-top: .2em; }
.consent::before { content: ''; position: absolute; inset: -30% -9%; z-index: -1; border-radius: 40%;
  background: radial-gradient(closest-side, rgb(14 16 7 / .95), rgb(14 16 7 / .88) 60%, rgb(14 16 7 / .5) 82%, transparent); filter: blur(1.2cqw); }
.consent a { color: #e2bf7f; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.ask-error { width: 72%; margin: 2.4cqw auto 0; padding: 1.4cqw 2.4cqw; border-radius: 1cqw; text-align: center;
  font: 600 max(14px, 3cqw)/1.3 'Cormorant Garamond', serif; color: #f6e3c4; background: rgb(96 28 18 / .78); box-shadow: 0 .5cqw 1.2cqw rgb(0 0 0 / .4); }

/* pie de la mesa, anclado abajo como en el comp: el mazo a la izquierda y «Barajar» a la derecha.
   El texto de arriba puede bajar hasta el margen transparente del mazo; si crece más (móvil), la mesa crece. */
.ask-wrap { padding-bottom: 47cqw; } /* el mazo empieza debajo de la última línea del consentimiento */
.table-foot { position: absolute; left: 0; right: 0; bottom: 3.7cqw; height: 43.8cqw; }
.deck-top { position: absolute; left: 4.86cqw; top: 0; width: 42.19cqw; height: 43.8cqw; }
.deck-top img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1.6cqw 1.6cqw rgb(0 0 0 / .55)); }
.shuffle-btn {
  position: absolute; left: 51.74cqw; top: 12.3cqw; width: 40.28cqw; height: 15.6cqw; min-height: 44px; padding: 0;
  font: 400 8.5cqw/1 'Linden Hill', serif; color: #efdcbb; letter-spacing: .01em; cursor: pointer;
  background: #a8691e url('/assets/plates/amber.png') repeat; background-size: 10.4cqw auto;
  border: .25cqw solid #5a3a10; border-radius: 1.9cqw;
  box-shadow: 0 .7cqw 1.8cqw rgb(20 12 2 / .5), inset 0 0 0 .45cqw rgb(232 176 92 / .35), inset 0 .3cqw .4cqw rgb(255 222 160 / .4), inset 0 -.45cqw .6cqw rgb(60 34 6 / .45);
  text-shadow: 0 .15cqw .2cqw rgb(60 34 6 / .6);
}
.shuffle-btn:hover { filter: brightness(1.06); }
.shuffle-btn:active { transform: translateY(.2cqw); }
.shuffle-btn:focus-visible { outline: .3cqw solid #f3e1bf; outline-offset: .5cqw; }
.shuffle-btn:disabled { filter: saturate(.6) brightness(.85); cursor: progress; }

/* ---- Ritual: todo pasa en el mismo paño ---- */
.ritual { position: relative; padding: 0 0 6cqw; }
.ritual-msg {
  margin: 7cqw 4cqw 0; min-height: 2.2em; display: flex; align-items: center; justify-content: center; text-align: center; text-wrap: balance;
  font: 400 max(24px, 6.4cqw)/1.1 'Linden Hill', serif; color: #e4cfa9; text-shadow: 0 .3cqw 1cqw rgb(8 10 4 / .6);
}
.ritual-msg:focus { outline: none; }
.ritual.is-waiting .ritual-msg { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .62; } }

/* huecos de la tirada: las mismas siluetas de la consulta, ahora a tamaño de carta */
.slots { list-style: none; display: flex; justify-content: center; gap: 4cqw; margin: 4cqw 0 0; padding: 0; }
.slot { width: 21cqw; display: flex; flex-direction: column; align-items: center; text-align: center; }
.slot .pos { font: 500 max(13px, 3cqw)/1.15 'Cormorant Garamond', serif; color: #cdb995; min-height: 2.4em; display: flex; align-items: flex-end; margin-bottom: 1.4cqw; }
.card3d { position: relative; width: 100%; aspect-ratio: 400 / 693; perspective: 120cqw; }
.card3d::before, .card3d::after { content: ''; position: absolute; pointer-events: none; }
.card3d::before { /* el hueco dibujado en el paño: la silueta de la tirada a tamaño de carta */
  inset: 0; border: max(1.5px, .3cqw) solid #b0915a; border-radius: 1.2cqw;
  background: url('/assets/corner-star.svg') 50% 50% / 5.6cqw no-repeat;
}
.card3d::after {
  inset: 1.2cqw; border: 1px solid rgb(176 145 90 / .7); border-radius: .6cqw;
  background: url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat;
  background-size: 2.6cqw; background-position: .5cqw .5cqw, calc(100% - .5cqw) .5cqw, .5cqw calc(100% - .5cqw), calc(100% - .5cqw) calc(100% - .5cqw);
}
.card3d .inner { z-index: 1; }
.card3d .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.3, .7, .2, 1); }
.card3d.flipped .inner { transform: rotateY(180deg); }
.card3d .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 1.2cqw; overflow: hidden; box-shadow: 0 1.2cqw 2.4cqw rgb(0 0 0 / .55), 0 .2cqw .5cqw rgb(0 0 0 / .45); }
.card3d .back { background: #16233a url('/assets/plates/card-back.webp') center / cover; }
.card3d .front { transform: rotateY(180deg); background: #e9dcc0; }
.card3d .front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card3d.reversed .front img { transform: rotate(180deg); }
.card3d.empty .inner { visibility: hidden; }
.slot .name { margin-top: 1.6cqw; min-height: 2.5em; font: 400 max(15px, 3.6cqw)/1.15 'Linden Hill', serif; color: #ecdab6; text-wrap: balance; }
.slot .name .rev { display: block; font: italic 500 max(13px, 3cqw)/1.2 'Cormorant Garamond', serif; color: #cdb995; }

/* foso: zona donde se baraja, se corta y se abre el abanico */
.pit { position: relative; margin-top: 3cqw; min-height: 70cqw; }
.rdeck { position: absolute; left: 50%; top: 4cqw; width: 26cqw; aspect-ratio: 400 / 693; translate: -50% 0; }
.rdeck span {
  position: absolute; inset: 0; border-radius: 1.2cqw; background: #16233a url('/assets/plates/card-back.webp') center / cover;
  box-shadow: 0 .3cqw .6cqw rgb(0 0 0 / .45);
}
.rdeck span:nth-child(n) { translate: calc(var(--i, 0) * -.12cqw) calc(var(--i, 0) * -.12cqw); }
.rdeck[hidden] { display: none; }
/* barajado: el mazo se parte en dos mitades que se intercalan, tres veces */
.rdeck.is-riffling span:nth-child(odd)  { animation: riffle-l 1.15s cubic-bezier(.45, 0, .2, 1) 3; }
.rdeck.is-riffling span:nth-child(even) { animation: riffle-r 1.15s cubic-bezier(.45, 0, .2, 1) 3; }
@keyframes riffle-l { 35% { transform: translateX(-62%) rotate(-7deg); } 55% { transform: translateX(-62%) rotate(-7deg); } 100% { transform: none; } }
@keyframes riffle-r { 35% { transform: translateX(62%) rotate(7deg); }  55% { transform: translateX(62%) rotate(7deg); }  100% { transform: none; } }

/* corte: tres montones; el elegido sube y los otros pasan debajo */
.piles { position: absolute; left: 0; right: 0; top: 4cqw; display: flex; justify-content: center; gap: 5cqw; }
.pile {
  position: relative; width: 24cqw; aspect-ratio: 400 / 693; padding: 0; border: 0; border-radius: 1.2cqw; cursor: pointer;
  background: #16233a url('/assets/plates/card-back.webp') center / cover;
  box-shadow: .25cqw .3cqw .35cqw #0f1726, .5cqw .6cqw .4cqw rgb(201 164 100 / .55), .9cqw 1.2cqw 1.8cqw rgb(0 0 0 / .5); /* canto del montón: luz cenital, sombra blanda */
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .5s ease;
}
.pile-label { position: absolute; left: 0; right: 0; top: calc(100% + 2.4cqw); font: 500 max(14px, 3.3cqw)/1 'Cormorant Garamond', serif; color: #d9c59f; }
.pile:hover, .pile:focus-visible { transform: translateY(-2cqw); }
.pile:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(3px, .6cqw); }
.piles.is-cut .pile { opacity: 0; transform: translateY(2cqw) scale(.94); }
.piles.is-cut .pile.is-chosen { opacity: 1; transform: translateY(-4cqw) scale(1.04); }

/* abanico: dos arcos concéntricos de 39 cartas que giran (arrastrar, rueda, botones o flechas).
   Cada carta gira alrededor del centro del arco (transform-origin a un radio por debajo); entre carta y carta quedan
   al menos 6,6 cqw de arco por carta (25 px en un móvil de 390), el mínimo de WCAG 2.5.8. */
.fan { position: relative; height: 52cqw; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fan-card {
  position: absolute; left: 50%; top: var(--top, 0); width: 10.4cqw; margin-left: -5.2cqw; aspect-ratio: 400 / 693;
  padding: 0; border: 0; border-radius: .9cqw; cursor: pointer;
  background: #16233a url('/assets/plates/card-back.webp') center / cover;
  box-shadow: -.2cqw .5cqw .9cqw rgb(0 0 0 / .5), 0 0 0 1px rgb(201 164 100 / .35);
  transform-origin: 50% var(--R); transform: rotate(0deg) scale(.92); opacity: 0;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1), opacity .45s ease, box-shadow .3s ease;
  transition-delay: var(--d, 0ms);
}
.fan.is-dealt .fan-card { opacity: var(--o, 1); transform: rotate(var(--a)); }
.fan.is-turning .fan-card { transition: transform .12s linear, opacity .12s linear; transition-delay: 0ms; }
.fan.is-dealt .fan-card:hover, .fan.is-dealt .fan-card:focus-visible {
  transform: rotate(var(--a)) translateY(-2.8cqw); transition-delay: 0ms; z-index: 3;
  box-shadow: -.2cqw 1.6cqw 1.8cqw rgb(0 0 0 / .55), 0 0 0 max(1px, .2cqw) #e8cf98;
}
.fan-card:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(2px, .3cqw); }
.fan-card.off { pointer-events: none; }
.fan-card.taken { visibility: hidden; }
/* al terminar, el abanico se recoge en un mazo ordenado antes de desaparecer */
.fan.is-gathered .fan-card { transform: rotate(0deg) translateY(4cqw); opacity: 1; transition: transform .6s cubic-bezier(.5, 0, .2, 1), opacity .3s ease .55s; transition-delay: var(--g, 0ms); }
.fan.is-gathered.is-gone .fan-card { opacity: 0; }
.fan-turn {
  position: absolute; bottom: 0; z-index: 4; width: max(44px, 9cqw); height: max(44px, 9cqw); padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #e4cfa9; background: rgb(14 16 8 / .72); border: max(1px, .2cqw) solid #b0915a;
  box-shadow: 0 .6cqw 1.2cqw rgb(0 0 0 / .45);
}
.fan-turn svg { width: 45%; height: 45%; }
.fan-turn.prev { left: 3cqw; } .fan-turn.next { right: 3cqw; }
.fan-turn:hover { color: #fff3dc; border-color: #e8cf98; }
.fan-turn:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(2px, .3cqw); }
.fan-turn:disabled { opacity: .35; cursor: default; }
.flyer { position: fixed; z-index: 30; border-radius: .9cqw; background: #16233a url('/assets/plates/card-back.webp') center / cover; box-shadow: 0 2cqw 3cqw rgb(0 0 0 / .55); pointer-events: none; }

.table:has(#ritual:not([hidden])) { min-height: 100svh; }

@media (prefers-reduced-motion: reduce) {
  .rdeck.is-riffling span, .ritual.is-waiting .ritual-msg { animation: none; }
  .fan-card, .fan.is-gathered .fan-card, .pile, .card3d .inner, .outlines, .outline { transition: none; }
  /* sin giro 3D: la cara se muestra tal cual (el volteo sin transición a veces no se pinta) */
  .card3d .inner { transform-style: flat; }
  .card3d.flipped .inner, .card3d .front { transform: none; }
  .card3d.flipped .back { display: none; }
}

/* lo oculto se queda oculto aunque su regla diga display: flex */
.table [hidden] { display: none !important; }

/* ---- Crisis y límite: lo mismo que la consulta, pero sin cartas. Nada se mueve en la crisis. ---- */
.care { padding: 0 7cqw 12cqw; text-align: center; }
.care-h {
  margin: 9cqw auto 0; max-width: 17ch; text-wrap: balance;
  font: 400 max(28px, 7.6cqw)/1.08 'Linden Hill', serif; color: #e4cfa9; text-shadow: 0 .3cqw 1cqw rgb(8 10 4 / .6);
}
.care-h:focus { outline: 0; }
.care-txt { margin: 4.4cqw auto 0; max-width: 34ch; text-wrap: pretty; font: 500 max(17px, 4.3cqw)/1.5 'Cormorant Garamond', serif; color: #e0cba4; }
/* teléfonos de ayuda: fichas de papel grandes, el número en rótulo y lo que es debajo */
.lines { list-style: none; margin: 6cqw auto 0; padding: 0; width: min(100%, 72cqw); display: grid; gap: 3.2cqw; }
.slip.line {
  display: grid; justify-items: center; gap: .9cqw; min-height: 48px; padding: 3.2cqw 5cqw 3.4cqw; text-decoration: none; color: #2b241a;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s;
}
.slip.line strong { font: 400 max(30px, 8.4cqw)/1 'Linden Hill', serif; letter-spacing: .02em; }
.slip.line span { font: 500 max(15px, 3.6cqw)/1.3 'Cormorant Garamond', serif; color: #3a3123; text-wrap: balance; }
.slip.line:hover { transform: translateY(-.6cqw); box-shadow: 0 1.6cqw 2.4cqw rgb(4 6 2 / .55), 0 .15cqw .3cqw rgb(4 6 2 / .5), inset 0 0 1.4cqw rgb(110 82 44 / .32); }
.slip.line:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(3px, .45cqw); }
/* el límite: el mazo descansa cerrado en el paño hasta mañana */
.rest-deck { display: block; width: 42.19cqw; margin: 5cqw auto 0; }
.rest-deck img { display: block; width: 100%; height: auto; filter: drop-shadow(0 1.6cqw 1.6cqw rgb(0 0 0 / .55)); }
.limit:not([hidden]) .rest-deck { animation: rest-deck .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rest-deck { from { transform: translateY(-4cqw) rotate(-10deg) scale(1.06); opacity: .5; } }
.care-go { margin: 5cqw 0 0; }
.care-go .amber-btn { font-size: max(24px, 6.6cqw); white-space: nowrap; border-radius: max(12px, 1.9cqw); }
.care-go .amber-btn:focus-visible { outline: max(2px, .3cqw) solid #f3e1bf; outline-offset: max(3px, .5cqw); }
@media (prefers-reduced-motion: reduce) { .limit .rest-deck { animation: none !important; } .slip.line { transition: none; } }

/* ---- Lectura: planos que bajan. Cada carta es un plano del paño con su ficha de papel debajo, unidos por el hilo dorado. ---- */
.r-reading { padding: 0 0 10cqw; }
.r-head { padding: 7cqw 7cqw 0; text-align: center; }
.r-head h1 { margin: 0; font: 400 max(28px, 7.6cqw)/1.06 'Linden Hill', serif; color: #e4cfa9; text-wrap: balance; text-shadow: 0 .3cqw 1cqw rgb(8 10 4 / .6); }
.r-head h1:focus { outline: none; }
.r-q { margin: 2.6cqw auto 0; max-width: 34ch; font: italic 500 max(16px, 3.9cqw)/1.35 'Cormorant Garamond', serif; color: #d1b890; }
.r-intro { margin: 4cqw auto 0; max-width: 36ch; font: 500 max(17px, 4.3cqw)/1.5 'Cormorant Garamond', serif; color: #e0cba4; text-wrap: pretty; }
.r-planes { list-style: none; margin: 6cqw 0 0; padding: 0; }
.r-plane { position: relative; padding: 0 0 12cqw; }
/* el hilo dorado que baja de un plano al siguiente */
.r-plane::after { /* hilo dorado: de la ficha a la carta siguiente, más intenso al llegar */
  content: ''; position: absolute; left: 50%; bottom: -1cqw; width: max(2px, .3cqw); margin-left: max(-1px, -.15cqw); height: 14cqw; z-index: 0;
  background: linear-gradient(#b0915a00, #b0915a 45%, #e8cf98); box-shadow: 0 0 .9cqw rgb(233 207 152 / .45); border-radius: 1px; }
.r-plane:last-child::after { display: none; }
.r-card { position: relative; z-index: 1; width: 46cqw; margin: 0 auto; transform: rotate(-3deg); }
.r-alt .r-card { transform: rotate(3deg); }
.r-card img { display: block; width: 100%; height: auto; border-radius: 1.6cqw; box-shadow: 0 2.4cqw 3.6cqw rgb(0 0 0 / .55), 0 .3cqw .8cqw rgb(0 0 0 / .45); }
.r-card.rev img { transform: rotate(180deg); }
.r-slip {
  position: relative; z-index: 2; margin: -6cqw 7cqw 0; padding: 6cqw 6.4cqw 5.4cqw;
  background: #c9b58b image-set(url('/assets/plates/paper.webp') type('image/webp'), url('/assets/plates/paper.png') type('image/png')) repeat; background-size: 15.6cqw auto;
  border-radius: 1.8cqw; color: #2b241a;
  box-shadow: 0 1cqw 2.2cqw rgb(4 6 2 / .55), 0 .15cqw .3cqw rgb(4 6 2 / .5), inset 0 0 1.4cqw rgb(110 82 44 / .32);
}
.r-slip h2 { margin: 0 0 2.4cqw; font: 400 max(22px, 5.6cqw)/1.1 'Linden Hill', serif; color: #2b241a; text-wrap: balance; }
.r-slip h2 em { display: block; margin-top: .6cqw; font: italic 500 max(15px, 3.6cqw)/1.2 'Cormorant Garamond', serif; color: #4d4232; }
.r-slip p { margin: 0; font: 500 max(17px, 4.3cqw)/1.55 'Cormorant Garamond', serif; color: #2b241a; text-wrap: pretty; hyphens: auto; }
.r-slip .rule-star { width: 60%; margin: 5cqw auto; color: #6b5434; } /* 3,4:1 sobre el papel */
.r-slip .rule-star::before, .r-slip .rule-star::after { background: linear-gradient(90deg, transparent, #6b5434); }
.r-close { position: relative; padding: 2cqw 0 0; }
.r-sum { margin-top: 0; }
.r-reflect { margin: 7cqw 9cqw 0; text-align: center; }
.r-reflect .rule-star { width: 50%; margin: 0 auto 5cqw; }
.r-reflect p { margin: 0; font: italic 400 max(22px, 5.8cqw)/1.25 'Linden Hill', serif; color: #ecdab6; text-wrap: balance; }
.r-notice { margin: 6cqw 9cqw 0; font: 500 max(15px, 3.6cqw)/1.45 'Cormorant Garamond', serif; color: #d1b890; text-align: center; }

/* acciones de quien hizo la consulta: botones de filete dorado; el único ámbar es «Nueva consulta» */
.r-owner { margin: 8cqw 7cqw 0; text-align: center; font: 500 max(16px, 3.9cqw)/1.4 'Cormorant Garamond', serif; color: #e0cba4; }
.r-owner .rule-star { margin: 0 auto 6cqw; }
.r-vote p { margin: 0; }
.r-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 3cqw; margin: 3cqw 0 0; }
.r-btn { /* filete de la mesa: borde dorado, filete interior y una estrellita en cada esquina */
  position: relative; min-height: 48px; min-width: 7.5em; padding: .35em 1.4em; cursor: pointer; border-radius: .9cqw;
  font: 500 max(16px, 3.9cqw)/1 'Cormorant Garamond', serif; color: #ecdab6; background: rgb(14 16 8 / .62);
  border: max(1.5px, .3cqw) solid #b0915a; box-shadow: 0 .6cqw 1.2cqw rgb(0 0 0 / .4);
}
.r-btn::before { content: ''; position: absolute; inset: max(3px, .6cqw); border: 1px solid rgb(176 145 90 / .7); border-radius: .4cqw; pointer-events: none;
  background: url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat, url('/assets/corner-star.svg') no-repeat;
  background-size: max(7px, 1.4cqw); background-position: 2px 2px, calc(100% - 2px) 2px, 2px calc(100% - 2px), calc(100% - 2px) calc(100% - 2px); }
.r-btn:hover { border-color: #e8cf98; color: #fff3dc; }
.r-btn:focus-visible, .r-link:focus-visible, .r-again:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(3px, .5cqw); }
.r-owner .tick { font-size: max(15px, 3.6cqw); }
.r-private { margin: 3cqw 0 0; font-size: max(14px, 3.3cqw); color: #b5a585; }
.r-status { min-height: 1.4em; margin: 2cqw 0 0; color: #ecd9ae; font: 500 max(15px, 3.6cqw)/1.4 'Cormorant Garamond', serif; text-align: center; }
.r-delete { margin: 3cqw 0 0; }
.r-link { min-height: 44px; padding: 0 .4em; border: 0; background: none; cursor: pointer; font: 500 max(15px, 3.6cqw)/1 'Cormorant Garamond', serif; color: #e2bf7f; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.r-new { margin: 9cqw 0 0; text-align: center; }
.r-meta { position: relative; isolation: isolate; margin: 7cqw 9cqw 0; text-align: center; font: 500 max(13px, 3cqw)/1.45 'Cormorant Garamond', serif; color: #c9b896; }
.r-meta::before { content: ''; position: absolute; inset: -40% -8%; z-index: -1; border-radius: 40%;
  background: radial-gradient(closest-side, rgb(14 16 7 / .95), rgb(14 16 7 / .85) 60%, rgb(14 16 7 / .45) 82%, transparent); filter: blur(1.2cqw); }
.r-group { margin-top: 7cqw; }
.r-group:first-of-type { margin-top: 0; }
.r-share .tick { margin-top: 0; }

/* revelado al bajar: el plano está entero; la ficha llega plegada y se abre como un pliego, y la carta se asienta a la vez */
.r-plane .r-card, .r-close > :not(.r-slip) { transition: transform .95s cubic-bezier(.16, 1, .3, 1), opacity .6s ease; }
/* plegada: solo se ve el primer tercio; app.js la abre en tres paneles al entrar en la vista */
.r-plane.is-folded .r-slip, .r-close.is-folded .r-slip { clip-path: inset(0 0 66.7% 0); }
.fold-panel { position: absolute; margin: 0 !important; z-index: 3; pointer-events: none; backface-visibility: hidden; }
.fold-panel::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(rgb(60 44 20 / .35), transparent 40%); }
.r-plane.is-folded .r-card { transform: translateY(3cqw) rotate(-3deg) scale(.97); }
.r-plane.r-alt.is-folded .r-card { transform: translateY(3cqw) rotate(3deg) scale(.97); }
.r-close.is-folded .r-reflect, .r-close.is-folded .r-notice { opacity: 0; transform: translateY(2cqw); }
@media (prefers-reduced-motion: reduce) {
  .r-plane .r-slip, .r-plane .r-card, .r-close > * { transition: none; }
}

/* ---- Cuenta: entrar, tu cuenta, packs e historial. Lo mismo de la mesa: fichas de papel, filetes y un solo ámbar. ---- */
.t-acct { color: #ebd7b4 !important; letter-spacing: .02em; }
.t-acct[aria-current] { text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.t-sep { width: 1px; height: 1em; background: rgb(233 214 180 / .45); }
a.r-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.acct .acct-form { display: block; }
.slip-mail { width: min(100%, 72cqw); margin: 5cqw auto 0; padding: 1.8cqw 3.4cqw 2cqw; text-align: left; }
.slip-mail label { display: block; font: 500 max(13px, 2.52cqw)/1.15 'Cormorant Garamond', serif; color: #3a3123; }
.slip-mail input {
  width: 100%; margin: .8cqw 0 0; padding: .4cqw 0 0; border: 0; background: transparent; outline: 0;
  font: 500 max(16px, 4cqw)/1.2 'Cormorant Garamond', serif; color: #2b241a; color-scheme: light;
}
.acct .consent { margin-top: 4cqw; }
.acct .ask-error:focus { outline: 0; }
.sent-letter { width: 26cqw; margin: 6cqw auto 0; color: #b0915a; filter: drop-shadow(0 .6cqw 1cqw rgb(0 0 0 / .45)); }
.sent-letter svg { display: block; width: 100%; height: auto; }
#login-sent:not([hidden]) .sent-letter { animation: letter-in 1.1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes letter-in { from { transform: translateY(-3cqw) rotate(-6deg); opacity: 0; } }
.acct-links { margin: 5cqw 0 0; }
.acct-who { margin: 2cqw 0 0; font: 500 max(15px, 3.6cqw)/1.4 'Cormorant Garamond', serif; color: #d1b890; overflow-wrap: anywhere; }
.acct-flash { margin: 3cqw auto 0; max-width: 34ch; }
/* saldo: dos fichas con la cifra en rótulo */
.tally { display: flex; justify-content: center; gap: 4cqw; margin: 5cqw auto 0; }
.tally-n { display: grid; justify-items: center; gap: .6cqw; width: 30cqw; margin: 0; padding: 3cqw 2cqw 3.2cqw; }
.tally-n strong { font: 400 max(34px, 10cqw)/1 'Linden Hill', serif; color: #2b241a; font-variant-numeric: lining-nums; }
.tally-n span { font: 500 max(14px, 3.2cqw)/1.2 'Cormorant Garamond', serif; color: #3a3123; }
.acct-home .rule-star { margin: 9cqw auto 0; }
.acct-block { margin: 5cqw 0 0; }
.acct-h2 { margin: 0; font: 400 max(22px, 5.6cqw)/1.1 'Linden Hill', serif; color: #e4cfa9; text-shadow: 0 .3cqw 1cqw rgb(8 10 4 / .6); }
.acct-note { margin: 3cqw auto 0; max-width: 36ch; font: 500 max(14px, 3.3cqw)/1.4 'Cormorant Garamond', serif; color: #c9b896; text-wrap: pretty; }
/* packs: tres fichas de papel en fila; la central, algo girada, como dejadas en el paño */
.packs { list-style: none; margin: 5cqw 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqw; }
.pack { display: grid; justify-items: center; align-content: start; gap: 1cqw; padding: 3.4cqw 1.6cqw 3cqw; text-align: center; }
.pack:nth-child(2) { transform: rotate(-1.5deg); }
.pack strong { font: 400 max(19px, 5cqw)/1.05 'Linden Hill', serif; color: #2b241a; text-wrap: balance; }
.pack-price { font: 500 max(18px, 4.6cqw)/1 'Cormorant Garamond', serif; color: #2b241a; font-variant-numeric: lining-nums; }
.pack-each { font: 500 max(13px, 2.8cqw)/1.2 'Cormorant Garamond', serif; color: #4d4232; }
.pack .r-btn { margin-top: 1.6cqw; min-width: 0; padding: .3em 1em; color: #2b241a; background: rgb(233 220 192 / .35); border-color: #8a6c3c; box-shadow: none; }
.pack .r-btn:hover { color: #120d05; border-color: #5a3a10; }
.pack-waiver { margin-top: 4cqw; max-width: 86%; }
/* historial: una lista leída como el índice de un cuaderno, con filete entre lecturas */
.history { list-style: none; margin: 4cqw auto 0; padding: 0; width: min(100%, 80cqw); text-align: left; }
.history li + li { border-top: 1px solid rgb(176 145 90 / .35); }
.history a { display: grid; gap: .6cqw; padding: 2.6cqw .5cqw; min-height: 44px; text-decoration: none; color: inherit; }
.history a:hover .h-title { color: #fff3dc; }
.history a:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(2px, .3cqw); border-radius: .4cqw; }
.h-meta { font: 500 max(13px, 3cqw)/1.2 'Cormorant Garamond', serif; color: #c9b896; }
.h-meta em { color: #ecd9ae; }
.h-title { font: 400 max(17px, 4.3cqw)/1.2 'Linden Hill', serif; color: #ecdab6; }
.acct-end { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2cqw 5cqw; margin: 5cqw 0 0; }
.acct-end .r-status { flex-basis: 100%; }
/* compartir en la lectura */
.r-sub { margin: 0 0 3cqw; font: 400 max(20px, 5cqw)/1.1 'Linden Hill', serif; color: #e4cfa9; }
.r-share .tick + .tick { margin-top: 2cqw; }
.r-share p { margin: 0 0 2cqw; }
.r-publink-row { margin: 0 0 3cqw !important; }
.r-publink { color: #e2bf7f; overflow-wrap: anywhere; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.r-publink:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: max(2px, .3cqw); }
.r-unpub { margin: 2cqw 0 0 !important; }
@media (prefers-reduced-motion: reduce) { #login-sent .sent-letter { animation: none !important; } }
.acct-end .r-link { display: inline-flex; align-items: center; }

/* ---- Textos (legales y «Cómo funciona»): un pliego de papel apoyado en el paño, con la tinta de las fichas ---- */
.doc { padding: 0 0 12cqw; text-align: center; }
.doc .care-h { max-width: 20ch; }
.sheet {
  width: 88cqw; margin: 6cqw auto 0; padding: 7cqw 7.4cqw 6cqw; text-align: left; border-radius: 1.8cqw;
  font: 500 max(16px, 3.9cqw)/1.6 'Cormorant Garamond', serif; color: #2b241a;
  box-shadow: 0 1cqw 2.2cqw rgb(4 6 2 / .55), 0 .15cqw .3cqw rgb(4 6 2 / .5), inset 0 0 1.4cqw rgb(110 82 44 / .32);
}
.sheet > :first-child { margin-top: 0; }
.sheet h2 { margin: 1.6em 0 .45em; font: 400 max(20px, 5cqw)/1.15 'Linden Hill', serif; color: #2b241a; text-wrap: balance; }
.sheet p, .sheet li { text-wrap: pretty; hyphens: auto; }
.sheet p { margin: 0 0 .8em; }
.sheet ul { margin: 0 0 .9em; padding-left: 1.15em; }
.sheet li { margin: 0 0 .45em; }
.sheet li::marker { color: #6b5434; }
.sheet strong { font-weight: 650; }
.sheet a { color: #5a3a10; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; overflow-wrap: anywhere; } /* 5:1 sobre el papel */
.sheet a:hover { color: #2b241a; }
.sheet a:focus-visible { outline: max(2px, .3cqw) solid #b9792a; outline-offset: 2px; border-radius: 2px; }
.sheet-date { margin: 2em 0 0 !important; font-size: max(14px, 3.3cqw); color: #4d4232; font-style: italic; }
.doc-go { margin-top: 8cqw; }
