.panel-granted {
  background: rgba(0, 8, 20, 0.85);
  animation: granted-flash 280ms steps(2, end) 1;
}

@keyframes granted-flash {
  0% { background: rgba(0, 255, 156, 0.18); }
  100% { background: rgba(0, 8, 20, 0.85); }
}

.glitch-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 255, 156, 0.18);
  mix-blend-mode: screen;
  animation: glitch-burst 260ms steps(3, end) 1;
}

@keyframes glitch-burst {
  0%   { opacity: 0.9; transform: translate(-3px, 1px) skewX(-1deg); }
  33%  { opacity: 0.6; transform: translate(2px, -2px) skewX(1.5deg); background: rgba(255, 42, 77, 0.18); }
  66%  { opacity: 0.4; transform: translate(-1px, 1px); background: rgba(0, 255, 156, 0.14); }
  100% { opacity: 0; transform: translate(0, 0); }
}

.granted-heading {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--neon);
  margin: 0;
  font-size: clamp(2rem, 9vw, 5rem);
  text-shadow:
    0 0 6px rgba(0, 255, 156, 0.9),
    0 0 18px rgba(0, 255, 156, 0.7),
    0 0 36px rgba(0, 255, 156, 0.45);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.02em;
}

.granted-heading span {
  display: inline-block;
  opacity: 0;
  transform: scale(1.25);
  animation: letter-reveal 320ms cubic-bezier(0.2, 0.9, 0.2, 1.1) forwards;
}

.granted-heading .granted-space {
  width: 0.5em;
  animation: none;
  opacity: 1;
  transform: none;
}

.granted-heading span:nth-child(1)  { animation-delay: 50ms; }
.granted-heading span:nth-child(2)  { animation-delay: 100ms; }
.granted-heading span:nth-child(3)  { animation-delay: 150ms; }
.granted-heading span:nth-child(4)  { animation-delay: 200ms; }
.granted-heading span:nth-child(5)  { animation-delay: 250ms; }
.granted-heading span:nth-child(6)  { animation-delay: 300ms; }
.granted-heading span:nth-child(8)  { animation-delay: 380ms; }
.granted-heading span:nth-child(9)  { animation-delay: 430ms; }
.granted-heading span:nth-child(10) { animation-delay: 480ms; }
.granted-heading span:nth-child(11) { animation-delay: 530ms; }
.granted-heading span:nth-child(12) { animation-delay: 580ms; }
.granted-heading span:nth-child(13) { animation-delay: 630ms; }
.granted-heading span:nth-child(14) { animation-delay: 680ms; }

@keyframes letter-reveal {
  0%   { opacity: 0; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

.terminal-granted,
.terminal-error,
.terminal-cooldown {
  margin-top: clamp(0.75rem, 3vh, 1.5rem);
  min-height: 6em;
}

.terminal-error {
  color: var(--danger);
  text-shadow: 0 0 6px rgba(255, 42, 77, 0.5);
}

.terminal-cooldown {
  color: var(--neon-dim);
  opacity: 0.85;
}

.cmd-btn-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 42, 77, 0.06);
  box-shadow:
    0 0 0 1px rgba(255, 42, 77, 0.18) inset,
    0 0 14px rgba(255, 42, 77, 0.25);
  text-shadow: 0 0 8px rgba(255, 42, 77, 0.5);
}

.cmd-btn-danger:active,
.cmd-btn-danger.is-pressed {
  background: rgba(255, 42, 77, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 42, 77, 0.4) inset,
    0 0 22px rgba(255, 42, 77, 0.5);
}

.panel-cooldown {
  background: rgba(0, 8, 20, 0.6);
  animation: cooldown-fade 1500ms ease-out forwards;
}

@keyframes cooldown-fade {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

.rotate-warning {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: var(--bg);
  color: var(--neon);
  text-align: center;
  padding: 2rem;
}

.rotate-icon {
  color: var(--neon);
  animation: rotate-hint 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(0, 255, 156, 0.5));
}

.rotate-text {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.4rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-90deg); }
  60% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .glitch-flash,
  .granted-heading span,
  .panel-granted,
  .panel-cooldown,
  .rotate-icon {
    animation: none !important;
  }
  .granted-heading span { opacity: 1; transform: none; }
}
