.instruction-overlay {
  position: fixed;
  top: var(--bar-height); /* bar is not covered */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998;

  background: rgba(15, 35, 24, 0.88);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1.5rem 1.5rem;

  animation: fadeIn 0.5s ease-out;
}

.instruction-overlay.hidden {
  display: none;
}

/* main layout */
.instruction-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3rem;
  width: min(100%, 980px);
  text-align: center;
}

/* top text area */
/* top text area */
.instr-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 0.8rem;
  width: 100%;
  text-align: center;
}

.instr-deco {
  position: fixed;
  display: flex;
  top:5rem;
  margin-left: 10rem;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin: 4px 7px 0.2rem 5px;
}


.instr-deco span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e86920;
  animation: pulse 1.8s ease-in-out infinite;
}

.instr-deco span:nth-child(2) {
  animation-delay: 0.3s;
  background: #b1c637;
}
.instr-deco span:nth-child(3) {
  animation-delay: 0.6s;
  background: #a7f554;
}

.instruction-panel h2 {
  display: block;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 500;
  color: #f5c354;
  line-height: 1.4;

  border-right: 2px solid #f5c354;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  margin: 0 auto;

  animation: typing 3s steps(50, end) 0.3s forwards, blink 0.75s step-end infinite;
}

.instruction-panel p {
  display: block;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;

  margin: 0;
  opacity: 0;

  animation: fadeIn 0.5s ease 3.5s forwards;
}

/* mini mockup */
.mini-mockup {
  width: 440px;
  max-width: 92vw;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #eaf8ff;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
  position: relative;
}

.mini-bar {
  height: 52px;
  background: white;
  border-bottom: 1.5px solid #e8a020;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.mini-pill {
  padding: 4px 14px;
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  transition: background 0.3s, color 0.3s;
}

.mini-pill.active {
  background: #e8a020;
  color: white;
  border-color: #e8a020;
}

.mini-genre-bar {
  height: 44px;
  background: white;
  border-bottom: 1px solid rgba(232, 160, 32, 0.2);
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  gap: 0.5rem;
  transform: translateY(-44px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  position: relative;
  z-index: 2;
}

.mini-genre-bar.show {
  transform: translateY(0);
  opacity: 1;
}

.mini-gpill {
  padding: 3px 12px;
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  transition: background 0.3s;
}

.mini-gpill.active {
  background: #e8a020;
  color: white;
  border-color: #e8a020;
}

.mini-body {
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 160px;
  position: relative;
  z-index: 2;
}

.mini-hymn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(232, 160, 32, 0.1);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
}

.mini-hymn.show {
  opacity: 1;
  transform: translateX(0);
}

.mini-hymn.selected {
  background: rgba(232, 160, 32, 0.2);
  border-color: rgba(232, 160, 32, 0.4);
}

.mini-num {
  font-size: 12px;
  font-weight: 700;
  color: #e8a020;
  min-width: 24px;
  text-align: right;
}

.mini-title {
  font-size: 12px;
  color: #1a2e1a;
}

/* mini overlay */
.mini-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 35, 24, 0.85);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.5s ease;
}

.mini-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.mini-overlay-text {
  font-size: 14px;
  color: #f5c354;
  font-weight: 600;
  text-align: center;
  padding: 0 18px;
  line-height: 1.5;
}

.mini-dot-row {
  display: flex;
  gap: 6px;
}

.mini-dot-row span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e8a020;
  animation: pulse 1.8s ease-in-out infinite;
}

.mini-dot-row span:nth-child(2) {
  animation-delay: 0.3s;
}

.mini-dot-row span:nth-child(3) {
  animation-delay: 0.6s;
}

/* cursor */
.mini-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(232, 160, 32, 0.6);
  pointer-events: none;
  transition: top 0.5s ease, left 0.5s ease, transform 0.2s;
  z-index: 10;
  opacity: 0;
}

.mini-cursor.tap {
  transform: scale(0.55);
}

/* responsive */
@media (max-width: 768px) {
  .instruction-overlay {
    align-items: flex-start;
    padding-top: 3rem;
  }

  .instruction-panel {
    gap: 2rem;
  }

  .instruction-panel h2 {
    font-size: 1.3rem;
  }

  .instruction-panel p {
    font-size: 0.8rem;
  }

  .mini-mockup {
    width: min(92vw, 380px);
  }
}

/* animations */
@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 26ch;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.7;
  }
}