/* Twinkle Twinkle Little Star — violin practice (page-local styles).
   Brand tokens mirror site.css so the page matches Teipen Performing Arts. */
:root {
  --tw-sky-top: #0b1026;
  --tw-sky-mid: #1a1440;
  --tw-star: #fff7a8;
  --tw-glow: #f6e27a;
}

.twinkle-app {
  padding-bottom: 2rem;
}

.twinkle-intro {
  max-width: 40rem;
}

.twinkle-intro .privacy-note {
  font-size: 0.95rem;
  color: var(--brown);
  background: var(--sage-light);
  border-left: 4px solid var(--olive);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0 0;
}

/* Sky stage */
.sky-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 3px solid var(--plum);
  background: var(--tw-sky-top);
  min-height: clamp(220px, 42vw, 380px);
  margin: 1.5rem 0 1.25rem;
}

#sky {
  display: block;
  width: 100%;
  height: clamp(220px, 42vw, 380px);
  touch-action: none;
}

.sky-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
}

#celebration {
  pointer-events: auto;
  text-align: center;
  background: rgba(43, 39, 42, 0.78);
  color: #fff;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius);
  max-width: 22rem;
  backdrop-filter: blur(4px);
}

#celebration h2 {
  color: var(--note);
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 0.4rem;
}

#celebration p {
  margin: 0 0 0.9rem;
  color: #f2f2f2;
}

/* Controls row */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.controls .btn[hidden],
[hidden] {
  display: none !important;
}

/* Target + progress + tuner */
.practice-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 720px) {
  .practice-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--sage-light);
  border: 1px solid var(--sage);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 2px 10px rgba(43, 39, 42, 0.06);
}

.panel h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--plum);
  margin: 0 0 0.6rem;
}

.target-display {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#target-note {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  color: var(--maroon);
  line-height: 1;
}

#target-finger {
  font-size: 1.05rem;
  color: var(--brown);
}

.progress-wrap {
  margin-top: 0.9rem;
}

.progress-bar {
  height: 12px;
  background: var(--white);
  border: 1px solid var(--olive);
  border-radius: 999px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--plum), var(--maroon));
  border-radius: 999px;
  transition: width 0.25s ease;
}

#progress-text {
  font-size: 0.9rem;
  color: var(--brown);
  margin-top: 0.35rem;
}

/* Tuner */
.tuner {
  text-align: center;
}

#tuner-note {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 2rem;
  color: var(--maroon);
  min-height: 2.4rem;
}

#tuner-cents {
  font-size: 0.95rem;
  color: var(--brown);
  min-height: 1.3rem;
}

.tuner-track {
  position: relative;
  height: 10px;
  margin: 0.85rem auto 0.4rem;
  max-width: 220px;
  background: linear-gradient(90deg, #c45c5c, var(--olive) 45%, var(--olive) 55%, #c45c5c);
  border-radius: 999px;
  border: 1px solid var(--olive-dark);
}

.tuner-center {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--maroon);
  transform: translateX(-50%);
}

#tuner-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--charcoal);
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  transition: transform 0.08s linear, background 0.15s ease;
}

#tuner-needle.in-tune {
  background: var(--olive-dark);
}

.tuner-labels {
  display: flex;
  justify-content: space-between;
  max-width: 220px;
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--brown);
}

/* Hint + status */
#hint {
  background: var(--note);
  color: #3b3207;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  font-size: 1rem;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
}

#status {
  font-size: 0.95rem;
  color: var(--brown);
  margin: 0 0 1rem;
}

#mic-fallback {
  background: #fff4f4;
  border: 1px solid #e0a0a0;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

#mic-fallback p {
  margin: 0 0 0.6rem;
  color: var(--maroon-dark);
}

/* Demo pad */
#demo-pad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

@media (max-width: 640px) {
  #demo-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.demo-key {
  appearance: none;
  border: 2px solid var(--olive);
  background: var(--white);
  border-radius: 10px;
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--brown);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.demo-key:hover {
  background: var(--sage-light);
  transform: translateY(-1px);
}

.demo-key:focus-visible {
  outline: 3px solid var(--olive-dark);
  outline-offset: 2px;
}

.demo-key.is-target {
  border-color: var(--maroon);
  background: var(--note);
  box-shadow: 0 0 0 3px rgba(99, 20, 49, 0.2);
}

.demo-key .dk-note {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--maroon);
}

.demo-key .dk-finger {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

/* Finger chart */
.finger-chart {
  margin-top: 1.5rem;
}

.finger-chart table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.finger-chart th,
.finger-chart td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--sage);
}

.finger-chart th {
  color: var(--maroon);
  font-family: var(--sans);
  background: var(--sage-light);
}

.howto ol {
  margin: 0.4rem 0 0;
  padding-left: 1.3rem;
}

.howto li {
  margin: 0.35rem 0;
}

/* Live region for screen readers */
.sr-live {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* v3: compact note + tuner bar so sky and demo pad fit on one screen */
.practice-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:.5rem 0}
.practice-grid .panel{padding:.45rem .7rem;margin:0}
.practice-grid h2{font-size:.72rem;margin:0 0 .15rem;letter-spacing:.04em;text-transform:uppercase;opacity:.7}
.practice-grid .target-display{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;margin:0}
.practice-grid #target-note,.practice-grid #tuner-note{font-size:1.6rem;line-height:1.1}
.practice-grid #target-finger{font-size:.85rem}
.practice-grid .progress-wrap{margin-top:.3rem;display:flex;align-items:center;gap:.5rem}
.practice-grid .progress-bar{flex:1;height:6px}
.practice-grid #progress-text{font-size:.75rem;white-space:nowrap}
.practice-grid .tuner{display:grid;grid-template-columns:auto 1fr;column-gap:.6rem;align-items:center}
.practice-grid .tuner h2{grid-column:1/-1}
.practice-grid #tuner-cents{font-size:.75rem}
.practice-grid .tuner-track{grid-column:1/-1;height:8px;margin:.25rem 0 0}
.practice-grid .tuner-labels{display:none}
#demo-pad{margin:.5rem 0}
#status,#hint{margin:.3rem 0}
