:root {
    --ink: #1c140f;
    --paper: #f3ecdf;
    --card: rgba(255, 250, 243, .78);
    --coral: #e23d2b;
    --muted: #6d5e52;
    --line: rgba(28, 20, 15, .14);
    --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
    --sans: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--sans);
    background:
        radial-gradient(900px 480px at 0% -10%, #ffd0b8 0%, transparent 55%),
        radial-gradient(640px 380px at 100% 0%, rgba(240, 201, 77, .45) 0%, transparent 46%),
        var(--paper);
}

h1, h2, p { margin: 0; }

button, input { font: inherit; color: inherit; }

a { color: inherit; }

::selection { background: var(--coral); color: #fffaf6; }

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.domain {
    margin: 0 0 18px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.mark {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(64px, 9vw, 112px);
    font-weight: 560;
    letter-spacing: -.045em;
    line-height: .86;
}

.mark em {
    color: var(--coral);
    font-style: italic;
    font-weight: 560;
}

.lede {
    max-width: 38ch;
    margin-top: 22px;
    font-size: 1.12rem;
    line-height: 1.45;
}

.rules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.rules li {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .88rem;
}

.poster {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
    gap: 36px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 42px 24px 72px;
}

.intro { padding-top: 12px; }

.board {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 24px 50px rgba(80, 30, 10, .06);
}

label, legend {
    display: block;
    margin: 16px 0 6px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

input[type="text"], input:not([type]) {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
}

input:focus { outline: none; border-color: var(--coral); }

.faces {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.face {
    position: relative;
    width: 56px;
    height: 56px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 18px;
}

.face input {
    position: absolute;
    opacity: 0;
}

.face svg { display: block; width: 100%; height: 100%; }

.face:has(input:checked) { outline: 2px solid var(--ink); outline-offset: 3px; }

.face:focus-within { outline: 2px solid var(--coral); outline-offset: 3px; }

.hint { margin-top: 8px; color: var(--muted); font-size: .92rem; }

.error { min-height: 1.2em; margin: 10px 0 0; color: #9d1c12; }

.error:empty { display: none; }

.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 13px 22px;
    color: #fffaf6;
    font-weight: 600;
    text-decoration: none;
    background: var(--coral);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.primary:hover { background: #c42d1d; }

.linkish { margin-top: 22px; }

.open-mouths { margin-top: 28px; }

.open-mouths h2 {
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 560;
}

.mouths { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.mouth {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    background: #fffaf3;
    border: 1px solid var(--line);
    border-radius: 18px;
    cursor: pointer;
}

.mouth:hover { border-color: rgba(226, 61, 43, .45); }

.mouth strong { font-size: 1.05rem; }

.mouth .count { color: var(--muted); }

.mouth-faces { display: flex; grid-column: 1 / -1; }

.avatar { display: inline-flex; width: 28px; height: 28px; }

.avatar svg { width: 100%; height: 100%; }

.mouth-faces .avatar { width: 22px; height: 22px; margin-right: -4px; }

.room-page {
    height: 100dvh;
    overflow: hidden;
    color: #f6efe6;
    background:
        radial-gradient(700px 280px at 10% -10%, rgba(226, 61, 43, .28), transparent 60%),
        #14110f;
}

.shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: 100dvh;
}

.top {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(246, 239, 230, .08);
}

.brand {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-style: italic;
    text-decoration: none;
}

.top-copy { flex: 1; min-width: 0; }

.top h1 {
    overflow: hidden;
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 560;
    letter-spacing: -.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live { color: #b5a89c; font-size: .92rem; }

#link-state::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    background: #e6b15a;
    border-radius: 50%;
}

#link-state.on::before { background: #7dcea0; }

.leave {
    padding: 8px 14px;
    text-decoration: none;
    border: 1px solid rgba(246, 239, 230, .2);
    border-radius: 999px;
}

.roster-wrap {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(246, 239, 230, .08);
}

.roster-wrap h2 {
    margin-bottom: 8px;
    color: #b5a89c;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#roster {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.person {
    display: flex;
    flex: none;
    gap: 8px;
    align-items: center;
    color: #f6efe6;
    font-size: .92rem;
}

.person .avatar { width: 32px; height: 32px; }

.stream {
    min-height: 0;
    padding: 18px 18px 8px;
    overflow-y: auto;
}

.quiet, .notice {
    color: #b5a89c;
    font-size: .92rem;
    text-align: center;
}

.notice { margin: 12px 0; }

.bubble {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    max-width: 680px;
    margin: 0 0 12px;
    animation: rise .28s ease;
}

.bubble .avatar { width: 36px; height: 36px; }

.bubble .text {
    padding: 10px 12px 12px;
    background: #2a211c;
    border-radius: 16px 16px 16px 6px;
}

.bubble.mine {
    width: fit-content;
    max-width: min(680px, 92%);
    margin-left: auto;
}

.bubble.mine .text {
    color: #fff8f5;
    background: var(--coral);
    border-radius: 16px 16px 6px 16px;
}

.bubble header {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: .8rem;
}

.bubble header time { color: rgba(246, 239, 230, .62); }

.bubble.mine header time { color: rgba(255, 248, 245, .75); }

.bubble p { line-height: 1.4; overflow-wrap: anywhere; }

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 16px 16px;
}

.composer input {
    padding: 12px 16px;
    color: #f6efe6;
    background: #2a211c;
    border: 0;
    border-radius: 999px;
}

.composer input:focus { outline: 2px solid rgba(226, 61, 43, .7); }

.composer .error { grid-column: 1 / -1; }

.composer button {
    padding: 0 18px;
    color: #1c140f;
    font-weight: 600;
    background: #f3ecdf;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.composer button:disabled, .composer input:disabled { opacity: .55; cursor: default; }

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
    .poster { grid-template-columns: 1fr; padding-top: 28px; }
    .mark { font-size: clamp(56px, 16vw, 84px); }
}

@media (min-width: 860px) {
    .shell {
        grid-template-columns: minmax(0, 1fr) 260px;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .top { grid-column: 1 / -1; }

    .roster-wrap {
        grid-column: 2;
        grid-row: 2 / span 2;
        border-bottom: 0;
        border-left: 1px solid rgba(246, 239, 230, .08);
    }

    #roster { flex-direction: column; align-items: stretch; }

    .stream { grid-column: 1; grid-row: 2; }

    .composer { grid-column: 1; grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
    .bubble { animation: none; }
}
