*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  color: #1a1a1a;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* --- Idle screen --- */

.idle-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.idle-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #1a1a1a;
}

.subtitle {
  font-size: 1rem;
  color: #888;
  margin-bottom: 16px;
}

.idle-actions {
  display: flex;
  gap: 12px;
}

.error-msg {
  display: none;
  color: #c0392b;
  font-size: 0.85rem;
  max-width: 340px;
  text-align: center;
  line-height: 1.5;
}

.error-msg.visible {
  display: block;
}

/* --- Placard --- */

.placard {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 0;
}

.placard-content {
  max-width: 620px;
  width: 100%;
}

.placard-content h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
}

.placard-content h2.artist {
  font-size: 1.45rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 14px;
}

.placard-content h3 {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 24px;
}

.placard-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #1a1a1a;
}

.placard-content .raw-text p {
  font-size: 1.2rem;
  line-height: 1.6;
}

.placard-content p.error-display {
  color: #c0392b;
  font-size: 0.9rem;
}

.placard-content p.empty-display {
  color: #aaa;
  font-style: italic;
}

/* --- Loading dots --- */

.loading-dots {
  display: flex;
  gap: 2px;
  font-size: 1.5rem;
  color: #aaa;
}

.loading-dots span {
  animation: dot-fade 1.4s infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-fade {

  0%,
  80%,
  100% {
    opacity: 0.2;
  }

  40% {
    opacity: 0.8;
  }
}

/* --- Hover zone (top-right) --- */

.hover-zone {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  opacity: 0.0;
  transition: opacity 0.3s ease;
}

.hover-zone:hover,
.hover-zone.open {
  opacity: 1;
}

.hover-panel {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  min-width: 160px;
}

.status-line {
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

.hover-actions {
  display: flex;
  gap: 6px;
}

@media (hover: none) {
  .hover-zone {
    opacity: 0.25;
  }
}

/* --- Buttons --- */

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-primary:hover {
  background: #333;
}

.btn-outline {
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
}

.btn-outline:hover {
  color: #1a1a1a;
  border-color: #999;
}

.btn-outline-sm {
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.btn-outline-sm:hover {
  background: #f5f5f5;
  color: #333;
}

/* --- Debug overlay --- */

.debug-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.debug-panel {
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  padding: 28px 24px;
  overflow-y: auto;
  border-left: 1px solid #e0e0e0;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.debug-panel h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.debug-panel label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.debug-panel textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
}

.debug-panel textarea:focus {
  border-color: #999;
}

.debug-panel input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  font-size: 0.78rem;
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
}

.debug-panel input[type="text"]:focus {
  border-color: #999;
}

.debug-panel input[type="range"] {
  width: 100%;
  accent-color: #1a1a1a;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row span {
  font-size: 0.85rem;
  color: #555;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] {
  flex: 1;
}

.slider-row span {
  font-size: 0.85rem;
  color: #555;
  min-width: 32px;
  text-align: right;
}

/* --- Small screen adjustments --- */

@media (max-width: 600px) {
  .placard {
    padding: 24px;
  }

  .placard-content h1 {
    font-size: 1.8rem;
  }

  .placard-content h2.artist {
    font-size: 1.2rem;
  }

  .placard-content h3 {
    font-size: 0.7rem;
  }

  .placard-content p {
    font-size: 0.95rem;
  }

  .hover-zone {
    top: 10px;
    right: 10px;
  }

  .debug-panel {
    width: 100vw;
    max-width: 100vw;
  }
}
