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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 20px;
}

header {
    text-align: center;
    background: white;
    color: #2d3748;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

header h1 {
    font-size: 24px;
}

.btn-back {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    color: #2d3748;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #cbd5e0;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section h2 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.section h3 {
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 15px;
}

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

input[type="text"],
input[type="number"],
textarea,
select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4299e1;
}

textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-neutral,
.btn-danger {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.2);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
}

.btn-neutral {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-neutral:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #f56565;
    color: white;
    font-size: 14px;
    padding: 8px 16px;
}

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

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

.category-item button {
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-selector {
    margin-bottom: 20px;
}

.song-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.add-song-form {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.songs-management-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-management-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
    border: 2px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
}

.song-management-item.editing {
    display: block;
}

.song-info {
    flex: 1;
}

.song-info .title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.song-info .artist {
    font-size: 14px;
    color: #666;
}

.song-info .spotify-id {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.song-diagnostics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.diagnostic-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid #d9deea;
    border-radius: 999px;
    background: white;
    color: #596273;
    font-size: 12px;
    font-weight: 700;
}

.diagnostic-pill.ok {
    border-color: rgba(19, 155, 114, 0.26);
    background: #e9f8f3;
    color: #0f7859;
}

.diagnostic-pill.warning {
    border-color: rgba(219, 65, 97, 0.24);
    background: #fff0f3;
    color: #b93250;
}

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

.edit-song-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.edit-song-grid .full-width {
    grid-column: 1 / -1;
}

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

.file-input-label {
    display: inline-block;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 20px;
    }

    .btn-back {
        position: static;
        display: block;
        margin-bottom: 10px;
        text-align: center;
    }

    .section {
        padding: 15px;
    }

    .import-export-actions {
        flex-direction: column;
    }

    .song-management-item {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .song-actions {
        justify-content: flex-start;
    }

    .edit-song-grid {
        grid-template-columns: 1fr;
    }
}

/* Shared LyricsGame visual language */
:root {
    --library-primary: #6557e8;
    --library-ink: #172033;
    --library-line: #e5e9f2;
}

body {
    color: var(--library-ink);
    background:
        radial-gradient(circle at 90% 0%, rgba(101, 87, 232, 0.15), transparent 32rem),
        linear-gradient(180deg, #f7f8fc, #eef1f7);
}

header {
    background: #171b2c;
    color: white;
    text-align: right;
    box-shadow: 0 12px 36px rgba(23, 27, 44, 0.18);
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.18);
}

.section {
    border: 1px solid rgba(229, 233, 242, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(30, 38, 67, 0.07);
}

.btn-primary {
    background: var(--library-primary);
}

.category-item,
.song-management-item,
.add-song-form {
    border-color: var(--library-line);
    border-radius: 12px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--library-primary);
    outline: 3px solid rgba(101, 87, 232, 0.12);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
