*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #f9f2e8;
    background:
        radial-gradient(circle at top left, rgba(209, 56, 48, 0.38), transparent 34rem),
        linear-gradient(145deg, #17110c 0%, #251811 42%, #10100f 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.app-shell {
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 16px 36px;
}

.hero {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 56px;
}

.eyebrow {
    margin: 0;
    color: #ffd082;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(3rem, 16vw, 5.8rem);
    line-height: 0.88;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.intro,
.page-header p {
    margin: 0;
    max-width: 32rem;
    color: #f4d9b7;
    font-size: 1.08rem;
}

.action-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.big-action {
    display: grid;
    min-height: 112px;
    align-content: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.big-action span {
    font-size: 1.45rem;
    font-weight: 900;
}

.big-action small {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
}

.big-action-list {
    background: #f9f2e8;
    color: #17110c;
}

.big-action-list small {
    color: #684735;
}

.big-action-signup,
.submit-button {
    background: #d13830;
    color: #fffaf2;
}

.page-header {
    display: grid;
    gap: 10px;
    padding: 8px 0 18px;
}

.page-header h1 {
    max-width: none;
    font-size: clamp(2.4rem, 11vw, 4.6rem);
}

.back-link {
    justify-self: start;
    color: #ffd082;
    font-weight: 800;
    text-decoration: none;
}

.back-link::before {
    content: "< ";
}

.panel {
    display: grid;
    gap: 14px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(20, 14, 10, 0.76);
    padding: 16px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.field-label {
    display: block;
    margin-bottom: 7px;
    color: #ffd082;
    font-weight: 850;
}

input[type="text"],
input[type="search"] {
    width: 100%;
    min-height: 52px;
    border: 2px solid rgba(255, 208, 130, 0.34);
    border-radius: 8px;
    background: #fffaf2;
    color: #17110c;
    padding: 12px 14px;
    outline: none;
}

input:focus {
    border-color: #ffd082;
    box-shadow: 0 0 0 4px rgba(255, 208, 130, 0.16);
}

.state-text,
.form-error {
    color: #f4d9b7;
}

.browse-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.browse-head h2 {
    margin-top: 4px;
}

.song-count {
    color: #ffd082;
    font-weight: 900;
    text-align: right;
}

.letter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.letter-tab {
    display: inline-grid;
    min-width: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 208, 130, 0.28);
    border-radius: 8px;
    background: rgba(255, 250, 242, 0.08);
    color: #fffaf2;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1;
    padding: 0 9px;
}

.letter-tab[data-letter="all"] {
    min-width: 54px;
}

.letter-tab:hover,
.letter-tab:focus-visible {
    border-color: rgba(255, 208, 130, 0.68);
    outline: none;
}

.letter-tab.is-active {
    border-color: #ffd082;
    background: #ffd082;
    color: #17110c;
}

.letter-tab:disabled {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.12);
    color: rgba(244, 217, 183, 0.42);
    cursor: not-allowed;
}

.form-error {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(209, 56, 48, 0.22);
    padding: 12px;
    font-weight: 750;
}

.song-list,
.picker-results {
    display: grid;
    gap: 10px;
}

.song-card,
.picker-option {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 250, 242, 0.08);
    color: #fffaf2;
    padding: 12px;
    text-align: left;
}

.song-card {
    cursor: pointer;
}

.song-card:hover,
.song-card:focus-within {
    border-color: rgba(255, 208, 130, 0.5);
    background: rgba(255, 250, 242, 0.12);
}

.picker-option {
    cursor: pointer;
}

.song-card-main {
    display: grid;
    min-width: 0;
    gap: 2px;
    color: inherit;
    text-decoration: none;
}

.song-card-main:hover {
    text-decoration: none;
}

.lyrics-button {
    justify-self: start;
    min-height: 38px;
    margin-top: 8px;
    border: 1px solid rgba(255, 208, 130, 0.36);
    border-radius: 8px;
    background: #fffaf2;
    color: #17110c;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.song-title {
    min-width: 0;
    font-size: 1.02rem;
    font-weight: 850;
}

.song-artist {
    min-width: 0;
    color: #f4d9b7;
    font-size: 0.94rem;
}

.signup-form {
    display: grid;
    gap: 18px;
}

.form-row,
.song-picker {
    min-width: 0;
}

.selected-song {
    margin-top: 9px;
    border-radius: 8px;
    background: rgba(255, 208, 130, 0.16);
    color: #fffaf2;
    padding: 10px 12px;
}

.picker-results {
    margin-top: 10px;
}

.submit-button,
.secondary-button {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 14px 18px;
    font-weight: 900;
    text-decoration: none;
}

.submit-button {
    width: 100%;
    cursor: pointer;
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.secondary-button {
    background: #fffaf2;
    color: #17110c;
}

.confirmation {
    display: grid;
    gap: 14px;
}

.confirmation[hidden],
[hidden] {
    display: none !important;
}

.confirm-choice {
    display: grid;
    gap: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 12px;
}

.confirm-choice strong {
    color: #ffd082;
}

.lyrics-modal[hidden] {
    display: none;
}

.lyrics-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: end center;
    padding: 14px;
}

.lyrics-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 8, 5, 0.78);
}

.lyrics-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(100%, 720px);
    max-height: 88vh;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: #17110c;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
    overflow: hidden;
}

.lyrics-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.lyrics-head p {
    margin: 4px 0 0;
    color: #f4d9b7;
}

.lyrics-close {
    min-height: 42px;
    padding: 10px 14px;
}

.lyrics-note {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 208, 130, 0.1);
    color: #ffd082;
    padding: 10px 16px;
    font-size: 0.86rem;
    font-weight: 850;
}

.lyrics-body {
    min-height: 240px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #0f0b08;
    color: #fffaf2;
    padding: 16px;
    font: inherit;
    font-size: 1.08rem;
    line-height: 1.62;
}

.has-modal-open {
    overflow: hidden;
}

@media (min-width: 640px) {
    .app-shell {
        padding: 36px 24px 56px;
    }

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

    .panel {
        padding: 22px;
    }
}

@media (max-width: 520px) {
    .browse-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .song-count {
        text-align: left;
    }

    .letter-tabs {
        gap: 6px;
    }

    .letter-tab {
        min-width: 33px;
        min-height: 34px;
        padding: 0 7px;
    }

    .letter-tab[data-letter="all"] {
        min-width: 50px;
    }
}
