html:has(#sala-cristalli:target) { scroll-behavior: auto; }

.crystal-hall {
  padding-block: clamp(1.8rem, 3.6vw, 3rem) var(--section-space);
  background: radial-gradient(ellipse at 60% 80%, #352641, transparent 65%), var(--nuria-night);
  color: #fcf0f4;
}
.crystal-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 2rem;
  padding-top: clamp(1.45rem, 3vw, 2.4rem);
  border-top: 1px solid #9b7aa97a;
  margin-bottom: clamp(1rem, 2.7vw, 2.2rem);
}
.crystal-heading h2 { font-size: clamp(1.75rem, 3.5vw, 3.5rem); text-wrap: pretty; }
.crystal-heading p { color: #e0cae9; font-size: clamp(.92rem, 1.45vw, 1.2rem); }
.crystal-stage {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #987a9f;
  background: #0e101d;
  box-shadow: 0 0 0 4px #493551, 0 1.15rem 3rem #0b081b99;
}
.crystal-backdrop, .crystal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.crystal-video {
  z-index: 3;
  visibility: hidden;
  opacity: 0;
  transition: opacity .55s ease;
  pointer-events: none;
}
.crystal-hall[data-show] .crystal-video { visibility: visible; opacity: 1; }
.crystal-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, #14112346 65%, #0e0d1cec);
}
.crystal-keys {
  position: absolute;
  z-index: 2;
  inset: auto 8% 6%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.1rem, 1vw, .7rem);
}
.crystal-key {
  --glow: #8fd9ff;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: end center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.crystal-key:nth-child(2) { --glow: #bb9aff; translate: 0 -10%; }
.crystal-key:nth-child(3) { --glow: #ffcd8b; translate: 0 -10%; }
.crystal-key:nth-child(4) { --glow: #ffaacb; }
.crystal-key img {
  display: block;
  width: min(100%, 12rem);
  height: auto;
  image-rendering: pixelated;
  filter: brightness(.82) saturate(.95) drop-shadow(0 2px #10101d);
  transition: filter .26s ease;
}
.crystal-key::before, .crystal-key::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.crystal-key::before {
  inset: -16% -6% -9%;
  z-index: -1;
  opacity: .12;
  background: radial-gradient(ellipse at 50% 67%, var(--glow), transparent 59%);
  transition: opacity .26s ease;
}
.crystal-key::after {
  width: 7px;
  height: 7px;
  bottom: 0;
  rotate: 45deg;
  background: #1a1726;
  border: 1px solid var(--glow);
}
.crystal-key:hover img, .crystal-key:focus-visible img, .crystal-key[data-lit] img {
  filter: brightness(1.07) saturate(1.15) drop-shadow(0 0 .36rem var(--glow));
}
.crystal-key:hover::before, .crystal-key:focus-visible::before { opacity: .38; }
.crystal-key[data-lit]::before { opacity: .7; }
.crystal-key[data-lit]::after { background: var(--glow); box-shadow: 0 0 .6rem var(--glow); }
.crystal-key:focus-visible { outline: 2px dashed var(--glow); outline-offset: 2px; }
.crystal-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem 1.4rem;
  min-height: 3.65rem;
  padding-top: .75rem;
  color: #e0cae9;
  font-size: clamp(.92rem, 1.45vw, 1.1rem);
}
.crystal-credit { color: #fff1dc; font-style: normal; }
.crystal-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-inline-start: auto; }
.crystal-actions:has(button:not([hidden])) { min-height: 2.75rem; }
.crystal-actions button {
  min-height: 2.75rem;
  padding: .38rem .8rem;
  border: 1px solid #a88cb2;
  color: #fcf0f4;
  background: #31243d;
  cursor: pointer;
}
.crystal-actions button:hover { background: #493554; }
.crystal-actions .crystal-play { color: #251a30; background: #e9d5f2; }
.crystal-actions .crystal-play:hover { background: #f8eafa; }
.crystal-actions button:focus-visible { outline-color: #ead5ff; outline-offset: 3px; }
.development-list dt a { text-underline-offset: .28em; }

@media (max-width: 600px) {
  .crystal-stage { aspect-ratio: 5 / 4; }
  .crystal-keys { inset-inline: 4%; }
  .crystal-actions { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .crystal-key img, .crystal-key::before, .crystal-video { transition: none; }
}
