:root {
    color-scheme: dark;
    --table: #14111b;
    --card: #1e1927;
    --line: #3b3346;
    --paper: #faf3ed;
    --muted: #c1b5c9;
    --peach: #ffc59b;
    --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(--peach); 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(--peach); }
.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(--peach); color: #211631; }
.primary:hover { background: #ffdabf; }
.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%; }
.edition {
    color: var(--peach);
    border-left: 1px solid var(--line);
    padding-left: 9px;
    font: 700 .82rem/1 ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.entry-kicker { margin-bottom: 8px; }
.media-notice {
    border-block: 1px dashed #665067;
    padding: 12px 0;
    margin: 4px 0;
    color: var(--muted);
    font-size: .87rem;
}
.media-notice strong { color: var(--paper); }
.media-notice p { margin-top: 4px; }

.custom-dare { margin-bottom: 10px; }
.custom-dare summary {
    min-height: 44px;
    padding: 10px 8px;
    color: var(--peach);
    cursor: pointer;
}
.custom-dare form { display: grid; gap: 8px; margin: 4px 0 12px; }
.custom-options { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.custom-options .primary { margin-left: auto; }
.custom-options label { color: var(--muted); }
.custom-options .check { display: inline-flex; gap: 5px; align-items: center; }
.check input { width: auto; min-height: auto; accent-color: var(--peach); }
#custom-prompt, #caption { min-height: 68px; }

.dare-list { border-top: 1px solid var(--line); }
.dare-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4rem;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 11px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--paper);
    cursor: pointer;
    text-align: left;
}
.dare-option:hover, .dare-option:focus-visible { background: var(--card); }
.media-tag {
    color: var(--peach);
    font: .72rem/1.4 ui-monospace, monospace;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 4px;
    text-align: center;
    text-transform: uppercase;
}
#empty-dares { padding: 16px 0; }

.dare-card h1 {
    font: 400 clamp(1.75rem, 4.9vw, 2.9rem)/1.16 Georgia, serif;
    letter-spacing: -.025em;
    margin-block: 10px 20px;
    overflow-wrap: anywhere;
}
.eyebrow { color: var(--peach); font-size: .77rem; letter-spacing: .04em; }
.capture-frame {
    background: var(--table);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.frame-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    font: .72rem/1.35 ui-monospace, monospace;
    letter-spacing: .06em;
}
.frame-dot { width: 8px; height: 8px; border-radius: 50%; background: #fd866f; }
#record-time { margin-left: auto; color: var(--peach); }
#capture-empty { padding: 18px 12px; }
.capture-preview img, .capture-preview video, .camera-live {
    display: block;
    width: 100%;
    max-height: 440px;
    object-fit: contain;
    background: #0e0b13;
}
.camera-live { transform: scaleX(-1); }
.capture-preview > .muted { padding: 12px; }
.capture-actions, .turn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.capture-actions .quiet, .turn-actions .quiet, #retry-upload { border-color: var(--line); }
.turn-actions { justify-content: space-between; }
.upload-status, #caption-field, #retry-upload, #next-turn { margin-top: 12px; }
#caption-field label { display: block; margin-bottom: 4px; }
.revealed-caption {
    margin-top: 12px;
    padding: 12px;
    border-left: 2px solid var(--peach);
    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; }
    .capture-actions button { flex: 1 1 auto; }
    .turn-actions button { flex: 1; }
}
