:root {
    color-scheme: dark;
    --table: #111014;
    --card: #19181e;
    --line: #302d38;
    --paper: #f5f0fc;
    --muted: #b1aaba;
    --lilac: #d2bcff;
    --danger: #f3a9b7;
    font: 16px/1.5 "Avenir Next", system-ui, sans-serif;
    background: var(--table);
    color: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }

.table {
    width: min(100% - 40px, 680px);
    margin-inline: auto;
    padding-block: 0 48px;
}

.top, .brand, .room-actions, .seat, .seats, .invite, .tools, .dialog-actions {
    display: flex;
    align-items: center;
}

.top {
    justify-content: space-between;
    gap: 12px;
    min-height: 78px;
    border-bottom: 1px solid var(--line);
}

.brand {
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.room-actions { gap: 6px; }

.seats {
    margin-block: 20px;
    padding: 10px 12px;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.seat { gap: 8px; min-width: 0; color: var(--muted); font-size: .875rem; }
.seat:last-child { justify-content: end; flex-direction: row-reverse; }
.seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.active { color: var(--paper); font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #574e62; flex: none; }
.active .dot { background: var(--lilac); }
.round { color: var(--muted); font: .725rem/1.5 ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: clamp(22px, 5vw, 40px);
}

.entry {
    margin: clamp(46px, 14vh, 128px) auto 0;
    max-width: 448px;
}

h1, h2, p { margin: 0; }
h1, h2 { font-weight: 650; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: 1.55rem; }
.entry h1 { margin-bottom: 22px; }
.entry .muted, dialog .muted { margin-top: 12px; }
.entry-form { display: grid; gap: 10px; }
.invite { align-items: stretch; gap: 8px; }
.invite input { min-width: 0; }
.invite button { flex: none; }

input, textarea, select, .primary, .quiet {
    min-height: 44px;
    border-radius: 8px;
    padding: 9px 12px;
}

input, textarea, select {
    border: 1px solid #4b4653;
    color: var(--paper);
    background: var(--table);
}

input, textarea { width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; display: block; min-height: 112px; }

.primary, .quiet {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-weight: 650;
}

.primary { background: var(--lilac); color: #211631; }
.primary:hover { background: #e0d1ff; }
.quiet { background: transparent; color: var(--muted); }
.quiet:hover { background: var(--card); color: var(--paper); }
button:disabled { cursor: default; opacity: .58; }

.picker { padding-top: 10px; }
.tools { gap: 8px; margin-block: 18px 10px; }
.tools input { flex: 1; min-width: 0; }
.tools select { max-width: 48%; }
.adult-filter, .adult-shortcut { border-color: var(--line); white-space: nowrap; }
.adult-filter[aria-pressed="true"], .adult-shortcut.unlocked {
    border-color: #786694;
    background: #25212e;
    color: var(--lilac);
}

.custom-question { margin-bottom: 10px; }
.custom-question summary {
    min-height: 44px;
    padding: 10px 8px;
    color: var(--lilac);
    cursor: pointer;
}
.custom-question form { display: flex; gap: 8px; margin: 4px 0 12px; }
.custom-question input { min-width: 0; }

.question-list { border-top: 1px solid var(--line); }
.question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    padding: 11px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--paper);
    cursor: pointer;
    text-align: left;
}
.question:hover, .question:focus-visible { background: var(--card); }
.question span:last-child { color: var(--lilac); }
#empty-questions { padding: 16px 0; }

.answer h1 {
    font: 400 clamp(1.9rem, 5vw, 3rem)/1.16 Georgia, serif;
    letter-spacing: -.025em;
    margin-block: 12px 24px;
    overflow-wrap: anywhere;
}

.eyebrow { color: var(--lilac); font-size: .77rem; letter-spacing: .04em; }
.answer button { margin-top: 12px; }
.revealed-answer {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--table);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.waiting { padding-block: 44px; }
.waiting h1 { font-size: clamp(1.45rem, 5vw, 2.1rem); overflow-wrap: anywhere; }

.muted, .message { font-size: .9rem; color: var(--muted); }
.message { margin-top: 12px; color: var(--danger); }
#connection { margin-block: 12px; color: var(--muted); }

dialog {
    width: min(100% - 36px, 400px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--paper);
    padding: 24px;
}
dialog::backdrop { background: rgb(5 4 7 / .76); }
.dialog-actions { margin-top: 20px; gap: 8px; justify-content: end; flex-wrap: wrap; }
.dialog-actions .quiet { border-color: var(--line); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 440px) {
    .table { width: calc(100% - 28px); }
    .top { min-height: 64px; }
    .tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .tools input { grid-column: 1 / -1; }
    .tools select { width: 100%; max-width: none; }
    .answer .primary { width: 100%; }
}
