/* Night rose: the design layer on top of the recoloured base stylesheet (tools/retint.mjs).
   Plum-black surfaces, one rose accent, hairlines instead of shadows. Phone first. */
:root {
  --bg: #0e0b11;
  --panel: #17131c;
  --raised: #201926;
  --border: #2f2638;
  --border-strong: #47384f;
  --text: #f4edf3;
  --muted: #b5a8bb;
  --subtle: #9c8fa5;
  --rose: #d6527c;
  --rose-hi: #f291ad;
  --purple: #f291ad;
  --mint: #7fd9bd;
  --pink: #ff8fae;
  --amber: #edc48d;
}
body {
  background:
    radial-gradient(1000px 520px at 92% -10%, #3014328c 0%, transparent 62%),
    radial-gradient(760px 460px at -14% 4%, #3a112652 0%, transparent 60%);
}
::selection { background: #d6527c66; }

/* Header */
.header { border-bottom-color: #ffffff0d; background: transparent; }
.header-inner { height: 66px; }
.brand { gap: 10px; }
.brand-mark { width: 34px; height: 34px; border: 0; border-radius: 50%; font-size: 18px; background: radial-gradient(circle at 34% 28%, #f7a3bc 0%, #d6527c 48%, #96305a 100%); box-shadow: 0 0 0 1px #f291ad33, 0 0 20px #d6527c73; }
.wordmark { font-size: 18px; font-weight: 750; letter-spacing: .1em; }
.wordmark span { font-weight: 600; letter-spacing: .34em; color: var(--subtle); }
.nav-link { font-size: .875rem; }
.nav-link.active::after { background: var(--rose); }
.icon-button { border-radius: 50%; color: var(--muted); }
.icon-button:hover, .profile:hover { background: var(--raised); color: #fff; }
.profile { border-color: var(--border); background: #17131c99; color: #e6dce8; font-size: .8125rem; }
.avatar { color: var(--rose-hi); background: #d6527c24; }

/* Buttons */
.button { border-radius: 12px; font-size: .875rem; font-weight: 650; }
.button.primary { border-color: #f291ad59; background: linear-gradient(180deg, #dc5a83, #c2416c); color: #fff; box-shadow: 0 8px 26px #d6527c47, inset 0 1px 0 #ffffff2e; text-shadow: 0 1px 0 #7a1f4366; }
.button.primary:hover:enabled { background: linear-gradient(180deg, #e66a91, #cb4a75); }
.button.outline { border-color: var(--border-strong); background: var(--raised); color: #e7dde9; }
.button.outline:hover:enabled { border-color: #c1678a; background: #2a2031; }
.button.danger { border-color: #7a3049; background: #3d1a29; color: #ffc4d3; }
.button.danger:hover:enabled { background: #4c2033; }

/* Home: the opening card */
.hero { min-height: 0; margin-top: 24px; border-color: var(--border); border-radius: 24px; background: var(--panel); }
.hero-art {
  background:
    radial-gradient(440px 320px at 88% 16%, #d6527c47 0%, transparent 66%),
    radial-gradient(380px 300px at 58% 108%, #7a3a9c33 0%, transparent 68%),
    linear-gradient(165deg, #1e1623 0%, #130f17 72%);
}
/* A slow pulse: rings fading out from one glowing point. */
.hero-art::before {
  top: 50%; right: -86px; bottom: auto; left: auto; width: 320px; height: 320px; translate: 0 -50%; border-radius: 50%;
  background: repeating-radial-gradient(circle at center, transparent 0 25px, #f291ad30 25px 26px);
  -webkit-mask-image: radial-gradient(circle at center, #000 0 16%, transparent 68%);
  mask-image: radial-gradient(circle at center, #000 0 16%, transparent 68%);
}
.hero-art::after {
  top: 50%; right: 68px; bottom: auto; left: auto; width: 12px; height: 12px; translate: 0 -50%; border-radius: 50%;
  background: #ffc2d4; box-shadow: 0 0 0 7px #f291ad1f, 0 0 36px 10px #d6527c8c;
  animation: ember 3.8s ease-in-out infinite;
}
@keyframes ember { 50% { box-shadow: 0 0 0 12px #f291ad14, 0 0 54px 16px #d6527c99; } }
.hero-content { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 32px clamp(22px, 4vw, 52px); }
.hero h1 { margin: 0 0 10px; font-size: clamp(31px, 4.6vw, 54px); font-weight: 760; letter-spacing: .05em; line-height: 1.18; }
.hero h1 span { color: var(--rose-hi); }
.hero-detail { color: var(--muted); font-size: .9375rem; letter-spacing: .02em; }
.hero-actions { margin-top: 24px; }
.hero-actions .button.primary { min-width: 220px; min-height: 52px; padding-inline: 28px; border-radius: 16px; font-size: 1rem; letter-spacing: .14em; animation: breathe 3.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 10px 40px #d6527c85, inset 0 1px 0 #ffffff2e; } }
.online-count { order: -1; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 5px 12px 5px 10px; border: 1px solid #ffffff14; border-radius: 999px; background: #0e0b1180; color: #dcd0df; font-size: .8125rem; line-height: 1.4; }
.online-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px #7fd9bd24; }

/* Home picture uploaded by an admin: shown dimmed behind the title. */
:root[data-backdrop] .hero { min-height: clamp(330px, 56vh, 440px); align-items: flex-end; }
:root[data-backdrop] .hero-art { background: #130f17; }
:root[data-backdrop] .hero-art::before { inset: 0; width: auto; height: auto; translate: none; border-radius: 0; background: var(--backdrop) center 26% / cover no-repeat; -webkit-mask-image: none; mask-image: none; }
:root[data-backdrop] .hero-art::after { inset: 0; width: auto; height: auto; translate: none; border-radius: 0; box-shadow: none; animation: none; background: linear-gradient(180deg, #0e0b1173 0%, #0e0b1133 30%, #120d16db 68%, #120d16f7 100%); }
@media (min-width: 821px) {
  :root[data-backdrop] .hero { align-items: center; min-height: 340px; }
  :root[data-backdrop] .hero-art::after { background: linear-gradient(90deg, #120d16f2 0%, #120d16c7 34%, #120d1640 68%, #120d1626 100%); }
}

/* Home: lists and other modes */
.directory-nav { gap: 10px; margin-top: 14px; }
.directory-nav .button { min-height: 50px; border-color: var(--border); border-radius: 14px; background: var(--panel); color: #e4dae6; font-weight: 600; }
.directory-nav .button:hover:enabled { border-color: var(--border-strong); background: var(--raised); }
.directory-nav .button [data-icon] { color: var(--rose-hi); }
.directory-nav .button[aria-expanded="true"] { border-color: #d6527c99; background: #d6527c1f; color: #ffe3ec; }
.directory-nav .tab-home { display: none; }
#friend-count { color: #fff; background: var(--rose); }
.social-panel, #lobby-notices { border-color: var(--border); border-radius: 20px; background: var(--panel); }
.social-heading h2 { font-size: 1.125rem; letter-spacing: .04em; }
.history-actions button[aria-pressed="true"] { border-color: #d6527c99; background: #d6527c1f; color: #ffe3ec; }
#online-filters, .online-limits-form { border-radius: 14px; }
/* A quiet note under the hero on why the site looks after women; the owner wants the reason said, not the matching order. */
.site-note { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid #d6527c99; border-radius: 14px; background: var(--panel); }
.site-note p { margin: 0; color: #d9cbd5; font-size: .8125rem; line-height: 1.75; }
.site-note .site-note-ps { margin-top: 8px; color: var(--rose-hi); font-size: .75rem; line-height: 1.6; }

/* Voice and type tags: chips to choose in the matching form, small labels on cards */
.tag-field { margin: 6px 0 10px; padding: 0; border: 0; }
.tag-field legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; padding: 0; color: #f4eaf0; font-size: .875rem; font-weight: 600; }
.tag-field legend small { color: var(--subtle); font-size: .75rem; font-weight: 400; }
.tag-group { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: start; margin-bottom: 6px; }
.tag-group-label { padding-top: 7px; color: var(--subtle); font-size: .75rem; }
.tag-options { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option { position: relative; }
.tag-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tag-option span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: #100c13; color: #cdbfcb; font-size: .8125rem; cursor: pointer; user-select: none; }
.tag-option input:checked + span { border-color: var(--rose); background: #d6527c33; color: #fff; }
.tag-option input:focus-visible + span { outline: 2px solid var(--rose-hi); outline-offset: 2px; }
.tag-strict { margin: -2px 0 12px; font-size: .8125rem; }
.match-priority { color: var(--rose-hi); }
.match-priority .text-button { margin-left: 6px; color: var(--rose-hi); text-decoration: underline; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag-chip { display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid #f291ad59; border-radius: 999px; color: var(--rose-hi); font-size: .6875rem; line-height: 18px; white-space: nowrap; }

/* The waiting screen of random matching: the card a partner gets (tags, voice sample), editable while waiting */
.match-card { width: min(100%, 360px); margin: 14px auto 2px; padding: 12px 14px; border: 1px solid #d6527c40; border-radius: 16px; background: #0000002e; text-align: left; }
.match-card-title { margin: 0 0 8px; color: var(--rose-hi); font-size: .8125rem; font-weight: 600; }
.match-card-row { display: flex; align-items: center; gap: 10px; min-height: 28px; color: #e4dae6; font-size: .8125rem; }
.match-card-row > span:first-child { flex: none; width: 30px; color: var(--subtle); font-size: .75rem; }
.match-card-row .tag-chips { margin-top: 0; }
.match-card-row em { color: var(--subtle); font-style: normal; }
.match-card-row strong { color: #fff; font-weight: 600; }
.match-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.match-card-actions .button { flex: 1 1 120px; min-height: 38px; font-size: .8125rem; }
.partner-sample { gap: 6px; }
.participant .partner-sample { margin-top: 6px; min-height: 32px; padding: 4px 12px; font-size: .75rem; }

.modes { margin-top: 28px; }
.section-label { margin-bottom: 12px; }
.section-label h2 { margin: 0; color: var(--subtle); font-size: .8125rem; font-weight: 600; letter-spacing: .22em; }
.mode-grid { gap: 12px; }
.mode-card, .mode-card.friend-card, .mode-card.solo-card { padding: 18px 18px 14px; border-color: var(--border); border-radius: 20px; background: var(--panel); }
.mode-card.friend-card { --accent: #f291ad; --tone: #d6527c21; }
.mode-card.solo-card { --accent: #edc48d; --tone: #edc48d1c; }
.mode-card:hover { background: var(--raised); }
.mode-icon { width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
.mode-card h3 { margin: 14px 0 4px; font-size: 1.0625rem; letter-spacing: .04em; }
.mode-card p { margin-bottom: 12px; font-size: .8125rem; line-height: 1.6; }
.card-action { border-top-color: #ffffff0f; font-size: .8125rem; }
.footer { min-height: 0; margin-top: 22px; padding-inline: 2px; border: 0; background: none; }
.footer-shield { border-radius: 50%; background: #ffffff0a; color: var(--subtle); }

/* Dialogs and form controls */
dialog { border-color: var(--border-strong); border-radius: 22px; background: #19141e; box-shadow: 0 24px 90px #000c; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
dialog::backdrop { background: #08060ac7; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-top h2 { font-size: 1.25rem; letter-spacing: .04em; }
.field input, select, .duration-custom input, .media-link input, .media-site-form input { border-color: var(--border-strong); border-radius: 11px; background: #100c13; color: var(--text); }
.choice, .role-option, .duration-option { border-color: var(--border-strong); border-radius: 11px; background: var(--raised); color: #e4dae6; }
.choice:has(input:checked), .role-option:has(input:checked), .duration-option[aria-pressed="true"] { border-color: var(--rose); background: #d6527c26; color: #fff; }
.duration-option:hover:enabled { border-color: #c1678a; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--rose); }
.rule [data-icon] { border-radius: 50%; background: #d6527c1f; color: var(--rose-hi); }
.toast { z-index: 40; border-color: var(--border-strong); border-radius: 12px; background: #241c2b; }

/* Room */
.room-stage, .room-side { border-radius: 22px; }
.room-side { background: var(--panel); }
.room-stage { background: radial-gradient(ellipse at 50% 36%, #3b1731 0%, #17121b 70%); }
.room-stage[data-cue="fast"] { --phase: #8fe3c8; background: radial-gradient(ellipse at 50% 36%, #123a31 0%, #121919 70%); }
.room-stage[data-cue="slow"] { --phase: #f1cd97; background: radial-gradient(ellipse at 50% 36%, #45321f 0%, #1b1618 70%); }
.room-stage[data-cue="stop"] { --phase: #ff8fae; background: radial-gradient(ellipse at 50% 36%, #5a1d3b 0%, #1d141c 70%); }
.orb { color: var(--phase, #f291ad); background: #0e0b1166; box-shadow: 0 0 36px color-mix(in srgb, currentColor 30%, transparent), inset 0 0 30px color-mix(in srgb, currentColor 16%, transparent); }
.progress span { background: var(--phase, var(--rose)); }
.room-stage .time-label { z-index: 4; padding: 2px 10px; border-radius: 999px; background: #0e0b11a6; }
.room-stage .time-label:empty { display: none; }
.stage-badges span { padding: 4px 11px; border-color: #ffffff1f; border-radius: 999px; background: #0e0b1173; }
.room-code { border-color: #ffffff1f; border-radius: 10px; background: #0e0b1173; }
.participant { border-color: var(--border); border-radius: 14px; }
.room-voice { border-color: var(--border); border-radius: 16px; background: var(--panel); }
.room-voice[data-incoming] { border-color: var(--rose-hi); background: #3a1a2c; }
.room-voice-icon { border-radius: 50%; background: #d6527c24; color: var(--rose-hi); }
.control-dock, .media-panel { border-radius: 18px; background: var(--panel); }
.room-chat, .watch-interaction > div, .watch-media { border-radius: 16px; background: var(--panel); }
.watch-panel, .admin-card { border-radius: 20px; background: var(--panel); }

/* Conversations (room chat and friend messages), drawn like a messenger: bubbles, the other side on the left. */
.room-chat { padding: 14px; }
.room-chat h3 { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin: 0 0 10px; font-size: 1rem; letter-spacing: .04em; }
.chat-close { display: none; width: 34px; height: 34px; margin: -3px -4px -3px 0; }
.chat-close svg { width: 18px; height: 18px; }
.chat-log, .friend-chat .chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 19rem; padding: 4px 2px 8px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; scrollbar-gutter: auto; }
.chat-log li, .friend-chat .chat-log li, .friend-chat .chat-log li.mine { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.chat-log li.mine { flex-direction: row-reverse; }
.chat-avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--raised); color: var(--rose-hi); font-size: .8125rem; font-weight: 700; line-height: 1; }
.follows > .chat-avatar, .chat-avatar.follows { color: var(--amber); }
.mine > .chat-avatar, .chat-avatar.mine { border-color: transparent; background: linear-gradient(180deg, #dc5a83, #c2416c); color: #fff; }
.chat-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(76%, 30rem); }
.chat-log li.mine .chat-body { align-items: flex-end; }
.chat-log li .chat-body strong { margin: 0 4px 3px; color: var(--subtle); font-size: .75rem; font-weight: 500; }
.chat-log li .chat-body strong:empty, .chat-log li.repeat .chat-body strong { display: none; }
.chat-log li.repeat { margin-top: -6px; }
.chat-log li .chat-body p { margin: 0; padding: 9px 13px; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; background: var(--raised); color: var(--text); font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-log li.mine .chat-body p { border-color: transparent; border-radius: 16px 4px 16px 16px; background: linear-gradient(180deg, #d85a81, #bd406a); color: #fff; }
.chat-log li.chat-time, .friend-chat .chat-log li.chat-time { justify-content: center; }
.chat-log .chat-time time, .friend-chat .chat-log .chat-time time { float: none; margin: 0; padding: 2px 10px; border-radius: 999px; background: #ffffff0a; color: var(--subtle); font-size: .75rem; }
.chat-empty, .chat-visibility, .friend-chat-status { text-align: center; }
.chat-visibility { margin: 6px 0 8px; color: var(--subtle); font-size: .75rem; }
.chat-compose { gap: 8px; align-items: center; }
.chat-compose input { min-height: 44px; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 22px; background: #100c13; color: var(--text); font-size: 1rem; }
.chat-compose input::placeholder { color: var(--subtle); }
.chat-compose input:focus-visible { outline: none; border-color: var(--rose-hi); box-shadow: 0 0 0 3px #d6527c33; }
.chat-compose .button { min-height: 44px; padding-inline: 18px; border-radius: 22px; }
/* Private lines in the room chat: "私信" sends a line the audience never sees; such lines carry a mark while an audience watches. */
.room-chat .chat-compose { display: flex; }
.room-chat .chat-compose input { flex: 1; }
.room-chat .chat-compose .chat-private { gap: 4px; padding-inline: 13px; border-color: #d6527c80; color: var(--rose-hi); }
.chat-private svg { width: 1em; height: 1em; }
.private-tag { display: none; }
.room-chat.audience-open .private-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 7px; border: 1px solid #f291ad66; border-radius: 999px; color: var(--rose-hi); font-size: .6875rem; font-weight: 600; line-height: 17px; vertical-align: 1px; }
.chat-log li.mine .chat-body .private-tag { margin-left: 0; }
.room-chat:not(.audience-open) .chat-log li.mine .chat-body strong { display: none; }
.chat-visibility .whisper-choice { display: inline-flex; align-items: center; min-height: 26px; margin: 4px 0 0 6px; padding: 2px 11px; border: 1px solid #d6527c80; border-radius: 999px; background: transparent; color: var(--rose-hi); font: inherit; font-weight: 600; vertical-align: middle; cursor: pointer; }
.chat-visibility .whisper-choice + .whisper-choice { margin-left: 4px; }
.chat-visibility .whisper-choice[data-action="whisper-allow"] { background: #d6527c2e; }
.chat-visibility .whisper-choice:hover { background: #d6527c40; }
.chat-visibility .whisper-choice:focus-visible { outline: 2px solid var(--rose-hi); outline-offset: 2px; }
.chat-peek { display: none; }
.quick-phrases { margin-bottom: 8px; }
.quick-phrases > summary { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .8125rem; list-style: none; }
.quick-phrases > summary::-webkit-details-marker { display: none; }
.quick-phrases[open] > summary { border-color: #d6527c80; color: var(--rose-hi); }
.quick-phrase-buttons .button { min-height: 34px; padding: 5px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 500; }

/* Friend messages take the whole dialog, with the text box at the bottom. */
dialog:has(.friend-chat) { width: min(520px, calc(100% - 16px)); height: min(88dvh, 720px); }
dialog:has(.friend-chat) .dialog-panel { display: flex; flex-direction: column; height: 100%; padding: 16px 14px 14px; }
dialog:has(.friend-chat) .dialog-top h2 { overflow: hidden; font-size: 1.0625rem; text-overflow: ellipsis; white-space: nowrap; }
.friend-chat { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.friend-chat .chat-log { flex: 1; min-height: 0; max-height: none; }
.friend-chat .friend-chat-older { align-self: center; min-height: 32px; margin-bottom: 8px; padding: 4px 12px; border-radius: 999px; font-size: .75rem; }
.friend-chat .friend-chat-status { margin: auto 0; }
.friend-chat form { margin-top: auto; padding-top: 10px; }
.friend-chat .chat-compose { margin-top: 0; }

@media (max-width: 600px) {
  /* Mid-round with the sheet closed: the latest line and the text box sit just above the room tools. */
  .compact-round:not([data-room-panel="chat"]) .room-chat:has(.chat-form) {
    display: block;
    position: fixed;
    z-index: 29;
    inset: auto max(8px, env(safe-area-inset-right)) calc(61px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .compact-round:not([data-room-panel="chat"]) .room-chat:has(.chat-form) > :not(.chat-form),
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-form > :not(.chat-compose, .chat-error, .chat-peek) { display: none; }
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-peek { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin: 0 0 6px; padding: 5px 10px 5px 6px; border: 1px solid var(--border-strong); border-radius: 999px; background: #17131cf5; color: var(--text); font: inherit; font-size: .875rem; text-align: left; box-shadow: 0 -4px 18px #0006; }
  .chat-peek .chat-avatar { width: 28px; height: 28px; font-size: .75rem; }
  .chat-peek-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-peek-count { flex: none; min-width: 20px; padding: 2px 6px; border-radius: 999px; background: var(--rose); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.3; text-align: center; }
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-compose { padding: 5px; border: 1px solid var(--border-strong); border-radius: 28px; background: #17131cf5; box-shadow: 0 -6px 22px #0009; }
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-compose input { min-height: 42px; border: 0; background: transparent; }
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-compose .button { min-height: 42px; }
  .compact-round:not([data-room-panel="chat"]) .room-chat .chat-error { margin: 0 0 5px; padding: 5px 10px; border-radius: 9px; background: var(--panel); }
  .compact-round:has(.room-chat:not([hidden]) .chat-form) .room-grid { margin-bottom: 66px; }
  .compact-round:has(.room-chat:not([hidden]) .chat-peek:not([hidden])) .room-grid { margin-bottom: 112px; }
  /* Sheet open: the whole conversation, with the text box pinned at the bottom. */
  .compact-round[data-room-panel="chat"] .room-chat { display: flex; flex-direction: column; height: min(72dvh, calc(100dvh - 84px)); max-height: none; padding: 14px 12px 12px; overflow: hidden; border-color: var(--border-strong); border-radius: 20px; background: var(--panel); }
  .compact-round[data-room-panel="chat"] .room-chat .chat-log { flex: 1; min-height: 0; max-height: none; }
  .compact-round[data-room-panel="chat"] .room-chat .chat-empty { display: grid; flex: 1; place-items: center; margin: 0; }
  .compact-round[data-room-panel="chat"] .room-chat .chat-close { display: inline-grid; place-items: center; }
  dialog:has(.friend-chat) { width: calc(100% - 12px); height: min(92dvh, 760px); max-height: 92dvh; }
}

/* Ratings: the line on a player's card, the form with its stars and voice slider, and the player's own summary. */
.rating-line { display: block; margin-top: 2px; color: var(--amber); font-size: .8125rem; line-height: 1.5; }
.participant .rating-line { font-size: .6875rem; }
.history-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 7px; }
.history-buttons .button { min-height: 38px; margin-top: 0; }
.history-buttons p { flex: 1 0 100%; margin: 0; }
.history-buttons p:empty { display: none; }
.history-ratings { margin-left: auto; }
.history-ratings [data-icon] { color: var(--amber); }
#rating-form fieldset { margin-top: 16px; }
.rating-stars legend, .rating-tone legend { padding: 0; }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-top: 6px; }
.star-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-row label { padding: 2px 5px; color: var(--border-strong); font-size: 2.125rem; font-weight: 400; line-height: 1; cursor: pointer; transition: color .12s, transform .12s; }
.star-row input:checked ~ label, .star-row label:hover, .star-row label:hover ~ label { color: #f6c768; }
.star-row label:active { transform: scale(.9); }
.star-row input:focus-visible + label { border-radius: 8px; outline: 2px solid var(--rose-hi); outline-offset: 1px; }
.tone-scale { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: .8125rem; }
.tone-scale input[type="range"] { width: 100%; min-width: 0; height: 32px; margin: 0; accent-color: var(--rose); }
.rating-tone:has([name="toneSkip"]:checked) .tone-scale { opacity: .4; }
#rating-form textarea { display: block; width: 100%; margin-top: 7px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 11px; background: #100c13; color: var(--text); font: inherit; font-weight: 400; line-height: 1.5; resize: vertical; }
#rating-form textarea:focus-visible { outline: none; border-color: var(--rose-hi); box-shadow: 0 0 0 3px #d6527c33; }
.rating-summary { display: grid; gap: 14px; margin: 14px 0; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--raised); }
.rating-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 10px; font-size: .875rem; }
.rating-meter strong { color: #f6c768; font-size: 1rem; font-variant-numeric: tabular-nums; }
.rating-meter .rating-bar, .rating-meter .tone-scale { grid-column: 1 / -1; margin: 0; }
.rating-bar { width: 100%; height: 6px; border: 0; border-radius: 6px; background: #ffffff14; overflow: hidden; appearance: none; -webkit-appearance: none; }
.rating-bar::-webkit-progress-bar { background: #ffffff14; }
.rating-bar::-webkit-progress-value { border-radius: 6px; background: #f6c768; }
.rating-bar::-moz-progress-bar { border-radius: 6px; background: #f6c768; }
.dialog-panel .rating-count { margin-bottom: 0; }
.dialog-panel h3 { margin: 16px 0 8px; font-size: .9375rem; }
.rating-comments { display: grid; gap: 8px; max-height: 38dvh; margin: 0; padding: 0; overflow: auto; list-style: none; }
.rating-comments li { padding: 9px 13px; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; background: var(--raised); font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Audience: the follower's decision, the bar that shows an audience is present, the leader's switches, polls,
   and the spectator's comment box. */
.audience-bar { margin-bottom: 13px; }
.audience-ask, .audience-live { padding: 12px 14px; border: 1px solid var(--rose); border-radius: 16px; background: #3a1a2c; }
.audience-ask strong { font-size: .9375rem; }
.audience-ask p { margin: 4px 0 10px; color: #ecdbe4; font-size: .8125rem; line-height: 1.55; }
.audience-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.audience-actions .button { flex: 1 1 96px; min-height: 40px; }
.audience-live { display: flex; align-items: center; gap: 10px; border-color: var(--border-strong); background: var(--panel); }
.audience-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px #ff8fae2e; }
.audience-live p { flex: 1; min-width: 0; margin: 0; }
.audience-live strong, .audience-live small { display: block; }
.audience-live strong { font-size: .875rem; }
.audience-live small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.audience-live .button { flex: none; min-height: 38px; padding: 6px 12px; font-size: .8125rem; }
.audience-panel .button { min-height: 40px; padding: 8px 14px; font-size: .8125rem; }
.audience-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--raised); color: var(--text); text-align: left; }
.audience-switch strong, .audience-switch small { display: block; }
.audience-switch strong { font-size: .875rem; }
.audience-switch small { margin-top: 2px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.switch-track { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.audience-switch[aria-checked="true"] { border-color: #d6527c80; }
.audience-switch[aria-checked="true"] .switch-track { background: var(--rose); }
.audience-switch[aria-checked="true"] .switch-track::after { transform: translateX(18px); }
.audience-state { margin: 0 0 10px; padding: 0; list-style: none; }
.audience-state li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: .8125rem; }
.audience-state strong { color: var(--muted); }
.audience-state strong.on { color: var(--pink); }
.poll, .watch-poll { margin: 10px 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--raised); }
.watch-poll { margin: 14px 0; background: var(--panel); }
.poll h3, .watch-poll h3 { margin: 0 0 8px; font-size: .9375rem; }
.poll ul { margin: 0; padding: 0; list-style: none; }
.poll li, .poll-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; padding: 6px 0; font-size: .8125rem; }
.poll li strong, .poll-option strong { color: var(--muted); font-variant-numeric: tabular-nums; }
.poll progress, .poll-option progress { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; border-radius: 5px; background: #ffffff14; overflow: hidden; appearance: none; -webkit-appearance: none; }
.poll progress::-webkit-progress-bar, .poll-option progress::-webkit-progress-bar { background: #ffffff14; }
.poll progress::-webkit-progress-value, .poll-option progress::-webkit-progress-value { border-radius: 5px; background: var(--rose); }
.poll progress::-moz-progress-bar, .poll-option progress::-moz-progress-bar { border-radius: 5px; background: var(--rose); }
.poll small, .watch-poll small { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.poll-option { width: 100%; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--raised); color: var(--text); font-size: .875rem; text-align: left; }
.poll-option[aria-pressed="true"] { border-color: var(--rose); background: #d6527c26; }
.poll-option:disabled { opacity: 1; }
.watch-comment-note { margin: -4px 0 12px; color: var(--subtle); font-size: .8125rem; text-align: center; }
.watch-comment-note:empty { display: none; }
.watch-heard { margin: 0 0 6px; color: var(--muted); font-size: .8125rem; }
.watch-heard:empty { display: none; }
.watching > .chat-avatar, .chat-avatar.watching { color: var(--mint); }
@media (max-width: 600px) {
  .compact-round .audience-bar { margin-bottom: 7px; }
  .compact-round .audience-ask, .compact-round .audience-live { padding: 9px 11px; border-radius: 13px; }
}

/* Danmaku: spectators' lines fly across the upper part of the screen and stay there however far the page is scrolled.
   Taps go through them. White text with a dark outline; a spectator's own line has a rose frame.
   The switch is a pill on the stage, a button in the bottom bar on a phone mid-round, and in the spectator's heading. */
.danmaku-screen { position: fixed; z-index: 28; top: max(56px, 9vh); left: 0; right: 0; height: 36vh; min-height: 96px; overflow: hidden; pointer-events: none; }
.danmaku-item { position: absolute; left: 0; padding: 0 4px; color: #fff; font-size: 1rem; font-weight: 650; line-height: 30px; white-space: nowrap; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 4px #000; opacity: .92; will-change: transform; }
.danmaku-item.mine { padding: 0 11px; border: 1px solid #f291adcc; border-radius: 999px; background: #0e0b1166; }
.danmaku-item.still { left: 50%; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; transform: translateX(-50%); animation: danmaku-fade 2.6s ease forwards; }
@keyframes danmaku-fade { 0%, 75% { opacity: .92; } 100% { opacity: 0; } }
.danmaku-toggle { position: absolute; top: 9px; left: 10px; z-index: 5; min-height: 30px; padding: 3px 11px; border: 1px solid #ffffff2b; border-radius: 999px; background: #0e0b11b3; color: #f1e6ee; font-size: .75rem; font-weight: 650; line-height: 1.2; }
.danmaku-toggle[aria-pressed="false"], .danmaku-tool[aria-pressed="false"], .danmaku-switch[aria-pressed="false"] { color: var(--subtle); }
.compact-round .room-stage .danmaku-toggle { display: none; }
.danmaku-tool[aria-pressed="true"] { color: var(--rose-hi); }
.watch-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-heading-actions .button { min-height: 40px; padding: 7px 12px; font-size: .8125rem; }
.watch-comment { margin: 12px 0 10px; }

/* Problem feedback: easy to find during a round, with a few self-help steps and the way to the X group. */
.button.feedback-button { border-color: #edc48d73; background: #edc48d14; color: var(--amber); }
.button.feedback-button:hover:enabled { border-color: var(--amber); background: #edc48d24; }
.room-voice .voice-help { flex: 1 0 100%; justify-content: flex-start; padding: 2px 0; color: var(--amber); font-size: .8125rem; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 14px; }
.footer-links .feedback-text { color: var(--amber); }
.feedback-tips { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.feedback-tips li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--raised); color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.feedback-tips strong { display: block; margin-bottom: 2px; color: var(--text); font-size: .875rem; }
.dialog-actions .feedback-link { flex: 1; text-decoration: none; }
@media (max-width: 580px) {
  .room-head-actions .feedback-button { order: -1; }
}

/* Admin: the home picture card */
.backdrop-preview { width: min(100%, 420px); aspect-ratio: 16 / 10; margin: 12px 0; border: 1px solid var(--border-strong); border-radius: 14px; background: #100c13 center 26% / cover no-repeat; }
.backdrop-preview[data-empty] { display: grid; place-items: center; color: var(--muted); font-size: .875rem; }
.backdrop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.backdrop-actions input[type="file"] { min-width: 0; max-width: 100%; }

/* Phones: the lists become a bottom bar, and an open list takes the place of the home card. */
@media (max-width: 580px) {
  .header-inner { height: 58px; }
  .hero { margin-top: 14px; border-radius: 22px; }
  .hero-content { padding: 24px 20px 22px; }
  .hero h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .hero-actions { width: 100%; }
  .hero-actions .button.primary { width: 100%; min-height: 56px; font-size: 1.0625rem; }
  .hero-art::before { top: 30%; right: -120px; }
  .hero-art::after { top: 30%; right: 34px; }
  .directory-nav {
    position: fixed; z-index: 20; inset: auto 0 0; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #120e16f2;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .directory-nav .button, .directory-nav .button:hover:enabled, .directory-nav .button[aria-expanded="true"] { flex-direction: column; gap: 3px; min-height: 50px; padding: 4px 2px; border: 0; border-radius: 12px; background: none; color: var(--subtle); font-size: .6875rem; font-weight: 600; }
  .directory-nav .button [data-icon] { color: inherit; font-size: 1.3125rem; }
  .directory-nav .tab-home { display: inline-flex; }
  .directory-nav .button[aria-expanded="true"], .directory-nav .button[aria-expanded="true"]:hover:enabled,
  .directory-nav:not(:has([aria-expanded="true"])) .tab-home, .directory-nav:not(:has([aria-expanded="true"])) .tab-home:hover:enabled { color: var(--rose-hi); }
  #friend-count { position: absolute; top: 2px; left: calc(50% + 7px); }
  #lobby:has(.directory-nav [aria-expanded="true"]) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  #lobby:has(.directory-nav [aria-expanded="true"]) :is(.hero, .site-note, .modes) { display: none; }
  body:has(#lobby:not([hidden])) > .footer { margin-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(#lobby .directory-nav [aria-expanded="true"]) > .footer { display: none; }
  .social-panel, #lobby-notices { margin-top: 14px; padding: 16px; border-radius: 18px; }
  .modes { margin-top: 22px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mode-card, .mode-card.friend-card, .mode-card.solo-card { padding: 15px 14px 12px; border-radius: 18px; }
  .mode-card h3 { margin-top: 12px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .compact-round .room-stage { border-radius: 18px; }
  .compact-round .mobile-room-tools .button[aria-expanded="true"] { border-color: var(--rose); background: #d6527c26; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art::after, .hero-actions .button.primary { animation: none; }
}
