:root {
  --primary-color: #333;
  --background-color: #fff;
  --text-color: #333;
  --piano-width: 700px;
  --white-key-width: 60px;
  --black-key-width: 40px;
}

[data-theme="dark"] {
  --primary-color: #fff;
  --background-color: #333;
  --text-color: #fff;
}
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

header {
  background-color: var(--background-color);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 50px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
}

.instructions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: column;
}

.instructions p {
  margin-bottom: 36px;
}

.piano {
  position: relative;
  width: 500px;
  padding: 20px 10px;
  margin: 0 auto;
  background: linear-gradient(#1d1d1d, #4a4a4a);
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.white-keys {
  display: flex;
  position: relative;
  gap: 0;
}

.key {
  width: 60px;
  height: 220px;
  background: linear-gradient(to bottom, #fff 0%, #eee 100%);
  border: 1px solid #ccc;
  border-radius: 0 0 6px 6px;
  margin: 0;
  padding: 0;
}

.key.black {
  position: absolute;
  width: 40px;
  height: 140px;
  background: linear-gradient(45deg, #000, #444);
  z-index: 2;
  top: 0;
}

/* 검은 건반 위치 */
.key[data-note="C#"] {
  left: 40px;
}
.key[data-note="D#"] {
  left: 100px;
}
.key[data-note="F#"] {
  left: 220px;
}
.key[data-note="G#"] {
  left: 280px;
}
.key[data-note="A#"] {
  left: 340px;
}

.key:active,
.key.active {
  background: linear-gradient(to bottom, #ddd 0%, #ccc 100%);
  transform: translateY(2px);
}

.key.black:active,
.key.black.active {
  background: linear-gradient(to bottom, #222 0%, #000 100%);
}

.key-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: bold;
  color: #777;
  pointer-events: none;
}

.black .key-label {
  color: #fff;
  bottom: 10px;
}
