/* Universal Tuner Styles - Sunset Boulevard */

body {
  font-family: var(--font-stack);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: var(--glass-bg);
  padding: 0.75rem 1.5rem;
  margin: -20px -20px 25px -20px;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.home-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.home-link:hover {
  color: var(--accent-secondary);
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Setup Section */
.setup-section {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.select-group {
  flex: 1;
}

.select-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
}

.select-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

/* Strings Section */
.strings-section {
  margin-bottom: 25px;
}

.strings-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.strings-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.string-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 65px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.string-btn .string-num {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.string-btn .string-note {
  font-size: 16px;
}

.string-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.string-btn.active {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--accent-primary);
}

.string-btn.modified {
  border-color: var(--warning-color);
}

.string-btn.modified::after {
  content: '\2022';
  position: absolute;
  top: 2px;
  right: 5px;
  color: var(--warning-color);
  font-size: 12px;
}

/* Tuner Section */
.tuner-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 25px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.detected-note {
  margin-bottom: 20px;
}

.note-name {
  font-size: 5rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  line-height: 1;
}

.note-octave {
  font-size: 2rem;
  color: var(--text-secondary);
  vertical-align: super;
}

/* Tuner Meter */
.tuner-meter {
  margin-bottom: 15px;
}

.meter-scale {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.flat-label, .sharp-label {
  font-size: 1.2rem;
  color: var(--text-secondary);
  width: 20px;
}

.meter-ticks {
  display: flex;
  justify-content: space-between;
  width: 200px;
}

.tick {
  width: 2px;
  height: 10px;
  background: var(--bg-tertiary);
}

.tick.center {
  height: 16px;
  background: var(--accent-primary);
}

.meter-bar {
  position: relative;
  height: 8px;
  background: linear-gradient(to right,
    var(--wrong-color) 0%,
    var(--warning-color) 20%,
    var(--accent-primary) 45%,
    var(--accent-primary) 55%,
    var(--warning-color) 80%,
    var(--wrong-color) 100%
  );
  border-radius: 4px;
  margin: 0 auto;
  width: 260px;
}

.meter-indicator {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 4px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.05s ease-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.meter-indicator.in-tune {
  background: var(--correct-color);
  box-shadow: 0 0 15px rgba(45, 212, 168, 0.8);
}

.meter-indicator.close {
  background: var(--warning-color);
}

/* Cents Display */
.cents-display {
  margin-bottom: 10px;
}

.cents-value {
  font-size: 2rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.cents-value.sharp {
  color: var(--warning-color);
}

.cents-value.flat {
  color: var(--accent-secondary);
}

.cents-value.in-tune {
  color: var(--correct-color);
}

.cents-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 5px;
}

/* Status */
.tuner-status {
  font-size: 1.1rem;
  margin-bottom: 10px;
  min-height: 28px;
}

.tuner-status.in-tune {
  color: var(--correct-color);
  font-weight: bold;
}

.tuner-status.flat {
  color: var(--accent-secondary);
}

.tuner-status.sharp {
  color: var(--warning-color);
}

.frequency-display {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Start Button */
.start-btn {
  display: block;
  width: 100%;
  padding: 18px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #0d0015;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

.start-btn.active {
  background: linear-gradient(135deg, var(--wrong-color) 0%, #d32f2f 100%);
}

.start-btn.active:hover {
  box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 25px;
  max-width: 350px;
  width: 100%;
  text-align: center;
}

.modal-content h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.modal-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.note-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.note-option {
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.note-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.note-option.selected {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--accent-primary);
}

.note-option.original {
  border-color: var(--text-secondary);
}

.modal-close {
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile */
@media (max-width: 400px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .setup-section {
    flex-direction: column;
    gap: 10px;
  }

  .string-btn {
    width: 48px;
    height: 58px;
  }

  .note-name {
    font-size: 4rem;
  }

  .meter-bar {
    width: 220px;
  }

  .meter-ticks {
    width: 170px;
  }
}
