/* soundbot: start page, Speaker and Admin. Builds on soundbot.css. */

.sb-page {
    --now-h: 0px;
    --dock-h: 0px;
}

/* Page shell */

.sb-top--page {
    grid-template-columns: auto 1fr auto;
}

.sb-nav {
    display: flex;
    gap: 4px;
}

.sb-nav a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.sb-nav a:hover {
    background: var(--tile);
    color: var(--text);
}

.sb-nav a[aria-current='page'] {
    background: var(--tile);
    color: var(--text);
}

.sb-page-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.sb-lede {
    max-width: 60ch;
    margin-top: 8px;
    color: var(--muted);
    font-size: 1.0625rem;
}

code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--tile-press);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875em;
    font-weight: 600;
    white-space: nowrap;
}

/* Start page */

.sb-setup__main {
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 32px 64px;
}

.sb-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.sb-step {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: start;
    gap: 20px;
    padding: 24px;
    border-radius: var(--radius-large);
    background: var(--tile);
}

.sb-step__num {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tile-press);
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sb-step.is-done .sb-step__num {
    background: var(--accent);
    color: #fff;
}

.sb-step h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.0625rem;
    font-weight: 700;
}

.sb-step h2 .sb-icon {
    color: var(--muted);
}

.sb-step__body p {
    max-width: 56ch;
    margin-top: 6px;
    color: var(--muted);
}

.sb-step__body .sb-step__status {
    margin-top: 10px;
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
}

.sb-step__status[data-state='online'] {
    color: var(--online);
}

.sb-step__status[data-state='warn'] {
    color: #ff8f91;
}

.sb-step > .sb-btn {
    align-self: center;
}

.sb-copy {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.sb-copy input,
.sb-field input,
.sb-field select {
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--ground);
    color: var(--text);
    font: inherit;
}

.sb-copy input {
    flex: 1;
    color: var(--muted);
}

.sb-copy input:focus,
.sb-field input:focus,
.sb-field select:focus {
    border-color: var(--accent-text);
    outline: none;
}

.sb-field input::placeholder {
    color: var(--faint);
}

/* Speaker */

.sb-speaker {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sb-speaker .sb-stage {
    flex: 1;
}

.sb-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 32px;
    text-align: center;
}

.sb-stage__icon {
    width: 72px;
    height: 72px;
    padding: 16px;
    border-radius: 20px;
    background: var(--tile);
    color: var(--muted);
    stroke-width: 1.5;
    transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.sb-stage[data-state='playing'] .sb-stage__icon {
    background: var(--accent);
    color: #fff;
}

.sb-stage__sub {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 600;
}

.sb-stage[data-state='playing'] .sb-stage__sub {
    color: var(--accent-text);
}

.sb-stage__title {
    max-width: 18ch;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.sb-stage[data-state='idle'] .sb-stage__title {
    color: var(--muted);
}

.sb-stage__progress {
    display: grid;
    grid-template-columns: 40px minmax(0, 480px) 40px;
    align-items: center;
    gap: 12px;
    width: min(600px, 100%);
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.sb-stage__progress .sb-now__time:last-child {
    text-align: right;
}

.sb-stage__progress .sb-now__track {
    height: 6px;
    border-radius: 3px;
}

.sb-stage[data-state='idle'] .sb-stage__progress {
    visibility: hidden;
}

.sb-stage__hint {
    color: var(--muted);
}

.sb-stage__hint a {
    color: var(--accent-text);
    font-weight: 600;
    text-underline-offset: 3px;
}

.sb-upcoming {
    width: min(560px, calc(100% - 32px));
    margin: 0 auto 32px;
    padding: 16px 20px;
    border-radius: var(--radius-large);
    background: var(--tile);
}

.sb-upcoming h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.sb-upcoming h2 .sb-icon {
    width: 16px;
    height: 16px;
}

.sb-upcoming ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sb-upcoming li {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.sb-upcoming li:first-child {
    border-top: 0;
}

.sb-upcoming time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.sb-unlock {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 9, 12, 0.8);
}

.sb-unlock[hidden] {
    display: none;
}

.sb-unlock__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    max-width: 440px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: var(--tile);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.sb-unlock__card .sb-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-text);
}

.sb-unlock__card h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.sb-unlock__card p {
    color: var(--muted);
}

.sb-unlock__card .sb-btn {
    height: 48px;
    margin-top: 4px;
    padding: 0 20px;
    font-size: 1rem;
}

.sb-yplayer {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Admin */

.sb-admin__main {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 32px 120px;
}

.sb-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding: 10px 10px 10px 16px;
    border-radius: var(--radius-large);
    background: var(--warn-bg);
    color: var(--warn-text);
    font-weight: 600;
}

.sb-alert[hidden] {
    display: none;
}

.sb-alert .sb-btn--icon {
    color: var(--warn-text);
}

.sb-card {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-large);
    background: var(--surface);
    border: 1px solid var(--line);
}

.sb-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sb-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.sb-card__meta {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.sb-card__note {
    max-width: 70ch;
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.sb-subhead {
    margin: 20px 0 8px;
    font-size: 0.9375rem;
    font-weight: 700;
}

.sb-upload {
    position: relative;
    overflow: hidden;
}

.sb-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.sb-upload:focus-within {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.sb-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

#sound-list {
    max-height: 520px;
    margin: 0 -8px;
    padding: 0 8px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.sb-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 40px 40px;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 6px 4px 6px 8px;
    border-top: 1px solid var(--line);
}

.sb-rows:not(.sb-rows--form) .sb-row:first-child {
    border-top: 0;
}

.sb-row .sb-tile__key {
    justify-self: start;
}

.sb-keypick {
    justify-self: start;
    width: 44px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: var(--tile-press);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45);
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    appearance: none;
}

.sb-keypick:hover {
    background: var(--tile-hover);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-text);
}

.sb-keypick.is-empty {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--faint);
}

.sb-keypick:disabled {
    opacity: 0.6;
}

.sb-row__nokey {
    justify-self: start;
    min-width: 28px;
    color: var(--faint);
    text-align: center;
}

.sb-row__name {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-row__meta {
    color: var(--muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.sb-danger:hover {
    background: var(--warn-bg);
    color: #ff8f91;
}

.sb-danger.is-confirming {
    width: auto;
    padding: 0 12px;
    background: var(--stop);
    color: #fff;
}

.sb-rows--form .sb-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
    align-items: start;
    gap: 12px;
    padding: 12px 0;
}

.sb-rows--form .sb-row:first-child {
    border-top: 0;
    padding-top: 4px;
}

.sb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sb-field label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.sb-field input[aria-invalid='true'] {
    border-color: #ff9a9c;
}

.sb-field__error {
    color: #ff9a9c;
    font-size: 0.8125rem;
}

.sb-field__error[hidden] {
    display: none;
}

.sb-row__remove {
    margin-top: 22px;
}

.sb-add {
    margin-top: 8px;
    padding-left: 8px;
    color: var(--accent-text);
}

.sb-add:hover {
    color: var(--accent-text);
}

.sb-savebar:not(.is-dirty) {
    display: none;
}

.sb-field select[aria-invalid='true'] {
    border-color: #ff9a9c;
}

.sb-savebar {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 12px 12px 12px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: var(--tile);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.sb-savebar__status {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.sb-savebar.is-dirty .sb-savebar__status {
    color: var(--text);
}

/* Create page */

.sb-btn--large {
    height: 52px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 1rem;
}

.sb-home main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.sb-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    align-items: center;
    gap: 64px;
    padding: 72px 0 88px;
}

.sb-hero h1 {
    max-width: 12ch;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.sb-hero .sb-lede {
    margin-top: 20px;
    font-size: 1.1875rem;
    line-height: 1.5;
}

.sb-hero__cta {
    margin-top: 32px;
}

.sb-hero__cta p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.875rem;
}

.sb-demo {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.sb-demo__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 16px;
    border-bottom: 1px solid var(--line);
}

.sb-demo__bar .sb-logo {
    font-size: 1.0625rem;
}

.sb-demo__bar .sb-presence {
    margin: 0;
}

.sb-demo__label {
    margin: 16px 4px 10px;
    font-size: 0.9375rem;
    font-weight: 700;
}

.sb-demo__grid.sb-grid--large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sb-demo__grid .sb-tile {
    min-height: 96px;
}

.sb-demo__now {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--ground);
}

.sb-demo__now .sb-now__icon {
    width: 36px;
    height: 36px;
    padding: 8px;
}

.sb-demo__now[data-state='playing'] .sb-now__icon {
    background: var(--accent);
    color: #fff;
}

.sb-demo__now .sb-now__track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 0;
    background: transparent;
}

.sb-demo__now .sb-now__fill {
    background: var(--accent-text);
}

.sb-demo figcaption {
    margin: 12px 4px 0;
    color: var(--faint);
    font-size: 0.75rem;
}

.sb-how,
.sb-features,
.sb-close {
    padding: 72px 0;
    border-top: 1px solid var(--line);
}

.sb-how h2,
.sb-features h2,
.sb-close h2 {
    max-width: 22ch;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.sb-how__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
}

.sb-how__steps h3,
.sb-features h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 6px;
    font-size: 1.125rem;
    font-weight: 700;
}

.sb-how__steps h3 .sb-icon {
    color: var(--muted);
}

.sb-how__steps p,
.sb-features p {
    max-width: 40ch;
    color: var(--muted);
    line-height: 1.55;
}

.sb-features ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 64px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
}

.sb-features li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 16px;
}

.sb-features li > .sb-icon {
    width: 40px;
    height: 40px;
    padding: 9px;
    border-radius: 10px;
    background: var(--tile);
    color: var(--accent-text);
}

.sb-features h3 {
    margin-top: 6px;
}

.sb-close {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 96px;
}

.sb-close p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.sb-close p .sb-icon {
    flex: none;
}

.sb-close form {
    margin-top: 8px;
}

@media (max-width: 960px) {
    .sb-hero {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 48px 0 64px;
    }

    .sb-how__steps {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 720px) {
    .sb-home main {
        padding: 0 16px;
    }

    .sb-hero {
        padding-top: 32px;
    }

    .sb-hero h1 {
        font-size: 2.5rem;
    }

    .sb-hero .sb-lede {
        font-size: 1.0625rem;
    }

    .sb-top--page .sb-btn--primary {
        height: 36px;
        padding: 0 12px;
    }

    .sb-demo__grid.sb-grid--large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sb-how,
    .sb-features,
    .sb-close {
        padding: 48px 0;
    }

    .sb-how h2,
    .sb-features h2,
    .sb-close h2 {
        font-size: 1.625rem;
    }

    .sb-features ul {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sb-close p {
        align-items: flex-start;
    }
}

/* Responsive */

@media (max-width: 720px) {
    .sb-page {
        --top-h: 56px;
    }

    .sb-top--page {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: none;
        height: var(--top-h);
        padding: 0 16px;
    }

    .sb-top--page .sb-presence {
        display: none;
    }

    .sb-nav a {
        padding: 0 10px;
    }

    .sb-setup__main,
    .sb-admin__main {
        padding: 28px 16px 96px;
    }

    .sb-page-title {
        font-size: 1.625rem;
    }

    .sb-step {
        grid-template-columns: 32px 1fr;
        gap: 14px;
        padding: 18px;
    }

    .sb-step__num {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .sb-step > .sb-btn {
        grid-column: 2;
        justify-self: start;
    }

    .sb-copy {
        flex-direction: column;
    }

    .sb-card {
        padding: 18px 16px;
    }

    .sb-card__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .sb-row {
        grid-template-columns: 48px minmax(0, 1fr) 40px 40px;
    }

    .sb-row__meta {
        display: none;
    }

    .sb-rows--form .sb-row {
        grid-template-columns: minmax(0, 1fr) 40px;
    }

    .sb-rows--form .sb-row .sb-field:nth-child(2) {
        grid-column: 1;
    }

    .sb-rows--form .sb-row__remove {
        grid-column: 2;
        grid-row: 1;
    }

    .sb-savebar {
        bottom: 8px;
    }

    .sb-stage__title {
        font-size: 2.25rem;
    }
}
