body {
  margin: 0;
  padding: 24px;
  background: #1f1f1f;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

a {
  color: #6eb5ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#header-display:empty {
  display: none;
}

/* Animation styles */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.delayed {
  opacity: 0;
  animation: delayedReveal 0.3s ease-in forwards;
}

@keyframes delayedReveal {
  to { opacity: 1; }
}

.wiggle {
  display: inline-block;
}

.wiggle > span {
  display: inline-block;
  animation: wiggle 0.4s ease-in-out infinite;
}

@keyframes wiggle {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-1px, 1px) rotate(-2deg); }
  20% { transform: translate(1px, -1px) rotate(1deg); }
  30% { transform: translate(-1px, -0.5px) rotate(-1deg); }
  40% { transform: translate(1px, 1px) rotate(2deg); }
  50% { transform: translate(-0.5px, 1px) rotate(-1deg); }
  60% { transform: translate(1px, -1px) rotate(1deg); }
  70% { transform: translate(-1px, 0.5px) rotate(-2deg); }
  80% { transform: translate(0.5px, -1px) rotate(1deg); }
  90% { transform: translate(-1px, 1px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.hop {
  display: inline-block;
}

.hop > span {
  display: inline-block;
  animation: hop 1.2s ease-in-out infinite;
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-8px); }
  40% { transform: translateY(0); }
}

.wave {
  display: inline-block;
}

.wave > span {
  display: inline-block;
  animation: wave 0.6s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.blink {
  display: inline;
  animation: blink 1s step-end infinite;
}

.blink.blink-fade {
  animation: blinkFade 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes blinkFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.typewriter {
  display: inline;
}

/* Interactive buttons */
.interactive-button {
  padding: 8px 16px;
  margin: 4px;
  background: #2d3139;
  border: 1px solid #404552;
  border-radius: 4px;
  color: #e8e8e8;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.interactive-button:hover {
  background: #363a44;
}

.clickable-text {
  color: #6eb5ff;
  transition: color 0.2s;
}

.clickable-text:hover {
  color: #8fc7ff;
}

@keyframes fadeInText {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#persistent-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}

#persistent-controls button {
  padding: 8px 16px;
  background: #2d3139;
  border: 1px solid #404552;
  border-radius: 4px;
  color: #e8e8e8;
  cursor: pointer;
  font-size: 14px;
}

#persistent-controls button:hover {
  background: #363a44;
}

/* Save list dropdown */
#save-list {
  display: none;
  position: fixed;
  top: 52px;
  right: 12px;
  width: 300px;
  padding: 10px;
  background: #1a1d24;
  border: 1px solid #404552;
  border-radius: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 999;
}

.save-item {
  padding: 8px;
  margin-bottom: 8px;
  background: #1a1d24;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-item button {
  margin-left: 8px;
  padding: 4px 10px;
  font-size: 12px;
  background: #2d3139;
  border: 1px solid #404552;
  border-radius: 4px;
  color: #e8e8e8;
  cursor: pointer;
}

.save-item button:hover {
  background: #363a44;
}

.passage-error {
  margin: 24px 0;
  padding: 16px;
  border: 2px solid #ff4d4f;
  background: #2a1416;
  border-radius: 6px;
  color: #ffd7d8;
}

.passage-error h2 {
  margin: 0 0 8px;
  color: #ff8d8f;
}

.passage-error code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.passage-link-error {
  color: #ff8d8f;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Update banner */
#update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: #1a3a5c;
  color: #d0e4ff;
  font-size: 14px;
  text-align: center;
  z-index: 2000;
}

#update-banner a {
  color: #6eb5ff;
  margin-left: 6px;
}

/* Vignette full-page overlay */
.vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 150px 60px rgba(0, 0, 0, 0.8);
  z-index: 999;
}

.vignette-overlay.vignette-blink {
  animation: vignetteBlink 1s ease-in-out infinite;
}

@keyframes vignetteBlink {
  0%, 100% { box-shadow: inset 0 0 150px 60px rgba(0, 0, 0, 0); }
  50% { box-shadow: inset 0 0 150px 60px rgba(0, 0, 0, 0.8); }
}

#update-banner button {
  background: none;
  border: none;
  color: #d0e4ff;
  font-size: 18px;
  cursor: pointer;
  margin-left: 12px;
  vertical-align: middle;
}
