:root {
  --bg-color: #000000;
  --text-color: #000;
  --header-bg: #000000;
  --header-text: #fff;
  --button-bg: #ffffff;
  --button-active: #400080;
  --card-bg: #ffffff;
  --card-shadow: rgba(0,0,0,0);
  --diagram-bg: #400080;
  --link-color: #1e90ff;
}

[data-theme="dark"] {
  --bg-color: #000;
  --text-color: #fff;
  --header-bg: #252525;
  --header-text: #ffffff;
  --button-bg: #000000;
  --button-active: #1e90ff;
  --card-bg: #111;
  --card-shadow: rgba(255,255,255,0.2);
  --diagram-bg: #333;
  --link-color: #ff6b00;
}

[data-theme="dark"] .tuning-circle {
  border: 2px solid rgba(75, 0, 130, 0.8);
  background: linear-gradient(145deg, #4B0082 0%, #2E0054 25%, #1A0033 50%, #301934 75%, #4B0082 100%) !important;
  color: #E6E6FA;
  box-shadow: 
    0 8px 20px rgba(75, 0, 130, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 3px 0 rgba(230, 230, 250, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.7),
    inset 3px 0 0 rgba(230, 230, 250, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(230, 230, 250, 0.2);
}

[data-theme="dark"] .tuning-circle:hover {
  background: linear-gradient(145deg, #6A0DAD 0%, #4B0082 25%, #2E0054 50%, #483D8B 75%, #6A0DAD 100%) !important;
  border-color: rgba(106, 13, 173, 0.9);
  color: #F0F8FF;
  box-shadow: 
    0 12px 25px rgba(75, 0, 130, 0.5),
    0 8px 15px rgba(0, 0, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 4px 0 rgba(240, 248, 255, 0.4),
    inset 0 -4px 0 rgba(0, 0, 0, 0.8),
    inset 4px 0 0 rgba(240, 248, 255, 0.2),
    inset -4px 0 0 rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(240, 248, 255, 0.3);
}

[data-theme="dark"] .tuning-circle.playing {
  background: linear-gradient(145deg, #9932CC 0%, #BA55D3 25%, #DA70D6 50%, #DDA0DD 75%, #EE82EE 100%) !important;
  border-color: rgba(218, 112, 214, 0.9);
  color: #191970;
  font-weight: 900;
  box-shadow: 
    0 0 25px rgba(218, 112, 214, 0.8),
    0 0 15px rgba(186, 85, 211, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 4px 0 rgba(255, 255, 255, 0.6),
    inset 0 -4px 0 rgba(153, 50, 204, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.4),
    inset -4px 0 0 rgba(153, 50, 204, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  animation: tuningGlowDark 1.2s ease-in-out infinite;
}

@keyframes tuningGlowDark {
  0%, 100% { 
    box-shadow: 
      0 0 25px rgba(218, 112, 214, 0.8),
      0 0 15px rgba(186, 85, 211, 0.6),
      0 8px 20px rgba(0, 0, 0, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.5),
      inset 0 4px 0 rgba(255, 255, 255, 0.6),
      inset 0 -4px 0 rgba(153, 50, 204, 0.8),
      inset 4px 0 0 rgba(255, 255, 255, 0.4),
      inset -4px 0 0 rgba(153, 50, 204, 0.6),
      inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  }
  50% { 
    box-shadow: 
      0 0 35px rgba(218, 112, 214, 1.0),
      0 0 25px rgba(186, 85, 211, 0.9),
      0 12px 30px rgba(0, 0, 0, 0.7),
      0 6px 18px rgba(0, 0, 0, 0.6),
      inset 0 4px 0 rgba(255, 255, 255, 0.8),
      inset 0 -4px 0 rgba(153, 50, 204, 1.0),
      inset 4px 0 0 rgba(255, 255, 255, 0.6),
      inset -4px 0 0 rgba(153, 50, 204, 0.8),
      inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  }
}

[data-theme="dark"] .repeat-circle {
  background: white;
  border-color: white;
  color: black;
}

[data-theme="dark"] header {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 25%, #2d2d2d 50%, #1a1a1a 75%, #0a0a0a 100%);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.8),
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5),
    inset 3px 0 0 rgba(255, 255, 255, 0.04),
    inset -3px 0 0 rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .tuning-row {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 25%, #2d2d2d 50%, #1a1a1a 75%, #0a0a0a 100%);
  box-shadow: 
    0 -12px 40px rgba(0, 0, 0, 0.8),
    0 -8px 24px rgba(0, 0, 0, 0.6),
    0 -4px 12px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5),
    inset 3px 0 0 rgba(255, 255, 255, 0.04),
    inset -3px 0 0 rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] footer.control-buttons {
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 25%, #2d2d2d 50%, #1a1a1a 75%, #0a0a0a 100%);
  box-shadow: 
    0 -12px 40px rgba(0, 0, 0, 0.8),
    0 -8px 24px rgba(0, 0, 0, 0.6),
    0 -4px 12px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5),
    inset 3px 0 0 rgba(255, 255, 255, 0.04),
    inset -3px 0 0 rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .chord-box {
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.6),
    0 4px 15px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.1),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5),
    inset 3px 0 0 rgba(255, 255, 255, 0.05),
    inset -3px 0 0 rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chord-box:hover {
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.7),
    0 8px 20px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 4px 0 rgba(255, 255, 255, 0.15),
    inset 0 -4px 0 rgba(0, 0, 0, 0.6),
    inset 4px 0 0 rgba(255, 255, 255, 0.08),
    inset -4px 0 0 rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

body {
  font-family: monospace, monospace;
  margin: 0; 
  padding: 0 0 6rem 0;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 2s, color 2s;
}

header {
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 25%, #3a3a3a 50%, #2d2d2d 75%, #1a1a1a 100%);
  color: var(--header-text);
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.15),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    inset 3px 0 0 rgba(255, 255, 255, 0.08),
    inset -3px 0 0 rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#normal-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0;
  align-items: center;
  gap: 0.2rem;
}

header button {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 20%, #e9ecef 50%, #dee2e6 80%, #d3d3d4 100%);
  border: none;
  color: #2c3e50;
  margin: 0.2rem 0.2rem;
  padding: 0.4rem 0.4rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 12px;
  width: 2.375rem;
  height: 2.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 rgba(0, 0, 0, 0.1),
    inset 3px 0 0 rgba(255, 255, 255, 0.4),
    inset -3px 0 0 rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.9);
  font-family: monospace, monospace;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

header button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

header button:hover::before {
  opacity: 1;
  animation: shine 0.6s ease-out;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

header button:hover {
  background: linear-gradient(145deg, #f8f8f8 0%, #f0f0f0 40%, #e8e8e8 100%) !important;
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1),
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    inset 3px 0 0 rgba(255, 255, 255, 0.4),
    inset -3px 0 0 rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

header button:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
header button.active {
  background: linear-gradient(145deg, var(--button-active), #1a7acc) !important;
  color: white !important;
  border-color: var(--button-active) !important;
  opacity: 1 !important;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.1);
  border: 2px solid white !important;
  font-family: monospace, monospace;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

header button.active:hover {
  background: linear-gradient(145deg, #1a7acc, var(--button-active)) !important;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 0 20px rgba(30, 144, 255, 1.0), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

header button.active:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

header button:focus {
  color: white;
  outline: none;
}

.tuning-row {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.tuning-modal {
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 25%, #3a3a3a 50%, #2d2d2d 75%, #1a1a1a 100%);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 4px 0 rgba(255, 255, 255, 0.15),
    inset 0 -4px 0 rgba(0, 0, 0, 0.4),
    inset 4px 0 0 rgba(255, 255, 255, 0.08),
    inset -4px 0 0 rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.2);
  animation: tuningModalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
}

@keyframes tuningModalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tuning-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.tuning-modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  margin-bottom: 1rem;
  text-align: center;
}

.tuning-circles-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

#tuning-circles {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tuning-circle {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  text-shadow: none !important;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

/* Playing state for tuning circles - same as active C chord button */
.tuning-circle.playing {
  background: linear-gradient(145deg, var(--button-active), #1a7acc) !important;
  color: white !important;
  border: 2px solid white !important;
  opacity: 1 !important;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.1);
  font-weight: 700 !important;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9) !important;
}

.tuning-circle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.tuning-circle:hover::before {
  opacity: 1;
  animation: shine 0.6s ease-out;
}

.tuning-circle:hover {
  background: linear-gradient(145deg, #1a7acc, var(--button-active)) !important;
  transform: translateY(-1px) scale(1.15);
  box-shadow: 0 0 20px rgba(30, 144, 255, 1.0), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.tuning-circle:active {
  transform: translateY(1px) scale(1.1);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tuning-circle[data-note="E"].playing {
  background: linear-gradient(145deg, #FF66B3 0%, #FF33A6 25%, #FF0080 50%, #FF4DA6 75%, #FF80C0 100%) !important;
  border-color: rgba(255, 0, 128, 0.9);
  color: white;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(255, 0, 128, 1.0),
    0 0 20px rgba(255, 51, 166, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(255, 0, 128, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(255, 0, 128, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tuning-circle[data-note="A"].playing {
  background: linear-gradient(145deg, #FFB366 0%, #FFA633 25%, #FF8000 50%, #FFB84D 75%, #FFCC80 100%) !important;
  border-color: rgba(255, 128, 0, 0.9);
  color: white;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(255, 128, 0, 1.0),
    0 0 20px rgba(255, 166, 51, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(255, 128, 0, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(255, 128, 0, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tuning-circle[data-note="D"].playing {
  background: linear-gradient(145deg, #FFEB66 0%, #FFE633 25%, #FFD700 50%, #FFE84D 75%, #FFF080 100%) !important;
  border-color: rgba(255, 215, 0, 0.9);
  color: #1A1A1A;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(255, 215, 0, 1.0),
    0 0 20px rgba(255, 230, 51, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(255, 215, 0, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(255, 215, 0, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tuning-circle[data-note="G"].playing {
  background: linear-gradient(145deg, #66FFB3 0%, #33FFA6 25%, #00FF80 50%, #4DFFB8 75%, #80FFC0 100%) !important;
  border-color: rgba(0, 255, 128, 0.9);
  color: #1A1A1A;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(0, 255, 128, 1.0),
    0 0 20px rgba(51, 255, 166, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(0, 255, 128, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(0, 255, 128, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tuning-circle[data-note="B"].playing {
  background: linear-gradient(145deg, #66B3FF 0%, #33A6FF 25%, #0080FF 50%, #4DB8FF 75%, #80C0FF 100%) !important;
  border-color: rgba(0, 128, 255, 0.9);
  color: white;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(0, 128, 255, 1.0),
    0 0 20px rgba(51, 166, 255, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(0, 128, 255, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(0, 128, 255, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tuning-circle[data-note="C"].playing {
  background: linear-gradient(145deg, #B366FF 0%, #A633FF 25%, #8000FF 50%, #B84DFF 75%, #C080FF 100%) !important;
  border-color: rgba(128, 0, 255, 0.9);
  color: white;
  font-weight: 900;
  box-shadow: 
    0 0 30px rgba(128, 0, 255, 1.0),
    0 0 20px rgba(166, 51, 255, 0.8),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(128, 0, 255, 0.8),
    inset 4px 0 0 rgba(255, 255, 255, 0.5),
    inset -4px 0 0 rgba(128, 0, 255, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  animation: tuningGlowRainbow 1.2s ease-in-out infinite;
  transform: translateY(-3px) scale(1.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes tuningGlowRainbow {
  0%, 100% { 
    filter: brightness(1.0) saturate(1.0);
    transform: translateY(-3px) scale(1.15);
  }
  25% { 
    filter: brightness(1.2) saturate(1.3);
    transform: translateY(-4px) scale(1.18);
  }
  50% { 
    filter: brightness(1.4) saturate(1.5);
    transform: translateY(-5px) scale(1.2);
  }
  75% { 
    filter: brightness(1.2) saturate(1.3);
    transform: translateY(-4px) scale(1.18);
  }
}

.repeat-circle {
  background: linear-gradient(145deg, #ffffff, #e6e6e6) !important;
  border-color: rgba(0, 0, 0, 0.1);
  color: black;
}

.repeat-circle.active {
  background: linear-gradient(145deg, #6c757d, #495057) !important;
  border-color: rgba(0, 0, 0, 0.3);
  color: white;
  animation: pulse 1s infinite;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6); 
  }
  50% { 
    box-shadow: 0 0 25px rgba(40, 167, 69, 0.9); 
  }
}

@keyframes pulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.4); 
  }
  50% { 
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.8); 
  }
}
main {
  padding: 1rem 1rem 8rem 1rem;
  max-width: 450px;
  margin: auto;
  padding-bottom: 8rem;
  border-radius: 8px;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  main {
    padding: 0.25rem 0.25rem 10rem 0.25rem;
    margin: 0;
    max-width: 100vw;
    border-radius: 0;
  }

  body {
    padding: 0;
    margin: 0;
  }

  /* Ensure mobile buttons keep jewel-like depth */
  header button {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%) !important;
    box-shadow: 
      0 6px 16px rgba(0, 0, 0, 0.1),
      0 3px 8px rgba(0, 0, 0, 0.08),
      inset 0 2px 0 rgba(255, 255, 255, 0.9),
      inset 0 -2px 0 rgba(0, 0, 0, 0.05),
      inset 2px 0 0 rgba(255, 255, 255, 0.3),
      inset -2px 0 0 rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
  }

  header button:hover {
    background: linear-gradient(145deg, #f8f8f8 0%, #f0f0f0 40%, #e8e8e8 100%) !important;
    box-shadow: 
      0 10px 20px rgba(0, 0, 0, 0.15),
      0 6px 12px rgba(0, 0, 0, 0.1),
      inset 0 3px 0 rgba(255, 255, 255, 0.95),
      inset 0 -3px 0 rgba(0, 0, 0, 0.08),
      inset 3px 0 0 rgba(255, 255, 255, 0.4),
      inset -3px 0 0 rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px) scale(1.02) !important;
  }

  /* Mobile footer button styling with gem-like effects */
  footer.control-buttons a {
    background: linear-gradient(145deg, #4a90e2 0%, #357abd 25%, #2c6aa0 50%, #235a87 75%, #1a4a6e 100%) !important;
    border: 2px solid var(--header-bg) !important;
    color: white !important;
    box-shadow: 
      0 8px 20px rgba(74, 144, 226, 0.3),
      0 4px 12px rgba(74, 144, 226, 0.2),
      inset 0 3px 0 rgba(255, 255, 255, 0.4),
      inset 0 -3px 0 rgba(0, 0, 0, 0.3) !important;
  }

  footer.control-buttons a:hover {
    background: linear-gradient(145deg, #5ba0f2 0%, #4285d4 25%, #337ab7 50%, #296aa3 75%, #1f5a8f 100%) !important;
    color: white !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 
      0 12px 25px rgba(74, 144, 226, 0.4),
      0 8px 15px rgba(74, 144, 226, 0.3),
      inset 0 3px 0 rgba(255, 255, 255, 0.5),
      inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
  }
}
.chord-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.chord-box {
  background: var(--diagram-bg);
  border-radius: 12px;
  width: calc(50% - 0.25rem);
  min-width: 140px;
  max-width: calc(50% - 0.25rem);
  min-height: 180px;
  padding: 1rem;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  flex: 0 0 calc(50% - 0.25rem);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 4px 15px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.2),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.1),
    inset -3px 0 0 rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
}



.chord-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
  pointer-events: none;
}

.chord-box:hover::before {
  opacity: 1;
  animation: shine 0.8s ease-out;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.chord-box:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 4px 0 rgba(255, 255, 255, 0.25),
    inset 0 -4px 0 rgba(0, 0, 0, 0.4),
    inset 4px 0 0 rgba(255, 255, 255, 0.15),
    inset -4px 0 0 rgba(0, 0, 0, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

.chord-box:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 3px 10px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .chord-box {
    width: calc(50% - 0.125rem);
    min-width: 0;
    max-width: none;
    padding: 0.2rem;
    font-size: 0.9rem;
    flex: 1 1 calc(50% - 0.125rem);
  }

  .chord-grid {
    gap: 0.25rem;
    ```
margin: 0;
    padding: 0;
    width: 100%;
  }

  .chord-diagram {
    font-size: 0.85rem;
    padding: 0.1rem;
    line-height: 1.2;
    overflow-x: visible;
    white-space: pre-wrap;
    word-break: keep-all;
  }

  .chord-name {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
  }
}
.chord-name {
  font-weight: bold;
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
  text-align: center;
  color: white;
}
.chord-diagram {
  font-family: monospace;
  background: var(--card-bg);
  padding: 0.2rem;
  border-radius: 4px;
  text-align: center;
  user-select: none;
  transition: background-color 0.3s;
  font-size: 1.1rem;
  overflow-x: visible;
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
}

.chord-diagram-container {
  position: relative;
  width: 100%;
  height: auto;
}

/* LAYER 1: Background Grid (lower z-index) */
.background-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  width: 100%;
}

.grid-string-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  font-weight: bold;
  height: 1.2rem;
}

.grid-string-label {
  width: 1.5rem;
  text-align: center;
  line-height: 1.2rem;
}

.grid-nut-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-weight: bold;
  height: 1.2rem;
  background-color: #333;
}

[data-theme="dark"] .grid-nut-line {
  background-color: #444;
}

.grid-nut-segment {
  width: 1.5rem;
  text-align: center;
  line-height: 1.2rem;
  color: #666;
}

[data-theme="dark"] .grid-nut-segment {
  color: #888;
}

.fret-number {
  width: 1.5rem;
  text-align: center;
  line-height: 1rem;
  height: 1rem;
  font-size: 0.8rem;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .fret-number {
  color: #fff;
}

[data-theme="dark"] .mini-chord-display .fret-number {
  color: #000;
}

.fret-number.first-fret-highlight {
  color: #dc3545;
  font-weight: 900;
  font-size: 1rem;
}

[data-theme="dark"] .fret-number.first-fret-highlight {
  color: #ff4757;
}

.fingering-fret-number {
  width: 1.5rem;
  height: 1rem;
}

.grid-fret-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  height: 1rem;
  align-items: center;
}

.grid-fret-row:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .grid-fret-row:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.grid-position {
  width: 1.5rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.grid-position::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 200%;
  background-color: #666;
  z-index: 0;
}

[data-theme="dark"] .grid-position::before {
  background-color: #888;
}

.grid-dot {
  display: none;
}

/* LAYER 2: Fingering Layer (higher z-index) */
.fingering-layer {
  position: relative;
  z-index: 2;
  width: 100%;
}

.fingering-string-spacer {
  height: 1.4rem; /* Match grid string labels height + margin */
  width: 100%;
}

.fingering-nut-spacer {
  height: 1.5rem; /* Match grid nut line height + margin */
  width: 100%;
}

.fingering-fret-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  height: 1rem;
  align-items: center;
}

.fingering-position {
  width: 1.5rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chord-note {
  background: #000;
  color: transparent;
  font-weight: normal;
  border: none;
  border-radius: 50%;
  width: 0.9rem;
  height: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  aspect-ratio: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-shadow: none;
}

[data-theme="dark"] .chord-note {
  background: #000;
  color: #fff;
  border: 2px solid #888;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.mute-marker {
  background: var(--card-bg);
  color: #dc3545;
  font-weight: bold;
  font-size: 0.9rem;
  border-radius: 50%;
  width: 0.9rem;
  height: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  aspect-ratio: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.chord-error {
  color: #dc3545;
  font-style: italic;
  text-align: center;
}
label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  user-select: none;
}

.button-container {
  display: flex;
  justify-content: space-evenly;
  margin-top: auto;
  padding-top: 0.5rem;
  width: 100%;
}

.pin-button, .alternate-button, .delete-button, .maximize-button, .minimize-button, .play-button {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 11;
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 20%, #e9ecef 50%, #dee2e6 80%, #d3d3d4 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 rgba(0, 0, 0, 0.1),
    inset 3px 0 0 rgba(255, 255, 255, 0.4),
    inset -3px 0 0 rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.pin-button::before, .alternate-button::before, .delete-button::before, .maximize-button::before, .minimize-button::before, .play-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.pin-button:hover::before, .alternate-button:hover::before, .delete-button:hover::before, .maximize-button:hover::before, .minimize-button:hover::before, .play-button:hover::before {
  opacity: 1;
  animation: shine 0.6s ease-out;
}

.pin-button:hover, .alternate-button:hover, .delete-button:hover, .maximize-button:hover, .minimize-button:hover, .play-button:hover {
  background: linear-gradient(145deg, #f8f8f8 0%, #f0f0f0 40%, #e8e8e8 100%) !important;
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1),
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 rgba(0, 0, 0, 0.08),
    inset 3px 0 0 rgba(255, 255, 255, 0.4),
    inset -3px 0 0 rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

.pin-button:active, .alternate-button:active, .delete-button:active, .maximize-button:active, .minimize-button:active, .play-button:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pin-button.saved {
  background: linear-gradient(145deg, var(--button-active), #1a7acc) !important;
  color: white !important;
  border-color: var(--button-active) !important;
  opacity: 1 !important;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.05);
  border: 2px solid white !important;
}

.pin-button.saved:hover {
  background: linear-gradient(145deg, #1a7acc, var(--button-active)) !important;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 0 20px rgba(30, 144, 255, 1.0), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.delete-button:hover {
  color: #dc3545 !important;
}

.alternate-button:hover {
  background: var(--button-active) !important;
  color: white !important;
  border-color: var(--button-active) !important;
}

.play-button.playing {
  background: linear-gradient(145deg, #28a745, #1e7e34) !important;
  color: white !important;
  animation: pulse 1s infinite;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

@keyframes pulse {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3); 
  }
  50% { 
    box-shadow: 0 0 25px rgba(40, 167, 69, 1.0), 0 6px 16px rgba(0, 0, 0, 0.4); 
  }
}

.pin-button .material-icons, 
.alternate-button .material-icons, 
.delete-button .material-icons, 
.maximize-button .material-icons, 
.minimize-button .material-icons, 
.play-button .material-icons {
  font-size: 16px;
}

.alternate-button:hover {
  opacity: 1;
  background: var(--button-active);
  color: white;
  border-color: var(--button-active);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--card-shadow);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.chord-modal {
  background: var(--diagram-bg);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
  box-sizing: border-box;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.6),
    0 15px 35px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.15),
    inset 0 -4px 0 rgba(0, 0, 0, 0.4),
    inset 4px 0 0 rgba(255, 255, 255, 0.08),
    inset -4px 0 0 rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.2);
  animation: chordModalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chord-modal-header {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 20;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--diagram-bg);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-color);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--diagram-bg);
}

.modal-content {
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.alternate-box {
  background: var(--diagram-bg);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  min-width: 140px;
  transition: background-color 0.3s;
}

.alternate-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.save-alternate-btn {
  margin-top: 0.5rem;
  padding: 0.3rem;
  font-size: 1rem;
  border: 1px solid var(--button-bg);
  background: transparent;
  color: var(--text-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.save-alternate-btn .material-icons {
  font-size: 16px;
}

.save-alternate-btn:hover {
  opacity: 1;
  background: var(--button-active);
  color: white;
  border-color: var(--button-active);
}

.save-alternate-btn.saved {
  background: #28a745;
  color: white;
  border-color: #28a745;
  opacity: 0.8;
}

.save-alternate-btn.saved:hover {
  background: #218838;
  border-color: #218838;
  opacity: 1;
}

footer.control-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 25%, #3a3a3a 50%, #2d2d2d 75%, #1a1a1a 100%);
  padding: 1rem 0;
  z-index: 98;
  box-shadow: 
    0 -12px 40px rgba(0, 0, 0, 0.6),
    0 -8px 24px rgba(0, 0, 0, 0.4),
    0 -4px 12px rgba(0, 0, 0, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.15),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    inset 3px 0 0 rgba(255, 255, 255, 0.08),
    inset -3px 0 0 rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

footer.control-buttons a {
  color: white !important;
  text-decoration: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--header-bg);
  background: linear-gradient(145deg, #4a90e2 0%, #357abd 25%, #2c6aa0 50%, #235a87 75%, #1a4a6e 100%);
  opacity: 0.95;
  width: 2.375rem;
  height: 2.375rem;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  box-shadow: 
    0 8px 20px rgba(74, 144, 226, 0.3),
    0 4px 12px rgba(74, 144, 226, 0.2),
    0 2px 6px rgba(74, 144, 226, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.2),
    inset -3px 0 0 rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

footer.control-buttons a .material-icons {
  font-size: 20px;
  line-height: 1;
  font-family: 'Material Icons', 'Material Icons Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  color: white !important;
  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;
  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;
  /* Support for IE. */
  font-feature-settings: 'liga';
}

footer.control-buttons a::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

footer.control-buttons a:hover::before {
  opacity: 1;
  animation: shine 0.6s ease-out;
}

footer.control-buttons a:hover {
    opacity: 1;
    background: linear-gradient(145deg, #5ba0f2 0%, #4285d4 25%, #337ab7 50%, #296aa3 75%, #1f5a8f 100%) !important;
    color: white !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 
      0 12px 25px rgba(74, 144, 226, 0.4),
      0 8px 15px rgba(74, 144, 226, 0.3),
      0 4px 8px rgba(74, 144, 226, 0.2),
      inset 0 3px 0 rgba(255, 255, 255, 0.5),
      inset 0 -3px 0 rgba(0, 0, 0, 0.4),
      inset 3px 0 0 rgba(255, 255, 255, 0.3),
      inset -3px 0 0 rgba(0, 0, 0, 0.3) !important;
  }

footer.control-buttons a:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Theme toggle specific styling */
#theme-toggle {
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border-color: var(--header-bg) !important;
  color: #ffd700 !important;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

#theme-toggle:hover {
  background: linear-gradient(145deg, #7a848a 0%, #6c757d 25%, #5a6268 50%, #495057 75%, #3d4449 100%) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(108, 117, 125, 0.4),
    0 8px 15px rgba(108, 117, 125, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Dark theme specific styling for theme toggle */
[data-theme="dark"] #theme-toggle {
  background: linear-gradient(145deg, #2c3e50 0%, #34495e 25%, #3e5770 50%, #485f72 75%, #52677b 100%) !important;
  border: 2px solid white !important;
  color: #ecf0f1 !important;
  box-shadow: 
    0 8px 20px rgba(44, 62, 80, 0.4),
    0 4px 12px rgba(44, 62, 80, 0.3),
    0 2px 6px rgba(44, 62, 80, 0.2),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #theme-toggle:hover {
  background: linear-gradient(145deg, #34495e 0%, #3e5770 25%, #485f72 50%, #52677b 75%, #5a6c7d 100%) !important;
  color: white !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(44, 62, 80, 0.5),
    0 8px 15px rgba(44, 62, 80, 0.4),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5) !important;
}

.instrument-selector {
  background: linear-gradient(145deg, #2c3e50 0%, #34495e 25%, #3e5770 50%, #485f72 75%, #52677b 100%) !important;
  color: #ecf0f1 !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.3) !important;
}

.instrument-selector.active {
  background: linear-gradient(145deg, var(--button-active), #1a7acc) !important;
  color: white !important;
  border-color: var(--button-active) !important;
  opacity: 1 !important;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.1);
  border: 2px solid white !important;
  font-family: monospace, monospace;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.instrument-selector:not(.active) {
  background: linear-gradient(145deg, #2c3e50 0%, #34495e 25%, #3e5770 50%, #485f72 75%, #52677b 100%) !important;
  color: #ecf0f1 !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.3) !important;
}

.instrument-selector:hover {
  background: linear-gradient(145deg, #34495e 0%, #3e5770 25%, #485f72 50%, #52677b 75%, #5a6c7d 100%) !important;
  color: white !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5) !important;
}

.instrument-selector.active:hover {
  background: linear-gradient(145deg, #1a7acc, var(--button-active)) !important;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 0 20px rgba(30, 144, 255, 1.0), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.instrument-icon {
  font-size: 16px;
  font-weight: bold;
  font-family: monospace;
}

/* Layout toggle specific styling */
#layout-toggle {
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border-color: var(--header-bg) !important;
  color: #9b59b6 !important;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

#layout-toggle:hover {
  background: linear-gradient(145deg, #7a848a 0%, #6c757d 25%, #5a6268 50%, #495057 75%, #3d4449 100%) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(108, 117, 125, 0.4),
    0 8px 15px rgba(108, 117, 125, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Show saved button specific styling */
#show-saved {
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border-color: var(--header-bg) !important;
  color: #f39c12 !important;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

#show-saved:hover {
  background: linear-gradient(145deg, #7a848a 0%, #6c757d 25%, #5a6268 50%, #495057 75%, #3d4449 100%) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(108, 117, 125, 0.4),
    0 8px 15px rgba(108, 117, 125, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Tuning toggle specific styling */
#tuning-toggle {
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border-color: var(--header-bg) !important;
  color: #27ae60 !important;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

#tuning-toggle:hover {
  background: linear-gradient(145deg, #7a848a 0%, #6c757d 25%, #5a6268 50%, #495057 75%, #3d4449 100%) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(108, 117, 125, 0.4),
    0 8px 15px rgba(108, 117, 125, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Print chords button specific styling */
#print-chords {
  background: linear-gradient(145deg, #6c757d 0%, #5a6268 25%, #495057 50%, #3d4449 75%, #343a40 100%) !important;
  border-color: var(--header-bg) !important;
  color: #8e44ad !important;
  box-shadow: 
    0 8px 20px rgba(108, 117, 125, 0.3),
    0 4px 12px rgba(108, 117, 125, 0.2),
    0 2px 6px rgba(108, 117, 125, 0.15),
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    inset 3px 0 0 rgba(255, 255, 255, 0.15),
    inset -3px 0 0 rgba(0, 0, 0, 0.2) !important;
}

#print-chords:hover {
  background: linear-gradient(145deg, #7a848a 0%, #6c757d 25%, #5a6268 50%, #495057 75%, #3d4449 100%) !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 
    0 12px 25px rgba(108, 117, 125, 0.4),
    0 8px 15px rgba(108, 117, 125, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Active state styling for non-instrument footer buttons */
#layout-toggle.active {
  border: 2px solid white !important;
}

#show-saved.active {
  border: 2px solid white !important;
}

#tuning-toggle.active {
  border: 2px solid white !important;
}

#print-chords.active {
  border: 2px solid white !important;
}



/* Add white outlines when these buttons are in their active functional states */
.chord-grid.single-column ~ * #layout-toggle {
  border: 2px solid white !important;
}

#saved-chords[style*="flex"] ~ #normal-footer #show-saved {
  border: 2px solid white !important;
}

/* Single column layout active state */
.chord-grid.single-column {
  grid-template-columns: 1fr;
}

main.single-column {
  max-width: 500px;
  margin: 0 auto;
}

/* White outline for layout toggle when in single column mode */
main.single-column ~ footer #layout-toggle {
  border: 2px solid white !important;
}

/* Single column layout active state */
.chord-grid.single-column {
  grid-template-columns: 1fr;
}

main.single-column {
  max-width: 500px;
  margin: 0 auto;
}

/* White outline for layout toggle when in single column mode */
main.single-column ~ footer #layout-toggle {
  border: 2px solid white !important;
}

/* Single column layout active state */
.chord-grid.single-column {
  grid-template-columns: 1fr;
}

main.single-column {
  max-width: 500px;
  margin: 0 auto;
}

/* White outline for layout toggle when in single column mode */
main.single-column ~ footer #layout-toggle {
  border: 2px solid white !important;
}

.chord-grid.single-column {
  flex-direction: column;
  align-items: center;
}

.chord-grid.single-column .chord-box {
  width: 100% !important;
  max-width: 350px !important;
  flex: 0 0 100% !important;
}

/* Specific centering for saved chords single column layout */
#saved-chords.single-column {
  flex-direction: column;
  align-items: center;
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#saved-chords.single-column .chord-box {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

#saved-chords.single-column .saved-chords-title {
  width: 100%;
  max-width: 350px;
  margin-left: 0;
  margin-right: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  text-align: center;
  box-sizing: border-box;
}

#saved-chords.single-column .no-chords-message {
  width: 100%;
  max-width: 350px;
  margin-left: 0;
  margin-right: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  text-align: center;
  box-sizing: border-box;
}

#saved-chords.single-column .close-saved-chords-btn {
  width: 100%;
  max-width: 350px;
  margin: 2rem auto 6rem auto;
}

.chord-grid.single-column .chord-diagram {
  font-size: 1.4rem;
  line-height: 1.5;
  padding: 0.4rem;
}

.chord-grid.single-column .chord-name {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

@media (max-width: 768px) {
  main.single-column {
    max-width: 95vw;
    margin: 0 auto;
  }

  .chord-grid.single-column .chord-box {
    max-width: none;
    width: 100%;
  }

  .chord-grid.single-column .chord-diagram {
    font-size: 1.6rem;
    line-height: 1.6;
    padding: 0.8rem;
  }

  .chord-grid.single-column .chord-name {
    font-size: 1.8rem;
  }
}

@media (orientation: landscape) {
  .chord-box {
    width: 30%;
  }
}

.saved-chords-title {
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  padding: 1rem;
  color: white;
  border-bottom: 2px solid var(--diagram-bg);
  grid-column: 1 / -1;
}

.no-chords-message {
  width: 100%;
  text-align: center;
  grid-column: 1 / -1;
  color: white;
  opacity: 0.9;
  font-size: 1.1rem;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

/* Saved chords specific spacing */
#saved-chords {
  padding-bottom: 8rem;
  min-height: calc(100vh - 12rem);
}

@media (max-width: 480px) {
  #saved-chords {
    padding-bottom: 10rem;
  }
}



/* Info Modal Styles */
.info-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  padding: 1rem;
  box-sizing: border-box;
}

.info-modal {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  margin-top: 4rem;
  margin-bottom: 5rem;
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid var(--diagram-bg);
  margin-bottom: 1rem;
}

.info-modal-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: bold;
}

.info-modal-close {
  background: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 2.375rem;
  height: 2.375rem;
  opacity: 0.7;
}

.info-modal-close:hover {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
  opacity: 1;
}

.info-modal-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.welcome-text {
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.5;
}

.step-guide {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--diagram-bg);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--card-shadow);
}

.step-number {
  background: var(--button-active);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.step-content {
  flex: 1;
}

.step-content strong {
  color: white;
  font-size: 1rem;
  display: block;
  margin-bottom: 0.3rem;
}

.step-content p {
  color: white;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
  opacity: 0.9;
}

.inline-icon {
  font-size: 16px !important;
  vertical-align: middle;
  background: var(--text-color);
  color: var(--card-bg);
  padding: 2px;
  border-radius: 3px;
  margin: 0 2px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.dont-show-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}

.dont-show-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.got-it-btn {
  width: 100%;
  background: var(--button-active);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.got-it-btn:hover {
  background: #1a7acc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 144, 255, 0.3);
}

.got-it-btn:active {
  transform: translateY(0);
}

/* Dark theme adjustments for info modal */
[data-theme="dark"] .info-modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .inline-icon {
  background: var(--text-color);
  color: var(--card-bg);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .info-modal {
    margin: 1rem;
    max-height: 85vh;
  }

  .info-modal-header {
    padding: 1rem 1rem 0 1rem;
  }

  .info-modal-content {
    padding: 0 1rem 1rem 1rem;
  }

  .step {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .step-number {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
  }

  .step-content strong {
    font-size: 0.95rem;
  }

  .step-content p {
    font-size: 0.85rem;
  }
}

/* Hide modal by default */
.info-modal-overlay {
  display: none;
}

.info-modal-overlay.hidden {
  display: none !important;
}

/* Close saved chords button */
.close-saved-chords-btn {
  width: 100%;
  max-width: 350px;
  background: transparent;
  color: var(--text-color);
  border: none;
  padding: 1rem 2rem 2rem 2rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin: 2rem auto 6rem auto;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  position: relative;
  z-index: 10;
}

.return-icon-circle {
  width: 2.85rem;
  height: 2.85rem;
  background: var(--button-active);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.return-icon-circle .material-icons {
  font-size: 24px;
}

.close-saved-chords-btn .return-text {
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: center;
  color: white;
}

.close-saved-chords-btn:hover .return-icon-circle {
  background: #1a7acc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 144, 255, 0.3);
}

.close-saved-chords-btn:active .return-icon-circle {
  transform: translateY(0);
}

/* Chord Modal Styles */
.chord-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1002;
  padding: 1rem;
  box-sizing: border-box;
}



@keyframes chordModalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.chord-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  width: 2.85rem;
  height: 2.85rem;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.chord-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

.chord-modal-close {
  font-size: 24px;
  font-weight: bold;
}

.chord-modal-content {
  text-align: center;
  margin-top: 1rem;
}

.chord-modal-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.chord-modal-diagram {
  font-family: monospace;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  font-size: 1.8rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  box-shadow: 
    inset 0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 -2px 4px rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chord-modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.chord-modal-save-btn {
  background: #400080;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 
    0 6px 15px rgba(64, 0, 128, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.chord-modal-save-btn:hover {
  background: #5a00b3;
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(64, 0, 128, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

.chord-modal-save-btn:active {
  transform: translateY(0);
}

.chord-modal-save-btn.saved {
  background: #6b0099;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 6px 15px rgba(107, 0, 153, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.chord-modal-save-btn.saved:hover {
  background: #7a00b3;
  box-shadow: 
    0 8px 20px rgba(107, 0, 153, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

/* Dark theme adjustments for chord modal */
[data-theme="dark"] .chord-modal {
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 4px 0 rgba(255, 255, 255, 0.1),
    inset 0 -4px 0 rgba(0, 0, 0, 0.6),
    inset 4px 0 0 rgba(255, 255, 255, 0.05),
    inset -4px 0 0 rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile responsive for chord modal */
@media (max-width: 480px) {
  .chord-modal {
    margin: 1rem;
    max-height: 85vh;
    padding: 1.5rem;
  }

  .chord-modal-title {
    font-size: 2rem;
  }

  .chord-modal-diagram {
    font-size: 1.4rem;
    padding: 1rem;
  }

  .chord-modal-close {
    width: 2.5rem;
    height: 2.5rem;
  }

  .chord-modal-close .material-icons {
    font-size: 18px;
  }
}

/* Reducing the font weight of chord note letters from bold to normal */