/* Colours and type from the Hearthcall mockups (Directions.dc.html). */
:root {
    --bg: #0a0e18;
    --bg-glow: #141d33;
    --surface: #0f1628;
    --line: #1d2640;
    --line-strong: #33405f;
    --text: #e6ebf5;
    --text-soft: #b9c3da;
    --muted: #8b97b3;
    --gold: #d4b26a;
    --gold-light: #f0d79c;
    --danger: #ff9aa3;
    --ok: #7fd1a0;
    --serif: 'Marcellus', serif;
    --sans: 'Figtree', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, var(--bg-glow) 0%, var(--bg) 60%) fixed var(--bg);
    color: var(--text);
    font: 16px/1.45 var(--sans);
}

a { color: var(--text-soft); }

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px 28px;
    padding: 14px clamp(16px, 4vw, 44px);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
}

.brand {
    font: 20px var(--serif);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
}

.who { display: flex; flex: 1; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.nav-link { padding: 6px 12px; border-radius: 8px; color: var(--text-soft); font-weight: 600; text-decoration: none; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { background: var(--line); color: var(--text); }
.account-link, .account { margin-left: auto; }
.account { position: relative; }
.account summary { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; list-style: none; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: ''; width: 6px; height: 6px; margin: -3px 2px 0 4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.account .initial { width: 28px; height: 28px; color: var(--gold-light); }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); display: grid; min-width: 180px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .4); }
.account-menu a { padding: 8px 12px; border-radius: 8px; color: var(--text-soft); text-decoration: none; }
.account-menu a + a { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.account-menu a:hover { background: var(--bg); color: var(--text); }

/* On a phone the bar keeps the links and the initial; the menu still names nothing it hides. */
@media (max-width: 520px) {
    .top { gap: 12px; }
    .brand { font-size: 16px; letter-spacing: .12em; }
    .account-name { display: none; }
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

h1 {
    margin: 0 0 24px;
    font: 400 clamp(30px, 5vw, 40px)/1.1 var(--serif);
}

.label {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.card {
    padding: 20px;
    margin-bottom: 32px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.row { display: flex; flex-wrap: wrap; gap: 10px; }

.input {
    flex: 1 1 240px;
    height: 54px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font: 17px var(--sans);
    color-scheme: dark;
}

.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* The native caret hugs the edge; this one sits inside the field's padding. */
select.input {
    appearance: none;
    padding-right: 44px;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b97b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 16px;
}

.btn {
    height: 54px;
    padding: 0 24px;
    border: 0;
    border-radius: 14px;
    background: var(--gold);
    color: var(--bg);
    font: 700 16px var(--sans);
    cursor: pointer;
}

.btn:hover { background: var(--gold-light); }

.error { margin: 10px 0 0; color: var(--danger); font-size: 15px; }

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

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

.rooms a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
}

.rooms a:hover .room-name { color: var(--gold-light); }
.rooms li.open { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.rooms li.open > a:first-child { flex: 1; min-width: 0; border-bottom: 0; }
.rooms .join { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 0; color: var(--bg); font-size: 15px; }

.room-name { font-size: 18px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.rooms .owner { margin-left: auto; font-size: 14px; white-space: nowrap; }

.code { font: 600 18px var(--mono); color: var(--gold-light); white-space: nowrap; }

/* The GM's rooms: a card per room, the whole card a link to the room page. */
.rooms-head { position: relative; margin-bottom: 20px; }
.rooms-head h1 { margin: 0 0 4px; padding-right: 150px; }
.rooms-head > p { margin: 0; font-size: 14px; }
.new-room > summary { position: absolute; top: 4px; right: 0; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; font-size: 15px; list-style: none; }
.new-room > summary::-webkit-details-marker { display: none; }
.new-room[open] > summary { display: none; }
.new-room .card { margin: 20px 0 0; border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.new-room .label { text-transform: none; letter-spacing: 0; color: var(--text-soft); }
.new-room .input, .new-room .btn { height: 46px; font-size: 15px; }
.new-room .btn { padding: 0 18px; }
.new-room form:invalid [type="submit"] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.new-room .muted { margin: 10px 0 0; font-size: 13px; }

/* The sign-in steps (#114): a centred column; the logo and a welcome quote sit side by side at its left. */
.sign-in { max-width: 420px; margin: clamp(8px, 4vh, 40px) auto 0; text-align: center; }
.sign-in-welcome { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; text-align: left; }
.sign-in-logo { flex: none; width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 25%, transparent); }
.sign-in-quote { margin: 0; font: 18px/1.3 var(--serif); color: var(--muted); }
.sign-in h1 { margin-bottom: 16px; }
.sign-in .muted { margin: 0 0 24px; }
.sign-in .card { margin-bottom: 20px; text-align: left; }
.sign-in .input { width: 100%; }
.sign-in-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 16px; margin-top: 24px; }
.sign-in-actions label { margin-right: auto; color: var(--text-soft); }
.sign-in-alt { font-size: 15px; }
.sign-in-alt a { color: var(--muted); }

.room-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.room-cards li { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.room-cards li:hover { border-color: var(--line-strong); }
.room-cards li:has(> a:first-child:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.room-cards li > a:first-child { flex: 1; min-width: 0; display: grid; gap: 4px; color: var(--text); text-decoration: none; outline: none; }
.room-cards li > a:first-child::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.room-cards .room-name { font-size: 17px; }
.room-cards li:hover .room-name { color: var(--gold-light); }
.room-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.room-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.room-meta > span:empty { display: none; }
.room-meta .icon { width: 14px; height: 14px; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.room-cards .code { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 15px; letter-spacing: .06em; }
.room-cards .join { position: relative; z-index: 1; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; font-size: 15px; text-decoration: none; }
.room-cards .chevron { width: 16px; height: 16px; color: var(--muted); }
.rooms-empty { margin: 0; padding: 32px 20px; border-radius: 14px; border: 1px dashed var(--line-strong); text-align: center; }

.back { display: inline-block; margin-bottom: 32px; font-size: 15px; color: var(--muted); }
.crumbs { margin-bottom: 20px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text-soft); }

.room-head { padding: 0; }
.table-state { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.table-state h1 { margin: 0 0 6px; }
.table-status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: var(--muted); }
.table-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.table-status.open::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.table-state form { display: flex; flex-wrap: wrap; gap: 10px; }
.table-state a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.room-code { padding: 20px; }
.room-code > .muted { margin: 12px 0 0; font-size: 14px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.code-row .code-boxes { justify-content: flex-start; gap: 6px; margin: 0 auto 0 0; }
.code-row .box { width: 40px; height: 48px; border-radius: 10px; font-size: 24px; box-shadow: none; }
.code-row .dash { font-size: 20px; }
.code-row .btn { height: 44px; padding: 0 16px; font-size: 15px; }
.code-row .confirm summary { display: inline-flex; align-items: center; }
.btn-soft { background: var(--line); color: var(--text); }
.btn-soft:hover { background: var(--line-strong); }

.code-boxes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(4px, 1.5vw, 10px);
    margin: 8px 0 24px;
}

.box {
    width: clamp(40px, 12vw, 64px);
    height: clamp(52px, 15vw, 78px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--gold);
    box-shadow: 0 0 24px rgba(212, 178, 106, .12);
    font: 600 clamp(26px, 8vw, 42px) var(--mono);
    color: var(--gold-light);
}

.dash { font: 600 28px var(--mono); color: var(--muted); }

.users { width: 100%; margin-top: 32px; border-collapse: collapse; font-size: 15px; }
.users th { text-align: left; font-weight: 600; color: var(--muted); }
.users th, .users td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.users .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-link { padding: 0; border: 0; background: none; color: var(--text-soft); font: inherit; text-decoration: underline; cursor: pointer; }

@media (max-width: 640px) {
    .users thead { display: none; }
    .users tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .users td { display: block; padding: 2px 0; border: 0; }
}

.schedule { margin-top: 40px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 20px; font-weight: 600; }
.card-head h3 { font-size: 16px; }
.card-head > .muted { font-size: 14px; }
.badge { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold-light); font-size: 13px; font-weight: 600; white-space: nowrap; }
.schedule form { display: grid; gap: 8px; }
.schedule form > .label { margin: 0; }
.schedule form > .label:not(:first-of-type) { margin-top: 8px; }
.schedule form .muted { margin: 0; font-size: 14px; }
.date-row { display: flex; flex-wrap: wrap; gap: 10px; }
.schedule .btn:disabled { opacity: .4; cursor: not-allowed; }
.schedule .btn:disabled:hover { background: var(--gold); }
.schedule .btn-outline:disabled:hover { background: transparent; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.email-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 20px -20px 0; padding: 16px 20px; border-top: 1px solid var(--line); }
.email-status > .icon { width: 36px; height: 36px; padding: 9px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--gold); }
.email-status > div { flex: 1 1 240px; }
.email-status p { margin: 0; font-size: 14px; }
.email-status .status-title { font-size: 16px; font-weight: 600; }
.email-status .btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; font-size: 15px; }
.btn-outline { border: 1px solid var(--line-strong); background: transparent; color: var(--text-soft); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--bg); }
.action-row a.btn, .check-card a.btn, .recap-actions a.btn { display: inline-flex; align-items: center; text-decoration: none; }

.people > h2 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.people h3 { margin: 0; font-size: 16px; font-weight: 600; }
.players .card-head { margin-bottom: 10px; }
.player-list { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.player-list ul { list-style: none; margin: 0; padding: 0; }
.player-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.player-list .empty { margin: 0; padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.player-who { display: grid; flex: 1; min-width: 0; }
.player-name { font-weight: 600; overflow-wrap: anywhere; }
.player-who .muted { font-size: 14px; overflow-wrap: anywhere; }
.btn-quiet { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-soft); font: 600 14px var(--sans); white-space: nowrap; cursor: pointer; }
.btn-quiet:hover { background: var(--surface); color: var(--text); }
.btn-quiet.danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.confirm { display: flex; }
.handout-list { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.handout-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.handout-item:last-child { border-bottom: 0; }
.handout-thumb { flex: none; }
.handout-thumb img { display: block; width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--surface); }
.handout-text { display: grid; flex: 1; gap: 6px; min-width: 0; }
.handout-text textarea.input, .handout-upload textarea.input { height: auto; }
.handout-text .btn-quiet { justify-self: start; }
.handout-upload { display: grid; gap: 6px; }
.handout-upload .btn { justify-self: start; margin-top: 8px; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] { gap: 6px; }
.confirm:not([open]) .opened, .confirm[open] .closed { display: none; }
li:has(.confirm[open]) .resend { display: none; }
.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; }
.invite summary { list-style: none; }
.invite summary::-webkit-details-marker { display: none; }
.invite:not([open]) .opened, .invite[open] .closed { display: none; }
/* Open, the summary is the Cancel at the end of the row. */
.invite[open] summary { order: 1; }
.invite::details-content { flex: 1 1 0; }
.invite form { display: flex; gap: 8px; }
.invite form .input { min-width: 0; }
.invite .input, .co-gms .input { flex: 1 1 200px; height: 44px; font-size: 15px; }
.invite .btn, .co-gms .btn { height: 44px; padding: 0 18px; font-size: 15px; }
.invite form:invalid .btn, .co-gms form:invalid .btn { opacity: .4; cursor: not-allowed; pointer-events: none; }
.co-gms { margin: 20px -20px 0; padding: 20px 20px 0; border-top: 1px solid var(--line); }
.co-gms > .muted { margin: 2px 0 12px; font-size: 14px; }
/* Owner first, then the co-GMs, with room between them (#116). */
.co-gms > form + h3 { margin-top: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tags li { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; }
.tags button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.tags button:hover { color: var(--text); }

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

/* Characters on the player's phone (ADR-0011). */
.section-title { margin: 32px 0 16px; font: 400 26px/1.2 var(--serif); }

.characters { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.character {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}
.character.playing { border-color: var(--gold); }
.character-name { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.character-who { flex: 1; min-width: 0; display: grid; }
.character-sheet { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.finish-sheet { margin-bottom: 16px; }
.character-state { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.character-edit { font-size: 14px; color: var(--muted); }
.gm-group.unseated { opacity: .55; }
.gm-group .label { margin: 20px 0 8px; }
/* The GM collapses those not at a table from their label. */
.unseated-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -12px 0 -12px -8px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.unseated-toggle:hover { background: var(--hover); }
.unseated-toggle .icon { width: 16px; height: 16px; transition: transform .15s; }
.unseated-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.btn-small { height: 40px; padding: 0 16px; font-size: 15px; }

/* Combat on the GM's and players' phones (ADR-0013). */
.combat, .roll-call { margin: 24px 0; }
.combat .section-title, .roll-call .section-title { margin-top: 0; }
.combatants { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.combatant { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.combatant.unrolled, .roll-call-waiting .character { opacity: .55; }
.combatant .error, .roll-call .error { flex-basis: 100%; margin: 0; }
.initiative-form { display: flex; align-items: center; gap: 8px; }
.initiative-form .label { flex-basis: 100%; }
.combatant .initiative, .roll-call .initiative, .secret-roll-form .initiative { width: 72px; }
.combatant.mine .character-name b { color: var(--gold); }
.combatant.current { border-color: var(--character-color); box-shadow: 0 0 0 1px var(--character-color); }
.turn-actions { display: flex; gap: 10px; margin-bottom: 16px; }
/* Combatants the GM names (#41); a hidden one only the GM sees, dimmed. */
.combatant.hidden { opacity: .55; border-style: dashed; }
.hidden-tag { font-size: 14px; color: var(--muted); }
.named-form { display: grid; gap: 12px; margin-bottom: 16px; }
.named-fields { display: grid; grid-template-columns: 1fr 72px; gap: 4px 8px; }
.named-fields .label { grid-row: 1; margin: 0; }
.named-form .error { margin: 0; }

/* The GM's checks (#42). */
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.check-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.check-form .label, .check-form .hint, .check-form .error { flex-basis: 100%; margin: 0; }
.check-form .input { flex: 0 0 96px; }
.check-card { margin: 24px 0; }
.check-card .section-title { margin-top: 0; }
.check-card h3.label, .roll-call h3.label { margin: 16px 0 8px; }
.check-value { font-weight: 700; }

/* Roll calls on the GM's and players' phones (ADR-0016). */
.roll-call .character { flex-wrap: wrap; gap: 10px 14px; }
.check-form #roll-call-label { flex: 1 1 160px; }
.your-turn { border-color: var(--gold); text-align: center; }
.new-character, .finish-sheet { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }
.new-character { border-style: dashed; }

.portrait {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--character-color);
    overflow: hidden;
    font: 600 15px var(--mono);
    color: var(--text-soft);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.character-form { display: grid; gap: 8px; }
.character-form .label { margin-top: 12px; }
.character-form .btn { margin-top: 20px; }

.portrait-picker {
    position: relative;
    justify-self: center;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--character-color);
    box-shadow: 0 0 32px color-mix(in srgb, var(--character-color) 30%, transparent);
    background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--bg) 8px 16px);
    overflow: hidden;
    cursor: pointer;
}
.portrait-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-picker img + .portrait-prompt { opacity: 0; }
.portrait-picker:hover .portrait-prompt, .portrait-picker:focus-within .portrait-prompt { opacity: 1; }
.portrait-prompt {
    position: relative;
    display: grid;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(10, 14, 24, .7);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}
.portrait-prompt small { font-weight: 400; color: var(--muted); }
.portrait-picker:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.check { justify-self: center; font-size: 15px; color: var(--text-soft); }

.swatches, .sheet { margin: 0; padding: 0; border: 0; }
.swatches legend, .sheet legend { padding: 0; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--swatch);
    cursor: pointer;
}
.swatch input { position: absolute; opacity: 0; }
.swatch.taken { opacity: .12; }
.swatch:has(input:checked) { outline: 3px solid var(--swatch); outline-offset: 3px; opacity: 1; }
.swatch:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.hint { margin: 4px 0 0; font-size: 14px; }

/* The character sheet: whole numbers two to a row (ADR-0014). */
.sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
/* Label, input and hint share rows across a pair, so the inputs line up when only one has a hint or a label wraps. */
.sheet-field { grid-column: 1 / -1; grid-row: span 3; display: grid; grid-template: subgrid / minmax(0, 1fr); row-gap: 0; }
.sheet-field .label { margin-bottom: 16px; }
.sheet-field .hint { margin-top: 12px; }
.sheet-field.sheet-number { grid-column: auto; }

/* Whispers on the GM's and players' phones (#44). */
.whispers { margin: 16px 0; }
.whispers .card { margin: 0; }
.whispers-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.whispers-head .section-title { margin: 0; }
.whispers-head a:not(.icon-btn) { font-size: 15px; color: var(--text-soft); }
.whispers-button { display: inline-flex; align-items: center; gap: 8px; }
.unread-count { min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: var(--bg); font-size: 14px; font-weight: 700; text-align: center; }
.whisper-thread { flex-wrap: wrap; color: inherit; text-decoration: none; }
.whisper-thread .portrait, .whisper-with .portrait { width: 40px; height: 40px; font-size: 13px; }
.gm-portrait { --character-color: var(--gold); }
.whisper-with { display: flex; align-items: center; gap: 8px; }
.whisper-last { flex-basis: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 15px; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.whisper-lines { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.whisper-lines li { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--bg); overflow-wrap: anywhere; }
.whisper-lines li.mine { justify-self: end; background: var(--surface); border: 1px solid var(--line); }
.whisper-lines b { display: block; font-size: 13px; color: var(--muted); }
.whisper-form { display: flex; gap: 8px; }
.whisper-form .input { flex: 1; min-width: 0; }
.whispers-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* A secret roll (#45): what it was for, then the total, large. */
.secret-roll-form { display: grid; gap: 8px; justify-items: start; }
.secret-roll-form #secret-roll-label { width: 100%; }
.whisper-lines .roll-number { font-size: 22px; font-weight: 700; }

/* Conditions on the GM's and players' phones (#46). */
.character:has(> .conditions) { flex-wrap: wrap; }
.conditions { flex-basis: 100%; display: grid; gap: 8px; }
.condition-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.condition { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; }
.condition-clear { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.condition-form { display: flex; flex-wrap: wrap; gap: 8px; }
.condition-form select { flex: 1 1 160px; min-width: 0; }
.condition-form .condition-level { flex: 0 0 80px; }
.condition-form .condition-custom { flex: 1 1 120px; min-width: 0; }
.conditions .error { margin: 0; }

/* RSVP page (#68). */
.rsvp form { display: grid; gap: 16px; justify-items: start; margin-bottom: 24px; }
.answers { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; }
.answers legend { margin-bottom: 8px; }
.answer { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 18px; }
.rsvp-roster { list-style: none; margin: 0; padding: 0; }
.rsvp-roster li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rsvp-answer { font-weight: 600; white-space: nowrap; }
.rsvps { margin: 0 -20px; padding: 20px 20px 0; border-top: 1px solid var(--line); }
.rsvps .card-head { margin-bottom: 12px; }
.rsvps .rsvp-roster li { align-items: center; border: 0; }
.answer-yes { --answer: var(--ok); }
.answer-maybe { --answer: var(--gold); }
.answer-no { --answer: var(--danger); }
.answer-none { --answer: var(--muted); }
.reply-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.reply-bar span { display: block; height: 100%; background: var(--ok); }
.rsvp-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 16px 0 8px; }
.rsvp-counts div { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.rsvp-counts dt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rsvp-counts dt::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--answer); }
.rsvp-counts dd { margin: 0; font-size: 22px; font-weight: 600; }
.initial { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-soft); font-size: 13px; font-weight: 600; text-transform: uppercase; }
.rsvp-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pill { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--answer) 14%, transparent); color: var(--answer); font-size: 13px; font-weight: 600; white-space: nowrap; }

.recaps .card-head { flex-wrap: nowrap; margin-bottom: 4px; }
.recaps p.muted { margin: 0 0 16px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--line); cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-soft); transition: transform .15s; }
.switch[aria-checked="true"] { border-color: var(--gold); background: var(--gold); }
.switch[aria-checked="true"]::after { background: var(--bg); transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.notes { display: grid; gap: 8px; margin: 0; padding: 14px 16px; list-style: none; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; color: var(--text-soft); }
.notes li { display: flex; align-items: baseline; gap: 10px; }
.notes li::before { content: ''; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--gold); transform: translateY(-1px); }

/* Landing page: one lit die, everything else quiet. */
.landing { --ember: #e08a4f; display: flex; flex-direction: column; }
.landing main.home { flex: 1; width: 100%; max-width: 1120px; padding: 0 clamp(16px, 4vw, 44px) 96px; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: center;
    gap: clamp(32px, 6vw, 96px);
    min-height: min(72vh, 680px);
    padding: clamp(24px, 6vw, 64px) 0;
}
.hero h1 { margin: 0 0 28px; font-size: clamp(48px, 8.5vw, 104px); line-height: .98; letter-spacing: -.01em; color: var(--gold-light); }
.hero .lede { max-width: 30em; margin: 0 0 40px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--text-soft); }
.hero .btn { display: inline-flex; align-items: center; text-decoration: none; }

.die {
    width: 100%;
    max-width: 420px;
    justify-self: center;
    overflow: visible;
    background: radial-gradient(closest-side at 50% 62%, color-mix(in srgb, var(--ember) 30%, transparent), transparent);
    filter: drop-shadow(0 0 18px rgba(212, 178, 106, .35));
}
.die g { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; }
.die g > :first-child { stroke-width: 2; }
.die text { font: 62px var(--serif); fill: var(--gold-light); }

@media (prefers-reduced-motion: no-preference) {
    .die g > * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.6, 0, .2, 1) forwards; }
    .die g > :nth-child(2) { animation-delay: .5s; }
    .die g > :nth-child(3) { animation-delay: .9s; }
    .die text { opacity: 0; animation: kindle 1.2s 1.9s ease-out forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes kindle { to { opacity: 1; } }

.steps { padding: 72px 0; border-top: 1px solid var(--line); }
.steps h2, .invite-only h2 { margin: 0 0 40px; font: 400 clamp(28px, 3.5vw, 38px)/1.15 var(--serif); }
.steps ol { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 0 clamp(20px, 3vw, 40px); border-left: 1px solid var(--line); counter-increment: step; }
.steps li:first-child { padding-left: 0; border-left: 0; }
.steps li::before { content: counter(step, upper-roman); display: block; margin-bottom: 20px; font: 34px var(--serif); color: var(--gold); }
.steps h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.steps p { margin: 0; line-height: 1.6; color: var(--muted); }

.invite-only {
    max-width: 640px;
    margin: 24px auto 0;
    padding: clamp(36px, 6vw, 56px) clamp(24px, 6vw, 64px);
    text-align: center;
    border: 1px solid var(--gold);
    outline: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    outline-offset: 6px;
    background: var(--surface);
}
.invite-only h2 { margin-bottom: 20px; color: var(--gold-light); }
.invite-only p { margin: 0 auto; max-width: 34em; line-height: 1.65; color: var(--text-soft); }
.invite-only p + p { margin-top: 20px; font-size: 15px; color: var(--muted); }
.invite-only a { color: var(--gold-light); }

.foot { padding: 32px 16px 40px; text-align: center; font: 14px var(--serif); letter-spacing: .18em; color: var(--muted); }

@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; min-height: 0; }
    .die { max-width: 240px; grid-row: 1; }
    .steps ol { grid-template-columns: 1fr; gap: 36px; }
    .steps li, .steps li:first-child { padding: 0; border: 0; }
}

/* A phone's recording line and switch (#50). */
.card.recording { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.card.recording .recording-badge { margin: 0; color: var(--danger); font-weight: 600; }

.card.recording .recording-badge.paused { color: var(--muted); }

/* Session recaps (#53): the latest open, older ones collapsed. */
.recap-list .section-title { margin-top: 0; }
.recap + .recap { border-top: 1px solid var(--line); }
.recap summary { padding: 12px 0; cursor: pointer; font-weight: 600; }
.recap-text h1 { font: 400 24px/1.2 var(--serif); margin: 4px 0 12px; }
.recap-text h2 { font: 600 15px/1.3 var(--sans); margin: 20px 0 8px; }
.recap-action { margin: 12px 0; }
.recap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.recap-action textarea { width: 100%; height: auto; padding: 12px 16px; font: 400 16px/1.5 var(--mono); }

/* The GM console (GM Console.dc.html): a header, the live panels and the party, a bar of actions along the bottom, and bottom sheets. */
.console {
    --panel: var(--surface);
    --well: #0b111c;
    --hover: #162034;
    --edge: #232e42;
    --quiet: #c3cad6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 16px;
    --console-width: 640px;
    max-width: var(--console-width);
    margin: -8px auto 0;
}
.console:has(.action-bar) { padding-bottom: 96px; }
.console > *, #gm > *, .console #combat > * { grid-column: 1 / -1; }
#gm, .console #combat, .console #characters { display: contents; }
#check { order: 1; }
#check:not(:has(> *)) { display: none; }
.console .party { order: 2; }
/* The recaps sheet's button sits beside Whispers; the sheet has its own title. */
.console .recaps-open { grid-row: 1; grid-column: 3; align-self: center; }
.console .recap-list { margin: 0; padding: 0; border: 0; background: none; }
.console .recap-list > .section-title { display: none; }
.console .recap summary { font-size: 14px; color: var(--quiet); }
.console .recap-text { font-size: 15px; line-height: 1.5; color: var(--text-soft); }
.console .recap-text h1 { margin: 0 0 8px; font: 700 16px/1.3 var(--sans); color: var(--text); }
.console .recap-text h2 { margin: 16px 0 6px; font-size: 13px; color: var(--text); }
.console .recap-text p { margin: 0 0 .6em; }
.console .recap-text ul { margin: 0 0 .6em; padding-left: 20px; }

#gm > .console-head, .console #combat > .console-head { grid-row: 1; grid-column: 1; }
.console-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.console-title { flex: 1; min-width: 0; }
.console h1 { margin: 0; font-size: 24px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.console-status { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console-status::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.console-status.is-live::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
/* A player's lobby while no game is on (#117). */
.console .waiting-head { align-items: flex-start; padding: 8px 0 28px; }
.console .waiting-head h1 { margin-top: 8px; font-size: 28px; white-space: normal; overflow-wrap: anywhere; }
.waiting-facts { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--text-soft); }
.waiting-facts li { display: flex; align-items: center; gap: 10px; }
.waiting-facts .icon { color: var(--muted); }
.console-back { width: 44px; height: 44px; margin-left: -8px; border-radius: 12px; }

.console #whispers { grid-row: 1; grid-column: 2; align-self: center; margin: 0; }
.console .whispers-button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; border-color: var(--edge); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.console .whispers-button:hover { border-color: var(--line-strong); background: var(--panel); }
/* On a phone the header's buttons are icons, so the room's name has the width. */
@media (max-width: 480px) {
    .console .whispers-button { width: 44px; justify-content: center; padding: 0; }
    .console .whispers-button:has(.unread-count) { width: auto; padding: 0 10px; }
    .console .button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.console .unread-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; line-height: 20px; color: #141006; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font: 22px/1 var(--sans); text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }
.party-card-head .icon-btn { border-color: var(--edge); color: var(--quiet); }
.party-card-head .icon-btn:hover { border-color: var(--line-strong); background: transparent; }
.party-card-head .icon-btn .icon { width: 17px; height: 17px; }

.btn-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 10px; background: var(--hover); color: var(--text); font: 600 13px var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.btn-chip:hover { border-color: var(--line-strong); }
.btn-chip.danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; color: var(--danger); }
.btn-chip.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.console .btn-quiet { color: var(--gold); font-size: 13px; }
.console .btn-quiet:hover { background: var(--hover); color: var(--gold-light); }

/* Panels: combat, a roll call, a check's result, raised hands. */
.panel { border-radius: 16px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; }
.panel-heading { flex: 1; min-width: 0; }
.panel-heading.error { margin: 0; }
.panel-title { margin: 0; font-size: 16px; font-weight: 700; }
.panel-sub { margin: 1px 0 0; font-size: 13px; color: var(--muted); }
.panel-foot { display: flex; align-items: center; margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.panel-foot p { margin: 0; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.panel .rows, .panel .characters, .panel .combatants { display: block; margin: 0; padding: 0; list-style: none; }
.row-item, .panel .combatant { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.panel .portrait { width: 36px; height: 36px; font-size: 12px; }
.panel .character-name { font-size: 15px; }
.panel .character-sheet { font-size: 12px; }
.panel .error { flex-basis: 100%; margin: 0; font-size: 13px; }
.result-badge { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.result-badge.pass { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.result-badge.fail { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.combat-panel { border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.combat-panel .panel-head { padding: 12px 12px 12px 16px; }
.combat-panel .panel-title { font-size: 17px; }
.combat-panel .portrait { width: 32px; height: 32px; }
.panel .combatant.unrolled, .panel .combatant.hidden { opacity: 1; }
.panel .combatant.hidden .portrait, .panel .combatant.hidden .character-name { opacity: .55; }
.panel .combatant.current { border-color: var(--line); box-shadow: none; background: color-mix(in srgb, var(--gold) 9%, transparent); }
.combatant-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.combatant-line .character-name { flex: none; }
.turn-pill, .hidden-tag { padding: 2px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.turn-pill { background: var(--gold); color: #141006; font-weight: 700; }
.panel .hidden-tag { background: var(--hover); color: var(--quiet); font-weight: 600; }
.panel .initiative-form { gap: 0; }
/* The number reads as text until tapped. */
.panel .initiative { width: 52px; height: 40px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: 700 18px var(--sans); font-variant-numeric: tabular-nums; text-align: right; color-scheme: dark; appearance: textfield; }
.panel .initiative::-webkit-inner-spin-button, .panel .initiative::-webkit-outer-spin-button, .number-input::-webkit-inner-spin-button, .number-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.panel .initiative::placeholder { color: #55617a; }
.panel .initiative:hover { border-color: var(--edge); }
.panel .initiative:focus { border-color: var(--gold); outline: none; background: var(--bg); }
.panel .initiative.passed { color: var(--ok); }
.panel .initiative.failed { color: var(--danger); }
.panel .icon-btn.remove { width: 32px; height: 32px; margin-right: -8px; font-size: 18px; }
/* Raised hands lead with the stations' gold banner (#48). */
.raised-hands { border-color: var(--gold); }
.raised-hands .hand-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--gold); color: var(--bg); }
.raised-hands .hand-banner svg { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.raised-hands .hand-banner div { display: grid; min-width: 0; }
.raised-hands .hand-banner b { font-size: 17px; font-weight: 800; line-height: 1.15; }
.raised-hands .hand-banner span { font-size: 13px; font-weight: 600; opacity: .75; }
.raised-hands .row-item:first-of-type { border-top: 0; }
.console .card.recording { margin: 0; padding: 12px 16px; }

/* The party: a card per character with its sheet's numbers. */
.party { display: grid; gap: 10px; }
.party-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.party-head .section-title { margin: 0; font-size: 22px; }
.party-head .muted { font-size: 13px; }
.console .gm-group .label { margin: 6px 4px 8px; font-size: 12px; }
.party-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.party-card { display: grid; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.party-card-head { display: flex; align-items: center; gap: 12px; }
.party-card .portrait { width: 44px; height: 44px; }
.party-card .character-name { font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.party-card .character-sheet { font-size: 13px; color: #a3adbf; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.stat-tiles div { padding: 6px 10px; border-radius: 10px; border: 1px solid #1a2333; background: var(--well); }
.stat-tiles dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.stat-tiles abbr { text-decoration: none; }
.stat-tiles dd { margin: 0; font-size: 18px; font-weight: 700; }
.party-card .conditions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.party-card .condition { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 2px 0 10px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: #f0a0a0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.party-card .condition-clear { width: 36px; height: 36px; color: inherit; font-size: 16px; }
.party-card .condition-clear:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
/* A system condition's name opens its rules (#111); the picker shows the picked one's. */
.condition-name { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.attribution { margin: 12px 0 0; font-size: 11px; line-height: 1.4; }
.add-condition { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px dashed #2f3b52; color: #a3adbf; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.add-condition:hover { border-color: #4a5872; color: var(--text); }
.party-card > form { justify-self: start; }

/* The bar of actions, always in reach of a thumb. */
.action-bar { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 8px max(8px, calc((100% - var(--console-width)) / 2)) calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.action-bar > * { min-width: 0; }
.rolls-menu { inset: auto auto calc(82px + env(safe-area-inset-bottom)) max(8px, calc((100% - var(--console-width)) / 2)); min-width: 220px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.rolls-menu:popover-open { display: grid; gap: 2px; }
.rolls-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: inherit; font: 600 15px var(--sans); text-align: left; text-decoration: none; cursor: pointer; }
.rolls-item:hover { background: var(--hover); }
.rolls-item:disabled { color: var(--quiet); cursor: default; background: none; }
.rolls-item .icon { width: 20px; height: 20px; color: var(--quiet); }
.action-bar form { display: grid; }
/* A count sits on the button's corner, so the button lets it out and its label clips itself. */
.action:has(.unread-count) { position: relative; overflow: visible; }
.action .unread-count { position: absolute; top: -7px; right: -5px; }
.action-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.handout-picks { list-style: none; margin: 0 0 16px; padding: 0; }
.handout-pick { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.handout-pick img { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.handout-pick b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
a.handout-pick { color: inherit; text-decoration: none; }
.handout-caption { display: grid; flex: 1; min-width: 0; }
.handout-caption .muted { font-size: 14px; overflow-wrap: anywhere; }
/* The GM's: the title beside the thumbnail, who to send it to and Reveal under it. */
li.handout-pick { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 6px 12px; align-items: center; }
li.handout-pick img { grid-row: span 2; width: 56px; height: 56px; }
.bottom-sheet .handout-pick form { flex-direction: row; gap: 8px; }
.handout-pick .btn-chip { flex: none; }
.handout-again summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.handout-again summary::-webkit-details-marker { display: none; }
.handout-again[open] summary { display: none; }
.handout-revealed { flex: 1; min-width: 0; color: var(--quiet); font-size: 14px; }
.bottom-sheet .handout-pick .handout-to { flex: 1; min-width: 0; height: 40px; }
.handout-sent { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--text); font-weight: 600; }
.handout-new { display: grid; gap: 6px; }
.handout-to { width: 100%; }
.handout-whisper { display: block; max-width: 100%; max-height: 160px; margin-top: 6px; border-radius: 8px; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 58px; padding: 0 2px; border: 0; border-radius: 12px; background: transparent; color: var(--quiet); font: 600 12px var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.action .icon { width: 22px; height: 22px; }
.action { overflow: hidden; text-overflow: ellipsis; }
.action:hover { background: var(--hover); color: var(--text); }
.action.primary { background: var(--gold); color: #141006; font-weight: 700; }
.action.primary:hover { background: var(--gold-light); }
.action:disabled, .action:disabled:hover { background: transparent; color: #4b566b; cursor: default; }
.action.primary:disabled { background: #1a2333; color: #6b778c; }

/* On a tablet the console widens and the party sits two to a row; sheets stay a centred column. */
@media (min-width: 760px) {
    .console { --console-width: 960px; }
    .party-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* Bottom sheets. Without JavaScript, CSS shows the one the server or a link opens. */
.bottom-sheet { width: 100%; max-width: 640px; max-height: 86vh; max-height: 86dvh; margin: auto auto 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); border: 1px solid var(--edge); border-bottom: 0; border-radius: 20px 20px 0 0; background: var(--panel); color: var(--text); overflow: auto; }
.bottom-sheet::before { content: ''; display: block; width: 40px; height: 4px; margin: 4px auto 10px; border-radius: 2px; background: #2a3549; }
.bottom-sheet::backdrop { background: rgba(3, 6, 12, .6); }
.bottom-sheet[data-open]:not([open]), .bottom-sheet:target:not([open]) { display: block; position: fixed; inset: auto 0 0; z-index: 40; }
@media (prefers-reduced-motion: no-preference) {
    .bottom-sheet[open] { animation: rise .2s ease-out; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.sheet-head .muted { margin: 2px 0 0; font-size: 13px; }
.sheet-close { border-radius: 50%; background: var(--hover); color: var(--quiet); font-size: 20px; }
.bottom-sheet form { display: flex; flex-direction: column; gap: 14px; }
.bottom-sheet fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.bottom-sheet .error { margin: 0; }
.sheet-note { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--well); font-size: 14px; line-height: 1.5; color: #a3adbf; }
.sheet-label { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--quiet); }
.bottom-sheet .input { flex: none; height: 48px; padding: 0 14px; border-radius: 10px; border-color: #2a3549; background-color: #0a0f19; font-size: 16px; }
.bottom-sheet select.input { padding-right: 40px; }
.bottom-sheet .input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.bottom-sheet .number-input { height: 60px; border-radius: 12px; font-size: 28px; font-weight: 700; text-align: center; appearance: textfield; }
.sheet-submit { width: 100%; height: auto; min-height: 52px; border-radius: 12px; white-space: nowrap; }
.bottom-sheet form:invalid .sheet-submit { background: #1a2333; color: #6b778c; cursor: default; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 10px; background: var(--well); color: var(--quiet); font: 600 14px var(--sans); white-space: nowrap; cursor: pointer; }
.ask-form .chip { min-height: 40px; }
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"], .chip:has(:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-light); }
.chip:has(:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.condition-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.levels legend { margin-bottom: 6px; }
.levels .chip { padding: 0; }
.ask-fields { display: flex; gap: 8px; }
.ask-fields .sheet-label:first-child { flex: 1; min-width: 0; }
.ask-fields .sheet-label:last-child { width: 112px; flex: none; }
.ask-fields .input { width: 100%; min-width: 0; }

.named-form .named-fields { display: flex; align-items: center; gap: 8px; }
.named-form .portrait { width: 48px; height: 48px; font-size: 15px; }
.named-form #named-name { flex: 1; min-width: 0; }
.named-form #named-initiative { width: 72px; padding: 0 10px; font-weight: 700; text-align: center; }
.named-form .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.named-form .swatches legend { margin-bottom: 8px; }
.named-form .swatch { width: 40px; margin: 2px; }
.named-form .swatch:has(input:checked) { outline: 0; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--swatch); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--well); cursor: pointer; }
.switch-row > span { flex: 1; display: grid; gap: 2px; }
.switch-title { font-size: 14px; font-weight: 600; }
.switch-row .muted { font-size: 12px; }
input.switch { appearance: none; margin: 0; border: 0; background: #2a3549; }
input.switch:checked { background: var(--gold); }
input.switch:checked::after { background: #141006; transform: translateX(18px); }
input.switch::after { top: 4px; left: 4px; }

/* Whispers on the GM's console open in a sheet. */
.whispers-sheet .card { padding: 0; border: 0; background: none; }
.whispers-sheet .whispers-head .section-title { font: 700 18px var(--sans); }
.whispers-sheet .whisper-threads { gap: 6px; }
.whispers-sheet .whisper-thread { padding: 12px; border-radius: 12px; background: var(--well); }
.whispers-sheet .whisper-thread:hover { border-color: #33405a; }
.whispers-sheet .whisper-last { font-size: 13px; }
.whispers-sheet .whisper-lines { gap: 6px; min-height: 120px; align-content: start; }
.whispers-sheet .whisper-lines li { padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: #1b2639; line-height: 1.4; }
.whispers-sheet .whisper-lines li.mine { border: 0; border-radius: 16px 16px 4px 16px; background: var(--gold); color: #141006; }
.whispers-sheet .whisper-lines li.mine b { color: #4a3b17; }
.whispers-sheet .whisper-form .input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; }
.whispers-sheet .whisper-form .btn { height: 46px; padding: 0 18px; border-radius: 999px; font-size: 15px; }
.whispers-sheet .whisper-form { flex-direction: row; gap: 8px; }
/* The older inline forms' rules don't apply inside a sheet. */
.bottom-sheet .check-form, .bottom-sheet .condition-form, .bottom-sheet .named-form { flex-wrap: nowrap; align-items: stretch; margin: 0; }
.bottom-sheet .check-form .input { flex: none; }
.console .check-card, .console .roll-call { margin: 0; }

/* A player's console (Player View.dc.html): the same header and sheets, then what the GM asks, combat, the character being played, and a bar for a hand and a secret roll. */
.console .new-character-step > p:first-child { margin: 0; color: var(--muted); }
.console-idle { margin: 4px 0 0; text-align: center; font-size: 13px; color: #55617a; }

.prompt-card { display: grid; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: #121b2c; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 8%, transparent); }
.prompt-title { margin: 2px 0 0; font: 400 26px/1.2 var(--serif); }
.prompt-hint { margin: 4px 0 0; font-size: 14px; color: #a3adbf; }
.prompt-card .prompt-form { display: flex; gap: 8px; }
.prompt-card .number-input { flex: 1; min-width: 0; height: 56px; border-radius: 12px; border-color: #2a3549; background: #0a0f19; font-size: 24px; font-weight: 700; text-align: center; appearance: textfield; }
.prompt-card .number-input:focus, .bottom-sheet .number-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.prompt-card .btn { height: 56px; border-radius: 12px; }
.prompt-card .error { margin: 0; }
.prompt-sent { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; }
.prompt-sent .panel-title { font-size: 15px; font-weight: 600; }
.sent-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.sent-mark .icon { width: 18px; height: 18px; stroke-width: 2.6; }

.turn-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--gold); color: #141006; }
.turn-title { flex: 1; margin: 0; font: 400 26px/1.2 var(--serif); }
.turn-round { font-size: 13px; font-weight: 700; white-space: nowrap; }
.turn-banner form { display: grid; flex-basis: 100%; }
.turn-end { height: 48px; border-radius: 12px; background: #141006; color: var(--gold-light); }
.turn-end:hover { background: #2a2210; }
#combat .combatant-line { flex: 1; min-width: 0; }
.initiative-number { min-width: 24px; text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: #a3adbf; }

.me-card .portrait { width: 52px; height: 52px; font-size: 16px; }
.me-card .character-name { font: 400 24px/1.1 var(--serif); }
.me-card .character-sheet { margin-top: 3px; }
.me-card .finish-sheet { justify-self: start; width: auto; margin: 0; font-size: 14px; color: var(--gold); }

.player-bar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; padding-top: 10px; }
.player-bar .action { flex-direction: row; gap: 8px; min-height: 52px; border: 1px solid #2a3549; background: var(--panel); color: var(--text); font-size: 15px; font-weight: 700; }
.player-bar .action:hover { border-color: #3a4760; background: var(--panel); }
.player-bar .action.primary { border-color: transparent; background: var(--gold); color: #141006; }
.player-bar .action .icon { width: 20px; height: 20px; }

/* The Switch sheet: the player's characters, then the stations to sit at. */
.character-picks { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.character-pick { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--well); }
.character-pick.playing { border-color: var(--gold); }
.character-pick .portrait { width: 40px; height: 40px; font-size: 13px; }
.character-pick > .character-name { flex: 1; min-width: 0; font-weight: 600; }
.character-pick .character-state { font-size: 12px; letter-spacing: 0; text-transform: none; }
.character-pick .character-edit { font-size: 13px; }
.bottom-sheet .new-character { height: auto; min-height: 52px; border-radius: 12px; font-size: 14px; }
.stations-title { margin: 20px 0 8px; }

.secret-roll-form legend { flex-direction: row; gap: 4px; margin-bottom: 6px; }
.secret-roll-form legend .muted { font-weight: 400; }
.secret-roll-form .chip { min-height: 40px; }

/* The notifications card (#87, #88): js/notifications.js sets the state it shows. */
.notify-card [data-show] { display: none; }
.notify-card[data-state="install"] [data-show="install"],
.notify-card[data-state="enable"] [data-show="enable"],
.notify-card[data-state="denied"] [data-show="denied"],
.notify-card[data-state="on"] [data-show="on"] { display: block; }
.notify-card > p[data-show] { margin: 0; }
.notify-card .link-button { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }
.notify-card ol { margin: 8px 0 0; padding-left: 20px; }

/* The account page (#115): a card per table with its next session, a folded join code, autosaving email switches. */
.account-email { margin: -16px 0 0; font-size: 14px; }
.name-first { margin: 24px 0 0; }
.tables { display: grid; gap: 12px; }
.table-card { margin: 0; padding: 16px 18px; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.table-head .room-name { font-size: 17px; }
.table-play { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 10px; color: var(--bg); font-size: 15px; text-decoration: none; }
.next-session { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.next-session > div:first-of-type { display: grid; gap: 2px; }
.next-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.name-first { margin: 24px 0 0; }
.next-when { font-size: 14px; color: var(--text-soft); }
.rsvp-choice { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); }
.rsvp-choice button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-soft); font: 600 13px var(--sans); cursor: pointer; }
.rsvp-choice button:hover { color: var(--text); }
.rsvp-choice button[aria-pressed="true"] { background: var(--gold); color: var(--bg); }
.rsvp-choice button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.join-code { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.join-code summary { list-style: none; cursor: pointer; }
.join-code summary::-webkit-details-marker { display: none; }
.join-link { color: var(--gold); }
.join-code summary:hover .join-link { color: var(--gold-light); }
.join-cancel, .join-code[open] .join-closed { display: none; }
.join-code[open] .join-cancel { display: inline; }
/* Open, the summary is the Cancel at the end of the code's row. */
.join-code[open] { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.join-code[open] summary { order: 1; }
.join-code form { display: flex; gap: 10px; }
.join-code .input { flex: 0 1 180px; width: 180px; height: 40px; padding: 0 12px; border-radius: 10px; font: 15px var(--mono); }
.join-button { height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--gold); background: none; color: var(--gold-light); font: 600 14px var(--sans); cursor: pointer; }
.join-button:hover { background: color-mix(in srgb, var(--gold) 15%, transparent); }
.profile-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.profile .label { font-size: 11px; }
.profile .input { width: 100%; height: 44px; border-radius: 10px; font-size: 15px; }
.profile .btn { display: block; height: 40px; margin: 16px 0 0 auto; padding: 0 20px; border-radius: 10px; font-size: 14px; }
.profile .btn:disabled { background: var(--line); color: var(--muted); cursor: default; }
.emails-note { margin: -8px 0 14px; font-size: 14px; }
.email-rows { margin: 0; padding: 0; }
.email-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; cursor: pointer; }
.email-row + .email-row { border-top: 1px solid var(--line); }
.emails .btn { margin-top: 12px; }
.emails-saved { margin: 10px 0 0; font-size: 13px; text-align: right; }

/* A character with Heroic Inspiration (#112): a gold star at the bottom left of its portrait. */
.portrait.inspired { position: relative; overflow: visible; }
.portrait.inspired img { border-radius: 50%; }
.inspiration-mark {
    position: absolute;
    bottom: -4px;
    left: -4px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    font: 12px/1 system-ui, sans-serif;
}

/* A player's private notes, in a sheet from their bar (#113). */
.bottom-sheet .player-notes textarea { width: 100%; height: auto; padding: 12px 16px; font: 400 16px/1.5 var(--sans); resize: vertical; }
.player-notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#notes-state { margin: 0; }
