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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Header ── */
header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 2px;
}

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

/* ── User Profile Widget ── */
#user-profile-widget {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  color: #ddd;
  transition: border-color 0.15s;
}

.profile-trigger:hover {
  border-color: #7c6fff;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-initials-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #7c6fff;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-stats-brief {
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #1e1e38;
  border: 1px solid #444;
  border-radius: 8px;
  min-width: 180px;
  padding: 6px 0;
  z-index: 1200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: #ddd;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.dropdown-item:hover {
  background: rgba(124, 111, 255, 0.15);
}

.dropdown-danger {
  color: #ff6b6b;
}

.dropdown-danger:hover {
  background: rgba(255, 107, 107, 0.1);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 4px 0;
}

#lang-select {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid #555;
  background: #2a2a3e;
  color: #ccc;
  font-size: 0.85rem;
  cursor: pointer;
}

#lang-select:focus {
  outline: none;
  border-color: #7c6fff;
}

/* ── Mode Tabs ── */
#mode-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 1400px;
  padding: 0 20px;
  border-bottom: 2px solid #333;
  margin-bottom: 4px;
}

.mode-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 0.92rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.mode-tab:hover {
  color: #ccc;
}

.mode-tab.active {
  color: #4ecdc4;
  border-bottom-color: #4ecdc4;
}

.mode-tab.tutorial-trigger-btn {
  color: #b197fc;
  font-weight: 600;
  margin-left: auto;
}

.mode-tab.tutorial-trigger-btn:hover {
  color: #d4bfff;
}

/* ── Tab Content ── */
#tab-content {
  width: 100%;
  max-width: 1400px;
  min-height: 60px;
  padding: 0 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Control buttons (shared) ── */
.control-btn {
  padding: 8px 20px;
  border: 2px solid #555;
  border-radius: 6px;
  background: #2a2a3e;
  color: #eee;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:hover {
  border-color: #888;
  background: #3a3a5e;
}

/* ── Play control buttons (above fretboard) ── */
.play-ctrl-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  color: #fff;
  min-width: 80px;
  text-align: center;
}

.play-ctrl-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.play-ctrl-btn:active {
  transform: translateY(0);
}

.play-btn-primary {
  background: #4ecdc4;
  color: #1a1a2e;
  font-size: 1rem;
  padding: 10px 28px;
  min-width: 100px;
}

.play-btn-primary:hover {
  background: #5fd9d0;
}

#playback-mode {
  display: inline-flex;
  gap: 6px;
}

.play-btn-strum {
  background: rgba(78, 205, 196, 0.15);
  color: #4ecdc4;
  border: 1px solid #4ecdc4;
}

.play-btn-strum:hover, .play-btn-strum.active {
  background: #4ecdc4;
  color: #1a1a2e;
}

.play-btn-pick {
  background: rgba(116, 143, 252, 0.15);
  color: #748ffc;
  border: 1px solid #748ffc;
}

.play-btn-pick:hover, .play-btn-pick.active {
  background: #748ffc;
  color: #fff;
}

.play-btn-loop {
  background: rgba(124, 111, 255, 0.15);
  color: #7c6fff;
  border: 1px solid #7c6fff;
}

.play-btn-loop:hover, .play-btn-loop.active {
  background: #7c6fff;
  color: #fff;
}

.play-btn-stop {
  background: #a63d3d;
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
}

.play-btn-stop:hover {
  background: #c44;
  color: #fff;
}

.play-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #aaa;
  border: 1px solid #555;
}

.play-btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  color: #ccc;
}

.looping {
  animation: loopPulse 1s ease-in-out infinite;
}

@keyframes loopPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 111, 255, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(124, 111, 255, 0); }
}

/* ── Keyboard Shortcuts Legend ── */
#shortcut-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0;
}

.shortcut-toggle-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  font-size: 1rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-toggle-btn:hover {
  border-color: #7c6fff;
  color: #7c6fff;
}

.shortcut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.75rem;
  color: #888;
}

.shortcut-list span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shortcut-list kbd {
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #ccc;
  min-width: 18px;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ── Play tab: selection row ── */
#selection-row {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

#selection-display {
  font-size: 0.85rem;
  color: #aaa;
}

/* ── Fretboard ── */
/* ── Fretboard + Mixer wrapper ── */
#fretboard-wrapper {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1400px;
  gap: 0;
}

#fretboard-container {
  overflow-x: auto;
  padding: 0 20px 8px;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
}

/* ── Mixer Panel (left sidebar) ── */
#mixer-panel {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

#mixer-panel.mixer-collapsed #mixer-body {
  display: none;
}

#mixer-body {
  width: 180px;
  padding: 0 10px;
  background: rgba(30, 30, 50, 0.9);
  border: 1px solid #333;
  border-radius: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
}

.mixer-toggle-btn {
  width: 24px;
  background: rgba(30, 30, 50, 0.9);
  border: 1px solid #333;
  border-left: none;
  border-radius: 0 6px 6px 0;
  color: #aaa;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  align-self: stretch;
}

.mixer-toggle-btn:hover {
  color: #fff;
  background: rgba(124, 111, 255, 0.2);
}

#mixer-panel.mixer-collapsed .mixer-toggle-btn {
  border-left: 1px solid #333;
  border-radius: 6px;
}

.mixer-header {
  display: none; /* hidden — title shown in toggle area, reset btn moved inline */
}

#mixer-panel .mixer-title {
  margin: 0;
  font-size: 0.9rem;
  color: #aaa;
}

.credits-badge {
  font-size: 0.75rem;
  color: #ffd600;
  background: rgba(255, 214, 0, 0.1);
  border: 1px solid rgba(255, 214, 0, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
}

.credits-badge.credits-redeemed {
  animation: creditsPulse 0.5s ease;
}

@keyframes creditsPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

#mixer-panel.mixer-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.mixer-muted {
  font-size: 0.65rem;
  color: #ff6b6b;
  font-weight: 600;
  margin-left: 4px;
  text-transform: uppercase;
}

.mixer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 30px; /* match fret-marker row */
  padding-top: 2px;
}

.mixer-reset-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}

.mixer-reset-btn:hover {
  color: #fff;
  border-color: #7c6fff;
}

#profile-credits {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.mixer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 50px; /* match fretboard grid-template-rows */
  flex-shrink: 0;
}

.mixer-label {
  width: 48px;
  font-size: 0.7rem;
  color: #ccc;
  text-align: right;
  flex-shrink: 0;
}

.mixer-slider {
  flex: 1;
  height: 6px;
  accent-color: #7c6fff;
  cursor: pointer;
}

.mixer-value {
  min-width: 30px;
  font-size: 0.7rem;
  color: #999;
  text-align: center;
  flex-shrink: 0;
}

#fretboard {
  display: grid;
  grid-template-columns: 60px repeat(21, minmax(45px, 1fr));
  grid-template-rows: repeat(6, 50px) 30px 25px;
  min-width: 900px;
  background: #8B6914;
  border-radius: 4px;
  position: relative;
}

/* Fret cells */
.fret-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  border-right: 2px solid #aaa;
  z-index: 1;
  touch-action: manipulation;
}

/* String line through each cell */
.fret-cell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1px;
  background: #ddd;
  z-index: 0;
  pointer-events: none;
}

/* Thicker strings for wound strings */
.fret-cell[data-string="0"]::after { height: 3px; background: #ccc; }
.fret-cell[data-string="1"]::after { height: 2.5px; background: #ccc; }
.fret-cell[data-string="2"]::after { height: 2px; background: #d0d0d0; }
.fret-cell[data-string="3"]::after { height: 1.5px; }
.fret-cell[data-string="4"]::after { height: 1px; }
.fret-cell[data-string="5"]::after { height: 1px; }

/* Nut (fret 0) */
.fret-cell.open-string {
  border-right: 4px solid #f5f5dc;
  background: rgba(0, 0, 0, 0.15);
}

/* Note circle */
.note-label {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  transition: transform 0.15s, opacity 0.15s;
  opacity: 0.7;
  background: var(--note-color);
  color: #111;
}

.fret-cell:hover .note-label {
  opacity: 1;
  transform: scale(1.2);
}

.fret-cell.selected .note-label {
  opacity: 1;
  transform: scale(1.25);
  box-shadow: 0 0 0 3px #ffd700, 0 0 12px rgba(255, 215, 0, 0.5);
}

.fret-cell.selected.answer .note-label {
  opacity: 1;
  transform: scale(1.25);
  background: #51cf66 !important;
  box-shadow: 0 0 0 3px #2f9e44, 0 0 14px rgba(81, 207, 102, 0.6);
  color: #111;
}

.fret-cell.selected.wrong .note-label {
  opacity: 1;
  transform: scale(1.25);
  background: #ff4444 !important;
  box-shadow: 0 0 0 3px #c00, 0 0 14px rgba(255, 68, 68, 0.6);
  color: #fff;
}

.fret-cell.playing .note-label {
  opacity: 1;
  transform: scale(1.3);
  background: #ff8c00 !important;
  box-shadow: 0 0 0 3px #ff6600, 0 0 16px rgba(255, 140, 0, 0.7);
  color: #111;
}

/* Note colors */
.note-C  { --note-color: #FF6B6B; }
.note-Cs { --note-color: #FF8E72; }
.note-D  { --note-color: #FFC145; }
.note-Ds { --note-color: #FFE066; }
.note-E  { --note-color: #95E67A; }
.note-F  { --note-color: #69DB7C; }
.note-Fs { --note-color: #38D9A9; }
.note-G  { --note-color: #4ECDC4; }
.note-Gs { --note-color: #74C0FC; }
.note-A  { --note-color: #748FFC; }
.note-As { --note-color: #B197FC; }
.note-B  { --note-color: #E599F7; }

/* Fret markers row */
.fret-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.marker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

/* Fret numbers row */
.fret-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Play Controls (above fretboard) ── */
#play-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  width: 100%;
  max-width: 1400px;
}

#play-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

#play-controls-chord {
  font-size: 0.85rem;
  color: #aaa;
  min-height: 1.2em;
}

/* ── Status bar ── */
#status {
  padding: 10px;
  font-size: 0.85rem;
  color: #888;
}

/* ── Game panel ── */
#game-panel {
  width: 100%;
  max-width: 1400px;
  padding: 0 0 8px;
}

#game-setup, #game-active, #game-results {
  background: #222240;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

#game-setup h2, #game-results h2 {
  font-weight: 400;
  margin-bottom: 10px;
}

#game-setup p {
  color: #aaa;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

#game-setup label {
  margin-right: 8px;
  font-size: 0.9rem;
}

#game-mode-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

#game-mode-selector label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

#progression-count-row {
  margin-bottom: 14px;
}

#progression-progress {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #a0c4ff;
  padding: 4px 0 8px;
  letter-spacing: 0.5px;
}

/* Velocity panels */
.mixer-title {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


.game-info-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0;
  margin: 8px auto;
  max-width: 520px;
  font-size: 0.85rem;
  color: #aaa;
  text-align: left;
}

.game-info-box summary {
  cursor: pointer;
  padding: 8px 14px;
  color: #748ffc;
  font-size: 0.85rem;
  list-style: none;
}

.game-info-box summary::before {
  content: '▸ ';
}

.game-info-box[open] summary::before {
  content: '▾ ';
}

.game-info-box[open] summary {
  border-bottom: 1px solid #333;
  margin-bottom: 0;
}

#game-info-content {
  padding: 10px 14px;
  line-height: 1.5;
}

#game-info-content .info-label {
  color: #4ecdc4;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 2px;
}

#game-info-content .info-label:first-child {
  margin-top: 0;
}

#game-setup select {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #2a2a3e;
  color: #eee;
  font-size: 0.9rem;
  margin-right: 12px;
}

.game-action-btn {
  border-color: #748ffc !important;
  color: #748ffc !important;
}

.game-action-btn:hover {
  background: #2a2a5e !important;
}

.quit-game-btn {
  border-color: #888 !important;
  color: #888 !important;
  font-size: 0.8rem;
  padding: 4px 12px;
}

.quit-game-btn:hover {
  border-color: #ff6b6b !important;
  color: #ff6b6b !important;
  background: rgba(255, 107, 107, 0.1) !important;
}

.ended-early-badge {
  color: #ffa94d;
  font-size: 0.85rem;
  margin-top: 4px;
}

#game-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 1rem;
  flex-wrap: wrap;
}

.game-nav-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.game-nav-btn:hover {
  color: #fff;
  border-color: #888;
}

.game-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#round-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.round-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #444;
  border: 1px solid #666;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.round-dot:hover {
  transform: scale(1.3);
}

.round-dot.dot-current {
  border-color: #fff;
  box-shadow: 0 0 4px rgba(255,255,255,0.4);
}

.round-dot.dot-correct {
  background: #4ecdc4;
  border-color: #4ecdc4;
}

.round-dot.dot-incorrect {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.round-dot.dot-partial {
  background: #ffc145;
  border-color: #ffc145;
}

.round-dot.dot-skipped {
  background: #ffa94d;
  border-color: #ffa94d;
}

#game-round { color: #eee; }
#game-score { color: #4ecdc4; }
#game-timer { color: #ffc145; }

#game-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

#game-feedback {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

#game-feedback.correct {
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid #4ecdc4;
  color: #4ecdc4;
}

#game-feedback.incorrect {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
}

#game-feedback.partial-correct {
  background: rgba(255, 214, 0, 0.15);
  border: 1px solid #ffd600;
  color: #ffd600;
}

.result-partial {
  color: #ffd600;
  font-weight: bold;
}

.score-breakdown {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #bbb;
  opacity: 0.9;
}

.score-breakdown strong {
  color: #69db7c;
  font-size: 0.9rem;
}

/* Answer reveal on fretboard */
.fret-cell.answer .note-label {
  opacity: 1;
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #4ecdc4, 0 0 10px rgba(78, 205, 196, 0.4);
}

/* Results */
#results-summary {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

#results-details {
  text-align: left;
  max-width: 500px;
  margin: 0 auto 16px;
  font-size: 0.85rem;
}

#results-details table {
  width: 100%;
  border-collapse: collapse;
}

#results-details th, #results-details td {
  padding: 6px 10px;
  border-bottom: 1px solid #333;
}

#results-details th {
  color: #aaa;
  text-align: left;
  font-weight: 500;
}

#results-details td.result-correct { color: #4ecdc4; }
#results-details td.result-incorrect { color: #ff6b6b; }
#results-details td.result-skipped { color: #ffa94d; }
#results-details td.result-partial { color: #ffc145; }

/* ── Game Replay Section ── */
.replay-section {
  margin-top: 16px;
  border-top: 1px solid #333;
  padding-top: 12px;
}

.replay-section h3 {
  font-size: 0.95rem;
  color: #aaa;
  margin: 0 0 10px;
}

.replay-round {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.replay-round-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #bbb;
  margin-bottom: 6px;
}

.replay-score {
  color: #69db7c;
  font-weight: 600;
}

.replay-diagrams {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.replay-diagram-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.replay-label {
  font-size: 0.7rem;
  color: #888;
}

.mini-fretboard {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px;
}

.mini-string {
  display: flex;
  gap: 1px;
}

.mini-fret {
  width: 12px;
  height: 10px;
  background: #2a2a3a;
  border-radius: 1px;
}

.mini-dot-correct {
  background: #4ecdc4 !important;
}

.mini-dot-wrong {
  background: #ff6b6b !important;
}

.mini-dot-missing {
  background: #555 !important;
}

.replay-sound-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.replay-sound-btn:hover {
  border-color: #7c6fff;
  color: #7c6fff;
}

#practice-weak-btn {
  margin-top: 12px;
  background: #3a2a1a;
  border-color: #ff9f43;
  color: #ff9f43;
}

#practice-weak-btn:hover {
  background: #4a3a2a;
}

/* ── Feedback panel (inline tab) ── */
/* ── Floating Feedback FAB ── */
#fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

#feedback-fab, #donate-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #333355;
  border: 1px solid #555;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#feedback-fab:hover, #donate-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── Donation Modal ── */
#donate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#donate-overlay.hidden { display: none; }

#donate-modal {
  background: #1e1e38;
  border: 1px solid #555;
  border-radius: 12px;
  padding: 28px;
  width: min(420px, 90vw);
  text-align: center;
}

.donate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.donate-header h3 {
  color: #ffd700;
  margin: 0;
  font-size: 1.1rem;
}

.donate-desc {
  font-size: 0.88rem;
  color: #aaa;
  margin-bottom: 20px;
  line-height: 1.5;
}

.donate-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.donate-amt {
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid #555;
  background: #2a2a4e;
  color: #eee;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.donate-amt:hover {
  border-color: #7c6fff;
  background: rgba(124, 111, 255, 0.15);
}

.donate-custom {
  margin-bottom: 16px;
}

.donate-custom label {
  font-size: 0.82rem;
  color: #888;
  display: block;
  margin-bottom: 6px;
}

.donate-custom-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.donate-currency {
  font-size: 1.1rem;
  color: #aaa;
}

#donate-custom-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #2a2a4e;
  color: #eee;
  font-size: 1rem;
}

.donate-amt-go {
  padding: 10px 16px !important;
  border-color: #4ecdc4 !important;
  color: #4ecdc4 !important;
}

#donate-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 8px;
}

.donate-footer {
  font-size: 0.72rem;
  color: #666;
  margin: 0;
}

/* ── Feedback Modal Overlay ── */
#feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#feedback-modal {
  background: #222240;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
  margin: 0;
}

.feedback-modal-header button {
  padding: 4px 8px;
  font-size: 0.9rem;
}

#feedback-user-info {
  font-size: 0.8rem;
  color: #888;
}

#feedback-upload-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#feedback-previews {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#feedback-previews img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #555;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-field label {
  font-size: 0.82rem;
  color: #aaa;
}

.feedback-field select,
.feedback-field input,
.feedback-field textarea {
  background: #2a2a4e;
  border: 1px solid #555;
  border-radius: 5px;
  color: #eee;
  font-size: 0.9rem;
  padding: 7px 10px;
  font-family: inherit;
  resize: vertical;
}

.feedback-field select:focus,
.feedback-field input:focus,
.feedback-field textarea:focus {
  outline: none;
  border-color: #7c6fff;
}

#feedback-status {
  font-size: 0.85rem;
  min-height: 1.2em;
}

#feedback-status.feedback-error { color: #ff6b6b; }
#feedback-status.feedback-success { color: #69db7c; }
#feedback-status a { color: #a0c4ff; }

#feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Tutorial overlay ── */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  pointer-events: none;
}

#tutorial-card {
  position: fixed;
  background: #1e1e38;
  border: 1px solid #555;
  border-radius: 10px;
  padding: 18px 20px;
  max-width: 320px;
  width: calc(100vw - 40px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  pointer-events: all;
  z-index: 1001;
}

#tutorial-step-indicator {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 6px;
}

#tutorial-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffd700;
}

#tutorial-card p {
  font-size: 0.88rem;
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 14px;
}

#tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#tutorial-skip-btn {
  padding: 6px 14px;
  border: 1px solid #555;
  border-radius: 5px;
  background: transparent;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
}

#tutorial-skip-btn:hover { color: #ccc; border-color: #888; }

#tutorial-next-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 5px;
  background: #748ffc;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

#tutorial-next-btn:hover { background: #5c7cfa; }

.tutorial-highlight {
  position: relative;
  z-index: 1001;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #ffd700, 0 0 0 6px rgba(255, 215, 0, 0.25), 0 0 20px rgba(255, 215, 0, 0.15) !important;
  animation: tutorialPulse 1.4s ease-in-out infinite;
}

@keyframes tutorialPulse {
  0%, 100% { box-shadow: 0 0 0 3px #ffd700, 0 0 0 6px rgba(255, 215, 0, 0.25); }
  50%       { box-shadow: 0 0 0 3px #ffd700, 0 0 0 10px rgba(255, 215, 0, 0.1); }
}

/* Playing animation */
@keyframes noteFlash {
  0% { box-shadow: 0 0 0 3px #4ecdc4, 0 0 16px rgba(78, 205, 196, 0.6); }
  100% { box-shadow: none; }
}

/* ── Auth modal ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#auth-overlay.hidden { display: none; }

#auth-modal {
  background: #1e1e38;
  border: 1px solid #555;
  border-radius: 10px;
  padding: 24px;
  width: min(400px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#auth-modal h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
  margin: 0;
  text-align: center;
}

#auth-tabs {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #555;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: #2a2a3e;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: #3a3a5e;
  color: #eee;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#auth-submit-btn {
  width: 100%;
  border-color: #4ecdc4;
  color: #4ecdc4;
}

#auth-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}

#auth-status.auth-error { color: #ff6b6b; }
#auth-status.auth-success { color: #69db7c; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #666;
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #444;
}

.auth-oauth-btn {
  width: 100%;
  border-color: #748ffc !important;
  color: #748ffc !important;
}

/* Google Sign-In button (official branding) */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}

.google-signin-btn:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  background: #f8f9fa;
}

.google-signin-btn:active {
  background: #e8eaed;
}

.google-g-icon {
  flex-shrink: 0;
}

#auth-close-btn {
  width: 100%;
  margin-top: 4px;
}

#auth-btn {
  border-color: #69db7c;
  color: #69db7c;
}

#profile-btn {
  border-color: #b197fc;
  color: #b197fc;
}

#signout-btn {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* ── Profile panel (overlay) ── */
#profile-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}

#profile-panel.hidden { display: none; }

#profile-content {
  background: #1e1e38;
  border: 1px solid #555;
  border-radius: 10px;
  padding: 24px;
  width: min(600px, 95vw);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

#profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#profile-header h2 {
  font-weight: 400;
  color: #ffd700;
}

#profile-user-info {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 20px;
}

/* Avatar circles */
.avatar-circle {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-initials {
  background: #3a3a5e;
  color: #aaa;
  font-weight: 600;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  border: 2px solid #555;
}

.avatar-lg:hover {
  border-color: #7c6fff;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

#profile-stats, #profile-accuracy, #profile-history {
  margin-bottom: 20px;
}

#profile-stats h3, #profile-accuracy h3, #profile-history h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #ccc;
  margin-bottom: 10px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

#profile-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #2a2a4e;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #4ecdc4;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: #888;
  margin-top: 4px;
}

#profile-accuracy-table table,
#profile-history-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#profile-accuracy-table th,
#profile-accuracy-table td,
#profile-history-table th,
#profile-history-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #333;
  text-align: left;
}

#profile-accuracy-table th,
#profile-history-table th {
  color: #aaa;
  font-weight: 500;
}

.accuracy-bar {
  display: inline-block;
  height: 8px;
  border-radius: 4px;
  background: #4ecdc4;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Leaderboard (inline tab) ── */
#leaderboard-panel {
  width: 100%;
}

#leaderboard-content {
  background: #222240;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
}

#leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#leaderboard-header h2 {
  font-weight: 400;
  color: #ffc145;
}

#leaderboard-global-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

#leaderboard-top-players,
#leaderboard-chord-stats {
  margin-bottom: 20px;
}

#leaderboard-top-players h3,
#leaderboard-chord-stats h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #ccc;
  margin-bottom: 10px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

#leaderboard-players-table table,
#leaderboard-chords-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#leaderboard-players-table th,
#leaderboard-players-table td,
#leaderboard-chords-table th,
#leaderboard-chords-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #333;
  text-align: left;
}

#leaderboard-players-table th,
#leaderboard-chords-table th {
  color: #aaa;
  font-weight: 500;
}

.lb-rank { color: #ffc145; font-weight: 600; }
.lb-player-name {
  cursor: help;
  position: relative;
}
.lb-player-name[title]:hover {
  color: #a0c4ff;
}
.lb-coming-soon {
  text-align: center;
  color: #888;
  padding: 30px 0;
  font-size: 1rem;
}

/* ── Race mode (inline tab) ── */
#race-panel {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
}

#race-content {
  background: #222240;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 24px;
  width: min(550px, 100%);
}

#race-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#race-header h2 {
  font-weight: 400;
  color: #ff6b9d;
}

#race-auth-required {
  text-align: center;
  padding: 30px 0;
}

#race-auth-required p {
  color: #888;
  font-size: 1rem;
}

#race-join p {
  color: #aaa;
  margin-bottom: 16px;
  font-size: 0.9rem;
  text-align: center;
}

#race-join-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.race-join-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.race-code-input {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #555;
  border-radius: 6px;
  background: #2a2a4e;
  color: #eee;
  font-size: 1.1rem;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 3px;
  font-family: monospace;
}

.race-code-input:focus {
  outline: none;
  border-color: #ff6b9d;
}

#race-room-code {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #ff6b9d;
  letter-spacing: 8px;
  font-family: monospace;
  margin: 12px 0;
  padding: 12px;
  background: #2a2a4e;
  border-radius: 8px;
}

#race-lobby h3,
#race-results h3 {
  text-align: center;
  font-weight: 400;
  margin-bottom: 10px;
  color: #ccc;
}

#race-players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.race-player-tag {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

#race-start-btn {
  display: block;
  margin: 0 auto;
}

#race-lobby-status {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Race track */
#race-track {
  margin-bottom: 16px;
}

.race-lane {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #2a2a4e;
  border-radius: 6px;
}

.race-lane-name {
  font-size: 0.8rem;
  color: #ccc;
  min-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-lane-bar {
  flex: 1;
  height: 20px;
  background: #1a1a2e;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.race-lane-progress {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 8px;
}

.race-lane-progress-text {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #eee;
  font-weight: 600;
}

#race-chord-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}

#race-chord-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

#race-chord-info {
  text-align: center;
  font-size: 1rem;
  color: #a0c4ff;
}

#race-game-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

#race-game-feedback {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  text-align: center;
}

#race-game-feedback.correct {
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid #4ecdc4;
  color: #4ecdc4;
}

#race-game-feedback.incorrect {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
}

#race-results-table {
  margin-bottom: 16px;
}

#race-results-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#race-results-table th,
#race-results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #333;
  text-align: left;
}

#race-results-table th {
  color: #aaa;
  font-weight: 500;
}

.race-rank-1 { color: #ffd700; }
.race-rank-2 { color: #c0c0c0; }
.race-rank-3 { color: #cd7f32; }

tr.podium-1 { background: rgba(255, 215, 0, 0.08); }
tr.podium-1 td { color: #ffd700; font-weight: 600; }
tr.podium-2 { background: rgba(192, 192, 192, 0.06); }
tr.podium-2 td { color: #c0c0c0; }
tr.podium-3 { background: rgba(205, 127, 50, 0.06); }
tr.podium-3 td { color: #cd7f32; }

.race-stats-summary {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #aaa;
}

#race-back-btn {
  display: block;
  margin: 0 auto;
}

/* Player colors */
.race-color-0 { background: #ff6b6b; color: #111; }
.race-color-1 { background: #4ecdc4; color: #111; }
.race-color-2 { background: #ffc145; color: #111; }
.race-color-3 { background: #748ffc; color: #fff; }
.race-color-4 { background: #b197fc; color: #111; }
.race-color-5 { background: #69db7c; color: #111; }
.race-color-6 { background: #ff8e72; color: #111; }
.race-color-7 { background: #74c0fc; color: #111; }

/* ========== Tablet breakpoint (768px) ========== */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    gap: 8px;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .header-right {
    gap: 6px;
  }

  .header-right .control-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  #mode-tabs {
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mode-tab {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .vel-slider {
    width: 120px;
  }

  #game-info {
    flex-wrap: wrap;
    gap: 14px;
  }

  #game-mode-selector {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .control-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ========== Phone breakpoint (480px) ========== */
@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: center;
    padding: 8px;
    gap: 6px;
  }

  header h1 {
    font-size: 1.1rem;
    text-align: center;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .header-right .control-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-height: 38px;
  }

  #mode-tabs {
    padding: 0 8px;
  }

  .mode-tab {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  #tab-content {
    padding: 0 10px;
  }

  #play-controls {
    padding: 6px 10px;
  }

  #play-controls-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .play-ctrl-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.85rem;
    min-width: 60px;
  }

  .play-btn-primary {
    width: 100%;
    min-width: unset;
  }

  #loop-stop-btn:not(.hidden) {
    display: inline-flex !important;
    min-width: 60px;
  }

  .control-btn {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  /* Velocity sliders — larger on phone */
  .vel-slider {
    width: 120px;
    height: 28px;
  }

  .vel-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .vel-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  /* Game action buttons stack vertically */
  #game-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #game-actions .control-btn {
    width: 100%;
  }

  /* Auth modal full-width on phone */
  #auth-modal {
    width: 95vw;
    padding: 18px;
  }

  #profile-content {
    width: 95vw;
    padding: 16px;
  }

  #profile-panel {
    padding: 20px 8px;
  }

  /* Game setup stacks better */
  #game-setup {
    padding: 14px;
  }

  #game-mode-selector {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  /* Fretboard container tighter padding */
  #fretboard-container {
    padding: 0 8px 8px;
  }

  /* Tutorial card full phone width */
  #tutorial-card {
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
  }

  /* Feedback modal */
  #feedback-modal {
    padding: 16px;
    width: 95vw;
  }
}

/* ── Toast Notifications ── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 90vw;
}
.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-error {
  background: #3a1a1a;
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
}
.toast-info {
  background: #1a2a3a;
  border: 1px solid #4ecdc4;
  color: #4ecdc4;
}

/* ── Profile Loading & Empty State ── */
.profile-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
  font-size: 0.9rem;
  padding: 16px 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #555;
  border-top-color: #7c6fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.profile-empty-state {
  text-align: center;
  padding: 24px 0;
  color: #888;
}

.profile-empty-state p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

#profile-refresh-btn {
  font-size: 1.1rem;
  padding: 4px 8px;
}

/* ── Piano Keyboard ── */
#piano-panel {
  text-align: center;
  padding: 16px 0;
}

#piano-keyboard {
  display: flex;
  justify-content: center;
  position: relative;
  height: 160px;
  margin: 0 auto;
  max-width: 100%;
  overflow-x: auto;
}

.piano-key {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.08s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.piano-white {
  width: 36px;
  height: 150px;
  background: #f0f0f0;
  border: 1px solid #999;
  border-radius: 0 0 4px 4px;
  z-index: 1;
}

.piano-white:hover {
  background: #e0e0e0;
}

.piano-white.piano-active {
  background: #7c6fff !important;
}

.piano-black {
  width: 24px;
  height: 95px;
  background: #222;
  border: 1px solid #111;
  border-radius: 0 0 3px 3px;
  margin-left: -12px;
  margin-right: -12px;
  z-index: 2;
  align-items: flex-end;
}

.piano-black:hover {
  background: #444;
}

.piano-black.piano-active {
  background: #5a4fcf !important;
}

.piano-key-label {
  font-size: 0.65rem;
  color: #666;
  padding-bottom: 6px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .piano-white {
    width: 28px;
    height: 120px;
  }
  .piano-black {
    width: 18px;
    height: 75px;
    margin-left: -9px;
    margin-right: -9px;
  }
  #piano-keyboard {
    height: 130px;
  }
}
