@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Baloo+2:wght@500;600&display=swap');

:root {
  --blue: #87CEEB;
  --blue-mid: #5BB8F5;
  --blue-dark: #3AA0E8;
  --yellow: #FFD93D;
  --yellow-dark: #F5C400;
  --white: #FFFFFF;
  --white-soft: rgba(255,255,255,0.15);
  --shadow: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 20px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #87CEEB 0%, #5BB8F5 50%, #3AA0E8 100%);
  min-height: 100vh;
  color: var(--white);
  overflow-x: hidden;
}

body::before {
  content: '⭐ 🎵 ✨ 🎶 ⭐ 🎵 ✨ 🎶 ⭐ 🎵 ✨ 🎶 ⭐ 🎵 ✨ 🎶 ⭐ 🎵 ✨ 🎶';
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  font-size: 24px;
  line-height: 3;
  letter-spacing: 40px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  word-break: break-all;
}

/* ==================== LIBRARY PAGE ==================== */
.header {
  text-align: center;
  padding: 30px 20px 10px;
  position: relative;
  z-index: 1;
}

.header h1 {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--yellow);
  text-shadow: 2px 2px 0px var(--yellow-dark), 4px 4px 0px rgba(0,0,0,0.1);
  letter-spacing: 1px;
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.header .subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin-top: 6px;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.library-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.library-section {
  margin-bottom: 30px;
  animation: fadeUp 0.5s ease both;
}

.library-section:nth-child(2) { animation-delay: 0.1s; }
.library-section:nth-child(3) { animation-delay: 0.2s; }

.level-badge {
  display: inline-block;
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: #0A4E9A;
  background: var(--yellow);
  padding: 6px 20px;
  border-radius: 50px;
  margin-bottom: 12px;
  box-shadow: 0 3px 0 var(--yellow-dark);
}

.piece-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.piece-btn {
  width: 100%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.piece-btn::before {
  content: '🎵';
  font-size: 1.4rem;
  flex-shrink: 0;
}

.piece-btn:hover {
  background: rgba(255,255,255,0.32);
  border-color: var(--yellow);
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

.piece-btn:active { transform: translateX(3px) scale(0.98); }

/* ==================== BACK ROW ==================== */
.back-row {
  padding: 16px 20px 0;
  position: relative;
  z-index: 1;
}

.back-row .back-btn,
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white-soft);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: translateX(-3px);
}

/* ==================== PLAYER TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
}

.top-bar h1 {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--yellow);
  text-shadow: 1px 1px 0px var(--yellow-dark);
  white-space: nowrap;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.top-bar .btn {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

.top-bar .btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.top-bar .btn-play { background: var(--yellow); color: #0A4E9A; }
.top-bar .btn-play:hover { background: var(--yellow-dark); }

.top-bar .btn-pause,
.top-bar .btn-stop {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
}

.top-bar .btn-pause:hover,
.top-bar .btn-stop:hover { background: rgba(255,255,255,0.3); }

.top-bar .btn-countin {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
}

.top-bar .btn-countin.active { background: #4CAF50; border-color: #4CAF50; }

/* ==================== TEMPO & VOLUME ==================== */
.tempo-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tempo-inline .tempo-label {
  font-family: 'Baloo 2', cursive;
  font-size: 0.95rem;
  color: var(--yellow);
  white-space: nowrap;
}

.tempo-inline input[type="range"] {
  width: 90px;
  height: 6px;
  border-radius: 50px;
  background: rgba(255,255,255,0.2);
  outline: none;
  cursor: pointer;
  accent-color: var(--yellow);
}

/* ==================== BEAT BUTTONS ==================== */
.beat-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.beat-inline .beat-label { font-size: 1rem; }

.beat-mode-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  transition: all 0.15s;
}

.beat-mode-btn:hover { background: rgba(255,255,255,0.25); }
.beat-mode-btn.active { background: #4CAF50; border-color: #4CAF50; color: white; }

/* ==================== BEAT DISPLAY ==================== */
#beatDisplay {
  position: fixed;
  top: 60px;
  right: 20px;
  text-align: center;
  z-index: 99999;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px 24px;
  border: 2px solid rgba(255,255,255,0.2);
}

#beatNumber {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 80px;
  color: var(--yellow);
  line-height: 1;
  text-shadow: 2px 2px 0px var(--yellow-dark);
  transition: transform 0.05s;
}

#beatNumber.flash {
  color: white;
  transform: scale(1.2);
}

#beatFlash {
  font-size: 48px;
  text-align: center;
  margin: 8px auto 0;
  transition: all 0.05s;
  display: block;
  line-height: 1;
  filter: grayscale(100%);
}

#beatFlash.flash {
  filter: none;
  transform: scale(1.3);
}

/* ==================== SCORE ==================== */
.score-container {
  background: transparent;
  border-radius: var(--radius);
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 95%;
}

#score svg {
  max-width: 100%;
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius-sm);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.loop-highlight { border-radius: 4px; }

/* ==================== NAVBAR ==================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-logo {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--yellow);
  text-shadow: 1px 1px 0px var(--yellow-dark);
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

.nav-link.active {
  background: var(--yellow);
  color: #0A4E9A;
  border-color: var(--yellow);
}

/* ==================== HOME PAGE ==================== */
.home-hero {
  text-align: center;
  padding: 60px 20px 30px;
  position: relative;
  z-index: 1;
}

.home-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--yellow);
  text-shadow: 2px 2px 0px var(--yellow-dark), 4px 4px 0px rgba(0,0,0,0.1);
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.home-subtitle {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin-top: 10px;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.home-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.home-btn:hover {
  background: rgba(255,255,255,0.32);
  border-color: var(--yellow);
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

.home-btn-featured {
  background: var(--yellow);
  color: #0A4E9A;
  border-color: var(--yellow-dark);
  box-shadow: 0 4px 0 var(--yellow-dark);
}

.home-btn-featured:hover {
  background: var(--yellow-dark);
  border-color: var(--yellow-dark);
  color: #0A4E9A;
}

.home-btn-icon { font-size: 1.8rem; }

/* ==================== COMING SOON ==================== */
.coming-soon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 60vh;
  position: relative;
  z-index: 1;
}

.coming-soon-card {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.coming-soon-card h1 {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 2rem;
  color: var(--yellow);
  text-shadow: 1px 1px 0px var(--yellow-dark);
  margin-bottom: 12px;
}

.coming-soon-card p {
  font-size: 1.1rem;
  color: white;
  font-weight: 600;
  margin-bottom: 8px;
}

.coming-soon-sub {
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  color: rgba(255,255,255,0.85) !important;
  line-height: 1.6;
  margin-bottom: 24px !important;
}

.coming-soon-btn {
  display: inline-block;
  background: var(--yellow);
  color: #0A4E9A;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 3px 0 var(--yellow-dark);
}

.coming-soon-btn:hover {
  background: var(--yellow-dark);
  transform: translateY(-2px);
}

/* ==================== FOOTER ==================== */
.footer {
  text-align: center;
  padding: 40px 24px 24px;
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.15);
  position: relative;
  z-index: 1;
}

.footer-quote {
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  max-width: 700px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

.footer-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--yellow);
  margin-bottom: 20px;
}

.footer-contact {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 24px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 20px;
  display: block;
  width: fit-content;
  margin: 0 auto 16px;
}

.footer-contact:hover {
  background: rgba(255,255,255,0.3);
  border-color: var(--yellow);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ==================== PDF BUTTON ==================== */
.btn-pdf {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

.btn-pdf:hover {
  background: rgba(255,255,255,0.3);
  border-color: var(--yellow);
}
/* ==================== THEORY TOPICS ==================== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.section-heading-icon {
  font-size: 2rem;
}

.section-heading-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--yellow);
  margin-bottom: 2px;
}

.section-heading-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}

.theory-intro-box {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}

.theory-intro-box strong { color: var(--yellow); }

.piece-btn-theory {
  background: rgba(255, 215, 0, 0.15) !important;
  border-color: rgba(255, 215, 0, 0.4) !important;
}

.piece-btn-theory:hover {
  background: rgba(255, 215, 0, 0.28) !important;
  border-color: var(--yellow) !important;
}

.theory-topic-btn {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  text-align: left !important;
}

.theory-topic-btn::before { display: none !important; }

.theory-topic-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.theory-topic-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.theory-topic-title {
  font-weight: 800;
  font-size: 1rem;
  color: white;
}

.theory-topic-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.theory-topic-arrow {
  font-size: 1.2rem;
  color: var(--yellow);
  flex-shrink: 0;
}

.theory-topic-soon {
  opacity: 0.6;
  cursor: not-allowed !important;
}

.theory-topic-soon:hover {
  transform: none !important;
  border-color: rgba(255,255,255,0.35) !important;
}

.theory-topic-soon-badge {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  flex-shrink: 0;
}