/* ─── Gig Request App — Stevenson Brooks ─── */
:root {
    --bg: #0f0f1a;
    --card: #1a1a2e;
    --card-border: #2d2d4a;
    --accent: #cf992c;
    --accent-glow: rgba(207, 153, 44, 0.3);
    --accent-soft: rgba(207, 153, 44, 0.1);
    --pink: #e84393;
    --pink-glow: rgba(232, 67, 147, 0.3);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.3);
    --text: #f0f0f5;
    --muted: #8888aa;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --played: rgba(46, 204, 113, 0.12);
    --queued: rgba(139, 92, 246, 0.12);
    --playing: rgba(207, 153, 44, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Header ─── */
.header {
    text-align: center;
    padding: 24px 0 16px;
}
.header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.header p, .show-info {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 4px;
}
.live-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

/* ─── Now Playing ─── */
.now-playing {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    text-align: center;
    animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 0 8px var(--purple-glow); }
    to { box-shadow: 0 0 20px var(--pink-glow); }
}
.now-playing-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 6px;
}
.now-playing-title {
    font-size: 1.15rem;
    font-weight: 700;
}
.now-playing-artist {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 2px;
}

/* ─── Not Live ─── */
.not-live-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    margin-top: 20px;
}
.not-live-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.not-live-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.not-live-card p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.btn-refresh {
    background: var(--card-border);
    color: var(--text);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
}
.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: var(--muted);
}
.tab.active {
    background: var(--accent);
    color: #000;
}

/* ─── Search ─── */
.search-bar {
    margin-bottom: 10px;
}
.search-bar input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus {
    border-color: var(--accent);
}
.search-bar input::placeholder { color: var(--muted); }

/* ─── Filter Chips ─── */
.filter-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ─── Song Count ─── */
.song-count {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 10px;
}

/* ─── Song List ─── */
.song-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 40px;
}
.song-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.song-card:active {
    transform: scale(0.98);
}
.song-card:hover {
    border-color: var(--accent);
}
.song-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1px;
    line-height: 1.3;
}
.song-info p {
    font-size: 0.78rem;
    color: var(--muted);
}
.request-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Request Modal ─── */
.modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 520px;
    padding: 24px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.modal-overlay.open .modal {
    transform: translateY(0);
}
.modal h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.modal .song-subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.modal input,
.modal textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s;
}
.modal input:focus,
.modal textarea:focus {
    border-color: var(--accent);
}
.modal textarea { resize: none; height: 70px; }
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.btn-submit {
    flex: 1;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-cancel {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--card-border);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

/* ─── Request Feed ─── */
.request-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 40px;
}
.request-item {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.request-item.played {
    background: var(--played);
    border-color: rgba(46, 204, 113, 0.3);
}
.request-item.queued {
    background: var(--queued);
    border-color: rgba(139, 92, 246, 0.3);
}
.request-item.playing {
    background: var(--playing);
    border-color: var(--accent);
    animation: glow 2s ease-in-out infinite alternate;
}
.request-item.skipped { opacity: 0.4; }
.request-item .song-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.request-item .meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}
.request-item .fan-message {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--muted);
    margin-top: 5px;
    padding-left: 8px;
    border-left: 2px solid var(--card-border);
}

/* ─── Status Badges ─── */
.status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}
.status-badge.played { background: var(--success); color: #000; }
.status-badge.queued { background: var(--purple); color: #fff; }
.status-badge.playing { background: var(--accent); color: #000; }
.status-badge.skipped { background: #555; color: #ccc; }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--success);
    color: #000;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 200;
    transition: transform 0.3s ease-out;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════
   ADMIN STYLES
   ══════════════════════════════════════════════════════════ */

/* ─── Admin Nav ─── */
.admin-nav {
    display: flex;
    gap: 4px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav .tab { flex: 0 0 auto; padding: 10px 14px; font-size: 0.8rem; }

/* ─── Show Control ─── */
.show-control {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.show-control h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.show-stats {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}
.stat-box {
    flex: 1;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}
.stat-box .num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
}
.stat-box .label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Admin Buttons ─── */
.btn-start {
    width: 100%;
    background: var(--success);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-end {
    width: 100%;
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-add {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.btn-small {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-play { background: var(--success); color: #000; }
.btn-queue { background: var(--purple); color: #fff; }
.btn-skip { background: #555; color: #ccc; }
.btn-now { background: var(--accent); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-toggle { background: var(--card-border); color: var(--text); }
.btn-toggle.active { background: var(--accent); color: #000; }

/* ─── Admin Song Card ─── */
.admin-song-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 6px;
}
.admin-song-card.hidden-song { opacity: 0.45; }
.admin-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* ─── Admin Request Card ─── */
.admin-request-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
}
.admin-request-card .request-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

/* ─── Admin Header Row ─── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.admin-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

/* ─── Admin Now Playing Bar ─── */
.admin-np {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-np .np-info {
    flex: 1;
}
.admin-np .np-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}
.admin-np .np-song {
    font-size: 0.95rem;
    font-weight: 700;
}
.admin-np .np-artist {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ─── Admin Form ─── */
.admin-form {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    margin-bottom: 8px;
    outline: none;
}
.admin-form input:focus, .admin-form select:focus {
    border-color: var(--accent);
}
.admin-form label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}

/* ─── Section Divider ─── */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 8px;
}

/* ─── Login ─── */
.login-box {
    max-width: 320px;
    margin: 80px auto;
    text-align: center;
}
.login-box input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text);
    font-size: 0.9rem;
    margin: 16px 0;
    outline: none;
}
.login-box button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

/* ═══ Lyrics Viewer ═══ */
.lyrics-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: #0a0a14;
    color: var(--text);
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.lyrics-title {
    font-size: 1rem;
    font-weight: 700;
}
.lyrics-artist {
    font-size: 0.8rem;
    color: var(--muted);
}
.lyrics-capo {
    background: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.lyrics-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.35;
    -webkit-overflow-scrolling: touch;
}
.lyrics-chords {
    color: var(--accent);
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: 0.5px;
    white-space: pre;
}
.lyrics-line {
    color: var(--text);
    white-space: pre-wrap;
    font-weight: 600;          /* heavier than body default — print-like, easy to read while playing */
}
.lyrics-blank {
    height: 10px;
}
.lyrics-section {
    color: var(--pink);
    font-weight: 700;
    font-style: italic;
    margin-top: 10px;
    margin-bottom: 2px;
    font-family: var(--font);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── Tablature ─── */
.lyrics-tab {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    overflow-x: auto;
}
.lyrics-tab-line {
    color: #a78bfa;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.2;
    white-space: pre;
}

/* ─── Beat Emphasis ─── */
.lyrics-beat {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
}

/* iPad landscape optimization — fit on one screen */
@media (min-width: 768px) {
    .lyrics-body {
        font-size: 15px;
        padding: 20px 32px;
        line-height: 1.4;
    }
}
@media (min-width: 1024px) {
    .lyrics-body {
        font-size: 16px;
        padding: 24px 48px;
        columns: 2;
        column-gap: 48px;
    }
}

/* ═══════════════════════════════════════════════════════
   PERFORMANCE LAYOUT (Admin Dashboard v2)
   ═══════════════════════════════════════════════════════ */

/* ─── Top Bar ─── */
.perf-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    padding: 8px 16px;
    gap: 12px;
    flex-wrap: wrap;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.topbar-center { flex: 0 0 auto; }
.topbar-right { display: flex; gap: 4px; flex-shrink: 0; }
.topbar-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}
.topbar-venue {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}
.topbar-stats {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}
.show-timer {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.live-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 6px transparent; }
}
.btn-icon {
    background: var(--card-border);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.btn-icon:hover { background: var(--accent); }

/* Now Playing compact */
.np-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    padding: 6px 14px;
    border-radius: var(--radius-sm);
}
.np-label-sm {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.8;
}
.np-song-sm { font-size: 0.85rem; font-weight: 700; }
.np-artist-sm { font-size: 0.75rem; opacity: 0.85; }

/* ─── Performance Two-Panel Layout ─── */
.perf-layout {
    display: flex;
    height: calc(100vh - 53px); /* below top bar */
    overflow: hidden;
}

/* Library (left panel) */
.perf-library {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}
.lib-search-row {
    padding: 8px 12px;
    flex-shrink: 0;
}
.lib-search-row input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
}
.lib-search-row input:focus { border-color: var(--accent); }
.lib-search-row input::placeholder { color: var(--muted); }

.lib-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 36px 40px 12px;
    -webkit-overflow-scrolling: touch;
}

/* A-Z Jump Bar — fills full height, auto-sizes letters */
.az-bar {
    position: absolute;
    right: 0;
    top: 52px;
    bottom: 0;
    width: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    padding: 6px 0;
    background: rgba(15, 15, 26, 0.85);
    border-left: 1px solid var(--card-border);
}
.az-bar span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--muted);
}
.az-bar span.az-active {
    color: var(--accent);
}
.az-bar span.az-dim {
    color: rgba(255,255,255,0.12);
}

/* Letter groups */
.letter-group { margin-bottom: 4px; }
.letter-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: var(--bg);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 6px 4px 4px;
    z-index: 5;
    border-bottom: 1px solid var(--card-border);
}

/* Library song item — single line: Artist — Title */
.lib-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.lib-item > * + * { margin-left: 6px; }
.lib-item:active { background: rgba(207, 153, 44, 0.08); }
.lib-item-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    line-height: 1.4;
}
.lib-artist {
    font-weight: 600;
    color: var(--text);
}
.lib-sep {
    color: var(--muted);
    margin: 0 4px;
}
.lib-title {
    color: var(--muted);
}
.lib-capo {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
}
.lib-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Small inline buttons */
.btn-sm {
    padding: 4px 8px;
    border-radius: 5px;
    border: none;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    line-height: 1;
}
.btn-sm.btn-q { background: var(--purple); color: #fff; }
.btn-sm.btn-p { background: var(--success); color: #000; }
.btn-sm.btn-l { background: var(--card-border); color: var(--text); }
.btn-sm.btn-x { background: #444; color: #999; }
.btn-sm:active { transform: scale(0.92); }

/* Cancel / Done button in lyrics overlay */
.btn-cancel-play {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
    text-align: center;
}
.btn-cancel-play.in-cancel {
    background: var(--warning);
    color: #000;
    animation: cancel-pulse 1.5s ease-in-out infinite;
}
.btn-cancel-play.is-done {
    background: var(--success);
    color: #000;
}
@keyframes cancel-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.1); }
}

/* ─── Sidebar (Queue + Activity) ─── */
.perf-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.sidebar-section:first-child {
    flex: 1;
}
.sidebar-section:last-child {
    flex: 0 0 auto;
    max-height: 40%;
    border-top: 1px solid var(--card-border);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    color: var(--text);
    background: var(--bg);
    flex-shrink: 0;
}
.sidebar-header:active { background: rgba(255,255,255,0.03); }
.badge {
    background: var(--purple);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
}
.chevron {
    font-size: 0.8rem;
    color: var(--muted);
    transition: transform 0.2s;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Queue items */
.queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.queue-item.is-request {
    border-left: 3px solid var(--pink);
}
.queue-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.queue-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.queue-song {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-meta {
    font-size: 0.68rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

/* Activity items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.activity-icon { font-size: 0.8rem; flex-shrink: 0; }
.activity-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { color: var(--muted); font-size: 0.65rem; flex-shrink: 0; }

.empty-state-sm {
    padding: 20px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
}

/* ─── Lyrics Ticker (bottom of lyrics overlay) ─── */
.lyrics-main {
    flex: 1;
    overflow: hidden;
    display: flex;
}
.lyrics-main .lyrics-body {
    flex: 1;
}
.lyrics-ticker {
    padding: 8px 16px;
    background: var(--card);
    border-top: 1px solid var(--card-border);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    flex-shrink: 0;
    min-height: 32px;
    transition: color 0.3s, background 0.3s;
}
.lyrics-ticker.ticker-flash {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ─── Fullscreen Overlays (Setlist, Settings) ─── */
.fullscreen-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--bg);
    z-index: 250;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.overlay-header h2 {
    font-size: 1rem;
    font-weight: 700;
}
.overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

/* Setlist items */
.setlist-list { max-width: 600px; margin: 0 auto; }
.setlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border);
}
.setlist-num {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.setlist-info { flex: 1; min-width: 0; }
.setlist-song { font-size: 0.85rem; font-weight: 600; }
.setlist-meta { font-size: 0.72rem; color: var(--muted); }
.setlist-time { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }

/* ─── Setup Bar (pre-show) ─── */
.setup-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a3a, #1e1e40);
    border-bottom: 2px solid var(--accent);
    padding: 8px 16px;
    flex-wrap: wrap;
}
.setup-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.setup-bar-left > * + * { margin-left: 10px; }
.setup-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
    white-space: nowrap;
}
.setup-input {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    outline: none;
    width: 160px;
    max-width: 30vw;
}
.setup-input:focus { border-color: var(--accent); }
.setup-input::placeholder { color: var(--muted); }
.setup-select {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    outline: none;
    max-width: 30vw;
}
.setup-select:focus { border-color: var(--accent); }
.btn-go-live {
    background: var(--success);
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 10px;
    animation: go-live-pulse 2s ease-in-out infinite;
}
.btn-go-live:active { transform: scale(0.96); }
@keyframes go-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.1); }
}

@media (max-width: 768px) {
    .setup-bar { padding: 6px 10px; }
    .setup-input { width: 120px; }
    .btn-go-live { padding: 6px 14px; font-size: 0.78rem; }
}

/* ─── Mobile / Portrait Responsive ─── */
@media (max-width: 768px) {
    .perf-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 53px);
    }
    .perf-library {
        height: 55vh;
        min-height: 300px;
    }
    .perf-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--card-border);
        flex: 1;
    }
    .perf-topbar {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .az-bar span {
        font-size: 0.5rem;
        padding: 1px 0;
    }
}

/* ─── Flexbox gap fallback for Safari < 14.1 ─── */
/* Safari 12 ignores flexbox gap, so we use margin on children */
.tabs > * + *,
.admin-nav > * + *,
.filter-row > * + * { margin-left: 4px; }
.modal-actions > * + * { margin-left: 10px; }
.show-stats > * + * { margin-left: 12px; }
.admin-actions > * + *,
.admin-request-card .request-actions > * + * { margin-left: 5px; }
.perf-topbar > * + * { margin-left: 12px; }
.topbar-left > * + * { margin-left: 8px; }
.topbar-right > * + * { margin-left: 4px; }
.lib-item-actions > * + * { margin-left: 4px; }
.queue-item > * + * { margin-left: 8px; }
.queue-actions > * + * { margin-left: 3px; }
.activity-item > * + * { margin-left: 8px; }
.setlist-item > * + * { margin-left: 12px; }
.recent-show-item > * + * { margin-left: 8px; }
.song-list > * + * { margin-top: 6px; }
.request-feed > * + * { margin-top: 6px; }

/* ─── Flex helpers (Safari 12 compatible) ─── */
.flex-row-6 { display: flex; align-items: center; }
.flex-row-6 > * + * { margin-left: 6px; }
.flex-row-8 { display: flex; align-items: center; }
.flex-row-8 > * + * { margin-left: 8px; }

/* ─── Utility ─── */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm > * + * { margin-left: 8px; }
.mt-sm { margin-top: 8px; }
.mb-sm { margin-bottom: 8px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.8rem; }

/* ═══ LyricsKit: dual-format renderer (SBL + ChordPro) ═══════════
   See SBL-FORMAT.md. Reuses .lyrics-chords/.lyrics-line/.lyrics-section
   /.lyrics-tab/.lyrics-beat above; the rules below add inline-anchored
   chords (ChordPro), annotations, separators, section variants, section
   depth, and the transpose / chords-off header controls. */

/* Section depth from indentation (replaces old raw-space indent). */
.lyrics-d1 { padding-left: 1.6em; }
.lyrics-d2 { padding-left: 3.2em; }

/* Inline chord anchored above its syllable (ChordPro-style songs). */
.lyrics-line { white-space: pre-wrap; }
.lyrics-anchored {
    display: inline-flex;
    flex-direction: column;
    vertical-align: bottom;
    line-height: 1.05;
}
.lyrics-anchored .lyrics-chord {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.82em;
    letter-spacing: 0.5px;
}
.lyrics-anchored-t { white-space: pre; }

/* Chord token inside a SBL chord line. */
.lyrics-chords .lyrics-chord { color: var(--accent); font-weight: 700; }
.lyrics-sep { color: var(--muted); }                 /* / | (new musical line) */
.lyrics-rep { color: var(--pink); font-weight: 700; } /* x2 x3 ... */
.lyrics-grp { color: var(--accent); }                /* (Esus4 E) */
.lyrics-anno {                                       /* ***, riff, N.C. ... */
    color: var(--muted);
    font-style: italic;
    font-size: 0.85em;
}
.lyrics-comment {
    color: var(--muted);
    font-style: italic;
    font-size: 0.85em;
    margin: 4px 0;
}

/* Section colour by normalized variant. */
.lyrics-section--chorus   { color: var(--accent); }
.lyrics-section--verse    { color: var(--pink); }
.lyrics-section--bridge   { color: #a78bfa; }
.lyrics-section--prechorus,
.lyrics-section--interlude { color: #f0a868; }
.lyrics-section--intro,
.lyrics-section--outro,
.lyrics-section--tag,
.lyrics-section--solo     { color: var(--muted); }

/* ─── Header controls: transpose + chords toggle ─── */
.lyrics-xpose {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.xpose-btn {
    min-width: 28px;
    padding: 4px 8px;
    background: var(--card-border);
    color: var(--text);
    font-weight: 700;
}
.xpose-key {
    min-width: 64px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
}
#btn-chords-toggle {
    background: var(--card-border);
    color: var(--muted);
}
#btn-chords-toggle.active {
    background: var(--accent);
    color: #000;
}

/* ─── Admin: song visibility flags ─── */
.song-flag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}
.flag-hidden   { background: #6b7280; color: #fff; }
.flag-noreq    { background: #f0a868; color: #000; }
.flag-archived { background: #b91c1c; color: #fff; }
.admin-song-card.archived-song { opacity: 0.55; }

/* ─── Fan app: not-requestable song card ─── */
.song-card.not-requestable { opacity: 0.7; }
.song-card .unavailable-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255,255,255,0.06);
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ─── Fan read-along lyrics overlay (chords never rendered here) ─── */
.fan-lyrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.fan-lyrics-meta { flex: 1; min-width: 0; }
.fan-lyrics-title { font-size: 1.05rem; font-weight: 800; }
.fan-lyrics-artist { font-size: 0.8rem; color: var(--muted); }
.fl-theme {
    background: var(--card-border);
    color: var(--text);
    border: none;
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}
.fl-close {
    background: var(--card-border);
    color: var(--text);
    border: none;
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}
.fan-lyrics-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px 28px;
    font-size: 1.05rem;
    line-height: 1.5;
    white-space: pre-wrap;
    -webkit-overflow-scrolling: touch;
}
.fan-lyrics-body .lyrics-section { margin-top: 16px; }
.fan-lyrics-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--card-border);
    flex-shrink: 0;
}
.fan-lyrics-foot .btn-submit { width: 100%; }
/* Light reading mode — black-on-white, scoped to the lyrics overlay only.
   Redefining the theme vars here re-skins every descendant automatically. */
.lyrics-overlay.light {
    --text: #000000;
    --muted: #555566;
    --card: #f4f4f6;
    --card-border: #dcdce4;
    background: #ffffff;
}
/* Section labels: darker, saturated hues that hold contrast on white
   while keeping each section's color identity. */
.lyrics-overlay.light .lyrics-section--chorus     { color: #9a6b00; }
.lyrics-overlay.light .lyrics-section--verse      { color: #c2185b; }
.lyrics-overlay.light .lyrics-section--bridge     { color: #6d28d9; }
.lyrics-overlay.light .lyrics-section--prechorus,
.lyrics-overlay.light .lyrics-section--interlude  { color: #b4530a; }
/* Chords: gold reads weak on white — use a strong blue that pops and stays
   distinct from the section-label hues. Covers chord lines + anchored chords
   and their inner spans (whose dark-theme rule sets var(--accent) directly). */
.lyrics-overlay.light .lyrics-chords,
.lyrics-overlay.light .lyrics-chords .lyrics-chord,
.lyrics-overlay.light .lyrics-anchored .lyrics-chord { color: #1d4ed8; }
@media (min-width: 768px) {
    .fan-lyrics-body { font-size: 1.15rem; padding: 28px 15%; }
}

/* ─── Admin in-place lyrics editor ("code mode" + live preview) ─── */
.lyrics-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
.lye-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.lye-capo {
    font-size: 0.75rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lye-capo input {
    width: 64px;
    padding: 4px 8px;
    background: #0a0a14;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
}
.lye-hint {
    font-size: 0.7rem;
    color: var(--muted);
}
.lye-hint code {
    background: rgba(255,255,255,0.08);
    padding: 0 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}
.lye-spacer { flex: 1; }
.lye-split {
    flex: 1;
    display: flex;
    min-height: 0;
}
#lyrics-src {
    flex: 1;
    width: 50%;
    resize: none;
    border: none;
    border-right: 1px solid var(--card-border);
    background: #0a0a14;
    color: #e8e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.45;
    padding: 16px 18px;
    outline: none;
    -webkit-overflow-scrolling: touch;
}
.lye-preview {
    flex: 1;
    width: 50%;
    overflow-y: auto;
}
@media (max-width: 760px) {
    .lye-split { flex-direction: column; }
    #lyrics-src, .lye-preview { width: 100%; }
    #lyrics-src { border-right: none; border-bottom: 1px solid var(--card-border); }
}

/* ─── Tipping (fan modal + badges across fan + admin) ─── */
.tip-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--card-border);
}
.tip-label { font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; }
.tip-sub { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.tip-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tip-chip {
    flex: 1 1 auto;
    min-width: 56px;
    padding: 8px 10px;
    background: var(--card-border);
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.tip-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
#tip-custom {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #0a0a14;
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.9rem;
}
.tip-methods {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.tip-method {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 6px 0;
}
.tip-venmo-note {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
}

/* Tip badges in queue + request feeds */
.tip-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
}
.tip-paid    { background: #16a34a; color: #fff; }
.tip-venmo   { background: #3d95ce; color: #fff; }
.tip-pending { background: var(--card-border); color: var(--muted); }

.queue-item.is-tipped { border-left: 3px solid #16a34a; }
.request-item.tipped  { border-left: 3px solid #16a34a; }
