* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: #111;
    color: white;
    font-family: Arial, sans-serif;
}

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

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

h1 {
    margin: 0 0 8px;
}

p {
    margin: 0;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary {
    background: #facc15;
    color: #111;
    border: none;
}

.card,
.song-card {
    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
}

input,
textarea,
select,
button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #444;
    background: #0f0f0f;
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
}

textarea {
    min-height: 220px;
    resize: vertical;
    font-family: monospace;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ddd;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.song-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

.song-meta {
    color: #bbb;
    margin-bottom: 12px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    align-items: center;
}

.controls button,
.controls select {
    width: auto;
    min-width: 70px;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.song-flow {
    padding: 8px 0;
}

.line-block {
    margin-bottom: 12px;
}

.scroll-x {
    overflow-x: auto;
    padding-bottom: 4px;
}

.chords-line,
.lyrics-line {
    display: block;
    width: max-content;
    min-width: 100%;
    white-space: pre;
    font-family: monospace;
    text-align: left;
}

.chords-line {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 4px;
    color: #facc15;
    font-weight: bold;
}

.lyrics-line {
    font-size: 22px;
    line-height: 1.35;
    color: white;
}

.scroll-x {
    overflow-x: auto;
    padding-bottom: 4px;
}

.song-flow .scroll-x {
    overflow-x: visible;
}

.chord-row,
.lyrics-row {
    display: flex;
    gap: 4px;
    min-width: max-content;
}

.cell {
    width: 24px;
    height: 32px;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.lyrics-cell {
    background: #222;
    cursor: default;
}

.space-cell {
    opacity: .25;
}

.error {
    background: #3b1111;
    border: 1px solid #7f1d1d;
    color: #fecaca;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.hint {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    body {
        padding: 14px;
    }

    .container {
        max-width: none;
        margin: 0;
    }

    .top-bar {
        flex-direction: row;
        align-items: flex-start;
    }

    .top-bar .btn {
        white-space: nowrap;
        font-size: 13px;
        padding: 9px 11px;
    }

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

    .controls {
        gap: 6px;
        margin: 16px 0;
    }

    .controls button,
    .controls select {
        width: auto;
        min-width: 58px;
        font-size: 13px;
        padding: 9px;
    }

    .line-block {
        margin-bottom: 8px;
    }

    .chords-line {
        font-size: 17px;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .lyrics-line {
        font-size: 17px;
        line-height: 1.3;
    }

    .cell {
        width: 22px;
        height: 30px;
        font-size: 11px;
    }
}