/* ==========================================================================
   Teclinha — teclado online para crianças
   Estilo: adesivo de brinquedo (bordas grossas, sombras duras, cores vivas)
   ========================================================================== */

:root {
  --ink: #26304d;
  --ink-soft: #5a6484;
  --cream: #fff7ea;
  --paper: #fffdf8;
  --sun: #ffc94a;
  --coral: #ff6b6b;
  --teal: #2ec4b6;
  --sky: #4d96ff;
  --grape: #9b5de5;
  --pink: #ff8fab;
  --green: #6bcb77;
  --line: rgba(38, 48, 77, 0.14);
  --shadow-hard: 0 6px 0 rgba(38, 48, 77, 0.16);
  --font-display: 'Baloo 2', 'Nunito', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ------------------------------- reset ---------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

h1, h2, h3, p { margin: 0; }
svg { display: block; }

/* --------------------------- fundo decorativo ---------------------------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.55;
}

.blob--1 {
  width: 340px; height: 340px;
  top: -150px; right: -120px;
  background: radial-gradient(circle, rgba(255, 201, 74, 0.75), rgba(255, 201, 74, 0) 70%);
}

.blob--2 {
  width: 300px; height: 300px;
  top: 42%; left: -160px;
  background: radial-gradient(circle, rgba(46, 196, 182, 0.45), rgba(46, 196, 182, 0) 70%);
}

.blob--3 {
  width: 280px; height: 280px;
  bottom: -120px; right: -80px;
  background: radial-gradient(circle, rgba(255, 143, 171, 0.55), rgba(255, 143, 171, 0) 70%);
}

.blob--4 {
  width: 200px; height: 200px;
  top: 12%; left: 58%;
  background: radial-gradient(circle, rgba(77, 150, 255, 0.3), rgba(77, 150, 255, 0) 70%);
}

/* ------------------------------- telas ---------------------------------- */
.screen { display: none; }

.screen.is-active { animation: screenIn 0.3s ease; }

.screen--home {
  max-width: 580px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 30px);
  min-height: 100vh;
  min-height: 100dvh;
}

.screen--home.is-active { display: block; }

/* ------------------------------- botões --------------------------------- */
.icon-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(38, 48, 77, 0.18);
}

.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.is-active { background: var(--sun); }
.icon-btn[hidden] { display: none; }

.btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 6px 0 rgba(38, 48, 77, 0.22);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(38, 48, 77, 0.22);
}

.btn--primary {
  padding: 13px 18px;
  background: linear-gradient(115deg, #ffd97a 0%, #ffb26b 45%, #ff8fab 100%);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  justify-content: center;
}

.btn--ghost {
  padding: 12px 18px;
  background: var(--paper);
  border-width: 2.5px;
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.16);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  justify-content: center;
}

/* ------------------------------- home ----------------------------------- */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 16px;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, #ffe08a, var(--sun));
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.2);
  display: grid;
  place-items: center;
}

.brand__mark svg { width: 26px; height: 26px; }

.brand__name {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1;
}

.brand__name span { color: var(--coral); }

.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 30px;
  box-shadow: var(--shadow-hard);
}

.hero-card::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 201, 74, 0.55), rgba(255, 201, 74, 0) 70%);
}

.hero-card__text { position: relative; flex: 1 1 auto; min-width: 0; }

.hero-card h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 8.2vw, 36px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.8px;
}

.hero-card h1 em { font-style: normal; color: var(--coral); }

.hero-card p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.35;
  max-width: 24ch;
}

.hero-card__art {
  position: relative;
  flex: 0 0 104px;
  width: 104px;
}

.hero-card__art svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 0 rgba(38, 48, 77, 0.12));
  animation: float 4.5s ease-in-out infinite;
}

.btn--free {
  margin-top: 14px;
  padding: 15px 16px;
  background: linear-gradient(115deg, #ffd97a 0%, #ffb26b 42%, #ff8fab 100%);
}

.btn--free .btn__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
}

.btn--free .btn__icon svg { width: 28px; height: 28px; }

.btn--theory {
  margin-top: 14px;
  padding: 13px 18px;
  background: linear-gradient(115deg, #dff3ff 0%, #cfe0ff 55%, #d9f7ff 100%);
}

.btn--theory .btn__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
}

.btn--theory .btn__icon svg { width: 26px; height: 26px; }

.btn__text { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; }

.btn__text strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.1;
}

.btn__text small {
  font-weight: 700;
  font-size: 12.5px;
  color: rgba(38, 48, 77, 0.72);
}

.btn__arrow {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.section-title {
  margin: 26px 4px 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 9px;
}

.section-title::before {
  content: '';
  width: 8px;
  height: 22px;
  border-radius: 6px;
  background: var(--coral);
  flex: 0 0 auto;
}

.songs { display: flex; flex-direction: column; gap: 13px; }

.song-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 rgba(38, 48, 77, 0.15);
  text-align: left;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.song-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(38, 48, 77, 0.15);
}

.song-card__icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 18px;
  background: var(--song-color, var(--sun));
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.song-card__icon svg { width: 28px; height: 28px; }

.song-card__body { flex: 1 1 auto; min-width: 0; }

.song-card__title {
  display: block;
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.15;
}

.song-card__meta {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.1px;
}

.song-card__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.song-card__stars {
  font-size: 13px;
  letter-spacing: 1px;
  color: #ddd0ba;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(38, 48, 77, 0.18);
}

.song-card__stars .on { color: var(--sun); }

.song-card__go {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--song-color, var(--sun));
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.home-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.home-footer span { color: var(--coral); }

/* ------------------------------- tocar ---------------------------------- */
.screen--play {
  height: 100vh;
  height: 100dvh;
  max-width: 620px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 12px);
  flex-direction: column;
  gap: 8px;
  -webkit-user-select: none;
  user-select: none;
}

.screen--play.is-active { display: flex; }

.play-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.play-header__title { flex: 1 1 auto; min-width: 0; text-align: center; }

.play-header__title strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-header__title small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 1px;
}

/* área da música */
.song-ui {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 4px;
}

.lyrics {
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.lyrics__line {
  font-family: var(--font-display);
  font-size: clamp(18px, 5.2vw, 23px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.1px;
}

.syl {
  display: inline;
  border-radius: 5px;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.syl.is-active {
  background: var(--note-color, var(--sun));
  color: #fff;
  box-shadow: 0 0 0 2px var(--note-color, var(--sun));
  padding: 1px 3px;
  margin: 0 -3px;
}

.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.hint__pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.14);
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
}

.hint__pill.pop { animation: hintPop 0.34s cubic-bezier(0.2, 1.4, 0.4, 1); }

.hint__pill.nudge { animation: hintNudge 0.3s ease; }

.hint__dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--note-color, var(--teal));
  border: 2px solid var(--ink);
  flex: 0 0 auto;
}

.hint__note {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--note-color, var(--ink));
  line-height: 1;
}

.progress { display: flex; align-items: center; gap: 10px; }

.progress__track {
  flex: 1 1 auto;
  height: 15px;
  border-radius: 999px;
  background: #ece1cd;
  border: 2px solid var(--ink);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.progress__count {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* modo tocar livre */
.free-ui {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.screen--play[data-mode='free'] .song-ui { display: none; }
.screen--play:not([data-mode='free']) .free-ui { display: none; }

.note-bubble {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--note-color, #fff);
  border: 4px solid var(--ink);
  box-shadow: 0 8px 0 rgba(38, 48, 77, 0.16), inset 0 -10px 0 rgba(0, 0, 0, 0.1);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.note-bubble.pop { animation: bubblePop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1); }

.free-hint {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
}

.octave-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 rgba(38, 48, 77, 0.12);
}

.octave-btn {
  width: 36px;
  height: 30px;
  border-radius: 999px;
  background: var(--sun);
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}

.octave-btn:disabled { opacity: 0.35; }
.octave-btn:active:not(:disabled) { transform: translateY(2px); }

.octave-label {
  font-size: 12px;
  font-weight: 800;
  min-width: 78px;
  text-align: center;
}

/* ------------------------------ teclado --------------------------------- */
.keyboard-wrap {
  flex: 1.4 1 0;
  min-height: 225px;
  max-height: 52vh;
  max-height: 52dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyboard {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: linear-gradient(180deg, #35436b, #26304d);
  border-radius: 18px;
  padding: 12px 12px 10px;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.28), 0 8px 0 rgba(38, 48, 77, 0.16);
  touch-action: none;
}

.keys { position: relative; height: 100%; }

.white-keys { display: flex; height: 100%; gap: 3px; }

.key--white {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  border: 2.5px solid var(--ink);
  border-radius: 0 0 9px 9px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--note-color) 9%, #fffefb) 0%,
    color-mix(in srgb, var(--note-color) 16%, #f8f1e4) 78%,
    color-mix(in srgb, var(--note-color) 22%, #efe5d3) 100%
  );
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  transition: transform 0.07s ease, background 0.12s ease, box-shadow 0.07s ease;
}

.key--white.is-down {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
  background: var(--note-color);
}

.black-keys { position: absolute; inset: 0; pointer-events: none; }

.key--black {
  position: absolute;
  top: 0;
  height: 59%;
  transform: translateX(-50%);
  border: 2.5px solid var(--ink);
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #4d597f 0%, #262f4d 55%, #1a2238 100%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  pointer-events: auto;
  transition: transform 0.07s ease, background 0.12s ease, box-shadow 0.07s ease;
}

.key--black.is-down {
  transform: translateX(-50%) translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  background: var(--note-color);
}

.key__label {
  font-family: var(--font-display);
  font-size: clamp(8px, 2.55vw, 11px);
  font-weight: 800;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 999px;
  background: #f4ecdf;
  color: var(--ink-soft);
  border: 1.5px solid rgba(38, 48, 77, 0.16);
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.key--white .key__label {
  background: #f4ecdf;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--note-color) 16%, #fff);
  color: color-mix(in srgb, var(--note-color) 70%, var(--ink));
  border-color: color-mix(in srgb, var(--note-color) 32%, #fff);
}

.key--black::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 13px;
  border-radius: 0 0 5px 5px;
  background: var(--note-color);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.key--black .key__label {
  font-size: clamp(7px, 1.95vw, 9px);
  padding: 1px 3px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

.no-labels .key__label { display: none; }

/* tecla-alvo */
.key.is-target {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--note-color) 78%, #fff) 0%,
    var(--note-color) 100%
  ) !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--ink), 0 0 22px 4px var(--note-color);
  animation: targetPulse 1.15s ease-in-out infinite;
}

.key.is-target .key__label {
  background: #fff;
  color: color-mix(in srgb, var(--note-color) 72%, var(--ink));
  border-color: var(--ink);
  transform: scale(1.14);
}

/* acerto / erro */
.key.is-correct { background: var(--green) !important; }
.key.is-correct .key__label {
  background: #fff !important;
  color: #2f8f3a !important;
  border-color: var(--ink) !important;
}

.key.is-wrong { background: #ffd9cf !important; }

.key--white.is-wrong { animation: shakeW 0.32s ease; }
.key--black.is-wrong { animation: shakeB 0.32s ease; }

/* ------------------------------- modais --------------------------------- */
.overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(38, 48, 77, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.overlay[hidden],
.modal[hidden] { display: none; }

.modal { z-index: 60; }

.overlay__card {
  position: relative;
  width: min(100%, 400px);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 30px;
  padding: 26px 22px 22px;
  box-shadow: 0 10px 0 rgba(38, 48, 77, 0.3);
  text-align: center;
  animation: cardPop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.overlay__card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  margin-top: 6px;
}

.overlay__song {
  margin-top: 6px;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-soft);
}

.overlay__msg {
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.big-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 2px;
}

.big-stars svg {
  width: 48px;
  height: 48px;
  transform: scale(0);
  animation: starPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}

.big-stars svg.is-empty { opacity: 0.22; }

.overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.overlay__actions .btn { flex: 1 1 0; }

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.95;
  animation: confettiFall linear forwards;
}

.modal__card {
  width: min(100%, 420px);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 20px;
  box-shadow: 0 10px 0 rgba(38, 48, 77, 0.3);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal__head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 2px dashed var(--line);
}

.setting:last-of-type { border-bottom: 0; }

.setting__label {
  font-weight: 800;
  font-size: 14.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting__label small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.modal__actions { margin-top: 16px; }

/* controle deslizante */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 12px;
  border-radius: 999px;
  background: #ece1cd;
  border: 2px solid var(--ink);
  outline: none;
  flex: 0 0 auto;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  box-shadow: 0 2px 0 rgba(38, 48, 77, 0.2);
  cursor: pointer;
}

input[type='range']::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  cursor: pointer;
}

/* interruptor */
.switch {
  -webkit-appearance: none;
  appearance: none;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #e3d8c5;
  border: 2.5px solid var(--ink);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(22px); }

/* ------------------------------- avisos --------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 26px);
  transform: translateX(-50%) translateY(18px);
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 6px 0 rgba(38, 48, 77, 0.2);
  white-space: nowrap;
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----------------------------- animações -------------------------------- */
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cardPop {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes starPop {
  to { transform: scale(1); }
}

@keyframes bubblePop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes hintPop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes hintNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes targetPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

@keyframes shakeW {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes shakeB {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(calc(-50% - 4px)); }
  40% { transform: translateX(calc(-50% + 4px)); }
  60% { transform: translateX(calc(-50% - 3px)); }
  80% { transform: translateX(calc(-50% + 3px)); }
}

@keyframes confettiFall {
  0% { transform: translateY(-16px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(760deg); opacity: 0.85; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

/* ---------------------------- ajustes finos ----------------------------- */
@media (max-height: 680px) {
  .lyrics { min-height: 44px; }
  .note-bubble { width: 104px; height: 104px; font-size: 30px; }
  .keyboard-wrap { min-height: 190px; }
  .hero-card { padding: 16px 14px; }
}

@media (min-width: 700px) {
  .screen--home { padding-top: 34px; }
  .song-card { padding: 16px 18px; }
  .hero-card { padding: 24px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ==========================================================================
   TELA DE LIÇÕES (trilha)
   ========================================================================== */

.screen--map {
  max-width: 580px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 34px);
  min-height: 100vh;
  min-height: 100dvh;
}

.screen--map.is-active { display: block; }

.map-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -16px;
  padding: 10px 16px 8px;
  background: rgba(255, 247, 234, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.map-header__title { flex: 1 1 auto; min-width: 0; text-align: center; }

.map-header__title strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-header__title small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 1px;
}

.map-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  margin-top: 4px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: var(--shadow-hard);
}

.map-hero__icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  background: var(--song-color, var(--sun));
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.map-hero__icon svg { width: 30px; height: 30px; }

.map-hero__text { flex: 1 1 auto; min-width: 0; }

.map-hero__text h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.12;
}

.map-hero__text p {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: 3px;
}

.map-hero__progress { flex: 0 0 auto; text-align: center; }

.map-hero__progress strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.map-hero__progress small {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ------------------------------- trilha -------------------------------- */
.trail {
  position: relative;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.trail::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 30px;
  bottom: 30px;
  width: 4px;
  background: #e8dcc6;
  border-radius: 4px;
}

.trail-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
}

.trail-item__badge {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.14);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: transform 0.1s ease;
}

.trail-item__badge svg { width: 24px; height: 24px; }

.trail-item:active:not(.is-locked) .trail-item__badge { transform: scale(0.94); }

.trail-item__card {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(38, 48, 77, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.trail-item:active:not(.is-locked) .trail-item__card {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(38, 48, 77, 0.12);
}

.trail-item__text { flex: 1 1 auto; min-width: 0; }

.trail-item__title {
  display: block;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.1;
}

.trail-item__meta {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: 2px;
}

.trail-item__stars {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.8px;
  line-height: 1;
  color: #ddd0ba;
}

.trail-item__stars .on { color: var(--sun); }

/* itens especiais (música completa e desafio) */
.trail-item--full .trail-item__badge { background: #dff3ff; }
.trail-item--timed .trail-item__badge { background: #ffe9d6; }
.trail-item--full .trail-item__card { background: linear-gradient(120deg, #eafaff, #e2f1ff); }
.trail-item--timed .trail-item__card { background: linear-gradient(120deg, #fff4e2, #ffe6ef); }

.trail-item.is-locked { opacity: 0.58; }
.trail-item.is-locked .trail-item__card { background: #f3ede2; box-shadow: none; }
.trail-item.is-locked .trail-item__badge { background: #ece4d6; box-shadow: none; }
.trail-item.is-locked .trail-item__badge svg { width: 20px; height: 20px; }

.map-tip {
  margin: 22px 6px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ------------------------- anel de progresso --------------------------- */
.song-card__ring {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  background: conic-gradient(var(--song-color, var(--sun)) calc(var(--p, 0) * 1%), #e9ddc7 0);
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
}

.song-card__ring-inner {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.song-card__ring-inner b {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.song-card__ring-inner small {
  font-size: 8px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: 1px;
}

/* ==========================================================================
   MODO RITMO
   ========================================================================== */

.score {
  display: none;
  justify-content: center;
  gap: 8px;
}

.screen--play[data-mode='timed'] .score { display: flex; }

.score__chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
  background: var(--paper);
}

.score__chip--hit { background: #d9f7e3; color: #1f7a3a; }
.score__chip--miss { background: #ffe3e3; color: #a33535; }

.beat-bar {
  display: none;
  align-items: center;
  gap: 8px;
}

.screen--play[data-mode='timed'] .beat-bar { display: flex; }

.beat-bar__icon {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1;
}

.beat-bar__track {
  flex: 1 1 auto;
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #ece1cd;
  border: 2px solid var(--ink);
  overflow: hidden;
}

.beat-bar__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  animation: beatFill var(--beat-dur, 0.5s) linear infinite;
}

@keyframes beatFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* contagem regressiva */
.countdown {
  position: fixed;
  left: 50%;
  top: 15%;
  transform: translate(-50%, -50%);
  z-index: 45;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 10px 0 rgba(38, 48, 77, 0.25);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.countdown[hidden] { display: none; }

.countdown__num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: var(--coral);
}

.countdown__num.pop { animation: countPop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }

@keyframes countPop {
  0% { transform: scale(0.5); opacity: 0.4; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ==========================================================================
   AVISO DE ORIENTAÇÃO — o Teclinha é feito para a horizontal
   ========================================================================== */
.rotate { display: none; }

@media (orientation: portrait) and (max-width: 900px) and (pointer: coarse) {
  .rotate {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    background:
      radial-gradient(circle at 18% 12%, rgba(255, 201, 74, 0.6), rgba(255, 201, 74, 0) 62%),
      radial-gradient(circle at 88% 88%, rgba(255, 143, 171, 0.5), rgba(255, 143, 171, 0) 62%),
      var(--cream);
  }

  .rotate.is-skipped { display: none; }

  .rotate__card { text-align: center; }

  .rotate__icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 28px;
    background: var(--sun);
    border: 3px solid var(--ink);
    box-shadow: 0 7px 0 rgba(38, 48, 77, 0.22);
    display: grid;
    place-items: center;
    animation: rotateHint 2.8s ease-in-out infinite;
  }

  .rotate__icon svg { width: 54px; height: 54px; }

  .rotate h2 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
  }

  .rotate p {
    margin: 10px auto 0;
    max-width: 30ch;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-soft);
    line-height: 1.45;
  }

  .rotate .btn {
    width: auto;
    margin: 22px auto 0;
    padding: 9px 18px;
    font-size: 13px;
    border-radius: 14px;
    box-shadow: 0 3px 0 rgba(38, 48, 77, 0.16);
  }
}

@keyframes rotateHint {
  0%, 16% { transform: rotate(0deg); }
  44%, 66% { transform: rotate(-90deg); }
  90%, 100% { transform: rotate(0deg); }
}

/* ==========================================================================
   TEORIA MUSICAL
   ========================================================================== */
.screen--theory {
  max-width: 1180px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 10px);
  flex-direction: column;
  gap: 10px;
  display: none;
  -webkit-user-select: none;
  user-select: none;
}

.screen--theory.is-active { display: flex; }

.theory-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.theory-header__title { flex: 1 1 auto; min-width: 0; text-align: center; }

.theory-header__title strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.theory-header__title small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 1px;
}

.theory-dots { display: flex; gap: 5px; flex: 0 0 auto; }

.theory-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e3d7c2;
  border: 1.5px solid rgba(38, 48, 77, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.theory-dot.is-on {
  background: var(--coral);
  border-color: var(--ink);
  transform: scale(1.2);
}

.theory-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px;
}

.theory-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; }

.theory-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 14px 16px;
  box-shadow: var(--shadow-hard);
}

.theory-card__kicker {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: #e8f7ff;
  border: 2px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theory-card h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
}

.theory-card p {
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-soft);
}

.theory-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.theory-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.1s ease;
}

.theory-chip:active { transform: scale(0.94); }
.theory-chip.is-on { background: var(--note-color, var(--sun)); color: #fff; }

.theory-nav { display: flex; gap: 8px; flex: 0 0 auto; }

.theory-nav .btn { flex: 1 1 0; padding: 9px 12px; font-size: 15px; border-radius: 16px; }

.theory-nav .btn[disabled] { opacity: 0.35; pointer-events: none; }

.theory-keyboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.theory-keyboard-hint {
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  min-height: 16px;
}

.keyboard--theory { flex: 1 1 auto; }

/* teclado de estudo: teclas pretas em posições fixas (Dó4 a Dó5) */
.keyboard--theory .key--black { pointer-events: auto; }

@media (orientation: portrait) {
  .theory-body { grid-template-columns: 1fr; }
  .theory-keyboard-wrap { min-height: 170px; }
}

/* ==========================================================================
   MODO PAISAGEM — layout de teclado de verdade
   ========================================================================== */
@media (orientation: landscape) {

  /* ------------------------------- HOME ------------------------------- */
  .screen--home {
    max-width: 1180px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 10px);
    overflow: hidden;
  }

  .screen--home.is-active {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 8px 18px;
  }

  .home-header { grid-column: 1; grid-row: 1; padding: 0 0 2px; align-self: start; }
  .brand__mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand__mark svg { width: 23px; height: 23px; }
  .brand__name { font-size: 24px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .icon-btn svg { width: 20px; height: 20px; }

  .hero-card {
    grid-column: 1;
    grid-row: 2;
    padding: 12px 14px;
    gap: 4px;
    border-radius: 22px;
    align-self: start;
  }
  .hero-card__art { flex: 0 0 60px; width: 60px; }
  .hero-card h1 { font-size: 22px; letter-spacing: -0.6px; }
  .hero-card p { margin-top: 4px; font-size: 11.5px; line-height: 1.3; max-width: 22ch; }

  .btn--free {
    grid-column: 1;
    grid-row: 3;
    margin-top: 0;
    padding: 9px 12px;
    border-radius: 18px;
    align-self: start;
  }
  .btn--free .btn__icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .btn--free .btn__icon svg { width: 21px; height: 21px; }
  .btn__text strong { font-size: 16px; }
  .btn__text small { font-size: 10.5px; }
  .btn__arrow { font-size: 21px; }

  .btn--theory {
    grid-column: 1;
    grid-row: 4;
    margin-top: 0;
    padding: 9px 12px;
    border-radius: 18px;
    align-self: start;
  }

  .section-title {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0 0 2px;
    font-size: 16px;
  }
  .section-title::before { height: 17px; width: 7px; }

  .songs {
    grid-column: 2;
    grid-row: 2 / 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .song-card { padding: 8px 10px; gap: 9px; border-radius: 16px; }
  .song-card__icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .song-card__icon svg { width: 21px; height: 21px; }
  .song-card__title { font-size: 14px; }
  .song-card__meta { font-size: 10px; margin-top: 1px; }
  .song-card__ring { width: 38px; height: 38px; flex-basis: 38px; border-width: 2px; }
  .song-card__ring-inner { width: 29px; height: 29px; }
  .song-card__ring-inner b { font-size: 11px; }
  .song-card__ring-inner small { font-size: 6px; }

  .home-footer { display: none; }

  /* ------------------------------- MAPA ------------------------------- */
  .screen--map {
    max-width: 1100px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 10px);
    overflow: hidden;
  }

  .screen--map.is-active {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px 18px;
  }

  .map-header {
    grid-column: 1 / -1;
    grid-row: 1;
    position: static;
    margin: 0;
    padding: 0 0 2px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .map-hero {
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 14px 12px;
    margin-top: 0;
    align-self: start;
  }
  .map-hero__icon { width: 52px; height: 52px; flex-basis: 52px; }
  .map-hero__text h2 { font-size: 17px; }
  .map-hero__text p { font-size: 11px; }

  .map-tip {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
    align-self: end;
    font-size: 10.5px;
  }

  .trail {
    grid-column: 2;
    grid-row: 2 / 4;
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 8px;
    align-content: start;
    overflow-y: auto;
    min-height: 0;
  }

  .trail::before { display: none; }

  .trail-item { flex-direction: column; gap: 5px; align-items: stretch; }

  .trail-item__badge {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin: 0 auto;
    font-size: 15px;
    border-width: 2.5px;
  }
  .trail-item__badge svg { width: 18px; height: 18px; }
  .trail-item.is-locked .trail-item__badge svg { width: 16px; height: 16px; }

  .trail-item__card {
    flex-direction: column;
    gap: 2px;
    padding: 6px 6px;
    text-align: center;
    border-radius: 14px;
  }
  .trail-item__title { font-size: 12px; }
  .trail-item__meta { font-size: 9px; margin-top: 0; }
  .trail-item__stars { font-size: 9px; }

  /* ------------------------------- TOCAR ------------------------------ */
  .screen--play {
    max-width: 1200px;
    padding: calc(env(safe-area-inset-top) + 6px) 12px calc(env(safe-area-inset-bottom) + 8px);
    gap: 5px;
  }

  .play-header__title strong { font-size: 15px; }
  .play-header__title small { font-size: 10px; }

  .song-ui {
    flex: 0 0 auto;
    gap: 3px;
    padding-bottom: 0;
    justify-content: flex-start;
  }

  .lyrics { min-height: 30px; }
  .lyrics__line { font-size: clamp(15px, 2.4vw, 20px); }

  .hint { min-height: 30px; }
  .hint__pill { padding: 4px 12px; font-size: 12.5px; gap: 7px; }
  .hint__dot { width: 12px; height: 12px; }
  .hint__note { font-size: 17px; }

  .score { gap: 6px; }
  .score__chip { padding: 2px 9px; font-size: 11px; }

  .progress__track { height: 11px; }
  .progress__count { font-size: 10.5px; }

  .beat-bar__track { height: 8px; }

  .keyboard-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    gap: 4px;
  }

  .keyboard { padding: 9px 9px 7px; border-radius: 16px; }

  .key__label { font-size: 11px; }
  .key--black .key__label { font-size: 8.5px; }

  /* modo tocar livre */
  .free-ui {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  .note-bubble { width: 66px; height: 66px; font-size: 24px; border-width: 3px; }
  .free-hint { font-size: 12px; }

  /* ------------------------------- MODAIS ----------------------------- */
  .overlay__card { max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 18px 20px 16px; }
  .overlay__card h2 { font-size: 22px; }
  .big-stars svg { width: 38px; height: 38px; }
  .overlay__actions { flex-direction: row; margin-top: 12px; }
  .modal__card { max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 16px; }
}
