/* Stranger Arp - VHS/CRT Enhanced 80s Aesthetic */

:root {
  --st-red: #ff3333;
  --st-red-dark: #cc0000;
  --st-red-glow: rgba(255, 51, 51, 0.8);
  --st-black: #0c0c10;
  --st-gray: #141418;
  --st-text: #c8d8c8;
  --st-border: rgba(255, 255, 255, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Courier New', monospace;
  background: var(--st-black);
  color: var(--st-text);
  overflow-x: hidden;
}

/* Scanline overlay for entire page */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
  pointer-events: none;
  z-index: 9999;
}

.stranger-container {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  position: relative;
}

.glow-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 51, 51, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.stranger-header {
  text-align: center;
  margin-bottom: 40px;
  z-index: 1;
}

.stranger-title {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 6px;
  color: var(--st-red);
  text-shadow:
    0 0 8px rgba(255, 51, 51, 0.5),
    -0.5px 0 rgba(0, 255, 255, 0.3),
    0.5px 0 rgba(255, 0, 0, 0.3);
  margin: 0;
  animation: title-flicker 3s infinite;
}

@keyframes title-flicker {
  0%, 100% { opacity: 1; }
  41.99% { opacity: 1; }
  42% { opacity: 0.7; text-shadow: 0 0 10px var(--st-red-glow), -3px 0 rgba(0, 255, 255, 0.8), 3px 0 rgba(255, 0, 0, 0.8); }
  43% { opacity: 1; }
  45.99% { opacity: 1; }
  46% { opacity: 0.85; }
  46.5% { opacity: 1; }
}

.controls-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-bottom: 40px;
  z-index: 1;
}

.control-button {
  background: transparent;
  border: 2px solid var(--st-red);
  color: var(--st-red);
  padding: 12px 30px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  border-radius: 2px;
}

.control-button:hover {
  background: var(--st-red);
  color: var(--st-black);
  box-shadow:
    0 0 20px var(--st-red-glow),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  text-shadow: none;
}

.control-button.play-btn {
  min-width: 180px;
  font-size: 1.25rem;
  padding: 15px 50px;
}

.control-button.playing {
  background: var(--st-red);
  color: var(--st-black);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--st-red-glow);
  }
  50% {
    box-shadow:
      0 0 30px var(--st-red-glow),
      0 0 50px var(--st-red-glow),
      0 0 70px rgba(255, 51, 51, 0.3);
  }
}

.control-group {
  text-align: center;
}

.control-group label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #555;
  text-transform: uppercase;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.control-button.small {
  padding: 8px 16px;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.control-button.active {
  background: var(--st-red-dark);
  color: var(--st-text);
  box-shadow: 0 0 15px rgba(255, 51, 51, 0.4);
}

/* Chord Sequencer */
.chord-sequencer {
  width: 100%;
  max-width: 700px;
  margin-bottom: 40px;
  z-index: 1;
}

.sequencer-label {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.chord-slots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.chord-slot {
  position: relative;
  display: flex;
  align-items: center;
}

.chord-select {
  background: var(--st-gray);
  border: 2px solid #333;
  color: var(--st-text);
  padding: 10px 30px 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.1s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 20px;
}

.chord-select:hover {
  border-color: #555;
}

.chord-select:focus {
  outline: none;
  border-color: var(--st-red);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.remove-chord {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--st-red-dark);
  border: 1px solid var(--st-red);
  color: var(--st-text);
  border-radius: 2px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.remove-chord:hover {
  background: var(--st-red);
  color: var(--st-black);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.add-chord {
  background: transparent;
  border: 2px dashed #333;
  color: #555;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.add-chord:hover {
  border-color: var(--st-red);
  color: var(--st-red);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

/* Sequence Display */
.sequence-display {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
  z-index: 1;
}

.note-block {
  width: 50px;
  height: 50px;
  border: 2px solid #333;
  background: var(--st-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #555;
  transition: all 0.05s;
  border-radius: 2px;
}

.note-block.active {
  background: var(--st-red);
  color: var(--st-black);
  border-color: var(--st-red);
  box-shadow:
    0 0 20px var(--st-red-glow),
    0 0 40px rgba(255, 51, 51, 0.3),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
  text-shadow:
    -1px 0 rgba(0, 255, 255, 0.5),
    1px 0 rgba(255, 0, 0, 0.5);
}

/* Navigation controls */
.stranger-back {
  border-color: #333;
  color: #666;
}

.stranger-back:hover {
  background: transparent;
  border-color: var(--st-red);
  color: var(--st-red);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

/* Hide main content in viz-only mode */
body.viz-only .stranger-header,
body.viz-only .controls-container,
body.viz-only .sequence-display,
body.viz-only .chord-sequencer {
  opacity: 0.1;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .stranger-title {
    font-size: 1.25rem;
    letter-spacing: 4px;
  }

  .control-button.play-btn {
    min-width: 140px;
    font-size: 1rem;
    padding: 12px 30px;
  }

  .button-group {
    flex-direction: column;
  }

  .control-button.small {
    width: 100%;
  }

  .note-block {
    width: 40px;
    height: 40px;
    font-size: 0.625rem;
  }

  .chord-select {
    font-size: 0.875rem;
    padding: 8px 25px 8px 10px;
  }

  /* Reduce scanline density on mobile */
  body::before {
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.1) 2px,
      rgba(0, 0, 0, 0.1) 4px
    );
  }
}
