:root {
    --ink: #111;
    --muted: #6a6a6a;
    --paper: #fff;
    --card: #fff;
    --yellow: #ffef9a;
    --play: #ffef9a;
    --line: #111;
    --grid: #ececec;
    --error: #8a1f12;
    --ok: #1f5a32;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    color: var(--ink);
    background: var(--paper);
    font-family: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.topnav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.95rem;
}

.topnav a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
    border-bottom-color: var(--ink);
}

body.home {
    position: relative;
    min-height: 100vh;
}

body.home .topnav {
    position: absolute;
    top: 18px;
    right: 28px;
    z-index: 20;
}

.stage {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 56px);
    row-gap: 24px;
    min-height: 100vh;
    padding: 52px clamp(20px, 3vw, 40px) 24px;
    align-items: start;
}

.logo {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: stretch;
    display: flex;
    justify-content: flex-end;
}

.logo img {
    display: block;
    width: min(100%, 300px);
    background: #fff;
}

.brand {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    min-width: 0;
    padding-top: 8px;
}

.brand h1 {
    margin: 0;
}

.brand h1 img {
    display: block;
    width: min(100%, 540px);
}

.blurb,
.howto {
    margin: 0 0 8px;
    max-width: 36em;
    color: var(--ink);
    font-size: 0.95rem;
}

.blurb {
    margin-top: 22px;
}

.letter-picks {
    margin: 0 0 12px;
    max-width: 36em;
}

.struggling {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
}

.letter-picks.open .struggling {
    display: none;
}

.letter-picks p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.letter-picks-row {
    display: flex;
    gap: 8px;
}

.letter-picks-row button {
    appearance: none;
    width: 2.1em;
    height: 2.1em;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: inherit;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.letter-picks-row button:hover:not(:disabled) {
    background: var(--yellow);
}

.letter-picks-row button.on {
    background: var(--play);
    cursor: default;
}

.letter-picks-row button:disabled:not(.on) {
    opacity: 0.35;
    cursor: default;
}

.letter-picks-meta {
    margin: 6px 0 0;
}

.hang-blank.hinted {
    cursor: default;
}

.cuts-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

.player {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: end;
    width: min(100%, 380px);
    background: var(--card);
    border: 1px solid var(--line);
    padding: 12px 12px 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.player h2 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 400;
}

.player audio {
    display: none;
}

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

#cuts-play {
    appearance: none;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: var(--play);
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    padding: 4px 10px;
    cursor: pointer;
}

#cuts-play:hover {
    filter: brightness(0.97);
}

.now {
    flex: 1;
    min-width: 0;
}

#cuts-now {
    margin: 0 0 2px;
    font-size: 0.95rem;
}

#cuts-time {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

#cuts-seek {
    width: 100%;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
}

.plist {
    list-style: none;
    margin: 0 -12px 0;
    padding: 0;
    overflow: visible;
    border-top: 1px solid var(--grid);
}

.plist li {
    margin: 0;
}

.plist button {
    appearance: none;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--grid);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.86rem;
    line-height: 1.25;
    padding: 3px 12px;
    cursor: pointer;
}

.plist button span {
    display: inline-block;
    width: 2em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.plist button.on,
.plist button:hover {
    background: var(--yellow);
}

.game {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 24px;
    width: 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    border: 1px solid var(--line);
    background: var(--card);
    padding: 14px 16px 18px;
}

.mix {
    padding: 0 0 18px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--grid);
}

.mix:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.mix.listening h3 {
    background: var(--yellow);
}

.mix h3 {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0 0 12px;
    padding: 2px 6px;
}

.hang-row {
    display: block;
    margin: 0 0 0.55em;
    padding: 1px 6px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    font-variant-ligatures: none;
    font-size: 0.95rem;
}

.hang-row.solved {
    background: #ff8a2b;
}

.hang-remix {
    display: none;
}

.hang-row.solved .hang-remix {
    display: inline;
}

.hang-row.solved .hang-remix-clue {
    display: none;
}

.hang-remix-clue {
    color: var(--muted);
}

.hang-num {
    color: var(--muted);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.hang-given,
.hang-punct,
.hang-dash,
.hang-blank {
    display: inline;
    font: inherit;
}

.hang-blank {
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: text;
}

.hang-blank:focus {
    outline: none;
    background: var(--yellow);
}

.hang-dash {
    letter-spacing: 0;
    color: var(--muted);
}

.refresh {
    display: inline-block;
    margin: 0;
    font-size: inherit;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.inner-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 28px 0;
}

.inner-head .topnav {
    flex: 0 0 auto;
    padding-top: 6px;
}

.inner-mark {
    display: block;
    width: min(420px, 58vw);
}

.inner-main {
    width: min(640px, calc(100% - 56px));
    margin: 28px 28px 64px;
}

.inner-main h2 {
    font-size: 1.4rem;
    font-weight: 500;
    margin: 0 0 12px;
}

.lede {
    max-width: 36em;
    margin: 0 0 22px;
    color: var(--muted);
}

form {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 22px;
}

label {
    display: block;
    margin: 0 0 14px;
    font-size: 0.92rem;
}

label span {
    display: block;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bbb;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
textarea:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.captcha-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.captcha-row img {
    display: block;
    height: 56px;
    width: auto;
    border: 1px solid var(--line);
    background: #fff;
}

.captcha-row label {
    flex: 1;
    margin: 0;
}

form .refresh {
    margin: 6px 0 16px;
    font-size: 0.85rem;
}

button[type="submit"] {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--play);
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    padding: 10px 18px;
    cursor: pointer;
}

.flash {
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.flash.error {
    background: #f8e4df;
    color: var(--error);
}

.flash.ok {
    background: #e5f3e8;
    color: var(--ok);
}

@media (max-height: 900px) {
    .logo img {
        width: min(100%, 200px);
    }

    .plist button {
        padding: 2px 12px;
    }
}

@media (max-width: 720px) {
    body.home {
        height: auto;
        overflow: auto;
    }

    body.home .topnav {
        position: static;
        justify-content: flex-end;
        padding: 16px 16px 0;
    }

    .stage {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 8px 16px 32px;
        gap: 20px;
    }

    .logo img {
        width: min(100%, 280px);
    }

    .player,
    .brand h1 img {
        width: 100%;
        max-width: none;
    }

    .logo,
    .player {
        justify-self: stretch;
        margin-left: auto;
    }

    .game {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .inner-head {
        flex-direction: column;
        padding: 16px 16px 0;
    }

    .inner-main {
        width: calc(100% - 32px);
    }
}
