@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root { 
  --bg:#fff;
  --text:#000;
  --white-key:#fff;
  --black-key:#000;
  --border-key:#000;
  --hover-bg:#fff;
  --solfa-bg:rgba(255,255,255,0.8);
  --footer-bg:rgba(255,255,255,0.9);
  --solfa-text:#000;
  --footer-text:#000;
  --current-color:blue; 
}

/* Hamburger Menu */
.hamburger-menu {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  background: var(--bg);
  border: 1px solid var(--border-key);
  border-radius: 0.3rem;
  padding: 0.3rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.hamburger-menu:hover {
  background: var(--hover-bg);
  transform: scale(1.05);
}

.hamburger-icon {
  width: 18px;
  height: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.menu-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.menu-content h2 {
  margin: 0 0 1.5rem 0;
  color: var(--text);
  font-size: 1.5rem;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.menu-link {
  display: block;
  padding: 1rem 1.5rem;
  background: var(--current-color);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.menu-link:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.5rem;
  border-radius: 0.3rem;
  transition: background 0.2s;
}

.menu-close:hover {
  background: rgba(0,0,0,0.1);
}

:root[data-theme="dark"] { 
  --bg:#222;
  --text:#eee;
  --white-key:#555;
  --black-key:#111;
  --border-key:#fff;
  --hover-bg:#555;
  --solfa-bg:rgba(0,0,0,0.8);
  --footer-bg:rgba(0,0,0,0.9);
  --solfa-text:#fff;
  --footer-text:#eee;
  --current-color:orange; 
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  padding: 1rem;
  margin: 0;
  position: relative;
  min-height: 100vh;
  width: 100vw;
  box-sizing: border-box;
  padding-bottom: 2.5rem;
}

#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1001;
}

h1 {
  text-align: center;
  margin: 0 0 1.5rem 0;
}

.keyboard {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 150px;
  margin: auto;
  overflow: visible;
}

.key {
  position: absolute;
  border: 1px solid var(--border-key);
  cursor: pointer;
}

.white {
  background: var(--white-key);
  height: 150px;
  z-index: 1;
}

.black {
  background: var(--black-key);
  height: 90px;
  z-index: 2;
  bottom: 60px;
}

.key.active {
  background: orange !important;
}

.key.playing {
  background: rgba(0,0,255,0.3) !important;
}

.key:hover {
  background: rgba(0,0,255,0.3) !important;
  z-index: 10;
  border-color: transparent !important;
  box-shadow: 0 0 0 2px rgba(0,0,255,0.15);
}

.key:hover::after {
  content: attr(data-note);
  position: absolute;
  top: -1.5rem;
  left: 0;
  background: var(--hover-bg);
  color: var(--text);
  padding: 2px 5px;
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
}

.solfa {
  /* Desktop-Festlegung: */
  position: fixed;
  bottom: 33%;
  left: 15%;
  width: 70%;
  text-align: center;
  font-size: max(14px,4vw);
  background: var(--solfa-bg);
  color: var(--solfa-text);
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: none;
  z-index: 100;
}

@media (max-width: 480px) {
  .solfa {
    /* Mobile-Überschreibung: */
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    margin-bottom: 1rem;
    display: none; /* bleibt per JS unsichtbar, bis playScale() es zeigt */
  }
}

.solfa span { 
  display: inline-block; 
  padding: 0 0.5rem; 
}

.solfa .current {
  color: var(--current-color);
  font-weight: bold;
}

.controls {
  max-width: 800px;
  margin: 2rem auto;
  text-align: center;
}

.control-group {
  margin-bottom: 1rem;
}

.control-group select {
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.buttons button {
  font-size: 1rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  background: #007bff;
  color: #fff;
  transition: background 0.2s;
}

.buttons button:hover {
  background: #0056b3;
}

.settings {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.settings label {
  font-size: 0.9rem;
}

.settings input[type=range] {
  width: 150px;
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
    font-size: 16px;
    width: 100vw;
    min-width: 0;
    box-sizing: border-box;
  }
  
  h1 {
    font-size: 1.8rem;
    margin: 1.5rem 0 1rem;
  }
  
  .keyboard {
    overflow-x: auto;
    overflow-y: visible;
    margin: 0;
    width: 100vw;
    min-width: unset;
    max-width: unset;
    box-sizing: border-box;
    background: none;
    -webkit-overflow-scrolling: touch;
  }
  .keyboard::-webkit-scrollbar {
    display: none;
  }
  .keyboard::before {
    display: none;
  }
  
  .controls {
    width: 100%;
    max-width: none;
    margin: 1.5rem 0 0 0;
    box-sizing: border-box;
  }
  
  .control-group select {
    font-size: 1.8rem;
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
  }
  
  .buttons {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    width: 100%;
  }
  
  .buttons button:nth-child(-n+2) {
    flex: 1 1 48%;
  }
  
  .buttons button:nth-child(n+3) {
    flex: 1 1 48%;
  }
  
  .buttons button {
    font-size: 1.1rem;
    padding: 0.8rem 1.2rem;
    flex: 1 1 48%;
    min-width: 120px;
    box-sizing: border-box;
  }
  
  .settings {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .settings label {
    font-size: 1rem;
  }
  
  .settings input[type=range] {
    width: 120px;
  }
  
  .solfa {
    position: static;
    margin-bottom: 1rem;
    bottom: auto;
    font-size: 1.2rem;
  }
  
  footer {
    font-size: 0.8rem;
    padding: 0.3rem;
  }
}

footer {
  left: 0;
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 0.3rem;
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 0.8rem;
  z-index: 9999;
  height: auto;
  min-height: 2rem;
} 

.key.black:hover {
  opacity: 1;
  background: #111 !important;
  border-color: transparent !important;
} 