/* === Guitar Dashboard Metronome (Dark Theme) === */

.gd-card{
  background:#1E2125;
  color:#fff;
  border-radius:14px;
  padding:16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  border:1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  max-width: 560px;
}

.gd-row{
  display:flex;
  align-items:center;
}

.gd-row--gap{ gap:10px; }
.gd-row--space{ justify-content:space-between; }

/* Space between BPM/slider row and Tap/Reset row */
.gd-header + .gd-row.gd-row--gap {
  margin-bottom: 10px;
}

.gd-header{ margin-bottom:10px; }

.gd-header-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.gd-title{
  color:#FF8A4D;
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
}

.gd-muted{
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

.gd-label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
}

.gd-input{
  background: rgba(255,255,255,.06);
  color:#fff;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  padding:10px 10px;
  outline:none;
}

.gd-input:focus{
  border-color: rgba(255,138,77,.8);
  box-shadow: 0 0 0 3px rgba(255,138,77,.18);
}

.gd-select{
  background: rgba(255,255,255,.06);
  color:#fff;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  padding:10px 10px;
  outline:none;
}

.gd-range{
  width:100%;
}

.gd-btn{
  background:#FF8A4D;
  color:#1E2125;
  border:none;
  border-radius:12px;
  padding:10px 14px;
  font-weight:800;
  cursor:pointer;
}

.gd-btn:hover{ filter: brightness(1.05); }
.gd-btn:active{ transform: translateY(1px); }

.gd-btn--soft{
  background: rgba(255,138,77,.18);
  color:#FF8A4D;
  border:1px solid rgba(255,138,77,.35);
}

.gd-btn--ghost{
  background: transparent;
  color: rgba(255,255,255,.85);
  border:1px solid rgba(255,255,255,.18);
}

.gd-status{
  font-size: 12px;
  color: rgba(255,255,255,.75);
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
}

.gd-status--on{
  color:#FF8A4D;
  border-color: rgba(255,138,77,.35);
}

.gd-adv-toggle{
  width:100%;
  margin-top:10px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight:700;
}

.gd-adv-toggle:hover{
  border-color: rgba(255,255,255,.2);
}

.gd-adv-panel{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.10);
}

.gd-adv-grid{
  flex-wrap: wrap;
}

.gd-check{
  display:flex;
  align-items:center;
  gap:8px;
  color: rgba(255,255,255,.85);
  font-size: 12px;
}

/* Presets */
.gd-presets{
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.gd-presets-title{
  font-weight:800;
  font-size:13px;
  margin-bottom:8px;
  color: rgba(255,255,255,.92);
}
.gd-presets-row{ flex-wrap:wrap; }

/* Speed trainer */
.gd-trainer{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.10);
}
.gd-trainer-title{
  font-weight:800;
  font-size:13px;
  margin-bottom:8px;
  color: rgba(255,255,255,.92);
}
.gd-trainer-grid{ flex-wrap:wrap; }
.gd-trainer-status{ margin-top:8px; }

/* Footer */
.gd-footer{ margin-top: 12px; }

/* Help button */
.gd-help-btn{
  width:32px;
  height:32px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.14);
  cursor:pointer;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gd-help-btn:hover{
  border-color: rgba(255,255,255,.25);
}

/* Beat indicator */
.gd-beat-wrap{
  width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gd-beat{
  width:10px;
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 0 0 0 rgba(255,138,77,.0);
}
.gd-beat.is-on{
  background: #FF8A4D;
  box-shadow: 0 0 0 6px rgba(255,138,77,.18);
}
.gd-beat.is-accent{
  box-shadow: 0 0 0 8px rgba(255,138,77,.22);
}

/* Modal */
.gd-modal{
  position: fixed;
  inset: 0;
  display:none;
  z-index: 99999;
}
.gd-modal.is-open{ display:block; }

.gd-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}

.gd-modal__panel{
  position:relative;
  max-width: 560px;
  margin: 10vh auto 0 auto;
  background: #1E2125;
  border:1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
  overflow:hidden;
}

.gd-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.gd-modal__title{
  font-weight:900;
  color:#FF8A4D;
}

.gd-modal__close{
  background: transparent;
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 16px;
  cursor:pointer;
}

.gd-modal__body{
  padding: 12px 14px;
}

.gd-help-list{
  margin:0;
  padding-left: 16px;
  color: rgba(255,255,255,.88);
}
.gd-help-list li{
  margin: 8px 0;
  line-height: 1.35;
}

.gd-modal__footer{
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.10);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* SR only */
.gd-sr{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* === Playlist widget === */
.gd-playlist-badge{
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
}

.gd-card.gd-playlist {
  max-width: 100%;
}

.gd-playlist-actions{
  margin-top: 8px;
  margin-bottom: 10px;
}

.gd-video__ratio{
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 14px;
  overflow: hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.gd-video__ratio iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

/* Playlist: presets last spacing */
.gd-pl-presets{ margin-top: 12px; }

/* === Tuner widget === */
.gd-tn-breadcrumbs{
  margin-top: 6px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.gd-tn-rack__wrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 8px 0 12px;
}

.gd-tn-string{
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.94);
  cursor: pointer;
  text-align: left;
}

.gd-tn-string:hover{
  border-color: rgba(255,255,255,.22);
}

.gd-tn-string__num{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.12);
  font-weight: 700;
}

.gd-tn-string__note{
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
}

.gd-tn-string__sub{
  font-size: 12px;
  color: rgba(255,255,255,.70);
  font-variant-numeric: tabular-nums;
}

.gd-tn-string.is-playing{
  border-color: rgba(255,138,77,.85);
  box-shadow: 0 0 0 2px rgba(255,138,77,.18);
}

.gd-tn-controls{
  margin-top: 6px;
  margin-bottom: 10px;
}

.gd-tn-status{
  white-space: nowrap;
}

.gd-tn-presets{
  margin-top: 12px;
}

/* =========================================================
   TIMER (SCOPED) — bloque único oficial
   PÉGALO AL FINAL del CSS global.
   Borra cualquier bloque anterior del timer para evitar pelea.
   ========================================================= */

/* =========================
   TIMER (Block widget)
   ========================= */

.gd-card.gd-timer{
  max-width: 560px;          /* vuelve a “widget”, no tira */
  padding: 16px;
}

.gd-card.gd-timer .gd-timer__header-right{
  display:flex;
  align-items:center;
  gap:14px;
}

/* status en header (texto pequeño) */
.gd-card.gd-timer .gd-timer__status{
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 14px;
}

/* dot indicador */
.gd-card.gd-timer .gd-timer__dot{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display:inline-block;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25);
}

.gd-card.gd-timer .gd-timer__dot.is-on{
  background:#FF8A4D;
  border-color: rgba(255,138,77,0.75);
  box-shadow:
    0 0 0 4px rgba(255,138,77,0.20),
    0 0 18px rgba(255,138,77,0.55);
}

/* Row 2: botones (3 columnas) */
.gd-card.gd-timer .gd-timer__controls{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.gd-card.gd-timer .gd-timer__btn{
  width: 100%;
  justify-content:center;
  padding: 14px 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Row 3: display grande */
.gd-card.gd-timer .gd-timer__display{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  min-height: 100px;

  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.gd-card.gd-timer .gd-timer__time{
  color:#FF8A4D;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 2px;
  font-size: clamp(64px, 9vw, 75px);
}

/* responsive */
@media (max-width: 520px){
  .gd-card.gd-timer .gd-timer__controls{
    grid-template-columns: 1fr;
  }
  .gd-card.gd-timer .gd-timer__display{
    min-height: 120px;
  }
}

/* =========================
   Learning Core (V00) – Layout
   ========================= */
.gd-learning{
  width: 100%;
}

.gd-learning__grid{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  align-items:start;
}

.gd-learning__left{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.gd-learning__right{
  width:100%;
}

.gd-tabviewer__viewer{
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  min-height: 340px;
  padding: 14px;
}

.gd-tabviewer__controls{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
}

.gd-tabviewer__lessons-header{
  margin-top: 12px;
}

.gd-tabviewer__info{
  flex: 1;
  min-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  font-size: 12px;
}

.gd-tabviewer__statusbar{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.gd-learning__ads{
  margin-top: 14px;
}
.gd-learning__ads-inner{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(120,160,120,.35);
  padding: 28px 18px;
}

/* Lessons list items */
.gd-lessons__list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 50vh;
  overflow:auto;
  padding-right: 6px;
}
.gd-lessons__item{
  width:100%;
  text-align:left;
  cursor:pointer;
  border-radius: 14px;
  padding: 12px 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color:#fff;
}
.gd-lessons__item:hover{
  border-color: rgba(255,255,255,.22);
}
.gd-lessons__item-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.gd-lessons__badge{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.85);
}

/* Theory blocks */
.gd-theory__display{
  margin-top: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px;
  min-height: 220px;
  max-height: 360px;
  overflow:auto;
}
.gd-theory__toggles{
  margin-top: 10px;
}
.gd-theory__save{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.gd-theory__block{
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
  margin-bottom: 10px;
}
.gd-theory__block-top{
  display:flex;
  align-items:center;
  gap:10px;
}
.gd-theory__tag{
  font-size: 10px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,138,77,.16);
  border: 1px solid rgba(255,138,77,.28);
  color: #FF8A4D;
}

@media (max-width: 980px){
  .gd-learning__grid{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   TAB VIEWER: FULL WIDTH (V01)
   - Overrides gd-card max-width:560px
   ========================================================= */
.gd-card.gd-tabviewer{
  max-width: 100%;
  width: 100%;
}

/* Ensure inner blocks use full width too */
.gd-tabviewer__viewer,
.gd-tabviewer__controls,
.gd-tabviewer__lessons-row,
.gd-tabviewer__statusbar{
  width: 100%;
}

/* =========================================================
   BASELINE BUTTON ALIGNMENT (V01)
   - Forces rows with mixed inputs/buttons to align at bottom
   ========================================================= */

/* Lessons row: align controls */
.gd-tabviewer__lessons-row .gd-row{
  align-items: flex-end;
}

/* Theory toggles row: align buttons to bottom */
.gd-theory__toggles{
  align-items: flex-end;
}

/* Generic: buttons align to bottom in mixed rows */
/* Only enforce baseline alignment inside Learning Core rows */
.gd-learning .gd-row .gd-btn{
  align-self: flex-end;
}

/* =========================================================
   METRONOME STRIP (Learning Core) — compact UI (KEEP ONLY THIS)
   ========================================================= */
.gd-ms{ width:100%; }
.gd-ms__row{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
}
.gd-ms__control{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:120px;
}
.gd-ms__label{ font-weight:800; letter-spacing:.3px; }
.gd-ms__hover{ position:relative; }
.gd-ms__input{ width:92px; text-align:center; }
.gd-ms__btn{ height:42px; padding:0 14px; border-radius:12px; font-weight:800; }

.gd-ms__loop{
  display:flex;
  align-items:center;
  gap:10px;
  height:42px;
  padding:0 12px;
  border-radius:12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

/* Hover popover */
.gd-ms__popover{
  position:absolute;
  left:0;
  top: calc(100% + 8px);
  z-index:9999;
  width:220px;
  padding:10px 12px;
  border-radius:14px;
  background:#1E2125;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 16px 40px rgba(0,0,0,.45);
  display:none;
}
.gd-ms__hover:hover .gd-ms__popover,
.gd-ms__hover:focus-within .gd-ms__popover{ display:block; }

.gd-ms__hint{ margin-top:8px; font-size:12px; opacity:.75; }

/* Playlist: Advanced row spacing (optional but recommended) */
.gd-pl-advanced{
  align-items: center;
}

@media (max-width: 520px){
  .gd-pl-advanced{
    flex-direction: column;
    align-items: flex-start;
  }
}