/* ═══════════════════════════════════════════════
   GrooveTrainer — Design System
   Mobile-first. Tablet 768px+. Desktop 1024px+.
═══════════════════════════════════════════════ */

:root {
  --bg:           #0f0f0f;
  --surface:      #1a1a1a;
  --surface2:     #222222;
  --border:       #2a2a2a;
  --border2:      #333333;
  --text:         #e8e8e8;
  --text2:        #aaaaaa;
  --text3:        #666666;
  --green:        #4caf50;
  --green-dim:    #1a2e1a;
  --green-light:  #c8e6c9;
  --amber:        #f5a623;
  --blue:         #4a9eff;
  --red:          #e85454;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --nav-height:   64px;
  --header-height:52px;
  --font: -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ══════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════ */
.gt-auth-screen {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  padding: 24px;
}
.gt-auth-inner { text-align: center; max-width: 320px; width: 100%; }
.gt-logo-mark { font-size: 52px; margin-bottom: 12px; }
.gt-logo-text { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.gt-auth-sub { color: var(--text2); margin-bottom: 32px; }
.gt-auth-note { margin-top: 16px; font-size: 12px; color: var(--text3); }

/* ══════════════════════════════════════
   ONBOARDING
══════════════════════════════════════ */
.gt-onboarding {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 999;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.gt-onboarding-inner { max-width: 380px; margin: auto; width: 100%; display: flex; flex-direction: column; height: 100%; }
.gt-ob-step { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 0; }
.gt-ob-icon { font-size: 56px; margin-bottom: 20px; }
.gt-ob-title { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.gt-ob-body { color: var(--text2); font-size: 16px; line-height: 1.6; max-width: 300px; }
.gt-ob-dots { display: flex; gap: 8px; margin-top: 32px; justify-content: center; }
.gt-ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.gt-ob-dot.active { background: var(--green); }
.gt-ob-nav { display: flex; gap: 12px; padding-top: 16px; padding-bottom: 32px; }
.gt-ob-nav .gt-btn { flex: 1; }

/* ══════════════════════════════════════
   APP SHELL
══════════════════════════════════════ */
#gt-app { display: flex; flex-direction: column; height: 100dvh; }

/* Header */
.gt-header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 16px;
  gap: 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
.gt-header-title { flex: 1; font-size: 16px; font-weight: 600; }
.gt-header-right { display: flex; align-items: center; gap: 10px; }
.gt-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text2); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.gt-icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.gt-icon-btn:hover { background: var(--surface2); }

/* Main */
.gt-main { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: calc(var(--nav-height) + 16px); }

/* Bottom nav */
.gt-bottom-nav {
  display: flex;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
}
.gt-nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 11px; font-family: var(--font); padding: 8px;
  transition: color 0.15s;
}
.gt-nav-btn svg { flex-shrink: 0; }
.gt-nav-btn.active { color: var(--green); }
.gt-nav-btn:hover { color: var(--text2); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.gt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap; min-height: 44px;
}
.gt-btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.gt-btn-primary:hover { opacity: 0.88; }
.gt-btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.gt-btn-secondary:hover { background: var(--border); }
.gt-btn-ghost { background: none; color: var(--text2); border-color: var(--border2); }
.gt-btn-ghost:hover { background: var(--surface2); }
.gt-btn-large { min-height: 52px; font-size: 16px; padding: 12px 24px; width: 100%; }
.gt-btn-block { width: 100%; }
.gt-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }

/* Badges */
.gt-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: 0.5px; display: inline-flex; align-items: center; }
.gt-badge-amber { background: #2a1a0a; color: var(--amber); border: 1px solid var(--amber); }

/* ══════════════════════════════════════
   HOME SCREEN
══════════════════════════════════════ */
.gt-home { display: flex; flex-direction: column; gap: 16px; }
.gt-greeting-title { font-size: 22px; font-weight: 700; }
.gt-greeting-sub { color: var(--text2); font-size: 14px; margin-top: 4px; }

.gt-continue-card {
  background: #1c2a1c; border: 1px solid var(--green);
  border-radius: var(--radius-lg); padding: 18px 20px;
  cursor: pointer;
}
.gt-continue-label { font-size: 11px; color: #4caf5088; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; font-weight: 600; }
.gt-continue-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.gt-continue-bpm { font-size: 13px; color: var(--text2); margin-bottom: 14px; }
.gt-continue-btn { min-height: 40px; }

.gt-home-section-title { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.gt-level-summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.gt-level-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.gt-level-summary-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.gt-level-summary-name { font-size: 15px; font-weight: 600; }
.gt-level-summary-count { font-size: 13px; color: var(--text2); }
.gt-chevron { color: var(--text3); flex-shrink: 0; }

/* ══════════════════════════════════════
   LEVELS SCREEN
══════════════════════════════════════ */
.gt-levels-list { display: flex; flex-direction: column; gap: 10px; }
.gt-level-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color 0.15s;
}
.gt-level-card:hover:not(.locked) { border-color: var(--border2); }
.gt-level-card.locked { opacity: 0.5; cursor: default; }
.gt-level-stick { width: 6px; height: 40px; border-radius: 3px; flex-shrink: 0; }
.gt-level-card-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.gt-level-card-name { font-size: 16px; font-weight: 600; }
.gt-level-card-count { font-size: 13px; color: var(--text2); }
.gt-level-locked-tag { font-size: 13px; color: var(--text3); }

/* ══════════════════════════════════════
   LEVEL DETAIL (categories)
══════════════════════════════════════ */
.gt-category-list { display: flex; flex-direction: column; gap: 10px; }
.gt-cat-section-title { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-top: 8px; margin-bottom: 4px; }
.gt-cat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.gt-cat-card:hover { border-color: var(--border2); }
.gt-cat-card-info { flex: 1; }
.gt-cat-name { display: block; font-size: 16px; font-weight: 600; }
.gt-cat-count { display: block; font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ══════════════════════════════════════
   GROOVE LIST
══════════════════════════════════════ */
.gt-groove-list { display: flex; flex-direction: column; gap: 10px; }
.gt-groove-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.gt-groove-card:hover { border-color: var(--border2); }
.gt-groove-card.in-progress { border-color: var(--blue); }
.gt-groove-card.completed { opacity: 0.7; }

.gt-groove-ring {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text3); font-weight: 600;
}
.gt-groove-ring.partial { border-color: var(--blue); color: var(--blue); }
.gt-groove-ring.done { border-color: var(--green); background: var(--green-dim); color: var(--green); }

.gt-groove-card-info { flex: 1; min-width: 0; }
.gt-groove-name { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-groove-desc { display: block; font-size: 12px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-groove-status { display: block; font-size: 11px; color: var(--text3); margin-top: 4px; }
.gt-groove-status.in-progress { color: var(--blue); }
.gt-groove-status.done { color: var(--green); }
.gt-groove-btn { flex-shrink: 0; min-height: 36px; padding: 6px 14px; font-size: 13px; }

/* ══════════════════════════════════════
   PROGRESS VIEW
══════════════════════════════════════ */
.gt-progress-view { display: flex; flex-direction: column; gap: 20px; }
.gt-progress-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.gt-progress-big-num { font-size: 52px; font-weight: 700; color: var(--green); line-height: 1; }
.gt-progress-big-label { font-size: 14px; color: var(--text2); margin-top: 6px; margin-bottom: 16px; }
.gt-progress-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.gt-progress-bar-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.5s ease; }

.gt-progress-groove-list { display: flex; flex-direction: column; gap: 10px; }
.gt-progress-groove-row { display: flex; align-items: center; gap: 10px; }
.gt-progress-groove-name { font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-progress-groove-bar-wrap { width: 80px; height: 4px; background: var(--border); border-radius: 2px; flex-shrink: 0; }
.gt-progress-groove-bar-fill { height: 100%; background: var(--green); border-radius: 2px; }
.gt-progress-groove-num { font-size: 11px; color: var(--text3); width: 32px; text-align: right; flex-shrink: 0; }

/* ══════════════════════════════════════
   GROOVE PLAYER OVERLAY
══════════════════════════════════════ */
.gt-player-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 500;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.gt-player-inner { max-width: 680px; width: 100%; margin: 0 auto; padding-bottom: 32px; }

.gt-player-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.gt-player-title-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.gt-player-title { font-size: 16px; font-weight: 600; }
.gt-player-level-tag { font-size: 11px; color: var(--text3); }

.gt-player-tip {
  background: var(--surface); border-left: 3px solid var(--amber);
  padding: 10px 14px; margin: 12px 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--text2); line-height: 1.5;
}

.gt-notation-wrap {
  margin: 12px 16px; border-radius: var(--radius);
  background: #fff; overflow: visible; min-height: 120px;
  position: relative;
}
.gt-notation-frame { width: 100%; height: 200px; border: none; display: block; }
.gt-notation-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #fff; color: #888; font-size: 13px;
}

/* Mode toggle */
.gt-mode-toggle {
  display: flex; margin: 12px 16px;
  background: var(--surface2); border-radius: var(--radius-sm); padding: 3px;
}
.gt-mode-btn {
  flex: 1; padding: 8px; border: none; background: none;
  color: var(--text3); font-family: var(--font); font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
  min-height: 40px;
}
.gt-mode-btn.active { background: var(--bg); color: var(--text); }

/* BPM controls */
.gt-bpm-controls { padding: 8px 16px; }
.gt-bpm-info { display: flex; align-items: center; justify-content: space-between; }
.gt-bpm-info-text { font-size: 14px; color: var(--text2); }
.gt-bpm-current { font-size: 13px; color: var(--green); font-weight: 600; }

.gt-fixed-bpm-row { display: flex; align-items: center; gap: 12px; }
.gt-bpm-label { font-size: 14px; color: var(--text2); }
.gt-bpm-stepper {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.gt-bpm-input {
  width: 80px; height: 40px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 18px; font-weight: 700; text-align: center;
  font-family: var(--font);
}

/* Playback row */
.gt-playback-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 16px;
}
.gt-toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 72px; }
.gt-toggle-label { font-size: 11px; color: var(--text3); text-align: center; }
.gt-toggle-btn {
  height: 30px; width: 60px; border-radius: 15px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text3); font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all 0.2s;
}
.gt-toggle-btn.active { background: var(--green-dim); border-color: var(--green); color: var(--green); }

.gt-play-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--text); border: none; color: var(--bg);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, background 0.15s; flex-shrink: 0;
}
.gt-play-btn:active { transform: scale(0.93); }

/* Tempo section */
.gt-tempo-section { padding: 0 16px 16px; }
.gt-tempo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gt-tempo-title { font-size: 14px; font-weight: 600; }
.gt-tempo-count { font-size: 13px; color: var(--green); font-weight: 600; }

.gt-tempo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gt-chip {
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text2); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font); min-height: 44px; min-width: 60px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.gt-chip:hover { border-color: var(--text3); }
.gt-chip.done { background: var(--green-dim); border-color: var(--green); color: var(--green-light); }
.gt-chip-bounce { animation: gt-bounce 0.35s ease; }
@keyframes gt-bounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.22)} }

.gt-tempo-actions { display: flex; flex-direction: column; gap: 8px; }
.gt-mark-all { text-align: center; }
.gt-reset { text-align: center; color: var(--text3); border-color: transparent; }
.gt-reset:hover { color: var(--red); border-color: var(--red); }

/* ══════════════════════════════════════
   COMPLETION BANNER
══════════════════════════════════════ */
.gt-completion-banner {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: gt-fadein 0.3s ease;
}
@keyframes gt-fadein { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.gt-completion-inner {
  background: var(--surface); border: 1px solid var(--green);
  border-radius: var(--radius-lg); padding: 32px 24px;
  text-align: center; max-width: 340px; width: 100%;
}
.gt-completion-icon { font-size: 48px; margin-bottom: 12px; }
.gt-completion-title { font-size: 24px; font-weight: 700; color: var(--green); margin-bottom: 8px; }
.gt-completion-sub { color: var(--text2); font-size: 14px; margin-bottom: 24px; }
.gt-completion-btns { display: flex; flex-direction: column; gap: 10px; }

/* ══════════════════════════════════════
   TABLET 768px+
══════════════════════════════════════ */
@media (min-width: 768px) {
  .gt-main { padding: 24px; max-width: 680px; margin: 0 auto; width: 100%; }
  .gt-groove-list { display: flex; flex-direction: column; gap: 10px; }
  .gt-notation-frame { height: 260px; }
}

/* ══════════════════════════════════════
   DESKTOP 1024px+
══════════════════════════════════════ */
@media (min-width: 1024px) {
  #gt-app { flex-direction: row; }
  .gt-header { display: none; }
  #gt-app.has-back .gt-header { display: flex; }
  .gt-bottom-nav {
    position: sticky; top: 0; left: 0;
    width: 220px; height: 100dvh;
    flex-direction: column; justify-content: flex-start;
    padding: 24px 12px; gap: 4px; border-top: none;
    border-right: 1px solid var(--border);
  }
  .gt-nav-btn { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
  .gt-main { padding-bottom: 24px; flex: 1; max-width: 800px; }
  .gt-groove-list { grid-template-columns: 1fr; }
  .gt-tempo-chips .gt-chip { min-width: 70px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gt-chip-bounce, .gt-completion-banner { animation: none; }
}

/* ══════════════════════════════════════
   NOTATION FRAME - uses GrooveScribe Mode=view
   View mode shows notation only, no chrome
══════════════════════════════════════ */
.gt-notation-wrap {
  margin: 12px 16px;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  min-height: 120px;
  position: relative;
}
.gt-notation-frame {
  width: 100%;
  height: 200px;
  border: none;
  display: block;
  pointer-events: none;
}

/* ══════════════════════════════════════
   PROGRESSIVE FIELDS (min/max/step)
══════════════════════════════════════ */
.gt-prog-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: nowrap;
  justify-content: space-between;
}
.gt-prog-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
}
.gt-prog-field-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.gt-step-select {
  appearance: auto;
  cursor: pointer;
  font-family: var(--font);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  height: 40px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  padding: 0 8px;
}

/* ══════════════════════════════════════
   LANDSCAPE ORIENTATION
══════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 600px) {
  /* Landscape on phone/tablet: show only the notation full-screen */
  .gt-player-overlay {
    overflow: hidden;
  }
  .gt-player-inner {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  /* Hide all controls */
  .gt-player-header,
  .gt-player-tip,
  .gt-mode-toggle,
  .gt-bpm-controls,
  .gt-playback-row,
  .gt-exercise-actions {
    display: none !important;
  }
  /* Notation fills entire screen */
  .gt-notation-wrap {
    flex: 1;
    margin: 0;
    border-radius: 0;
    min-height: 0;
  }
  .gt-notation-frame {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
  }
  /* Small back-to-controls button */
  .gt-landscape-back {
    display: flex !important;
  }
}

/* Version number - bottom left, tiny */
#gt-version {
  position: fixed;
  bottom: 4px;
  left: 6px;
  font-size: 9px;
  color: rgba(255,255,255,0.2);
  font-family: monospace;
  z-index: 99999;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   EXERCISE ACTIONS (replaces tempo chips)
══════════════════════════════════════ */
.gt-exercise-actions {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ══════════════════════════════════════
   HOLD BUTTON
══════════════════════════════════════ */
.gt-hold-btn {
  width: 80px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gt-hold-btn:hover { border-color: var(--amber); color: var(--amber); }
.gt-hold-btn.active {
  background: #2a200a;
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 700;
  font-size: 13px;
}
.gt-prog-hold-field {
  min-width: 80px;
  align-self: flex-end;
  padding-bottom: 0;
}

/* Metronome frequency selector */
.gt-metro-select {
  appearance: auto;
  cursor: pointer;
  font-family: var(--font);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  height: 30px;
  width: 60px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 0 4px;
  transition: border-color 0.15s;
}
.gt-metro-select:focus { outline: none; border-color: var(--green); }

/* Landscape back-to-controls button */
.gt-landscape-back {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 600;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* Landscape: when back button is tapped, show controls overlay */
@media (orientation: landscape) and (max-height: 600px) {
  .gt-player-overlay.gt-show-controls .gt-player-header,
  .gt-player-overlay.gt-show-controls .gt-mode-toggle,
  .gt-player-overlay.gt-show-controls .gt-bpm-controls,
  .gt-player-overlay.gt-show-controls .gt-playback-row,
  .gt-player-overlay.gt-show-controls .gt-exercise-actions {
    display: flex !important;
  }
  .gt-player-overlay.gt-show-controls .gt-notation-wrap {
    flex: 0 0 120px;
  }
}

/* Mark Exercise done state */
.gt-btn-done {
  background: var(--green-dim) !important;
  color: var(--green) !important;
  border: 1px solid var(--green) !important;
}
.gt-btn-done:hover {
  background: #2a3a2a !important;
}



/* ── Mute buttons ──────────────────────────────────────────────────── */
.gt-mute-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.gt-mute-btns {
  display: flex;
  gap: 4px;
  background: var(--gt-surface);
  border: 1.5px solid var(--gt-border);
  border-radius: 20px;
  padding: 3px;
}
.gt-mute-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: var(--gt-text-secondary);
  border-radius: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  min-width: 38px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.gt-mute-btn.active {
  background: #e53935;
  color: #fff;
  box-shadow: 0 1px 4px #e5393560;
}
.gt-mute-btn:hover:not(.active) {
  color: var(--gt-text);
  background: rgba(255,255,255,0.06);
}


/* ── Player prev/next nav ──────────────────────────────────────────── */
.gt-player-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.gt-nav-arrow {
  background: none;
  border: none;
  color: var(--gt-text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.gt-nav-arrow:hover:not(:disabled) {
  color: var(--gt-accent);
  background: var(--gt-surface);
}
.gt-nav-arrow:disabled {
  color: var(--gt-border);
  cursor: default;
}
.gt-player-nav-counter {
  font-size: 11px;
  color: var(--gt-text-secondary);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Notation fullscreen button ────────────────────────────────────────── */
.gt-notation-wrap {
  position: relative;
}
.gt-notation-reload-btn {
  position: absolute;
  top: 8px;
  right: 44px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.gt-notation-reload-btn:hover { background: rgba(0,0,0,0.7); }
.gt-notation-reload-btn.spinning { transform: rotate(360deg); }

.gt-notation-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.gt-notation-fullscreen-btn:hover {
  background: rgba(0,0,0,0.7);
}

/* ── Notation wrap fullscreen mode ─────────────────────────────────────── */
.gt-notation-wrap:fullscreen,
.gt-notation-wrap:-webkit-full-screen {
  background: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.gt-notation-wrap:fullscreen .gt-notation-frame,
.gt-notation-wrap:-webkit-full-screen .gt-notation-frame {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}
.gt-notation-wrap:fullscreen .gt-notation-loading,
.gt-notation-wrap:-webkit-full-screen .gt-notation-loading,
.gt-notation-wrap:fullscreen .gt-notation-fullscreen-btn,
.gt-notation-wrap:-webkit-full-screen .gt-notation-fullscreen-btn {
  display: none !important;
}

/* ── Beat count row ─────────────────────────────────────────────────────── */
.gt-count-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 80px 0 58px;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.gt-count-row.hidden { display: none; }
.gt-count-row span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  font-family: -apple-system, sans-serif;
  letter-spacing: 0;
  line-height: 1.4;
}
.gt-count-row span:nth-child(1),
.gt-count-row span:nth-child(5),
.gt-count-row span:nth-child(9),
.gt-count-row span:nth-child(13) {
  color: #222;
  font-size: 13px;
}

/* ── Count toggle button ─────────────────────────────────────────────────── */
.gt-count-toggle-btn {
  position: absolute;
  top: 8px;
  right: 44px;
  height: 28px;
  padding: 0 8px;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.gt-count-toggle-btn.hidden { display: none; }
.gt-count-toggle-btn:hover { background: rgba(0,0,0,0.7); }
.gt-count-toggle-btn.active {
  background: var(--gt-accent);
}


/* ── Paywall overlay ─────────────────────────────────────────────────── */
.gt-paywall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.gt-paywall-overlay.hidden { display: none; }
.gt-paywall-box {
  background: var(--surface1);
  border: 1px solid var(--border1);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 320px;
  text-align: center;
}
.gt-paywall-icon { font-size: 40px; margin-bottom: 12px; }
.gt-paywall-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.gt-paywall-body { font-size: 14px; color: var(--text2); line-height: 1.5; margin-bottom: 24px; }
.gt-paywall-btns { display: flex; gap: 10px; justify-content: center; }

/* ── Premium lock badge on groove cards ─────────────────────────────── */
.gt-groove-card-premium {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 13px;
  opacity: 0.7;
}
.gt-groove-card.is-premium { opacity: 0.85; }
