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

:root {
    /* SingsClubKaraoke2-inspired theme */
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --dark-bg: #0a0015;
    --darker-bg: #050008;
    --card-bg: transparent;
    --border-color: rgba(139, 92, 246, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #c9cbe2;
    --text-light: #aeb1c6;
    --accent: #8b5cf6;
    --accent-light: rgba(139, 92, 246, 0.2);
    --border: rgba(139, 92, 246, 0.25);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;
    --shadow-strong: 0 30px 80px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 16px 40px rgba(7, 4, 14, 0.6);

    /* Input readability defaults */
    --input-background: #ffffff;
    --input-text: #111111;
    --input-placeholder: #666666;
    --button-text-on-primary: #ffffff;
    --button-text-on-secondary: #ffffff;
    --button-text-on-record: #ffffff;

    /* Keep existing tokens mapped to new palette */
    --primary-gradient-start: var(--primary-purple);
    --primary-gradient-end: var(--primary-pink);
    --primary-button: var(--primary-purple);
    --primary-button-rgb: 139, 92, 246;
    --primary-button-hover: #a78bfa;
    --secondary-button: var(--primary-pink);
    --secondary-button-hover: #f472b6;
    --record-button: #ef4444;
    --record-button-hover: #dc2626;
    --background: var(--dark-bg);
    --card-background: transparent;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(139, 92, 246, 0.2);
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    height: 100vh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Text visibility upgrades (global) */
body,
button {
    color: var(--text-primary);
}

input,
select,
textarea {
    color: var(--input-text);
}

label,
.menu-item-label,
.meter-label,
.slider-label,
.performance-mode-label,
.thumbnail-picker-label,
.color-input-group label,
.setting-row label,
.settings-modal .setting-row label,
.metadata-field label,
.device-group label,
.visibility-toggle label,
.merge-input label,
.sync-slider-container label,
.form-group label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.01em;
}

.placeholder,
.recording-meta,
.menu-item-status,
.device-settings-prompt,
.status-message,
.modal-subtitle,
.track-history-meta {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.loading-text {
    margin-top: 20px;
    color: var(--text-secondary);
}

.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: var(--background);
    opacity: 1;
}

.is-hidden {
    display: none;
}

.app-toast-container {
    position: fixed;
    bottom: 52px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 24px));
    z-index: 120000;
    pointer-events: none;
}

.toast-history-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 119990;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--glass) 85%, var(--background));
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

.toast-history-toggle:hover {
    color: var(--text-primary);
}

.toast-history-panel {
    position: fixed;
    right: 16px;
    bottom: 54px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(46vh, 420px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    background: color-mix(in srgb, var(--glass) 86%, var(--background));
    z-index: 119991;
    display: none;
    overflow: hidden;
}

.toast-history-panel.open {
    display: flex;
    flex-direction: column;
}

.toast-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.toast-history-header h4 {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
}

.toast-history-clear {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.toast-history-clear:hover {
    color: var(--text-primary);
}

.toast-history-list {
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-history-empty {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 8px;
}

.toast-history-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.toast-history-item--success {
    border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.toast-history-item--error {
    border-color: color-mix(in srgb, var(--error) 55%, var(--border));
}

.toast-history-item--warning {
    border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
}

.toast-history-item--info {
    border-color: color-mix(in srgb, var(--info) 50%, var(--border));
}

.toast-history-meta {
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 4px;
}

.toast-history-message {
    color: var(--text-primary);
    font-size: 12px;
    white-space: pre-wrap;
    line-height: 1.35;
}

.app-toast {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: start;
    gap: 8px;
    padding: 12px 12px 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    background: color-mix(in srgb, var(--glass) 85%, var(--background));
    color: var(--text-primary);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px);
    animation: appToastIn 0.18s ease forwards;
}

.app-toast.closing {
    animation: appToastOut 0.16s ease forwards;
}

.app-toast-content {
    white-space: pre-wrap;
    line-height: 1.35;
    font-size: 0.92em;
}


.app-toast-menu-wrapper {
    position: relative;
}

.app-toast-menu-button {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    width: 28px;
    height: 24px;
    line-height: 18px;
    font-size: 20px;
    cursor: pointer;
}

.app-toast-menu-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.app-toast-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    background: color-mix(in srgb, var(--glass) 95%, var(--background));
    padding: 6px;
    display: none;
    z-index: 2;
}

.app-toast-menu.open {
    display: block;
}

.app-toast-menu-item {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font-size: 12px;
    padding: 7px 8px;
    cursor: pointer;
}

.app-toast-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-toast-close {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    line-height: 20px;
    font-size: 18px;
    cursor: pointer;
}

.app-toast-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.app-toast--success {
    border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.app-toast--error {
    border-color: color-mix(in srgb, var(--error) 55%, var(--border));
}

.app-toast--warning {
    border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
}

.app-toast--info {
    border-color: color-mix(in srgb, var(--info) 50%, var(--border));
}

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

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

.modal-content--wide {
    max-width: 900px;
}

.modal-content--medium {
    max-width: 600px;
}

.video-player-rounded {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.status-message--spaced {
    margin-top: 1rem;
}

/* ========================================
   App Shell - Now inside main-area
   ======================================== */
.app-shell {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    z-index: 1;
}

/* Standalone mode (without sidebar) */
body:not(:has(.sidebar)) .app-shell {
    width: 96vw;
    height: 96vh;
    border-radius: 32px;
}

.app-frame {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.container {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background: var(--card-background);
    background: color-mix(in srgb, var(--card-background) 80%, transparent);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
.settings-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
}
.settings-section--primary {
    border: 1px solid rgba(255, 178, 0, 0.45);
    background: linear-gradient(135deg, rgba(255, 178, 0, 0.12), rgba(255, 114, 0, 0.08));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    position: relative;
}
.settings-section--primary::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 178, 0, 0.25);
    pointer-events: none;
}
.settings-section--compact {
    padding: 16px;
}
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
    background-color: transparent;
    border-radius: 12px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 99999;
}

.titlebar button,
.titlebar a,
.titlebar input,
.titlebar .no-drag {
    -webkit-app-region: no-drag;
}

.no-drag,
.no-drag * {
    -webkit-app-region: no-drag;
}

header {
    text-align: left;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    background: var(--darker-bg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Titlebar progress bar — mirrors encoding/upload progress; always visible */
.titlebar-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 10px;
    flex-shrink: 1;
}

.titlebar-progress.is-hidden {
    display: none;
}

.titlebar-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    min-width: 60px;
}

.titlebar-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.titlebar-progress-bar.is-indeterminate {
    width: 40%;
    animation: playback-progress-slide 1.2s ease-in-out infinite;
}

.titlebar-progress-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 100000;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
    position: relative;
    z-index: 100001;
}

.window-control-btn {
    background: rgba(255, 255, 255, 0.75);
    color: #1d1b2a;
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: 34px;
    height: 30px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.window-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(90, 70, 140, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

.window-control-close {
    background: rgba(255, 111, 177, 0.9);
    color: #fff;
    border-color: rgba(255, 111, 177, 0.7);
}

.window-control-close:hover {
    background: rgba(255, 111, 177, 1);
}

.header-status {
    margin-top: 0;
    padding: 6px 12px;
    font-size: 12px;
    text-align: center;
    max-width: 520px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Utility classes moved from inline styles in index.html */
.mt-12 {
    margin-top: 12px;
}

.calibration-subtext {
    font-size: 0.9em;
    color: var(--text-light);
}

.wrap-gap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ml-16 {
    margin-left: 16px;
}

/* Special menu item styles */

.menu-item.musician-pending-notice {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

h1 {
    font-size: 1.1em;
    color: var(--accent);
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
}

.titlebar h1,
.header-left h1 {
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.subtitle {
    display: none;
}

/* Discord User Card */
.discord-user-card {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-discord-login {
    background: #5865F2;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    line-height: 1.3;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(88, 101, 242, 0.2);
}

.btn-discord-login:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

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

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

.user-info-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(88, 101, 242, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #5865F2;
}

.user-tag-inline {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-logout {
    background: rgba(237, 66, 69, 0.1);
    color: #ed4245;
    border: 1px solid rgba(237, 66, 69, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #ed4245;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 2px 8px rgba(237, 66, 69, 0.4);
}

/* Google Button Modern Style */
.btn-google-modern {
    background: white;
    color: #3c4043;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    line-height: 1.3;
    border-radius: 8px;
    border: 1px solid #dadce0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}

.btn-google-modern:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #d2d3d4;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.3);
    transform: translateY(-2px);
}

.btn-google-modern:active:not(:disabled) {
    background: #f1f3f4;
    transform: translateY(0);
}

.btn-google-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-google-modern.connected {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.btn-google-modern.connected:hover {
    background: #357ae8;
    border-color: #357ae8;
}

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

/* Auth lock: gate UI until Discord + Google are linked */
body.auth-locked .app-frame button:not(.auth-allowed),
body.auth-locked .app-frame a:not(.auth-allowed),
body.auth-locked .app-frame input:not(.auth-allowed),
body.auth-locked .app-frame select:not(.auth-allowed),
body.auth-locked .app-frame textarea:not(.auth-allowed) {
    pointer-events: none;
    opacity: 0.5;
}

body.auth-locked .app-shell {
    position: relative;
}

body.auth-locked .sidebar {
    position: fixed;
}

body.auth-locked .app-shell::after,
body.auth-locked .sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    z-index: 20;
}

body.auth-locked .titlebar {
    position: relative;
    z-index: 30;
    pointer-events: auto;
}

body.auth-locked .discord-user-card {
    position: relative;
    z-index: 30;
    pointer-events: auto;
}

body.auth-locked .discord-user-card * {
    pointer-events: auto;
}

body.auth-locked .app-frame .titlebar button,
body.auth-locked .app-frame .titlebar a,
body.auth-locked .app-frame .titlebar input,
body.auth-locked .app-frame .titlebar .no-drag {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Performance Sub-tabs */
.performances-tabs-inline {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.perf-tab {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.65);
    transition: all 0.2s ease;
}

.perf-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.perf-tab.active {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.22);
}

.perf-tab-content {
    display: none;
}

.perf-tab-content.active {
    display: block;
}

/* My Performances Tabs (inside My Performances main tab) */
.my-perf-tab {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.65);
    transition: all 0.2s ease;
}

.my-perf-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.my-perf-tab.active {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.22);
}

.song-library-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.song-library-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.song-library-search {
    flex: 1;
    min-width: 240px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(7, 5, 16, 0.7);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.song-library-sort {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(7, 5, 16, 0.7);
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.song-library-sort:focus {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.song-library-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.song-library-search:focus {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.song-library-section {
    margin-top: 18px;
}

.song-library-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.55);
}

.song-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(6, 4, 16, 0.35);
}

.song-thumb {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.song-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist,
.song-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.song-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.song-favorite-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-favorite-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.song-favorite-btn.is-favorite {
    color: #ffd54a;
    border-color: rgba(255, 213, 74, 0.4);
    background: rgba(255, 213, 74, 0.12);
    box-shadow: 0 8px 18px rgba(255, 213, 74, 0.2);
}

.my-perf-tab-content {
    display: none;
}

.my-perf-tab-content.active {
    display: block;
}

.user-profile {
    display: none; /* Using new discord-user-card instead */
}

/* Legacy user styles - keeping for backwards compatibility */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Main Tabs Navigation */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: transparent;
}

.main-tab {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.main-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.main-tab.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.25);
}

.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    padding: 2px;
}

.tab-content.active {
    display: flex;
}


.device-settings-prompt {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.device-settings-prompt strong {
    color: var(--accent);
}

.device-settings-prompt p {
    margin: 0;
}

.muted {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.btn-discord {
    display: none; /* Using new btn-discord-login instead */
}

.btn-discord:hover {
    background: #4752C4;
}

.btn-discord svg {
    display: none;
}

.google-drive-connector {
    display: none; /* Using new btn-google-modern instead */
}

.header-patreon {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}

.header-patreon .btn {
    /* Removed override to allow .btn-small styles to apply */
}

.patreon-status {
    font-size: 0.6rem;
    color: var(--text-secondary);
    padding: 1px 3px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    line-height: 1;
}

.btn-patreon {
    background: #ff424d;
    color: #fff;
}

.btn-patreon:hover {
    background: #e13943;
}

.auth-mandate {
    display: none;
}

.btn-google {
    display: none; /* Using new btn-google-modern instead */
}

.google-drive-status {
    display: none; /* Removed - using inline status in btn-google-modern instead */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-background);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-tag {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-stats {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.subscription-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.subscription-badge.free {
    background: #e0e0e0;
    color: var(--text-secondary);
}

.subscription-badge.basic {
    background: #667eea;
    color: white;
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Subscription Notice */
.subscription-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subscription-notice-footer {
    position: sticky;
    bottom: 12px;
    z-index: 30;
    margin-top: 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.subscription-notice--footer {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.subscription-notice-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.subscription-notice-restore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.subscription-notice-footer.minimized .subscription-notice--footer {
    display: none;
}

.subscription-notice-footer.minimized .subscription-notice-restore {
    display: inline-flex;
}

.subscription-notice-footer:not(.minimized) .subscription-notice-restore {
    display: none;
}

.notice-content h3 {
    margin: 0 0 10px 0;
    color: white;
}

.notice-content p {
    margin: 5px 0;
    opacity: 0.95;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.is-hidden {
    display: none;
}

.modal-content {
    background-color: transparent;
    color: var(--text-primary);
    padding: 40px;
    border-radius: 0;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: none;
    box-shadow: none;
}

#themeTab .modal-content {
    max-height: none;
    padding: 24px;
}

.close-modal {
    position: absolute;
    right: 24px;
    top: 24px;
    color: var(--text-secondary);
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

.modal-content h2 {
    text-align: center;
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 1.75em;
    font-weight: 700;
}

.modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.05em;
}

#bug-reportTab,
#feedbackTab {
    color: var(--text-primary);
}

#bug-reportTab .form-input,
#feedbackTab .form-input {
    color: var(--input-text);
}

#bug-reportTab input[type="checkbox"],
#feedbackTab input[type="checkbox"] {
    accent-color: var(--accent);
}

.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 32, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1500;
}

.settings-modal.visible {
    display: flex;
}

.settings-dialog {
    background: var(--card-background);
    border-radius: 20px;
    padding: 22px;
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Settings screen readability: follow theme text colors */
.settings-modal,
.settings-modal .settings-dialog,
.settings-modal .settings-header h3,
.settings-modal .settings-body,
.settings-modal .settings-section h4,
.settings-modal .settings-description,
.settings-modal .setting-row label,
.settings-modal .input-unit,
.settings-modal .muted,
.settings-modal .info-text,
.settings-modal .calibration-description,
.settings-modal .click-instruction,
.settings-modal .calibration-progress,
.settings-modal #calibrationStatusText,
.settings-modal #calibrationOffsetDisplay,
.settings-modal #calibrationSliderValue,
.settings-modal .calibration-review h5,
.settings-modal #calibrationReviewMessage,
.settings-modal .meter-label,
.settings-modal .status-message,
.settings-modal .settings-dialog p,
.settings-modal .settings-dialog span,
.settings-modal .settings-dialog strong {
    color: var(--text-primary);
}

.settings-modal .settings-description,
.settings-modal .input-unit,
.settings-modal .muted,
.settings-modal .info-text,
.settings-modal .calibration-description,
.settings-modal .click-instruction,
.settings-modal .calibration-progress {
    color: var(--text-secondary);
}

.settings-modal input,
.settings-modal select,
.settings-modal textarea,
.settings-modal option {
    color: var(--input-text);
    background: var(--input-background);
    border-color: var(--border);
}

.settings-modal .btn {
    color: var(--text-primary);
}

.settings-modal .btn-primary,
.settings-modal .btn-secondary,
.settings-modal .btn-stop {
    background: var(--secondary-button);
}

.settings-modal .btn-primary {
    background: var(--primary-button);
}

.settings-modal .btn-stop {
    background: var(--record-button);
}

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

.settings-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.settings-page .settings-header {
    align-items: center;
    margin-bottom: 20px;
}

.settings-page .settings-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.6em;
}

.settings-subtitle {
    margin: 6px 0 0 0;
    color: var(--text-secondary);
}

.settings-page .settings-body {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    gap: 18px;
}

.settings-page .device-group {
    flex-direction: column;
    align-items: stretch;
}

.settings-dialog .device-group {
    flex-direction: column;
    align-items: stretch;
}

.device-actions {
    display: flex;
    justify-content: flex-end;
}

.pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.pricing-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.featured-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.card-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.card-header h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.price {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.price span {
    font-size: 0.4em;
    color: var(--text-secondary);
    font-weight: normal;
}

.price-yearly {
    font-size: 0.85em;
    color: #27ae60;
    margin-top: 5px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.features-list li {
    padding: 10px 0;
    color: #333;
    font-size: 0.95em;
}

.pricing-card .btn {
    width: 100%;
    margin-top: 10px;
}

.upgrade-btn {
    font-size: 0.9em;
}

.patreon-status-panel {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(240, 147, 251, 0.12));
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 16px;
    padding: 18px;
    margin-top: 24px;
}

.patreon-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.patreon-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.14);
    color: #334155;
    font-weight: 700;
}

.patreon-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.patreon-status-item {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 14px;
}

.patreon-status-label {
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
}

.patreon-status-value {
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
}

.patreon-subscribe-status {
    margin: 16px 0 0;
    color: #475569;
    font-size: 0.95em;
}

.pricing-card.current-tier {
    border-color: #16a34a;
    box-shadow: 0 10px 30px rgba(22, 163, 74, 0.16);
}

.pricing-card.current-tier .card-header {
    border-bottom-color: rgba(22, 163, 74, 0.2);
}

.subscription-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 25px;
    text-align: center;
}

.subscription-note p {
    margin: 5px 0;
    color: #856404;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .patreon-status-header {
        flex-direction: column;
        align-items: stretch;
    }
}

.subscription-note p {
    margin: 5px 0;
    color: #856404;
    font-size: 0.9em;
}

/* Theme Customization Styles */
.theme-modal {
    max-width: 920px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 16, 30, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    color: #f8fafc;
}

.theme-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.theme-tab {
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.7);
    transition: all 0.3s;
    border-radius: 12px 12px 0 0;
}

.theme-tab.active {
    color: #f8fafc;
    border-bottom-color: rgba(255, 255, 255, 0.6);
    background: rgba(30, 41, 59, 0.8);
}

.theme-tab:hover {
    color: #f8fafc;
}

.theme-tab-content {
    display: none;
}

.theme-tab-content.active {
    display: block;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
}

.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    border-color: rgba(248, 250, 252, 0.45);
}

.theme-card.active {
    border-color: rgba(248, 250, 252, 0.7);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.35);
}

.theme-preview {
    height: 80px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-name {
    text-align: center;
    font-weight: 600;
    color: #f8fafc;
}

.custom-colors-editor {
    padding: 20px 0;
}

.color-category {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--accent-light);
    border-radius: 8px;
}

.color-category h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.color-input-group label {
    min-width: 180px;
    color: var(--text-primary);
    font-weight: 500;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.color-text {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: var(--input-background);
    color: var(--input-text);
}

.theme-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Performance Overlay Styles */
.performance-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(9, 18, 36, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.performance-overlay.visible {
    display: flex;
}

.performance-overlay.preparing .performance-karaoke-video,
.performance-overlay.preparing .performance-partner-video,
.performance-overlay.preparing .performance-webcam-corner,
.performance-overlay.preparing .performance-controls {
    opacity: 0;
    pointer-events: none;
}

.performance-prep {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    background: rgba(8, 16, 32, 0.75);
}

.performance-prep.is-hidden {
    display: none;
}

.performance-prep-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 28px;
    min-width: 320px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.performance-prep-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.performance-prep-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.performance-prep-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.performance-prep-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.25s ease;
}

.performance-prep-progress-bar.is-indeterminate {
    width: 40%;
    animation: performance-prep-slide 1.2s ease-in-out infinite;
}

.playback-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.playback-progress.is-hidden {
    display: none;
}

.playback-progress-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.playback-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.playback-progress-percent {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.playback-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.playback-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.25s ease;
}

.playback-progress-bar.is-indeterminate {
    width: 40%;
    animation: playback-progress-slide 1.2s ease-in-out infinite;
}

.update-progress {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 5000;
    pointer-events: none;
}

.update-progress.is-hidden {
    display: none;
}

.update-progress-card {
    background: linear-gradient(160deg, rgba(22, 26, 38, 0.94) 0%, rgba(16, 20, 33, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 14px 16px;
    width: min(520px, 92%);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.update-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-progress-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.update-progress-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-top-color: rgba(255, 255, 255, 0.9);
    animation: update-progress-spin 0.9s linear infinite;
}

.update-progress-icon {
    display: none;
    font-size: 16px;
    font-weight: 700;
}

.update-progress-title-wrap {
    min-width: 0;
    flex: 1;
}

.update-progress-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f7f7fb;
    line-height: 1.2;
}

.update-progress-text {
    font-size: 0.86rem;
    font-weight: 500;
    color: rgba(244, 244, 248, 0.86);
    margin-top: 2px;
    line-height: 1.3;
}

.update-progress-details {
    margin-top: 12px;
}

.update-progress-details.is-hidden {
    display: none;
}

.update-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.update-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gradient-start, #667eea) 0%, var(--primary-gradient-end, #764ba2) 100%);
    transition: width 0.25s ease;
}

.update-progress-bar.is-indeterminate {
    width: 40%;
    animation: playback-progress-slide 1.2s ease-in-out infinite;
}

.update-progress-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 16px;
}

.update-progress-detail,
.update-progress-percent {
    font-size: 0.78rem;
    color: rgba(244, 244, 248, 0.78);
}

#updateProgress[data-phase="downloaded"] .update-progress-spinner,
#updateProgress[data-phase="error"] .update-progress-spinner,
#updateProgress[data-phase="not-available"] .update-progress-spinner {
    display: none;
}

#updateProgress[data-phase="downloaded"] .update-progress-icon,
#updateProgress[data-phase="error"] .update-progress-icon,
#updateProgress[data-phase="not-available"] .update-progress-icon {
    display: block;
}

#updateProgress[data-phase="downloaded"] .update-progress-icon,
#updateProgress[data-phase="not-available"] .update-progress-icon {
    color: #7cf3a7;
}

#updateProgress[data-phase="error"] .update-progress-icon {
    color: #ff8f8f;
}

@keyframes playback-progress-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(40%); }
    100% { transform: translateX(200%); }
}

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

@keyframes performance-prep-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(40%); }
    100% { transform: translateX(200%); }
}

.performance-karaoke-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.performance-partner-video {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background: #000;
    display: none;
    z-index: 3;
}

.performance-partner-video.visible {
    display: block;
}

.performance-webcam-corner {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 260px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.45);
    z-index: 4;
}

.performance-webcam-corner video {
    width: 100%;
    height: auto;
    display: block;
}

.performance-live-indicator {
    position: absolute;
    top: 8px;
    left: 10px;
    background: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 12px;
    z-index: 5;
}

.performance-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.65);
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 5;
}

.performance-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-volume-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.performance-volume-slider {
    width: 120px;
}

.performance-volume-value {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 42px;
    text-align: right;
}

.performance-mode-label {
    color: #f7f1ff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.performance-overlay .btn-stop {
    background: #e74c3c;
}

@media (max-width: 900px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        text-align: center;
    }
    
    h1 {
        font-size: 2.5em;
    }
    
    .user-profile {
        width: 100%;
        justify-content: center;
    }
    
    .header-right {
        align-items: center;
    }

    .header-center {
        width: 100%;
    }

    .header-status {
        max-width: 100%;
        white-space: normal;
    }
    
    .header-actions {
        justify-content: center;
    }
}

.section {
    padding: 16px 20px;
    background: var(--card-background);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section h2 {
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: 700;
}

.section h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.track-section {
    padding: 10px 16px;
    position: relative;
    z-index: 120;
    isolation: isolate;
}

.track-section h2 {
    margin-bottom: 6px;
    font-size: 1em;
}

.track-section .input-group {
    margin-bottom: 4px;
    gap: 8px;
}

.track-input-group {
    position: relative;
    align-items: center;
    z-index: 1;
}

.track-section .youtube-input {
    padding: 8px 12px;
    font-size: 13px;
}

.track-section .btn {
    padding: 8px 12px;
    font-size: 13px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.youtube-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    min-width: 0;
}

.track-history-btn {
    min-width: 42px;
    padding: 8px 10px;
}

.track-history-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: min(420px, 100%);
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    transform: translateZ(0);
    will-change: transform;
}

.track-history-menu.is-hidden {
    display: none;
}

.track-history-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.track-history-item:hover {
    background: var(--accent-light);
}

.track-history-item .track-history-title {
    font-weight: 600;
}

.track-history-item .track-history-meta {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.track-history-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.youtube-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.youtube-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: rgba(0, 0, 0, 0.45);
}

.youtube-input:-webkit-autofill,
.youtube-input:-webkit-autofill:hover,
.youtube-input:-webkit-autofill:focus,
.youtube-input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff;
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.45) inset;
}

/* Song Metadata Form */
.song-metadata-form {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--accent-light);
    border-radius: 8px;
    border: 2px solid var(--primary-gradient-start);
}

.song-metadata-form.metadata-collapsed-compact {
    padding: 0.75rem 1rem;
    border-width: 1px;
}

.song-metadata-form.is-hidden {
    display: none;
}

.metadata-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.song-metadata-form.metadata-collapsed-compact .metadata-header {
    gap: 0.75rem;
}

.metadata-prompt {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.song-metadata-form.metadata-collapsed-compact .metadata-prompt {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.metadata-header .metadata-prompt {
    margin-bottom: 0;
}

.metadata-details {
    margin-top: 1rem;
}

.metadata-details.is-hidden {
    display: none;
}

.metadata-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metadata-field {
    display: flex;
    flex-direction: column;
}

.metadata-track-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--warning);
}

.metadata-toggle-btn {
    flex-shrink: 0;
}

.metadata-field label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.metadata-input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--input-background);
    color: var(--input-text);
    transition: border-color 0.3s ease;
}

.metadata-input.is-readonly {
    background: var(--card-background);
    color: var(--text-secondary);
    border-color: var(--border);
    cursor: not-allowed;
}

.metadata-edit-btn {
    margin-top: 0.5rem;
}

.metadata-confirm-btn {
    margin-top: 0.5rem;
}

.metadata-input:focus {
    outline: none;
    border-color: var(--primary-gradient-start);
}

.metadata-info-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

.metadata-info-text.success {
    color: var(--success);
}

.metadata-info-text.warning {
    color: var(--warning);
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary-button);
    color: var(--button-text-on-primary, #ffffff);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--secondary-button);
    color: var(--button-text-on-secondary, #ffffff);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: #1b1b1b;
}

.btn-warning:hover:not(:disabled) {
    background: color-mix(in srgb, var(--warning) 85%, #000000);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-record {
    background: var(--record-button);
    color: var(--button-text-on-record, #ffffff);
}

.btn-record:hover:not(:disabled) {
    background: var(--record-button-hover);
}

.btn-stop {
    background: #95a5a6;
    color: white;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-panel-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.musician-gradient-btn {
    background: linear-gradient(135deg, var(--primary-button), var(--accent));
}

.musician-pending-notice {
    background: rgba(251, 191, 36, 0.2);
    color: #f59e0b;
    cursor: default;
}

.device-selection {
    background: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.device-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.device-group label {
    min-width: 150px;
    font-weight: 500;
    color: var(--accent);
}

.device-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-background);
    color: var(--input-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.device-select option {
    padding: 10px;
}

.device-info {
    margin-top: 10px;
    padding: 10px;
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    color: var(--text-primary);
}

.device-feedback {
margin-top: 15px;
padding: 15px;
background: var(--card-background);
border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.meter-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #444;
}

.meter-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.meter-level {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2ecc71, #f39c12, #e74c3c);
    border-radius: inherit;
    transition: width 0.1s ease;
}

.info-text {
    font-size: 0.9em;
    color: #555;
    margin: 0;
}

.info-text.warning {
    color: #e67e22;
}

.info-text.success {
    color: #27ae60;
}

/* Audio Calibration Styles */
.calibration-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.calibration-section h4 {
    margin: 0 0 10px 0;
    color: var(--primary-button);
    font-size: 1.1em;
}

.calibration-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.calibration-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--card-background);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.calibration-status.calibrated {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(52, 211, 153, 0.1));
    border-color: #2ecc71;
}

.calibration-status.invalid {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.1));
    border-color: #f59e0b;
}

#calibrationStatusText {
    font-weight: 500;
}

#calibrationOffsetDisplay {
    font-weight: bold;
    color: var(--primary-button);
}

.calibration-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.calibration-ui {
    padding: 20px;
    background: var(--card-background);
    border-radius: 10px;
    margin-top: 15px;
}

.click-track-container {
    text-align: center;
    padding: 20px;
}

.click-visual {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.click-visual.beat {
    transform: scale(1.2);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.click-instruction {
    font-size: 1em;
    color: var(--text-secondary);
    margin-top: 10px;
}

.calibration-progress {
    text-align: center;
    margin: 20px 0;
    font-size: 1.1em;
    font-weight: 500;
    color: var(--primary-button);
}

.calibration-progress-bar {
    width: 100%;
    height: 8px;
    margin: 12px auto 0;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.calibration-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.08s linear;
}

.calibration-review {
    padding: 20px;
    background: var(--card-background);
    border-radius: 10px;
    margin-top: 15px;
}

.calibration-visualization {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calibration-visualization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.calibration-visualization-title {
    font-weight: 600;
    color: var(--primary-button);
}

.calibration-waveform-status {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.calibration-waveform-status.error {
    color: #e53e3e;
}

.calibration-track-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calibration-track-label {
    width: 48px;
    text-align: right;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.calibration-track-canvas {
    flex: 1;
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}

.calibration-mic-canvas {
    height: 120px;
}

.calibration-review h5 {
    margin: 0 0 15px 0;
    color: var(--primary-button);
}

.calibration-review-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

#calibrationSliderValue {
    color: var(--primary-button);
    font-size: 1.1em;
}

.calibration-offset-hint {
    margin: 10px 0 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.calibration-offset-hint.invalid {
    color: #f59e0b;
}

/* Cache Cleanup Settings */
.settings-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.settings-section h4 {
    margin: 0 0 10px 0;
    color: var(--primary-button);
    font-size: 1.1em;
}

.settings-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-row label {
    flex: 1;
    font-weight: 500;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
    text-align: center;
    background: var(--input-background);
    color: var(--input-text);
}

.text-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 1em;
    background: var(--input-background);
    color: var(--input-text);
}

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

.input-unit {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Recordings List Styles */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

.recording-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
    background: var(--card-background);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    min-height: 520px;
}

.recording-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.recording-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.recording-card > * {
    position: relative;
    z-index: 2;
}

.recording-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-button);
    transform: translateY(-2px);
}

.recording-card--pinned {
    border-color: var(--primary-button);
    box-shadow: 0 0 0 1px rgba(var(--primary-button-rgb), 0.35), 0 8px 24px rgba(var(--primary-button-rgb), 0.18);
}

.recording-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
    min-height: 170px;
    flex: 1;
}

.recording-title {
    font-size: 1.05em;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    width: 100%;
}

.recording-meta {
    font-size: 0.88em;
    color: var(--text-secondary);
    display: flex;
    gap: 10px 14px;
    flex-wrap: wrap;
    line-height: 1.4;
    width: 100%;
    margin-top: auto;
}

.recording-card--has-bg .recording-title {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 10px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
}

.recording-card--has-bg {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.recording-card--has-bg .recording-meta {
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.recording-actions {
    display: flex;
    flex-direction: row;
    gap: 8px 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 96px;
    align-content: flex-end;
}

.recording-actions--compact {
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 0;
    align-content: center;
}

.recording-actions--compact .btn,
.recording-actions--compact .btn-small {
    font-size: 0.78em;
    padding: 5px 10px;
    min-height: 34px;
    line-height: 1.1;
    white-space: nowrap;
}

.recording-actions--single-row {
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 0;
    align-content: center;
}

.recording-actions--single-row .btn,
.recording-actions--single-row .btn-small {
    font-size: 0.74em;
    padding: 4px 8px;
    min-height: 30px;
    line-height: 1.05;
    white-space: nowrap;
    flex: 1 1 0;
}

.recording-actions--single-row .performance-star-btn {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 4px 9px;
}

@media (max-width: 900px) {
    .recording-actions {
        justify-content: flex-start;
    }

    .recording-actions--compact {
        flex-wrap: wrap;
    }

    .recording-actions--single-row {
        flex-wrap: wrap;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.2;
}

.badge-success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.recordings-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Explorer */
.explorer-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.explorer-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.explorer-search-input {
    min-width: 240px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-background);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.explorer-body {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.explorer-list {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    min-height: 360px;
}

.explorer-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explorer-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.explorer-user-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.explorer-user-card.is-selected {
    border-color: var(--primary-button);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.12);
}

.explorer-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
}

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

.explorer-user-name {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-user-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.explorer-profile {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    min-height: 360px;
}

.explorer-profile-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.explorer-profile-content.is-hidden {
    display: none;
}

.explorer-profile-header {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.explorer-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid var(--primary-button);
}

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

.explorer-profile-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.explorer-profile-tag {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.explorer-profile-meta {
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.explorer-profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.explorer-friend-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.explorer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.explorer-stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.explorer-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.explorer-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.explorer-performances h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

/* Explorer header actions layout */
.explorer-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.explorer-performances .recording-actions--single-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 8px;
}

.explorer-performances .recording-meta {
    row-gap: 8px;
    margin-bottom: 6px;
}

.explorer-performances .recording-meta .performance-badge {
    display: inline-flex;
    align-items: center;
}

.header-back-btn {
    margin-right: 10px;
}

.header-back-btn,
.header-back-btn:hover,
.header-back-btn:active {
    transform: none !important;
    backface-visibility: visible;
}

.header-back-btn::before,
.header-back-btn:hover::before {
    content: none !important;
}

.titlebar .header-back-btn.btn-secondary:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
}

@media (max-width: 980px) {
    .explorer-body {
        grid-template-columns: 1fr;
    }
    .explorer-header-actions {
        width: 100%;
    }
    .explorer-search {
        width: 100%;
    }
    .explorer-search-input {
        width: 100%;
    }
}

/* Recording Playback Modal */
#recordingPlaybackModal .modal-content {
    background: var(--card-background);
    padding: 0;
}

#recordingPlaybackModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

#recordingPlaybackModal .modal-body {
    padding: 20px;
}

#recordingPlaybackModal .modal-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    background: rgba(0, 0, 0, 0.25);
}

#recordingPlaybackVideo {
    width: 100%;
    min-height: 360px;
    max-height: 70vh;
    border-radius: 8px;
    background: #000;
}

/* App Footer */
.app-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
    z-index: 1000;
}

.studio-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.video-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.video-container h3 {
    font-size: 1em;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 0;
    border: 1px solid rgba(139, 92, 246, 0.35);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placeholder {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.video-controls, .recording-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.video-controls .btn, .recording-controls .btn {
    padding: 10px 16px;
    font-size: 0.92em;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.6);
    box-shadow: 0 10px 24px rgba(6, 4, 16, 0.35);
    transition: all 0.2s ease;
}

.video-controls .btn:hover:not(:disabled),
.recording-controls .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(10, 6, 24, 0.45);
}

.video-controls .btn:disabled,
.recording-controls .btn:disabled {
    opacity: 0.4;
    box-shadow: none;
    transform: none;
}

.recording-controls .webcam-profile-select {
    min-width: 200px;
    padding: 10px 12px;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.recording-controls .webcam-profile-select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.22);
}

.recording-controls .webcam-profile-select option {
    background: #1a1228;
    color: #ffffff;
}

.mode-selection {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: transparent;
    border-radius: 0;
    justify-content: center;
}

.mode-selection label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.98em;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
}

.mode-selection input[type="radio"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    appearance: none;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}

.mode-selection input[type="radio"]::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s ease;
    background: var(--primary-purple);
}

.mode-selection label:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.mode-selection label:has(input[type="radio"]:checked) {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.24);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.25);
}

.mode-selection label:has(input[type="radio"]:checked) input[type="radio"] {
    border-color: var(--primary-purple);
}

.mode-selection label:has(input[type="radio"]:checked) input[type="radio"]::before {
    transform: scale(1);
}

.mode-selection label.disabled,
.mode-selection label:has(input[type="radio"]:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    text-shadow: none;
}

.mode-selection label.disabled:hover,
.mode-selection label:has(input[type="radio"]:disabled):hover {
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.mode-selection input[type="radio"]:disabled {
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.35);
}

.mode-selection input[type="radio"]:disabled::before {
    background: rgba(255, 255, 255, 0.35);
}

.start-performance-btn {
    display: block;
    margin: 8px auto 0 auto;
    min-width: 180px;
}

.recordings-list {
    min-height: 100px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
}

/* Performance card styles */
/* ========================================
   UNIFIED PERFORMANCE CARD STYLES
   Used across all pages: performances.html, user-profile.html, 
   friend-performances.html, musician-dashboard.html
   ======================================== */

.performance-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 380px;
    background: var(--card-background);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.performance-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Dark gradient overlay to ensure text readability while showing background */
/* Text is positioned at bottom where gradient is darkest (0.85 opacity = 85%) for WCAG contrast */
.performance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
    z-index: 1;
    pointer-events: none;
}

.performance-card > * {
    position: relative;
    z-index: 2;
}

.performance-card:hover {
    border-color: var(--primary-button);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.performance-card--pinned {
    border-color: var(--primary-button);
    box-shadow: 0 0 0 1px rgba(var(--primary-button-rgb), 0.4), 0 14px 34px rgba(var(--primary-button-rgb), 0.22);
}

.performance-card:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.1) 100%);
}

/* Cards without background thumbnails get gradient background */
/* Note: Inherits min-height: 380px from .performance-card - same size as cards with thumbnails */
.performance-card.no-thumbnail {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
}

.performance-card.no-thumbnail .performance-thumbnail-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5em;
    opacity: 0.25;
    z-index: 0;
}

/* Hide old-style thumbnail element - we use background images now */
.performance-thumbnail {
    display: none;
}

/* Performance info section - compact to show more background */
.performance-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    min-width: 0;
}

.performance-title {
    font-weight: 700;
    font-size: 0.95em;
    color: white;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 8px;
    border-radius: 6px;
    word-break: break-word;
}

.performance-meta {
    font-size: 0.75em;
    color: rgba(255,255,255,0.95);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.performance-meta span {
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.performance-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.badge-solo,
.badge-full {
    background: #3498db;
    color: white;
}

.badge-duet-first,
.badge-seed {
    background: #9b59b6;
    color: white;
}

.badge-duet-second {
    background: #e67e22;
    color: white;
}

.performance-expiry {
    display: inline-block; padding: 2px 7px; border-radius: 8px;
    background: rgba(230, 126, 34, 0.25); color: #fad390;
    border: 1px solid rgba(230, 126, 34, 0.5);
    font-size: 0.7em; font-weight: 600; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7); cursor: default;
}
.performance-expiry--urgent {
    background: rgba(231, 76, 60, 0.25); color: #ff6b6b;
    border-color: rgba(231, 76, 60, 0.5);
}
.performance-expiry--permanent {
    background: rgba(52, 152, 219, 0.15); color: #74b9ff;
    border-color: rgba(52, 152, 219, 0.35);
}
/* Always place expiry badge on its own line, separated from type/tag badges */
.recording-meta .performance-expiry {
    flex-basis: 100%;
    display: block;
    text-align: center;
    margin-top: 3px;
    padding-top: 5px;
    padding-bottom: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.badge-complete {
    background: #2ecc71;
    color: white;
}

.badge-local {
    background: #27ae60;
    color: white;
}

.badge-cloud {
    background: #5dade2;
    color: white;
}

.badge-published {
    background: #27ae60;
    color: white;
}

.badge-upload-failed {
    background: #f39c12;
    color: #1f2937;
    font-weight: 800;
    cursor: help;
}

.badge-unpublished {
    background: #95a5a6;
    color: white;
}

/* Performance action buttons - compact and symmetrical */
.performance-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
    padding: 0 12px 12px 12px;
}

.performance-actions .btn {
    font-size: 0.75em;
    padding: 6px 10px;
    flex: 1;
    min-width: 80px;
    max-width: 140px;
}

.performance-actions .btn-small {
    font-size: 0.7em;
    padding: 5px 8px;
}

/* Star/Like button styles */
.star-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-background);
    color: var(--text-secondary);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.star-btn.liked {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.1));
    border-color: #FFD700;
    color: #F59E0B;
}

.star-btn.liked:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.2));
    transform: scale(1.05);
}

.star-icon {
    font-size: 1.1em;
    transition: transform 0.2s ease;
}

.star-btn:hover .star-icon {
    transform: scale(1.2);
}

.star-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.visibility-toggle {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
}

.visibility-toggle input[type="checkbox"] {
    margin: 0;
}

.visibility-toggle label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Keep My Performances card sizing/layout aligned with community cards */
#my-performancesTab .recordings-list {
    min-height: 100px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.recording-item {
    background: var(--card-background);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recording-item h4 {
    color: var(--accent);
    margin-bottom: 5px;
    font-size: 0.9em;
    word-break: break-all;
}

.recording-item p {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin: 5px 0;
}

.placeholder-text {
    color: var(--text-light);
    text-align: center;
    padding: 30px;
    grid-column: 1 / -1;
}

.merge-container {
    background: var(--card-background);
    padding: 20px;
    border-radius: 8px;
}

.merge-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.merge-input label {
    min-width: 150px;
    font-weight: 500;
}

.file-path {
    color: var(--text-secondary);
    font-size: 0.9em;
    flex: 1;
}

.shared-packages-list {
background: var(--card-background);
border: 1px solid var(--border);
border-radius: 10px;
padding: 12px;
display: grid;
gap: 10px;
margin-top: 10px;
}

.shared-packages-list .package-card {
    background: #f7f7ff;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.shared-packages-list .package-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.shared-packages-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

#partnerKaraokeAudio {
    display: none;
}

.status-message {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    display: none;
    font-size: 13px;
    font-weight: 500;
}

.status-message.success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
    border: 1px solid rgba(39, 174, 96, 0.3);
    display: block;
}

.status-message.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error);
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: block;
}

.status-message.info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
    border: 1px solid rgba(52, 152, 219, 0.3);
    display: block;
}

.status-message.persistent {
    display: block;
}

.recording-indicator {
    color: #e74c3c;
    font-weight: bold;
    display: none;
    align-items: center;
    gap: 8px;
}

.recording-indicator.active {
    display: flex;
}

.recording-indicator::before {
    content: '●';
    font-size: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (max-width: 768px) {
    .studio-layout {
        grid-template-columns: 1fr;
    }
    
    .mode-selection {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .merge-input {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Sync Adjustment Styles */
.sync-container {
    background: var(--card-background);
    padding: 20px;
    border-radius: 8px;
}

.sync-preview {
    max-width: 900px;
    margin: 0 auto;
}

.sync-video-player {
    width: 100%;
    max-height: 500px;
    background: #000;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sync-controls {
    background: var(--accent-light);
    padding: 20px;
    border-radius: 8px;
}

/* Finalize Performance Modal - Full Screen Overlay */
.finalize-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.finalize-modal.is-hidden {
    display: none;
}

/* Discard confirmation modal must appear above the finalize overlay */
#discardConfirmModal {
    z-index: 10100;
}

.finalize-modal-content {
    width: 95vw;
    max-width: 1400px;
    height: 95vh;
    background: var(--card-background);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.finalize-header {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    padding: 20px 30px;
    flex-shrink: 0;
}

.finalize-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.8em;
}

.finalize-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95em;
}

/* Access Gate Overlay */
.access-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Development mode: hide access gate (only for screenshots/testing) */
body.dev-mode .access-gate {
    display: none !important;
}

.access-gate.is-hidden {
    display: none;
}

.access-gate-content {
    width: 100%;
    max-width: 520px;
    background: var(--card-background);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.access-gate-content h2 {
    margin: 0 0 10px 0;
    font-size: 1.6em;
}

.access-gate-content p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
}

.access-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.finalize-body {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.finalize-video-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.finalize-info-box {
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.finalize-info-box strong {
    color: var(--accent);
}

.finalize-video-player {
    width: 100%;
    height: calc(100% - 80px);
    min-height: 400px;
    background: #000;
    border-radius: 8px;
    object-fit: contain;
}

.finalize-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--accent-light);
    padding: 20px;
    border-radius: 8px;
    overflow-y: auto;
}

.finalize-title-section {
    background: var(--accent-light);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finalize-title-section .form-input {
    width: 100%;
}

.finalize-volume-control {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finalize-volume-label {
    color: var(--text-primary);
}

.publish-toggle {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.thumbnail-picker {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumbnail-picker-label {
    color: var(--text-primary);
}

.thumbnail-preview {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-placeholder {
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: center;
    padding: 8px;
}

.thumbnail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: var(--text-primary);
}

.publish-toggle input[type="checkbox"] {
    cursor: pointer;
}

.sync-value-display {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.finalize-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finalize-warning-banner {
    background: rgba(255, 180, 0, 0.15);
    border: 1px solid rgba(255, 180, 0, 0.6);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9em;
    padding: 10px 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.finalize-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 1em;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Audio Effects Toolbar */
.audio-effects-toolbar {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audio-effects-label {
    color: var(--text-primary);
    margin-bottom: 0;
}

.audio-effects-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85em;
    line-height: 1.4;
}

.audio-effect-item {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s;
}

.audio-effect-item:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
}

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

.effect-header .toggle-inline {
    font-size: 0.95em;
    font-weight: 600;
}

.effect-toggle {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.effect-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-left: 8px;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

.audio-effect-item:has(.effect-toggle:checked) .effect-controls {
    opacity: 1;
    pointer-events: auto;
}

.slider-with-value {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.effect-param-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    min-width: 80px;
    margin: 0;
}

.effect-slider {
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.3), var(--accent));
    cursor: pointer;
}

.effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.effect-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.4);
}

.effect-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.effect-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.4);
}

.effect-value {
    min-width: 60px;
    text-align: right;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

@media (max-width: 1024px) {
    .finalize-body {
        grid-template-columns: 1fr;
        grid-template-rows: 2fr 1fr;
    }
    
    .finalize-video-player {
        height: 50vh;
        min-height: 300px;
    }
}

.sync-slider-container {
    margin-bottom: 20px;
}

.sync-slider-container label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #667eea;
}

#syncValue {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.2em;
    margin-left: 10px;
}

.slider-with-labels {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.slider-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-align: center;
    min-width: 60px;
}

.sync-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e74c3c 0%, #667eea 50%, #27ae60 100%);
    cursor: pointer;
}

.sync-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.sync-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    border-color: #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sync-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.sync-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    border-color: #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sync-help {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.sync-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.sync-actions .btn {
    min-width: 150px;
}

@media (max-width: 768px) {
    .sync-actions {
        flex-direction: column;
    }
    
    .sync-actions .btn {
        width: 100%;
    }
    
    .slider-with-labels {
        flex-direction: column;
    }
    
    .slider-label {
        display: none;
    }
}


/* Theme Customization Styles */
.theme-modal {
    max-width: 920px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 16, 30, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    color: #f8fafc;
}

.theme-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.theme-tab {
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.7);
    transition: all 0.3s;
    border-radius: 12px 12px 0 0;
}

.theme-tab.active {
    color: #f8fafc;
    border-bottom-color: rgba(255, 255, 255, 0.6);
    background: rgba(30, 41, 59, 0.8);
}

.theme-tab:hover {
    color: #f8fafc;
}

.theme-tab-content {
    display: none;
}

.theme-tab-content.active {
    display: block;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
}

.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    border-color: rgba(248, 250, 252, 0.45);
}

.theme-card.active {
    border-color: rgba(248, 250, 252, 0.7);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.35);
}

.theme-preview {
    height: 80px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-name {
    text-align: center;
    font-weight: 600;
    color: #f8fafc;
}

.custom-colors-editor {
    padding: 20px 0;
}

.color-category {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--accent-light);
    border-radius: 8px;
}

.color-category h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.color-input-group label {
    min-width: 180px;
    color: var(--text-primary);
    font-weight: 500;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.color-text {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.theme-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Spinner animation for YouTube download */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-progress {
    padding: 40px;
    text-align: center;
}

/* Welcome Modal Styles */
#welcomeModal {
    background: rgba(0, 0, 0, 0.78);
}

.modal-content.welcome-modal {
    max-width: 700px;
    text-align: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-strong);
    padding: 32px;
}

.welcome-modal h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.welcome-content {
    text-align: left;
}

.welcome-section {
    background: var(--accent-light);
    border-left: 4px solid var(--primary-button);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.welcome-section h3 {
    color: var(--primary-button);
    margin-top: 0;
    margin-bottom: 10px;
}

.welcome-section p {
    margin: 8px 0;
    line-height: 1.6;
}

.welcome-steps {
    margin: 25px 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.3s;
}

.step-item:hover {
    background: var(--accent-light);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
}

.step-text {
    flex: 1;
}

.step-text h4 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

.step-text p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.5;
}

.welcome-actions {
    text-align: center;
    margin: 30px 0 20px;
}

.welcome-actions .btn-primary {
    padding: 16px 48px;
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 200px;
}

.welcome-actions .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8e 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-3px);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1em;
}

.welcome-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 15px;
}

/* Calibration Required Indicator */
.calibration-required-banner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.calibration-required-banner strong {
    font-weight: 700;
}

.studio-login-notice {
    background: linear-gradient(135deg, #7289da 0%, #5865f2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.35);
}

.studio-login-notice strong {
    font-weight: 700;
}

/* Bug Report Modal Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--input-background);
    color: var(--input-text);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-button);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--input-placeholder);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

select.form-input {
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-hint {
    margin-top: 4px;
    margin-left: 24px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.screenshot-preview {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.screenshot-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-background);
}

.screenshot-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-preview-item .remove-screenshot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.screenshot-preview-item .remove-screenshot:hover {
    background: rgba(192, 57, 43, 1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.form-actions .btn {
    min-width: 120px;
}

/* Contributor badges */
.contributor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.contributor-badge--bronze {
    background: #f0e0d0;
    border-color: #c58b5b;
    color: #6a3d1c;
}

.contributor-badge--silver {
    background: #e8edf3;
    border-color: #9aa7b3;
    color: #3a4a5a;
}

.contributor-badge--gold {
    background: #fff1c1;
    border-color: #c9a227;
    color: #7a5a00;
}

.contributor-badge--platinum {
    background: #e6f3ff;
    border-color: #63a6d9;
    color: #1d4f7a;
}

.contributors-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.section-subtitle {
    margin: 6px 0 12px;
    font-size: 1.05rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.activity-main {
    flex: 1;
}

.activity-title {
    font-weight: 600;
}

.activity-meta {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 4px;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.85em;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .activity-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .activity-time {
        white-space: normal;
    }
}

/* Patreon badge */
.patreon-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 1px solid #d4af37;
    color: #7a5a00;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.patreon-badge:before {
    content: '★';
    font-size: 1em;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Contributors leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
}

.leaderboard-rank {
    font-weight: 800;
    color: var(--text-primary);
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-stats {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Promoted Events Section */
.promoted-events-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.promoted-event-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.promoted-event-card:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.promoted-event-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.promoted-star {
    color: #FFD700;
    font-size: 24px;
    flex-shrink: 0;
}

.promoted-event-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.promoted-event-owner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.promoted-event-owner img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.promoted-event-date {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.promoted-event-time {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.promoted-event-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 8px;
}

.promoted-event-type.seed {
    background: #667eea;
    color: white;
}

.promoted-event-type.stream {
    background: #764ba2;
    color: white;
}

/* ========================================
   Modern UI Enhancements
   Global hover effects, transitions, shadows
   ======================================== */

/* Universal transitions for smooth UI */
*,
*::before,
*::after {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced button base styles */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:hover::before {
    width: 300%;
    height: 300%;
}

.btn:active {
    transform: scale(0.98);
}

/* Soft shadow elevation system */
.elevation-1 {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.elevation-2 {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.elevation-3 {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.elevation-4 {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Card hover effects */
.section,
.pricing-card,
.menu-item,
.perf-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.section:hover,
.pricing-card:hover,
.perf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}

#admin-panelTab > .section:hover {
    transform: none;
    box-shadow: none;
}

/* Focus visible styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Selection color */
::selection {
    background: var(--accent);
    color: white;
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--accent-light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation for content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .container {
        padding: 12px;
        border-radius: 16px;
    }
    
    header {
        padding: 10px 12px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .main-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
    }
    
    .main-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .main-tab {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.85em;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .btn {
        display: none !important;
    }
    
    .main-area {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .app-shell {
        box-shadow: none;
        border: none;
    }
}
}

.promoted-event-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SingsClubKaraoke2 UI overrides
   ============================================ */

.titlebar {
    background: var(--darker-bg);
    border-bottom: 1px solid var(--border-color);
    -webkit-app-region: drag;
}

.header-content {
    height: 44px;
    padding: 0 16px;
    gap: 16px;
}

.header-left h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-center .status-message {
    color: var(--text-secondary);
}

.window-control-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    width: 46px;
    height: 100%;
    border-radius: 0;
    border-left: 1px solid var(--border-color);
}

.window-control-btn:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.window-control-close:hover {
    background: #e81123;
    color: #ffffff;
}

.main-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 6px;
}

.main-tab {
    flex: 0 0 auto;
    padding: 8px 20px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(6, 3, 18, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.main-tab:last-child {
    border-right: none;
}

.main-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.main-tab.active {
    background: rgba(139, 92, 246, 0.22);
    color: #ffffff;
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.25);
}

.main-content {
    background: transparent;
    color: var(--text-primary);
    overflow-y: auto;
}

.section,
.card,
.modal-content {
    background: transparent;
    border: none;
    color: var(--text-primary);
    box-shadow: none;
}

.section {
    border-radius: 0;
}

.recording-card,
.performance-card {
    border-radius: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.leaderboard-frame {
    width: 100%;
    height: 100vh;
    border: none;
}

.modal {
    background: rgba(5, 0, 8, 0.7);
}

.modal-content {
    border-radius: 0;
}

.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
}

input,
select,
textarea {
    background: rgba(5, 0, 8, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

.status-message {
    color: var(--text-secondary);
}

/* Friends page */
.friends-container,
.performances-container,
.admin-container,
.calendar-container,
.lyrics-editor-container,
.musician-container,
.profile-container {
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

body .friends-container .friends-header,
body .admin-container .admin-header,
body .calendar-container .calendar-header,
body .performances-container .performances-header,
body .dashboard-container .dashboard-header,
body .editor-container .editor-header {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

body .friends-container .friends-tabs,
body .admin-container .admin-tabs,
body .performances-container .performances-tabs,
body .dashboard-container .dashboard-tabs {
    border-bottom: 1px solid var(--border-color);
}

body .friends-container .friends-tab,
body .admin-container .admin-tab,
body .performances-container .performances-tab,
body .performances-container .performances-scope-tab,
body .dashboard-container .dashboard-tab {
    color: var(--text-secondary);
}

body .friends-container .friends-tab.active,
body .admin-container .admin-tab.active,
body .performances-container .performances-tab.active,
body .performances-container .performances-scope-tab.active,
body .dashboard-container .dashboard-tab.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

body .friends-container .friend-card,
body .admin-container .pending-card,
body .recording-card,
body .performance-card,
body .dashboard-container .performance-card,
body .dashboard-container .stat-card,
body .friend-performances-container .performance-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

body .recording-card--pinned,
body .performance-card--pinned,
body .dashboard-container .performance-card--pinned,
body .friend-performances-container .performance-card--pinned {
    border-color: var(--primary-button);
    box-shadow: 0 0 0 1px rgba(var(--primary-button-rgb), 0.35), 0 10px 24px rgba(var(--primary-button-rgb), 0.18);
}

body .friends-container .friend-card:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateX(4px);
    box-shadow: none;
}

.contributors-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.contributors-toolbar .status-message {
    margin: 0;
}

/* Performances */
.performance-card__meta,
.recording-meta {
    color: var(--text-secondary);
}

/* Calendar */
body .calendar-container .calendar-main {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

body .calendar-container .timeline-date-header {
    background: rgba(5, 0, 8, 0.95);
    border-bottom: 1px solid var(--border-color);
}

body .calendar-container .day-column {
    border-right: 1px solid rgba(139, 92, 246, 0.25);
}

/* Admin */
.admin-badge {
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

/* Buttons in headers */
.back-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-pink);
}

/* ===================================
   Song Library Styles
   =================================== */

.song-library-search-container {
    position: relative;
    margin-bottom: 20px;
}

.song-library-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.song-library-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.song-library-filter-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-library-filter-btn:hover {
    border-color: var(--primary-button);
    color: #ffffff;
}

.song-library-filter-btn.is-active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.55);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.2);
}

.song-library-search {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: var(--input-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.song-library-search:focus {
    outline: none;
    border-color: var(--primary-button);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    transition: color 0.2s ease;
}

.clear-search-btn:hover {
    color: var(--text);
}

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

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-button);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.song-library-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.song-library-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-library-item:hover {
    border-color: var(--primary-button);
    background: var(--hover-bg);
    transform: translateX(4px);
}

.song-library-item-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.song-library-item-info {
    flex: 1;
    min-width: 0;
}

.song-library-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-library-item-artist {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-library-item-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    width: fit-content;
}

.song-library-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.song-library-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    width: fit-content;
}

.song-library-item-tag.tag-solo {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #eafff2;
}

.song-library-item-tag.tag-duet {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #ecf4ff;
}

.song-library-item-submitter {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.45;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-library-item-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.song-library-item-type.is-solo {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #eafff2;
}

.song-library-item-type.is-duet {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #ecf4ff;
}

.song-library-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.song-library-item-action {
    padding: 8px 12px;
    background: var(--primary-button);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.song-library-item-action:hover {
    background: var(--primary-button-hover);
    transform: translateY(-2px);
}

.song-library-item-action.secondary {
    background: var(--secondary-button);
}

/* Friends Tab */
.friends-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.friends-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.friends-subtitle {
    margin: 6px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.friends-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.friends-search {
    flex: 1;
    min-width: 240px;
}

.friends-search input {
    width: 100%;
    padding: 10px 12px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
}

.friends-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.friends-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.friends-aside {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.friends-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.friends-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.summary-value {
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 6px;
    color: var(--text-primary);
}

.friends-aside-section {
    margin-top: 16px;
}

.friends-aside-section h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
}

.friends-aside-section p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
}

.friends-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.friends-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.friends-tab:hover {
    color: var(--text-primary);
}

.friends-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-button);
}

.friends-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.friends-tab-content.active {
    display: block;
}

.friend-card {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    min-height: 80px;
}

.friend-card:hover {
    background: var(--accent-light);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

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

.friend-username {
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.friend-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.add-friend-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-friend-input {
    flex: 1;
    padding: 10px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
}

.suggestion-badge {
    background: var(--primary-button);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-left: 10px;
}

.friends-warning-banner {
    display: block;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.section-spacing {
    margin-top: 30px;
}

.tab-intro {
    margin-bottom: 20px;
}

@media (max-width: 1100px) {
    .friends-shell {
        grid-template-columns: 1fr;
    }

    .friends-aside {
        order: -1;
    }

    .friends-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .friends-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .friends-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .friend-card {
        grid-template-columns: 50px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .friend-avatar {
        width: 50px;
        height: 50px;
    }

    .friend-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 8px;
    }

    .friend-username {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .friend-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .friend-avatar {
        justify-self: center;
    }

    .friend-info {
        text-align: center;
    }

    .friend-username {
        justify-content: center;
    }

    .friend-meta {
        justify-content: center;
    }

    .friend-actions {
        justify-content: center;
    }
}

/* Calendar Tab */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    gap: 16px;
    padding: 20px;
    min-height: 70vh;
    --date-header-height: 60px;
    --time-header-height: 40px;
    --time-slot-width: 24px;
    --event-card-width: 240px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 220px;
}

.calendar-header h1 {
    font-size: clamp(18px, 2.2vw, 26px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.calendar-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    flex-wrap: wrap;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.calendar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--card-background);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    min-height: 520px;
}

.event-notifications {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: min(420px, 90vw);
}

.event-notification-card {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.event-notification-card h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-primary);
}

.event-notification-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-notification-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.notification-dismiss-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.notification-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.timeline-container {
    flex: 1;
    position: relative;
    overflow: auto;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.7) 100%), var(--background);
    min-height: 420px;
}

.timeline-container.dragging {
    cursor: grabbing;
}

.timeline-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    will-change: transform;
}

.timeline-grid {
    position: absolute;
    top: calc(var(--date-header-height) + var(--time-header-height));
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

.timeline-grid-canvas {
    position: absolute;
    top: calc(var(--date-header-height) + var(--time-header-height));
    left: 0;
    pointer-events: none;
    z-index: 2;
}

.timeline-date-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--date-header-height);
    background: var(--glass);
    border-bottom: 2px solid var(--border);
    display: flex;
    z-index: 10;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.timeline-time-header {
    position: absolute;
    top: var(--date-header-height);
    left: 0;
    right: 0;
    height: var(--time-header-height);
    background: var(--glass);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 9;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: height 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
}

.time-header-slot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 700;
    height: 100%;
    border-right: 1px dashed rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    min-width: var(--time-slot-width);
    padding-left: 10px;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 0;
}

.timeline-time-header.hide-time-labels .time-header-slot {
    opacity: 0;
}

.timeline-container.time-collapsed .timeline-time-header {
    height: 0;
    opacity: 0;
}

.time-header-slot.is-hour {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    letter-spacing: 0.4px;
}

.day-column {
    position: relative;
    top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.day-header {
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    position: absolute;
    top: 0;
}

.day-header .day-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 2px;
}

.day-header .day-date {
    font-size: 22px;
    margin-top: 4px;
    font-weight: 700;
}

.current-time-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    z-index: 100;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    pointer-events: none;
}

.current-time-indicator {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #e74c3c;
}

.current-time-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.event-card {
    position: absolute;
    background: var(--input-background);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid var(--primary-button);
    min-height: 80px;
    width: var(--event-card-width);
    left: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50;
    color: #0f0f14;
}

.event-card.is-complete {
    opacity: 0.55;
    filter: grayscale(0.35);
    box-shadow: none;
}

.calendar-main.is-compact .time-header-slot {
    font-size: 11px;
    padding-left: 8px;
}

.calendar-main.is-compact .event-card {
    padding: 8px 10px;
    min-height: 64px;
    font-size: 12px;
}

.calendar-main.is-compact .event-title {
    font-size: 12px;
}

.calendar-main.is-compact .event-owner {
    font-size: 10px;
}

.event-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.event-card.is-complete:hover {
    transform: none;
    box-shadow: none;
}

.event-card.promoted {
    border: 3px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.event-card.promoted:hover {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.event-card.seed,
.event-card.event {
    border-left-color: #667eea;
}

.event-card.promoted.seed,
.event-card.promoted.event {
    border-left: 4px solid #667eea;
}

.event-card.stream,
.event-card.streaming {
    border-left-color: #764ba2;
}

.event-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f0f14;
    margin-bottom: 4px;
}

.event-owner {
    font-size: 12px;
    color: #3b3f4f;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.event-owner img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.event-time {
    font-size: 11px;
    color: #5b6072;
}

.event-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

.event-type-badge.seed,
.event-type-badge.event {
    background: #667eea;
    color: white;
}

.event-type-badge.stream,
.event-type-badge.streaming {
    background: #764ba2;
    color: white;
}

.event-status-badge {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 6px;
    background: rgba(120, 120, 120, 0.2);
    color: #6f7280;
    border: 1px solid rgba(120, 120, 120, 0.35);
}

.event-card .event-star-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.event-card .event-star-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.12);
}

.event-card.is-starred .event-star-btn {
    background: rgba(255, 200, 0, 0.2);
    border-color: rgba(255, 200, 0, 0.6);
    color: #ffd15a;
}

.event-card .event-stream-btn {
    position: absolute;
    top: 8px;
    right: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 60, 0.5);
    background: rgba(255, 100, 0, 0.22);
    color: #ffd5a0;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    letter-spacing: 0.5px;
    display: none;
}

.event-card.has-stream .event-stream-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.promoted-star-badge {
    color: #FFD700;
    font-weight: bold;
    font-size: 16px;
    margin-right: 4px;
}

.zoom-controls {
    display: flex;
    gap: 8px;
    background: rgba(7, 4, 14, 0.65);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.view-controls {
    display: flex;
    gap: 6px;
    background: rgba(7, 4, 14, 0.65);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.calendar-controls .btn,
.zoom-controls .btn,
.view-controls .btn {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.calendar-controls .btn:hover,
.zoom-controls .btn:hover,
.view-controls .btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.calendar-controls .btn:disabled,
.zoom-controls .btn:disabled,
.view-controls .btn:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.12);
    cursor: not-allowed;
    box-shadow: none;
}

.view-controls .btn.is-active {
    background: linear-gradient(135deg, var(--primary-button), var(--secondary-button));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.35);
}

.zoom-level {
    font-size: clamp(10px, 1.4vw, 12px);
    color: rgba(255, 255, 255, 0.75);
    padding: 0 8px;
    display: flex;
    align-items: center;
}

@media (max-width: 980px) {
    .calendar-controls {
        justify-content: flex-start;
    }

    .calendar-header {
        align-items: flex-start;
    }
}

/* Musician Onboarding */
.onboarding-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 40px;
}

.onboarding-header h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.onboarding-header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.onboarding-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.onboarding-container .form-group {
    margin-bottom: 25px;
}

.onboarding-container .form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.onboarding-container .form-group .helper-text {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.onboarding-container .form-group input[type="text"],
.onboarding-container .form-group input[type="url"],
.onboarding-container .form-group textarea,
.onboarding-container .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-background);
    color: var(--input-text);
    font-size: 1em;
    font-family: inherit;
}

.onboarding-container .form-group select option {
    color: var(--input-text);
    background: var(--input-background);
}

.onboarding-container .form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.onboarding-container .form-group input:focus,
.onboarding-container .form-group textarea:focus,
.onboarding-container .form-group select:focus {
    outline: none;
    border-color: var(--primary-button);
}

.social-links-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.onboarding-container .status-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.onboarding-container .status-message.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
    display: block;
}

.onboarding-container .status-message.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #F44336;
    display: block;
}

body.auth-locked #musician-onboardingTab input,
body.auth-locked #musician-onboardingTab select,
body.auth-locked #musician-onboardingTab textarea,
body.auth-locked #musician-onboardingTab button {
    pointer-events: auto !important;
    opacity: 1 !important;
}

#musician-onboardingTab input,
#musician-onboardingTab select,
#musician-onboardingTab textarea {
    -webkit-user-select: text;
    user-select: text;
    -webkit-app-region: no-drag;
}

.benefits-card {
    text-align: center;
    margin-top: 30px;
}

/* Musician Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.dashboard-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.artist-name {
    color: var(--text-primary);
    font-weight: 600;
}

.dashboard-header-actions {
    display: flex;
    gap: 10px;
}

.musician-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, var(--primary-button), var(--accent));
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.dashboard-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.dashboard-tab:hover {
    color: var(--text-primary);
}

.dashboard-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-button);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-button);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.performance-list {
    display: grid;
    gap: 15px;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.action-card:hover {
    background: var(--accent-light);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.action-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.action-desc {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.create-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
}

.video-preview {
    margin-top: 10px;
    display: none;
}

.preview-video {
    max-width: 100%;
    border-radius: 6px;
}

.create-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Admin Panel */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
}

body.admin-panel-active #mainSidebar {
    display: none;
}

body.admin-panel-active .main-area {
    margin-left: 0;
    width: 100%;
}

#admin-panelTab .admin-layout {
    display: block;
}

#admin-panelTab .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 200;
}

#admin-panelTab .admin-main-area {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    overflow-y: auto;
}

#admin-panelTab .sidebar.collapsed ~ .admin-main-area {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.admin-layout #backToAppSidebarBtn,
.admin-layout #backToAppSidebarBtn:hover,
.admin-layout #backToAppSidebarBtn:active {
    transform: none;
    animation: none;
}

.admin-container {
    max-width: none;
    margin: 0;
    padding: 20px 28px;
    width: 100%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.admin-header-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-name {
    color: var(--text-primary);
    font-weight: 600;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.admin-tabs {
    display: none;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.admin-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-tab:hover {
    color: var(--text-primary);
}

.admin-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-button);
}

.roles-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (min-width: 1100px) {
    .roles-grid {
        grid-template-columns: minmax(340px, 1fr) minmax(460px, 1.35fr);
    }
}

.roles-panel {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

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

.roles-help {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.roles-form {
    display: grid;
    gap: 12px;
}

.roles-form-row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 12px;
    align-items: center;
}

.roles-form-row input,
.roles-form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-background);
    color: var(--input-text);
    font-family: inherit;
}

.roles-form-row input::placeholder {
    color: var(--input-placeholder);
}

.roles-form-row select option {
    color: var(--input-text);
    background: var(--input-background);
}

.roles-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roles-list-item {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--background);
    overflow-wrap: anywhere;
}

.roles-list-header {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
}

.roles-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.roles-status {
    margin-top: 12px;
}

.pending-card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.pending-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.pending-info h3 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.pending-meta {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.pending-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #f59e0b;
}

.status-approved {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-committed {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.pending-details {
    margin: 15px 0;
    padding: 15px;
    background: var(--background);
    border-radius: 6px;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-value {
    color: var(--text-primary);
}

.pending-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.rejection-form {
    margin-top: 15px;
    padding: 15px;
    background: var(--background);
    border-radius: 6px;
    border: 1px solid var(--border);
    display: none;
}

.rejection-form.active {
    display: block;
}

.rejection-helper {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.rejection-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-background, #ffffff);
    color: var(--text-primary);
    font-family: inherit;
    margin-bottom: 10px;
}

.song-library-item-action.secondary:hover {
    background: var(--secondary-button-hover);
}

.song-library-item-action.danger {
    background: var(--danger-button, #dc3545);
    min-width: auto;
    padding: 8px 10px;
}

.song-library-item-action.danger:hover {
    background: var(--danger-button-hover, #c82333);
}

@media (max-width: 960px) {
    .roles-form-row {
        grid-template-columns: 1fr;
    }

    .roles-list-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .roles-actions {
        justify-content: flex-start;
    }
}
