.grain,
.vignette,
.spot,
.slit,
.cine-copy,
.cine-title,
.cine-line {
  pointer-events: none;
}

.grain,
.vignette,
.spot {
  position: fixed;
  inset: 0;
}

.grain {
  z-index: 4;
  opacity: 0.05;
  background-image: radial-gradient(#F3EDE2 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  animation: grainShift 0.9s steps(2) infinite;
}

.vignette {
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.62) 100%);
}

.spot {
  z-index: 2;
  width: 280px;
  height: 280px;
  inset: auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 194, 122, 0.34), transparent 68%);
  transform: translate(-50%, -50%);
}

#open {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #000;
  text-align: center;
  padding: 24px;
}

#open[hidden] { display: none !important; }

.slit {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 18px;
  transform: translateX(-50%) scaleX(0.35);
  background: linear-gradient(90deg, transparent, #E9C27A, transparent);
  animation: slitOpen 2.6s ease forwards;
}

.cine-title,
.cine-line {
  position: relative;
  z-index: 1;
  margin: 0;
  opacity: 0;
  animation: lineIn 0.7s ease forwards;
}

.cine-title { font-size: 42px; letter-spacing: 0.4em; animation-delay: 0.7s; }
.cine-line { margin-top: 12px; font-size: 22px; font-weight: 600; animation-delay: 1.35s; }

#skipOpen {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  pointer-events: auto;
}

[data-screen] { animation: pushIn 500ms ease; }

#resultName {
  font-size: 40px;
  line-height: 1.2;
  animation: unveil 520ms ease forwards;
}

.cells { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 14px 0; }
.cell { height: 48px; border-radius: 8px; background: #6d675f; }
.cell.gold { background: #E9C27A; }
.cell.blue { background: #6F8FD8; }
.cell.gray { background: #6d675f; }

.tap { position: relative; }
.tap.is-ripple::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid #E9C27A;
  pointer-events: none;
  animation: goldRipple 0.48s ease-out;
}
@keyframes goldRipple {
  from { transform: scale(0.82); opacity: 0.9; }
  to { transform: scale(1.28); opacity: 0; }
}
.tap[data-glow="gold"] { box-shadow: 0 0 42px #E9C27A; border-color: #E9C27A; }
.tap[data-glow="blue"] { box-shadow: 0 0 42px #6F8FD8; border-color: #6F8FD8; }
.tap[data-glow="gray"] { box-shadow: 0 0 12px #8a8478; filter: grayscale(0.55); }

.staff { cursor: pointer; }
.staff i {
  position: absolute;
  bottom: 28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #E9C27A;
}
.staff i:nth-child(6) { left: 12%; }
.staff i:nth-child(7) { left: 28%; }
.staff i:nth-child(8) { left: 46%; }
.staff i:nth-child(9) { left: 64%; }
.staff i:nth-child(10) { left: 80%; }

#melodyBox { flex-wrap: wrap; }
#melodyBox .degree { flex: 1 1 42%; min-width: 0; }

@keyframes slitOpen {
  to { transform: translateX(-50%) scaleX(46); opacity: 0.45; }
}

@keyframes lineIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pushIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes unveil {
  from { clip-path: inset(0 50% 0 50%); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes grainShift {
  from { background-position: 0 0; }
  to { background-position: 3px 2px; }
}

@media (prefers-reduced-motion: reduce) {
  #open { display: none !important; }
  .grain { animation: none; }
  .spot { display: none !important; }
  .slit, .cine-title, .cine-line, [data-screen], #resultName { animation: none; }
  .cine-title, .cine-line { opacity: 1; }
}
