/* =========================================================
   SELECTOR DE RESPUESTAS (pie de la partida y mando)
   vf y opción: lacres de cera sobre tablillas de pergamino.
   color: gemas talladas. orden y número: doblones que se marcan y se confirman.
   Al contestar: el lacre bueno se sella con un rebote; el malo se agrieta.
   ========================================================= */
#pieJuego.eligiendo .opciones, .mando-selector { display: grid; }
#opciones, .mando-selector { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
#opciones.con-confirmar, .mando-selector.con-confirmar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

.selector { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
/* Muchas opciones: una sola fila que se desliza con el dedo */
.selector-color, .selector-orden, .selector-numero { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 4px 8px; margin: -6px -4px -8px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.selector-color::-webkit-scrollbar, .selector-orden::-webkit-scrollbar, .selector-numero::-webkit-scrollbar { display: none; }

/* ---------- Lacres (verdadero/falso y tres opciones) ---------- */
.lacre { --cera: #b3261e; position: relative; min-height: 3.3rem; padding: 0.4rem 0.55rem 0.4rem 2.35rem; border: none; color: #3b2207;
  font: clamp(0.88rem, 3.6vw, 1.05rem)/1.1 "Lilita One", system-ui, sans-serif; text-align: left; overflow-wrap: anywhere;
  border-radius: 14px 9px 16px 8px / 9px 14px 8px 15px;
  background: radial-gradient(ellipse 30% 22% at 86% 80%, rgba(120, 70, 20, 0.16), transparent 70%),
    radial-gradient(ellipse at 28% 12%, rgba(255, 255, 255, 0.55), transparent 55%), linear-gradient(180deg, #f8e8bf, #dcbb7c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), inset 0 -4px 0 rgba(120, 70, 20, 0.32), 0 0 0 2px #5c3a17, 0 5px 0 #3b2207,
    0 9px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, filter 0.2s; touch-action: manipulation; }
.lacre:nth-child(3n + 2) { --cera: #1f5f8b; border-radius: 9px 15px 8px 13px / 13px 8px 15px 9px; }
.lacre:nth-child(3n) { --cera: #6b3fa0; border-radius: 16px 10px 12px 9px / 11px 15px 9px 13px; }
.selector-vf .lacre:nth-child(1) { --cera: #1e8a4c; }
.selector-vf .lacre:nth-child(2) { --cera: #b3261e; }
.selector-vf .lacre { min-height: 3.6rem; font-size: clamp(1.05rem, 4.4vw, 1.3rem); }
/* El sello de cera: gota irregular con brillo y sombra */
.lacre::before { content: ""; position: absolute; left: 0.5rem; top: 50%; width: 1.45rem; height: 1.45rem; translate: 0 -50%;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55) 0 14%, transparent 34%),
    radial-gradient(circle, transparent 46%, rgba(0, 0, 0, 0.28) 48% 54%, transparent 56%),
    radial-gradient(circle at 50% 50%, var(--cera), color-mix(in srgb, var(--cera) 55%, #000));
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.lacre:active:not(:disabled) { transform: scale(0.92); transition-duration: 0.06s; }
.lacre:disabled { cursor: default; }
.lacre:disabled:not(.sellada, .rota, .correcta) { filter: saturate(0.75) brightness(0.93); }

/* ---------- Doblones (orden y número) ---------- */
.moneda-opcion { flex: 0 0 auto; width: 3.2rem; height: 3.2rem; border: none; border-radius: 50%; scroll-snap-align: center;
  color: #f6e6bd; font: 1.05rem "Lilita One", system-ui, sans-serif; text-shadow: 0 2px 0 #1d0e04;
  background: radial-gradient(circle at 34% 28%, #a8743c, #5e3a1a 62%, #33200c);
  box-shadow: inset 0 0 0 3px #a8803c, inset 0 0 0 5px #4a2e0f, inset 0 3px 5px rgba(255, 225, 160, 0.35), 0 0 0 2px #1d0e04,
    0 4px 0 #1d0e04, 0 7px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s; touch-action: manipulation; }
.moneda-opcion:nth-child(odd) { rotate: -4deg; }
.moneda-opcion:nth-child(3n) { rotate: 5deg; }
.moneda-opcion .opcion-texto { display: block; font-size: clamp(0.72rem, 3vw, 1rem); line-height: 1; }
.moneda-opcion.elegida, .moneda-opcion.sellada, .moneda-opcion.rota, .moneda-opcion.correcta { color: #3b2207; text-shadow: 0 1px 0 rgba(255, 246, 214, 0.75);
  background: radial-gradient(circle at 34% 28%, #fff6c4, #f3cc5c 45%, #c48f24 80%, #8a5a10); }
.moneda-opcion.elegida { transform: translateY(-4px) scale(1.1);
  box-shadow: inset 0 0 0 3px #fff0b3, inset 0 0 0 5px #b8862e, 0 0 0 2px #5a3a0e, 0 6px 0 #5a3a0e, 0 0 18px rgba(255, 200, 90, 0.8); }
.moneda-opcion:active:not(:disabled) { transform: scale(0.92); transition-duration: 0.06s; }
.moneda-opcion.bloqueada { opacity: 0.35; text-decoration: line-through; text-decoration-thickness: 2px; }

.btn-confirmar { min-height: 3.2rem; padding: 0 0.9rem; border: none; border-radius: 12px 8px 13px 7px / 8px 12px 7px 13px;
  color: #3b2207; font: 1rem "Lilita One", system-ui, sans-serif; white-space: nowrap; text-shadow: 0 1px 0 rgba(255, 246, 214, 0.75);
  background: radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.6), transparent 55%), linear-gradient(180deg, #ffe38a, #e0a92e 60%, #a8701a);
  box-shadow: inset 0 -3px 0 rgba(90, 55, 10, 0.4), 0 0 0 2px #5a3a0e, 0 5px 0 #3b2207, 0 0 16px rgba(255, 200, 90, 0.45);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s; touch-action: manipulation; }
.btn-confirmar:active:not(:disabled) { transform: scale(0.92); transition-duration: 0.06s; }
.btn-confirmar:disabled { filter: grayscale(0.7) brightness(0.8); box-shadow: inset 0 -3px 0 rgba(90, 55, 10, 0.4), 0 0 0 2px #5a3a0e, 0 5px 0 #3b2207; }

/* ---------- Gemas (color) ---------- */
.gema-opcion { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 3.6rem; min-height: 3.6rem; padding: 2px 0;
  border: none; background: none; scroll-snap-align: center; transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); touch-action: manipulation; }
.gema-piedra { width: 2.4rem; height: 2.4rem; clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0 16%, transparent 30%),
    linear-gradient(200deg, transparent 58%, rgba(0, 0, 0, 0.3) 59%),
    conic-gradient(from 200deg at 50% 60%, color-mix(in srgb, var(--gema) 70%, #fff), var(--gema), color-mix(in srgb, var(--gema) 55%, #000), var(--gema), color-mix(in srgb, var(--gema) 70%, #fff));
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 5px color-mix(in srgb, var(--gema) 60%, transparent)); }
.gema-opcion:nth-child(odd) .gema-piedra { rotate: -6deg; }
.gema-opcion:nth-child(3n) .gema-piedra { rotate: 7deg; scale: 0.94; }
.gema-nombre { font: 800 0.68rem "Nunito", system-ui, sans-serif; color: #f6e6bd; text-shadow: 0 1px 2px #000; }
.gema-opcion:active:not(:disabled) { transform: scale(0.92); transition-duration: 0.06s; }

/* ---------- Resultado: sellado, roto y la buena ---------- */
.sellada { animation: sellar 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.lacre.sellada { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), inset 0 -4px 0 rgba(120, 70, 20, 0.32), 0 0 0 3px #2e9e4f, 0 5px 0 #14532d,
  0 0 22px rgba(80, 220, 130, 0.85); }
.lacre.sellada::before { transform: scale(1.25) rotate(-12deg); }
.gema-opcion.sellada .gema-piedra, .gema-opcion.correcta .gema-piedra { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(120, 255, 170, 0.95)); }
.moneda-opcion.sellada { box-shadow: inset 0 0 0 3px #fff0b3, 0 0 0 3px #2e9e4f, 0 0 20px rgba(80, 220, 130, 0.85); }
@keyframes sellar { 0% { transform: scale(0.9); } 45% { transform: scale(1.14) translateY(-3px); } 100% { transform: scale(1.04); } }

.rota { animation: romper 0.45s ease-out both; }
.lacre.rota { filter: saturate(0.6); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 0 0 3px #b3261e, 0 3px 0 #5e0f0a, 0 0 18px rgba(230, 60, 60, 0.7); }
/* El sello se parte en dos */
.lacre.rota::before { clip-path: polygon(0 0, 55% 0, 38% 45%, 62% 55%, 45% 100%, 0 100%); transform: rotate(-14deg) translateX(-2px); }
.lacre.rota::after { content: ""; position: absolute; left: 0.5rem; top: 50%; width: 1.45rem; height: 1.45rem; translate: 0 -50%;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; clip-path: polygon(55% 0, 100% 0, 100% 100%, 45% 100%, 62% 55%, 38% 45%);
  background: radial-gradient(circle at 50% 50%, var(--cera), color-mix(in srgb, var(--cera) 55%, #000)); transform: rotate(16deg) translate(4px, 2px); }
.moneda-opcion.rota, .gema-opcion.rota { filter: grayscale(0.6); }
@keyframes romper { 0%, 100% { translate: 0; } 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
.correcta:not(.sellada) { animation: brillo-correcta 1.1s ease-in-out infinite alternate; }
.lacre.correcta:not(.sellada) { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 0 0 3px #2e9e4f, 0 5px 0 #14532d, 0 0 16px rgba(80, 220, 130, 0.7); }
@keyframes brillo-correcta { to { filter: brightness(1.12); } }

/* ---------- Pergamino de la curiosidad bajo la isla ---------- */
.isla-dato { position: absolute; left: 50%; bottom: calc(var(--m) * 0.15); z-index: 6; width: min(94%, 24rem); translate: -50% 0;
  padding: 0.5rem 0.9rem 0.6rem; border-radius: 6px 10px 7px 12px / 10px 6px 12px 7px; pointer-events: none;
  color: #3b2207; font: 700 clamp(0.8rem, 3.3vw, 0.98rem)/1.3 "Nunito", system-ui, sans-serif; text-align: center;
  background: radial-gradient(ellipse 30% 30% at 88% 80%, rgba(120, 70, 20, 0.16), transparent 70%),
    radial-gradient(ellipse at 25% 10%, rgba(255, 255, 255, 0.5), transparent 55%), linear-gradient(180deg, #f8e8bf, #dcbb7c);
  box-shadow: inset 0 0 14px rgba(140, 85, 25, 0.45), 0 0 0 2px #5c3a17, 0 8px 16px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: scaleY(0.15); transform-origin: 50% 0; transition: opacity 0.2s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.isla-dato.visible { opacity: 1; transform: none; }
.isla-dato.mal { box-shadow: inset 0 0 14px rgba(140, 85, 25, 0.45), 0 0 0 2px #8a1c16, 0 8px 16px rgba(0, 0, 0, 0.55); }
/* Varas enrolladas arriba y abajo */
.isla-dato::before, .isla-dato::after { content: ""; position: absolute; left: -6px; right: -6px; height: 7px; border-radius: 4px;
  background: linear-gradient(180deg, #e9d29a, #a7834a 60%, #6e5228); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.isla-dato::before { top: -5px; }
.isla-dato::after { bottom: -5px; }
.dato-eleccion { display: block; margin-bottom: 2px; color: #8a1c16; font: 0.85rem "Lilita One", system-ui, sans-serif; }
.dato-texto { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Mando ---------- */
.mando-selector { flex: 1 1 100%; order: 5; margin: 6px 0 4px; }
.mando-selector .lacre { min-height: 3.8rem; }
.mando-estaca-num { display: grid; place-items: center; min-width: 3rem; height: 3rem; border-radius: 50%; color: #3b2207;
  font: 1.3rem "Lilita One", system-ui, sans-serif; background: radial-gradient(circle at 34% 28%, #fff6c4, #f3cc5c 45%, #c48f24 80%, #8a5a10);
  box-shadow: inset 0 0 0 3px #fff0b3, 0 0 0 2px #5a3a0e, 0 4px 8px rgba(0, 0, 0, 0.45); }
.mando-botones .mando-clavar { order: 6; }
.mando-dato { display: block; margin-top: 6px; font: 700 0.9rem/1.3 "Nunito", system-ui, sans-serif; opacity: 0.9; }

@media (prefers-reduced-motion: reduce) {
  .sellada, .rota, .correcta:not(.sellada) { animation: none; }
}
