/* ===== SHARED STYLES FOR SONG PAGES ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #2D2D2D;
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* HEADER */
.header {
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.header-inner { position: relative; z-index: 1; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.25);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 16px;
  transition: all 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.4); }
.header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: white;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.header-emoji { font-size: 3rem; display: block; margin-bottom: 8px; }
.header p {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 6px;
}

/* NAV */
.nav {
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav a {
  text-decoration: none;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #666;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav a:hover, .nav a.active { border-color: var(--page-color, #764ba2); color: var(--page-color, #764ba2); }

/* MAIN */
.main { max-width: 1000px; margin: 0 auto; padding: 28px 16px 48px; }

/* YOUTUBE PLAYER */
.youtube-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  text-align: center;
}
.youtube-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: #764ba2;
  margin-bottom: 16px;
}
.youtube-embed {
  position: relative;
  width: 100%;
  padding-bottom: 40%;
  border-radius: 12px;
  overflow: hidden;
}
.youtube-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  border-radius: 12px;
}

/* CONTROLS */
.controls-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.controls-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: #764ba2;
  flex: 1 1 100%;
}
.play-btn {
  background: var(--page-color, #764ba2);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.play-btn:hover { transform: scale(1.05); }

.speed-label {
  font-weight: 700;
  color: #888;
  font-size: 0.9rem;
}
.speed-select {
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

/* NOTES DISPLAY */
.notes-section {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.notes-section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  color: #764ba2;
  margin-bottom: 20px;
}

.notes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.note-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
  user-select: none;
}
.note-ball:hover { transform: scale(1.15); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.note-ball.active-note {
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.8), 0 8px 24px rgba(0,0,0,0.3);
  border-color: white;
}
.note-rest {
  background: #e0e0e0 !important;
  color: #999 !important;
  cursor: default;
}

/* MINI KEYBOARD */
.keyboard-section {
  background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow-x: auto;
}
.keyboard-section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
  text-align: center;
}

.mini-keyboard {
  display: flex;
  position: relative;
  height: 100px;
  gap: 2px;
  justify-content: center;
  min-width: 600px;
}
.mini-key {
  position: relative;
  cursor: pointer;
  border-radius: 0 0 6px 6px;
  transition: all 0.08s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.mini-key.white {
  width: 30px;
  height: 95px;
  background: linear-gradient(180deg, #f5f5f5, #ddd);
  border: 1px solid #bbb;
  box-shadow: 1px 3px 6px rgba(0,0,0,0.3);
  z-index: 1;
}
.mini-key.black {
  width: 18px;
  height: 60px;
  background: linear-gradient(180deg, #333, #111);
  border-radius: 0 0 4px 4px;
  box-shadow: 1px 4px 6px rgba(0,0,0,0.5);
  z-index: 2;
  margin-left: -9px;
  margin-right: -9px;
}
.mini-key.key-lit {
  filter: brightness(1.5);
  transform: translateY(2px);
}
.mini-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 0.55rem;
  color: white;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.mini-key.black .mini-badge { width: 14px; height: 14px; font-size: 0.4rem; }

/* TIP CARD */
.tip-card {
  background: linear-gradient(135deg, #667eea22, #764ba222);
  border: 2px solid #764ba240;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.tip-icon { font-size: 2rem; flex-shrink: 0; }
.tip-text { font-size: 0.95rem; color: #555; line-height: 1.6; }
.tip-text strong { color: #764ba2; }

/* LEGEND MINI */
.legend-mini {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.legend-mini-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: #764ba2;
  margin-bottom: 14px;
}
.legend-mini-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.legend-mini-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  border-radius: 50px;
  padding: 4px 12px;
}
.legend-mini-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.75rem;
}
.legend-mini-name { font-size: 0.8rem; font-weight: 700; }

/* FOOTER */
footer {
  background: #2d2d2d;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
}
footer strong { color: white; }

/* RESPONSIVE */
@media (max-width: 500px) {
  .note-ball { width: 36px; height: 36px; font-size: 0.85rem; }
  .youtube-embed { padding-bottom: 56%; }
}
