/* AR die preview — dariusz.tv (see ar-preview.js)
   Colours come from style.css, so they follow the site's theme. */

.arp {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px; cursor: pointer; touch-action: manipulation;
  background: linear-gradient(var(--band-bg, #f8f5f2), color-mix(in srgb, var(--band-bg, #f8f5f2) 80%, var(--text-primary, #1f3442)));
  perspective: 900px; perspective-origin: 50% 20%;
  -webkit-user-select: none; user-select: none;
}
.arp-fill { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.arp:focus-visible { outline: 2px solid var(--label-color, #bf4e44); outline-offset: -4px; }

.arp-table {
  position: absolute; left: 50%; top: 58%; width: var(--m); height: var(--m);
  transform: translate(-50%, -50%) rotateX(62deg); transform-style: preserve-3d;
}
.arp-marker { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.arp-shadow {
  position: absolute; left: 50%; top: 50%; width: calc(var(--d) * 1.15); height: calc(var(--d) * 1.15);
  transform: translate(-50%, -50%); border-radius: 22%; background: rgba(0, 0, 0, .35); filter: blur(6px);
}
.arp-hop, .arp-cube { position: absolute; left: 50%; top: 50%; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); transform-style: preserve-3d; }
.arp-hop { transform: translateZ(calc(var(--d) / 2)); }
.arp.rolling .arp-hop { animation: arp-hop 1.1s cubic-bezier(.3, .6, .3, 1); }
@keyframes arp-hop { 0%, 100% { transform: translateZ(calc(var(--d) / 2)); } 35% { transform: translateZ(calc(var(--d) * 1.6)); } 70% { transform: translateZ(calc(var(--d) * .62)); } }
.arp-cube { margin: 0; left: 0; top: 0; transition: transform 1.1s cubic-bezier(.2, .7, .25, 1); }
.arp-face {
  position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center;
  padding: 12%; background: #2c5670; border-radius: 14%; backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 -6px 12px rgba(0, 0, 0, .25);
}
.arp-face i { width: 62%; height: 62%; border-radius: 50%; }
.arp-face i.on { background: #fff; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }

/* Portfolio card: the preview sits over the marker image; a button switches between them */
.arp-layer { position: absolute; inset: 0; z-index: 1; }
.arp-layer[hidden] { display: none; }
.arp-caption {
  position: absolute; left: .75rem; top: 1rem; margin: 0; z-index: 2; pointer-events: none;
  font-size: .8rem; font-weight: 600; color: var(--text-primary, #1f3442);
}
/* "INTERACTIVE" and the switch: always together on one line */
.arp-status-group { display: flex; align-items: center; flex-wrap: nowrap; gap: .9rem; white-space: nowrap; }
.arp-toggle {   /* in the info bar: the same link look as "Play: DNA game" */
  padding: .3rem 0; border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--text-accent, #3b6f8f); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.arp-toggle:hover { color: var(--text-accent-hover, #bf4e44); }
.arp-toggle:focus-visible { outline: 3px solid var(--focus-ring, #3b6f8f); outline-offset: 2px; border-radius: 6px; }
.arp-toggle-corner {   /* fallback when there is no info bar */
  position: absolute; right: .75rem; bottom: .75rem; z-index: 3; padding: .45rem .85rem; border-radius: 999px;
  background: rgba(255, 255, 255, .9); text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

@media (prefers-reduced-motion: reduce) {
  .arp-cube { transition: none; }
  .arp.rolling .arp-hop { animation: none; }
}
