/* ── Think-Chords - Premium Dark Theme ───────────────── */

:root {
    --bg-primary: #08080d;
    --bg-secondary: #0e0e16;
    --bg-card: rgba(22, 22, 38, 0.6);
    --bg-card-solid: #161626;
    --bg-card-hover: rgba(30, 30, 55, 0.8);
    --bg-glass: rgba(18, 18, 32, 0.75);
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(139, 92, 246, 0.35);
    --border-accent: rgba(139, 92, 246, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #9d9db5;
    --text-muted: #5e5e7a;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.12);
    --accent-glow-strong: rgba(139, 92, 246, 0.25);
    --pink: #f472b6;
    --pink-glow: rgba(244, 114, 182, 0.15);
    --green: #34d399;
    --cyan: #22d3ee;
    --orange: #fb923c;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.08);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ──────────────────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

.sidebar-header {
    padding: 4px 20px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.sidebar-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-light), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    padding: 0 10px;
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 14px 14px 6px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow-strong);
    color: var(--accent-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg { opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.stats-row {
    display: flex;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.stats-row span {
    color: var(--accent-light);
    font-weight: 700;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    padding-bottom: 0;
}

/* ── Top Bar ─────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 8, 13, 0.8);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-xs);
}

.menu-toggle svg { width: 22px; height: 22px; }

.search-wrapper {
    flex: 1;
    max-width: 560px;
    position: relative;
}

.search-wrapper > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 80px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow);
    background: var(--bg-card-hover);
}

.search-input::placeholder { color: var(--text-muted); }

.search-kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-family: inherit;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    line-height: 1;
}

.search-input:focus + .search-kbd { opacity: 0; }

.topbar-actions { display: flex; gap: 8px; }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--accent-glow-strong);
    color: var(--accent-light);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.btn-icon svg { width: 17px; height: 17px; }

/* ── Content Area ────────────────────────────────────── */

.content-area {
    padding: 24px;
    max-width: 1100px;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

/* ── Home Page ───────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 48px 20px 36px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 50%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 2px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-link {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all var(--transition);
}

.section-link:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

/* ── Card Grid ───────────────────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 36px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--pink));
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.card:hover::before { opacity: 1; }

.card:active { transform: translateY(-1px); }

.card-song {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.card-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-artist svg {
    width: 13px;
    height: 13px;
    color: var(--accent);
    opacity: 0.7;
}

/* ── Artist Chips ────────────────────────────────────── */

.artist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}

.artist-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.artist-chip:hover {
    background: var(--accent-glow-strong);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.artist-chip .count {
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 7px;
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--accent-light);
    font-weight: 700;
}

/* ── Search Results ──────────────────────────────────── */

.results-header {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.result-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.result-item:active { background: var(--bg-card-hover); }

.result-num {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 24px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 600;
}

.result-info { flex: 1; min-width: 0; }

.result-song {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-artist {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.result-action {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition);
}

.result-item:hover .result-action { opacity: 1; }

.result-action svg { width: 16px; height: 16px; }

/* ── Chord Detail ────────────────────────────────────── */

.chord-detail { max-width: 800px; }

.chord-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.chord-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.chord-artist-name {
    font-size: 0.95rem;
    color: var(--accent-light);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.chord-artist-name:hover {
    color: var(--pink);
    text-decoration: underline;
}

.chord-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-fav.is-favorite {
    color: var(--pink);
    border-color: rgba(244, 114, 182, 0.3);
    background: var(--pink-glow);
}

.btn-fav.is-favorite svg { fill: var(--pink); }

.chord-image-wrapper {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.chord-image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 32px;
    transition: all var(--transition);
}

.source-link:hover {
    background: var(--accent-glow-strong);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.source-link svg { width: 15px; height: 15px; }

.related-section { margin-top: 36px; }

/* ── History / Favorites List ────────────────────────── */

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

.list-page-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
}

.list-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.list-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.list-table tr {
    cursor: pointer;
    transition: background var(--transition);
}

.list-table tbody tr:hover { background: var(--bg-card); }
.list-table tbody tr:active { background: var(--bg-card-hover); }
.list-table .song-col { font-weight: 600; }
.list-table .artist-col { color: var(--text-secondary); }

.list-table .time-col {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* ── Pagination ──────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    padding: 16px 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.page-btn:hover {
    background: var(--accent-glow-strong);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

.page-dots {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0 2px;
    user-select: none;
}

/* ── Random Page ─────────────────────────────────────── */

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

.random-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.random-header h2 svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

/* ── Artists Page ─────────────────────────────────────── */

.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.artist-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.artist-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.artist-card:active { transform: translateY(0); }

.artist-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.artist-info { min-width: 0; flex: 1; }

.artist-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.artist-info p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Back Button ─────────────────────────────────────── */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 16px;
    text-decoration: none;
    transition: all var(--transition);
    background: none;
    border: none;
    padding: 4px 8px 4px 0;
    border-radius: var(--radius-xs);
}

.back-btn:hover { color: var(--accent-light); }
.back-btn svg { width: 16px; height: 16px; }

/* ── Empty State ─────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p { font-size: 0.92rem; }

/* ── Loading / Spinner ───────────────────────────────── */

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Overlay ─────────────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 90;
}

.sidebar-overlay.active { display: block; }

/* ── Mobile Bottom Nav ───────────────────────────────── */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(14, 14, 22, 0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid var(--border);
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    min-width: 52px;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-item.active {
    color: var(--accent-light);
}

.mobile-nav-item:active {
    transform: scale(0.92);
}

/* ── Transitions ─────────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ── Guitar Tuner ───────────────────────────────────── */

.tuner-page {
    max-width: 520px;
    margin: 0 auto;
}

.tuner-header {
    text-align: center;
    padding: 20px 0 8px;
}

.tuner-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tuner-header h2 svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.tuner-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 6px;
}

.tuner-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* ── Note Ring Display ── */

.tuner-display {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.tuner-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tuner-ring.listening {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(139,92,246,0.12);
}

.tuner-ring.in-tune {
    border-color: var(--green);
    box-shadow: 0 0 40px rgba(52,211,153,0.2);
}

.tuner-ring.close {
    border-color: var(--orange);
    box-shadow: 0 0 30px rgba(251,146,60,0.15);
}

.tuner-ring.off {
    border-color: var(--pink);
    box-shadow: 0 0 30px rgba(244,114,182,0.15);
}

.tuner-ring-glow {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    transition: box-shadow 0.3s ease;
}

.tuner-ring-glow.in-tune {
    box-shadow: 0 0 60px rgba(52,211,153,0.25), inset 0 0 30px rgba(52,211,153,0.05);
}

.tuner-ring-glow.close {
    box-shadow: 0 0 40px rgba(251,146,60,0.15);
}

.tuner-ring-glow.off {
    box-shadow: 0 0 40px rgba(244,114,182,0.12);
}

.tuner-ring-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    pointer-events: none;
}

.tuner-ring-pulse.active {
    border-color: rgba(139,92,246,0.15);
    animation: tunerPulse 2s ease-out infinite;
}

.tuner-ring.in-tune ~ .tuner-ring-pulse.active,
.tuner-ring.in-tune .tuner-ring-pulse.active {
    border-color: rgba(52,211,153,0.2);
}

@keyframes tunerPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.tuner-ring-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 1;
}

.tuner-note {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.tuner-ring.listening .tuner-note { color: var(--accent-light); }
.tuner-ring.in-tune .tuner-note { color: var(--green); text-shadow: 0 0 24px rgba(52,211,153,0.4); }
.tuner-ring.close .tuner-note { color: var(--orange); }
.tuner-ring.off .tuner-note { color: var(--pink); }

.tuner-octave {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: -2px;
    transition: color 0.2s ease;
}

.tuner-ring.listening .tuner-octave { color: var(--text-secondary); }

.tuner-hz {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* ── Cents Gauge ── */

.tuner-gauge {
    width: 100%;
    max-width: 420px;
    padding: 0 8px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 0 4px;
}

.gauge-label-flat,
.gauge-label-sharp {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.gauge-track {
    position: relative;
    height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
}

.gauge-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gauge-tick {
    position: absolute;
    top: 50%;
    width: 1px;
    height: 10px;
    background: var(--border);
    transform: translate(-50%, -50%);
}

.gauge-tick-center {
    height: 100%;
    width: 2px;
    background: rgba(255,255,255,0.12);
}

.gauge-center-zone {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: calc(50% - 5%);
    width: 10%;
    background: rgba(52,211,153,0.08);
    border-radius: 50px;
}

.gauge-needle {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 50%;
    width: 4px;
    margin-left: -2px;
    background: var(--accent);
    border-radius: 4px;
    transition: left 0.08s ease-out, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 8px rgba(139,92,246,0.5);
    z-index: 2;
}

.gauge-needle.in-tune {
    background: var(--green);
    box-shadow: 0 0 12px rgba(52,211,153,0.6);
    width: 6px;
    margin-left: -3px;
}

.gauge-needle.close {
    background: var(--orange);
    box-shadow: 0 0 10px rgba(251,146,60,0.5);
}

.gauge-needle.off {
    background: var(--pink);
    box-shadow: 0 0 10px rgba(244,114,182,0.5);
}

.gauge-cents {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 2px;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
}

.gauge-cents-zero { color: var(--green); }

/* ── Hint ── */

.tuner-hint {
    text-align: center;
    min-height: 24px;
}

.tuner-hint span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

/* ── String Chips ── */

.tuner-strings-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.string-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 58px;
    transition: all 0.2s ease;
}

.string-chip.active {
    border-color: var(--accent);
    background: var(--accent-glow-strong);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(139,92,246,0.2);
}

.string-chip.in-tune {
    border-color: var(--green);
    background: rgba(52,211,153,0.1);
    box-shadow: 0 4px 16px rgba(52,211,153,0.15);
}

.chip-note {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.string-chip.active .chip-note { color: var(--accent-light); }
.string-chip.in-tune .chip-note { color: var(--green); }

.chip-freq {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Start/Stop Button ── */

.tuner-controls {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.tuner-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}

.tuner-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(139,92,246,0.4);
}

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

.tuner-btn.active {
    background: rgba(244,114,182,0.12);
    border-color: var(--pink);
    color: var(--pink);
    box-shadow: 0 4px 20px rgba(244,114,182,0.15);
}

.tuner-btn.active:hover {
    background: rgba(244,114,182,0.2);
    box-shadow: 0 6px 28px rgba(244,114,182,0.2);
}

.tuner-btn svg { width: 18px; height: 18px; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding-bottom: 72px; }
    .mobile-nav { display: flex; }
    .menu-toggle { display: block; }
    .search-kbd { display: none; }

    .search-input { padding-right: 16px; }

    .content-area { padding: 16px 14px; }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card { padding: 14px 12px; }
    .card-song { font-size: 0.85rem; }
    .card-artist { font-size: 0.75rem; }

    .hero { padding: 28px 12px 20px; }
    .hero h2 { font-size: 1.6rem; }
    .hero p { font-size: 0.9rem; }

    .chord-header { flex-direction: column; gap: 12px; }
    .chord-actions { width: 100%; }
    .chord-actions .btn { flex: 1; justify-content: center; }

    .artists-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .artist-card { padding: 10px 12px; }
    .artist-avatar { width: 34px; height: 34px; font-size: 0.85rem; }
    .artist-info h3 { font-size: 0.8rem; }

    .topbar { padding: 8px 12px; }

    .list-table th,
    .list-table td { padding: 10px 8px; font-size: 0.82rem; }

    .list-table .time-col { display: none; }

    .result-action { opacity: 1; }

    .random-header { flex-direction: column; gap: 10px; align-items: flex-start; }

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

    .artist-chips { gap: 6px; }
    .artist-chip { padding: 6px 12px; font-size: 0.78rem; }

    .pagination { gap: 4px; margin-top: 20px; }
    .page-btn { min-width: 34px; height: 34px; font-size: 0.8rem; }

    .tuner-ring { width: 130px; height: 130px; }
    .tuner-note { font-size: 2.4rem; }
    .tuner-octave { font-size: 0.95rem; }
    .tuner-strings-row { gap: 6px; }
    .string-chip { padding: 8px 10px; min-width: 48px; }
    .chip-note { font-size: 0.82rem; }
    .tuner-btn { padding: 12px 26px; font-size: 0.85rem; }
}

@media (max-width: 380px) {
    .card-grid { grid-template-columns: 1fr; }
    .artists-grid { grid-template-columns: 1fr; }
}
